@spartan-ng/cli 0.0.1-alpha.366 → 0.0.1-alpha.368
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 +5 -4
- package/src/generators/base/generator.js +22 -25
- package/src/generators/base/generator.js.map +1 -1
- package/src/generators/base/lib/build-dependency-array.js +6 -6
- package/src/generators/base/lib/build-dependency-array.js.map +1 -1
- package/src/generators/base/lib/get-target-library-directory.js +3 -2
- package/src/generators/base/lib/get-target-library-directory.js.map +1 -1
- package/src/generators/base/lib/initialize-angular-library.js +38 -19
- package/src/generators/base/lib/initialize-angular-library.js.map +1 -1
- package/src/generators/base/versions.d.ts +22 -22
- package/src/generators/base/versions.js +22 -22
- package/src/generators/base/versions.js.map +1 -1
- package/src/generators/theme/compat.js +2 -1
- package/src/generators/theme/compat.js.map +1 -1
- package/src/generators/theme/generator.js +45 -48
- package/src/generators/theme/generator.js.map +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.js +12 -7
- package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
- package/src/generators/ui/add-dependent-primitive.js +12 -26
- package/src/generators/ui/add-dependent-primitive.js.map +1 -1
- package/src/generators/ui/compat.js +3 -2
- package/src/generators/ui/compat.js.map +1 -1
- package/src/generators/ui/generator.js +86 -64
- package/src/generators/ui/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-icon.directive.ts.template +3 -10
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-accordion-helm/generator.js.map +1 -1
- 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/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-alert-dialog-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-alert-dialog-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-description.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-icon.directive.ts.template +4 -10
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-title.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert.directive.ts.template +4 -8
- package/src/generators/ui/libs/ui-alert-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-alert-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-alert-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.spec.ts.template +2 -1
- package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.ts.template +9 -11
- package/src/generators/ui/libs/ui-aspect-ratio-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-aspect-ratio-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-aspect-ratio-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/fallback/hlm-avatar-fallback.directive.spec.ts.template +2 -2
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/fallback/hlm-avatar-fallback.directive.ts.template +2 -2
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.spec.ts.template +3 -3
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +6 -10
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.spec.ts.template +2 -2
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-avatar-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +9 -22
- package/src/generators/ui/libs/ui-badge-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-badge-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-badge-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/index.ts.template +32 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-ellipsis.component.ts.template +23 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-item.directive.ts.template +16 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-link.directive.ts.template +36 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-list.directive.ts.template +18 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-page.directive.ts.template +19 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-separator.component.ts.template +30 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb.directive.ts.template +19 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-button-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-button-helm/files/index.ts.template +1 -0
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.directive.ts.template +13 -16
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.token.ts.template +22 -0
- package/src/generators/ui/libs/ui-button-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-button-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-button-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-calendar-helm/files/index.ts.template +10 -0
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.component.ts.template +160 -0
- package/src/generators/ui/libs/ui-calendar-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-calendar-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-calendar-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-card-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-card-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-card-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template +3 -3
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template +7 -3
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.component.ts.template +11 -15
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-previous.component.ts.template +14 -15
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template +8 -8
- package/src/generators/ui/libs/ui-carousel-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-carousel-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox-checkicon.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +11 -27
- package/src/generators/ui/libs/ui-checkbox-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-checkbox-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.directive.ts.template +5 -9
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +3 -3
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template +3 -9
- package/src/generators/ui/libs/ui-command-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-command-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-command-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog.service.ts.template +3 -3
- package/src/generators/ui/libs/ui-dialog-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-dialog-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/form-field.spec.ts.template +4 -2
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-error.directive.ts.template +1 -0
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-form-field.component.ts.template +6 -7
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-hint.directive.ts.template +1 -0
- package/src/generators/ui/libs/ui-form-field-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-form-field-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-form-field-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-hover-card-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-hover-card-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-hover-card-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-icon-helm/files/index.ts.template +1 -0
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.spec.ts.template +5 -5
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.ts.template +26 -48
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.token.ts.template +23 -0
- package/src/generators/ui/libs/ui-icon-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-icon-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-icon-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +26 -26
- package/src/generators/ui/libs/ui-input-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-input-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-input-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +14 -13
- package/src/generators/ui/libs/ui-label-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-label-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-label-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-icon.directive.ts.template +3 -9
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-menu-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-menu-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/index.ts.template +3 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination.component.ts.template +269 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-content.directive.ts.template +3 -2
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-ellipsis.component.ts.template +7 -7
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-item.directive.ts.template +4 -2
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-link.directive.ts.template +8 -6
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.component.ts.template +10 -12
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-previous.component.ts.template +10 -12
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination.directive.ts.template +6 -4
- package/src/generators/ui/libs/ui-pagination-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-pagination-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-content.directive.ts.template +3 -3
- package/src/generators/ui/libs/ui-popover-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-popover-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-popover-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +12 -22
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-progress-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-progress-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-progress-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-radio-group-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-radio-group-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-radio-group-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-scroll-area-helm/files/lib/hlm-scroll-area.component.ts.template +15 -44
- package/src/generators/ui/libs/ui-scroll-area-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-scroll-area-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-scroll-area-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-content.directive.ts.template +2 -10
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +4 -10
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.component.ts.template +2 -10
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +4 -7
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-value.directive.ts.template +0 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select.directive.ts.template +0 -1
- package/src/generators/ui/libs/ui-select-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-select-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-select-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-separator-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-separator-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-separator-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +4 -4
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-overlay.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-sheet-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-skeleton-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-skeleton-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-skeleton-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-slider-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-slider-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-slider-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-sonner-helm/files/lib/hlm-toaster.component.ts.template +21 -17
- package/src/generators/ui/libs/ui-sonner-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-sonner-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-sonner-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-spinner-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-spinner-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-spinner-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-ng-model.component.ignore.spec.ts.template +1 -0
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.directive.ts.template +2 -1
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +37 -59
- package/src/generators/ui/libs/ui-switch-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-switch-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-switch-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-caption.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-table.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-table-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-table-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-table-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-paginated-list.component.ts.template +16 -13
- package/src/generators/ui/libs/ui-tabs-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-tabs-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle-group.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-toggle-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-tooltip-helm/files/lib/hlm-tooltip-trigger.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-tooltip-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-tooltip-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-tooltip-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-typography-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-typography-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-typography-helm/generator.js.map +1 -1
- package/src/generators/ui/primivite-deps.js +2 -2
- package/src/generators/ui/primivite-deps.js.map +1 -1
- package/src/generators/ui/primivites.d.ts +1 -1
- package/src/generators/ui/schema.json +0 -1
- package/src/generators/ui/supported-ui-libraries.json +184 -130
- package/src/utils/config.d.ts +5 -0
- package/src/utils/config.js +26 -0
- package/src/utils/config.js.map +1 -0
- package/src/utils/version-utils.js +3 -4
- package/src/utils/version-utils.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component,
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';
|
|
2
2
|
import { BrnAvatarComponent } from '@spartan-ng/ui-avatar-brain';
|
|
3
3
|
import { hlm } from '@spartan-ng/ui-core';
|
|
4
4
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
@@ -17,7 +17,7 @@ export const avatarVariants = cva('relative flex shrink-0 overflow-hidden rounde
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
type AvatarVariants = VariantProps<typeof avatarVariants>;
|
|
20
|
+
export type AvatarVariants = VariantProps<typeof avatarVariants>;
|
|
21
21
|
|
|
22
22
|
@Component({
|
|
23
23
|
selector: 'hlm-avatar',
|
|
@@ -28,7 +28,7 @@ type AvatarVariants = VariantProps<typeof avatarVariants>;
|
|
|
28
28
|
'[class]': '_computedClass()',
|
|
29
29
|
},
|
|
30
30
|
template: `
|
|
31
|
-
@if (image?.canShow()) {
|
|
31
|
+
@if (image()?.canShow()) {
|
|
32
32
|
<ng-content select="[hlmAvatarImage],[brnAvatarImage]" />
|
|
33
33
|
} @else {
|
|
34
34
|
<ng-content select="[hlmAvatarFallback],[brnAvatarFallback]" />
|
|
@@ -37,13 +37,9 @@ type AvatarVariants = VariantProps<typeof avatarVariants>;
|
|
|
37
37
|
})
|
|
38
38
|
export class HlmAvatarComponent extends BrnAvatarComponent {
|
|
39
39
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
40
|
+
public readonly variant = input<AvatarVariants['variant']>('medium');
|
|
41
|
+
|
|
40
42
|
protected readonly _computedClass = computed(() =>
|
|
41
|
-
hlm(avatarVariants({ variant: this.
|
|
43
|
+
hlm(avatarVariants({ variant: this.variant() }), this.userClass()),
|
|
42
44
|
);
|
|
43
|
-
|
|
44
|
-
private readonly _variant = signal<AvatarVariants['variant']>('medium');
|
|
45
|
-
@Input()
|
|
46
|
-
set variant(variant: AvatarVariants['variant']) {
|
|
47
|
-
this._variant.set(variant);
|
|
48
|
-
}
|
|
49
45
|
}
|
|
@@ -7,11 +7,11 @@ import { HlmAvatarImageDirective } from './hlm-avatar-image.directive';
|
|
|
7
7
|
standalone: true,
|
|
8
8
|
imports: [HlmAvatarImageDirective],
|
|
9
9
|
template: `
|
|
10
|
-
<img hlmAvatarImage [class]="userCls" />
|
|
10
|
+
<img hlmAvatarImage alt="Avatar image" [class]="userCls" />
|
|
11
11
|
`,
|
|
12
12
|
})
|
|
13
13
|
class HlmMockComponent {
|
|
14
|
-
userCls = '';
|
|
14
|
+
public userCls = '';
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
describe('HlmAvatarImageDirective', () => {
|
package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template
CHANGED
|
@@ -13,7 +13,7 @@ import type { ClassValue } from 'clsx';
|
|
|
13
13
|
},
|
|
14
14
|
})
|
|
15
15
|
export class HlmAvatarImageDirective {
|
|
16
|
-
canShow = inject(BrnAvatarImageDirective).canShow;
|
|
16
|
+
public canShow = inject(BrnAvatarImageDirective).canShow;
|
|
17
17
|
|
|
18
18
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
19
19
|
protected _computedClass = computed(() => hlm('aspect-square object-cover h-full w-full', this.userClass()));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generator = generator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const generator_1 = require("../../../base/generator");
|
|
6
|
-
function generator(tree, options) {
|
|
7
|
-
return
|
|
8
|
-
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'avatar',
|
|
10
|
+
internalName: 'ui-avatar-helm',
|
|
11
|
+
publicName: 'ui-avatar-helm',
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-avatar-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-avatar-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,QAAQ;QACvB,YAAY,EAAE,gBAAgB;QAC9B,UAAU,EAAE,gBAAgB;KAC5B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { Directive, booleanAttribute, computed, input } from '@angular/core';
|
|
2
3
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
4
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
4
5
|
import type { ClassValue } from 'clsx';
|
|
@@ -43,7 +44,7 @@ export const badgeVariants = cva(
|
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
46
|
);
|
|
46
|
-
type
|
|
47
|
+
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
47
48
|
|
|
48
49
|
@Directive({
|
|
49
50
|
selector: '[hlmBadge]',
|
|
@@ -53,26 +54,12 @@ type badgeVariants = VariantProps<typeof badgeVariants>;
|
|
|
53
54
|
},
|
|
54
55
|
})
|
|
55
56
|
export class HlmBadgeDirective {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
hlm(badgeVariants({ variant: this._variant(), size: this._size(), static: this._static() }), this.userClass()),
|
|
57
|
+
protected readonly _computedClass = computed(() =>
|
|
58
|
+
hlm(badgeVariants({ variant: this.variant(), size: this.size(), static: this.static() }), this.userClass()),
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
private readonly _static = signal<badgeVariants['static']>(false);
|
|
68
|
-
@Input({ transform: booleanAttribute })
|
|
69
|
-
set static(value: badgeVariants['static']) {
|
|
70
|
-
this._static.set(value);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private readonly _size = signal<badgeVariants['size']>('default');
|
|
74
|
-
@Input()
|
|
75
|
-
set size(size: badgeVariants['size']) {
|
|
76
|
-
this._size.set(size);
|
|
77
|
-
}
|
|
61
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
62
|
+
public readonly variant = input<BadgeVariants['variant']>('default');
|
|
63
|
+
public readonly static = input<BadgeVariants['static'], BooleanInput>(false, { transform: booleanAttribute });
|
|
64
|
+
public readonly size = input<BadgeVariants['size']>('default');
|
|
78
65
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generator = generator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const generator_1 = require("../../../base/generator");
|
|
6
|
-
function generator(tree, options) {
|
|
7
|
-
return
|
|
8
|
-
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'badge',
|
|
10
|
+
internalName: 'ui-badge-helm',
|
|
11
|
+
publicName: 'ui-badge-helm',
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-badge-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-badge-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,OAAO;QACtB,YAAY,EAAE,eAAe;QAC7B,UAAU,EAAE,eAAe;KAC3B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { HlmBreadcrumbEllipsisComponent } from './lib/breadcrumb-ellipsis.component';
|
|
3
|
+
import { HlmBreadcrumbItemDirective } from './lib/breadcrumb-item.directive';
|
|
4
|
+
import { HlmBreadcrumbLinkDirective } from './lib/breadcrumb-link.directive';
|
|
5
|
+
import { HlmBreadcrumbListDirective } from './lib/breadcrumb-list.directive';
|
|
6
|
+
import { HlmBreadcrumbPageDirective } from './lib/breadcrumb-page.directive';
|
|
7
|
+
import { HlmBreadcrumbSeparatorComponent } from './lib/breadcrumb-separator.component';
|
|
8
|
+
import { HlmBreadcrumbDirective } from './lib/breadcrumb.directive';
|
|
9
|
+
|
|
10
|
+
export * from './lib/breadcrumb-ellipsis.component';
|
|
11
|
+
export * from './lib/breadcrumb-item.directive';
|
|
12
|
+
export * from './lib/breadcrumb-link.directive';
|
|
13
|
+
export * from './lib/breadcrumb-list.directive';
|
|
14
|
+
export * from './lib/breadcrumb-page.directive';
|
|
15
|
+
export * from './lib/breadcrumb-separator.component';
|
|
16
|
+
export * from './lib/breadcrumb.directive';
|
|
17
|
+
|
|
18
|
+
export const HlmBreadCrumbImports = [
|
|
19
|
+
HlmBreadcrumbDirective,
|
|
20
|
+
HlmBreadcrumbEllipsisComponent,
|
|
21
|
+
HlmBreadcrumbSeparatorComponent,
|
|
22
|
+
HlmBreadcrumbItemDirective,
|
|
23
|
+
HlmBreadcrumbLinkDirective,
|
|
24
|
+
HlmBreadcrumbPageDirective,
|
|
25
|
+
HlmBreadcrumbListDirective,
|
|
26
|
+
] as const;
|
|
27
|
+
|
|
28
|
+
@NgModule({
|
|
29
|
+
imports: [...HlmBreadCrumbImports],
|
|
30
|
+
exports: [...HlmBreadCrumbImports],
|
|
31
|
+
})
|
|
32
|
+
export class HlmBreadCrumbModule {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
|
+
import { lucideEllipsis } from '@ng-icons/lucide';
|
|
3
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
5
|
+
import type { ClassValue } from 'clsx';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'hlm-breadcrumb-ellipsis',
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [HlmIconComponent],
|
|
11
|
+
providers: [provideIcons({ lucideEllipsis })],
|
|
12
|
+
template: `
|
|
13
|
+
<span role="presentation" aria-hidden="true" [class]="_computedClass()">
|
|
14
|
+
<hlm-icon name="lucideEllipsis" class="h-4 w-4" />
|
|
15
|
+
<span class="sr-only">More</span>
|
|
16
|
+
</span>
|
|
17
|
+
`,
|
|
18
|
+
})
|
|
19
|
+
export class HlmBreadcrumbEllipsisComponent {
|
|
20
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
|
|
22
|
+
protected readonly _computedClass = computed(() => hlm('flex h-9 w-9 items-center justify-center', this.userClass()));
|
|
23
|
+
}
|
package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-item.directive.ts.template
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import type { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmBreadcrumbItem]',
|
|
7
|
+
standalone: true,
|
|
8
|
+
host: {
|
|
9
|
+
'[class]': '_computedClass()',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
export class HlmBreadcrumbItemDirective {
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm('inline-flex items-center gap-1.5', this.userClass()));
|
|
16
|
+
}
|
package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-link.directive.ts.template
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { RouterLink } from '@angular/router';
|
|
3
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
+
import type { ClassValue } from 'clsx';
|
|
5
|
+
|
|
6
|
+
@Directive({
|
|
7
|
+
selector: '[hlmBreadcrumbLink]',
|
|
8
|
+
standalone: true,
|
|
9
|
+
hostDirectives: [
|
|
10
|
+
{
|
|
11
|
+
directive: RouterLink,
|
|
12
|
+
inputs: [
|
|
13
|
+
'target',
|
|
14
|
+
'queryParams',
|
|
15
|
+
'fragment',
|
|
16
|
+
'queryParamsHandling',
|
|
17
|
+
'state',
|
|
18
|
+
'info',
|
|
19
|
+
'relativeTo',
|
|
20
|
+
'preserveFragment',
|
|
21
|
+
'skipLocationChange',
|
|
22
|
+
'replaceUrl',
|
|
23
|
+
'routerLink: link',
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
host: {
|
|
28
|
+
'[class]': '_computedClass()',
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
export class HlmBreadcrumbLinkDirective {
|
|
32
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
33
|
+
public readonly link = input<RouterLink['routerLink']>();
|
|
34
|
+
|
|
35
|
+
protected readonly _computedClass = computed(() => hlm('transition-colors hover:text-foreground', this.userClass()));
|
|
36
|
+
}
|
package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-list.directive.ts.template
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import type { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmBreadcrumbList]',
|
|
7
|
+
standalone: true,
|
|
8
|
+
host: {
|
|
9
|
+
'[class]': '_computedClass()',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
export class HlmBreadcrumbListDirective {
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
|
|
15
|
+
protected readonly _computedClass = computed(() =>
|
|
16
|
+
hlm('flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5', this.userClass()),
|
|
17
|
+
);
|
|
18
|
+
}
|
package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-page.directive.ts.template
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import type { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmBreadcrumbPage]',
|
|
7
|
+
standalone: true,
|
|
8
|
+
host: {
|
|
9
|
+
role: 'link',
|
|
10
|
+
'[class]': '_computedClass()',
|
|
11
|
+
'[attr.aria-disabled]': 'disabled',
|
|
12
|
+
'[attr.aria-current]': 'page',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
export class HlmBreadcrumbPageDirective {
|
|
16
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
17
|
+
|
|
18
|
+
protected readonly _computedClass = computed(() => hlm('font-normal text-foreground', this.userClass()));
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
|
+
import { lucideChevronRight } from '@ng-icons/lucide';
|
|
3
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
5
|
+
import type { ClassValue } from 'clsx';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
9
|
+
selector: '[hlmBreadcrumbSeparator]',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [HlmIconComponent],
|
|
12
|
+
providers: [provideIcons({ lucideChevronRight })],
|
|
13
|
+
host: {
|
|
14
|
+
role: 'presentation',
|
|
15
|
+
'[class]': '_computedClass()',
|
|
16
|
+
'[attr.aria-hidden]': 'true',
|
|
17
|
+
},
|
|
18
|
+
template: `
|
|
19
|
+
<ng-content>
|
|
20
|
+
<hlm-icon name="lucideChevronRight" />
|
|
21
|
+
</ng-content>
|
|
22
|
+
`,
|
|
23
|
+
})
|
|
24
|
+
export class HlmBreadcrumbSeparatorComponent {
|
|
25
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
26
|
+
|
|
27
|
+
protected readonly _computedClass = computed(() =>
|
|
28
|
+
hlm('[&>hlm-icon]:w-3.5 [&>hlm-icon]:h-3.5 [&>hlm-icon]:flex', this.userClass()),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import type { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmBreadcrumb]',
|
|
7
|
+
standalone: true,
|
|
8
|
+
host: {
|
|
9
|
+
role: 'navigation',
|
|
10
|
+
'[class]': '_computedClass()',
|
|
11
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
export class HlmBreadcrumbDirective {
|
|
15
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
16
|
+
public readonly ariaLabel = input<string>('breadcrumb', { alias: 'aria-label' });
|
|
17
|
+
|
|
18
|
+
protected readonly _computedClass = computed(() => hlm(this.userClass()));
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generator = generator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'breadcrumb',
|
|
10
|
+
internalName: 'ui-breadcrumb-helm',
|
|
11
|
+
publicName: 'ui-breadcrumb-helm',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-breadcrumb-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,YAAY;QAC3B,YAAY,EAAE,oBAAoB;QAClC,UAAU,EAAE,oBAAoB;KAChC,CAAC,CAAC;AACJ,CAAC"}
|
|
Binary file
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
4
4
|
import type { ClassValue } from 'clsx';
|
|
5
|
+
import { injectBrnButtonConfig } from './hlm-button.token';
|
|
5
6
|
|
|
6
7
|
export const buttonVariants = cva(
|
|
7
8
|
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background',
|
|
@@ -33,31 +34,27 @@ export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
|
33
34
|
@Directive({
|
|
34
35
|
selector: '[hlmBtn]',
|
|
35
36
|
standalone: true,
|
|
37
|
+
exportAs: 'hlmBtn',
|
|
36
38
|
host: {
|
|
37
39
|
'[class]': '_computedClass()',
|
|
38
40
|
},
|
|
39
41
|
})
|
|
40
42
|
export class HlmButtonDirective {
|
|
43
|
+
private readonly _config = injectBrnButtonConfig();
|
|
44
|
+
|
|
45
|
+
private readonly _additionalClasses = signal<ClassValue>('');
|
|
46
|
+
|
|
41
47
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
42
|
-
private readonly _settableClass = signal<ClassValue>('');
|
|
43
48
|
|
|
44
|
-
protected _computedClass = computed(() =>
|
|
45
|
-
hlm(buttonVariants({ variant: this.
|
|
49
|
+
protected readonly _computedClass = computed(() =>
|
|
50
|
+
hlm(buttonVariants({ variant: this.variant(), size: this.size() }), this.userClass(), this._additionalClasses()),
|
|
46
51
|
);
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
this._settableClass.set(value);
|
|
50
|
-
}
|
|
53
|
+
public readonly variant = input<ButtonVariants['variant']>(this._config.variant);
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
@Input()
|
|
54
|
-
set variant(variant: ButtonVariants['variant']) {
|
|
55
|
-
this._variant.set(variant);
|
|
56
|
-
}
|
|
55
|
+
public readonly size = input<ButtonVariants['size']>(this._config.size);
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
set size(size: ButtonVariants['size']) {
|
|
61
|
-
this._size.set(size);
|
|
57
|
+
setClass(classes: string): void {
|
|
58
|
+
this._additionalClasses.set(classes);
|
|
62
59
|
}
|
|
63
60
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider, inject } from '@angular/core';
|
|
2
|
+
import type { ButtonVariants } from './hlm-button.directive';
|
|
3
|
+
|
|
4
|
+
export interface BrnButtonConfig {
|
|
5
|
+
variant: ButtonVariants['variant'];
|
|
6
|
+
size: ButtonVariants['size'];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const defaultConfig: BrnButtonConfig = {
|
|
10
|
+
variant: 'default',
|
|
11
|
+
size: 'default',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const BrnButtonConfigToken = new InjectionToken<BrnButtonConfig>('BrnButtonConfig');
|
|
15
|
+
|
|
16
|
+
export function provideBrnButtonConfig(config: Partial<BrnButtonConfig>): ValueProvider {
|
|
17
|
+
return { provide: BrnButtonConfigToken, useValue: { ...defaultConfig, ...config } };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function injectBrnButtonConfig(): BrnButtonConfig {
|
|
21
|
+
return inject(BrnButtonConfigToken, { optional: true }) ?? defaultConfig;
|
|
22
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generator = generator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const generator_1 = require("../../../base/generator");
|
|
6
|
-
function generator(tree, options) {
|
|
7
|
-
return
|
|
8
|
-
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'button',
|
|
10
|
+
internalName: 'ui-button-helm',
|
|
11
|
+
publicName: 'ui-button-helm',
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-button-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-button-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,QAAQ;QACvB,YAAY,EAAE,gBAAgB;QAC9B,UAAU,EAAE,gBAAgB;KAC5B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { HlmCalendarComponent } from './lib/hlm-calendar.component';
|
|
3
|
+
|
|
4
|
+
export * from './lib/hlm-calendar.component';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
imports: [HlmCalendarComponent],
|
|
8
|
+
exports: [HlmCalendarComponent],
|
|
9
|
+
})
|
|
10
|
+
export class HlmCalendarModule {}
|