@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,13 +1,13 @@
|
|
|
1
|
-
import { booleanAttribute, computed,
|
|
1
|
+
import { Directive, Input, booleanAttribute, computed, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { BrnMenuItemDirective } from '@spartan-ng/ui-menu-brain';
|
|
4
|
-
import {
|
|
4
|
+
import { VariantProps, cva } from 'class-variance-authority';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export const hlmMenuItemVariants = cva(
|
|
8
8
|
'group w-full relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50',
|
|
9
9
|
{
|
|
10
|
-
variants: { inset: { true: 'pl-
|
|
10
|
+
variants: { inset: { true: 'pl-8', false: '' } },
|
|
11
11
|
defaultVariants: { inset: false },
|
|
12
12
|
},
|
|
13
13
|
);
|
|
@@ -30,21 +30,11 @@ export type HlmMenuItemVariants = VariantProps<typeof hlmMenuItemVariants>;
|
|
|
30
30
|
export class HlmMenuItemDirective {
|
|
31
31
|
private readonly _inset = signal<boolean>(false);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@Input()
|
|
36
|
-
set class(userCls: ClassValue) {
|
|
37
|
-
this._userCls.set(userCls);
|
|
38
|
-
}
|
|
33
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
34
|
+
protected _computedClass = computed(() => hlm(hlmMenuItemVariants({ inset: this._inset() }), this.userClass()));
|
|
39
35
|
|
|
40
36
|
@Input({ transform: booleanAttribute })
|
|
41
37
|
set inset(value: boolean) {
|
|
42
38
|
this._inset.set(value);
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
46
|
-
|
|
47
|
-
private _generateClass() {
|
|
48
|
-
return hlm(hlmMenuItemVariants({ inset: this._inset() }), this._userCls());
|
|
49
|
-
}
|
|
50
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, Input, booleanAttribute, computed, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -13,20 +13,14 @@ import { ClassValue } from 'clsx';
|
|
|
13
13
|
},
|
|
14
14
|
})
|
|
15
15
|
export class HlmMenuLabelComponent {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
17
|
+
protected _computedClass = computed(() =>
|
|
18
|
+
hlm('block px-2 py-1.5 text-sm font-semibold', this._inset() && 'pl-8', this.userClass()),
|
|
19
|
+
);
|
|
21
20
|
|
|
22
21
|
private readonly _inset = signal<ClassValue>(false);
|
|
23
22
|
@Input({ transform: booleanAttribute })
|
|
24
23
|
set inset(value: boolean) {
|
|
25
24
|
this._inset.set(value);
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
29
|
-
private _generateClass() {
|
|
30
|
-
return hlm('block px-2 py-1.5 text-sm font-semibold', this._inset() && 'pl-10', this._userCls());
|
|
31
|
-
}
|
|
32
26
|
}
|
package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-separator.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
|
|
|
@@ -11,14 +11,6 @@ import { ClassValue } from 'clsx';
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
export class HlmMenuSeparatorComponent {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
set class(userCls: ClassValue) {
|
|
17
|
-
this._userCls.set(userCls);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
21
|
-
private _generateClass() {
|
|
22
|
-
return hlm('block -mx-1 my-1 h-px bg-muted', this._userCls());
|
|
23
|
-
}
|
|
14
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
+
protected _computedClass = computed(() => hlm('block -mx-1 my-1 h-px bg-muted', this.userClass()));
|
|
24
16
|
}
|
package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-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 HlmMenuShortcutComponent {
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { Component, computed,
|
|
1
|
+
import { Component, Input, computed, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { BrnMenuDirective } from '@spartan-ng/ui-menu-brain';
|
|
4
|
-
import {
|
|
4
|
+
import { VariantProps, cva } from 'class-variance-authority';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export const menuVariants = cva(
|
|
@@ -32,20 +32,12 @@ type MenuVariants = VariantProps<typeof menuVariants>;
|
|
|
32
32
|
`,
|
|
33
33
|
})
|
|
34
34
|
export class HlmMenuComponent {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
set class(userCls: ClassValue) {
|
|
38
|
-
this._userCls.set(userCls);
|
|
39
|
-
}
|
|
35
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
36
|
+
protected _computedClass = computed(() => hlm(menuVariants({ variant: this._variant() }), this.userClass()));
|
|
40
37
|
|
|
41
38
|
private readonly _variant = signal<MenuVariants['variant']>('default');
|
|
42
39
|
@Input()
|
|
43
40
|
set variant(value: MenuVariants['variant']) {
|
|
44
41
|
this._variant.set(value);
|
|
45
42
|
}
|
|
46
|
-
|
|
47
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
48
|
-
private _generateClass() {
|
|
49
|
-
return hlm(menuVariants({ variant: this._variant() }), this._userCls());
|
|
50
|
-
}
|
|
51
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, computed,
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { BrnMenuDirective } from '@spartan-ng/ui-menu-brain';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
@@ -15,17 +15,11 @@ import { ClassValue } from 'clsx';
|
|
|
15
15
|
`,
|
|
16
16
|
})
|
|
17
17
|
export class HlmSubMenuComponent {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this._userCls.set(userCls);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
25
|
-
private _generateClass() {
|
|
26
|
-
return hlm(
|
|
18
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
19
|
+
protected _computedClass = computed(() =>
|
|
20
|
+
hlm(
|
|
27
21
|
'border-border min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
28
|
-
this.
|
|
29
|
-
)
|
|
30
|
-
|
|
22
|
+
this.userClass(),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
31
25
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { HlmPaginationContentDirective } from './lib/hlm-pagination-content.directive';
|
|
4
|
+
import { HlmPaginationEllipsisComponent } from './lib/hlm-pagination-ellipsis.componet';
|
|
5
|
+
import { HlmPaginationItemDirective } from './lib/hlm-pagination-item.directive';
|
|
6
|
+
import { HlmPaginationLinkDirective } from './lib/hlm-pagination-link.directive';
|
|
7
|
+
import { HlmPaginationNextComponent } from './lib/hlm-pagination-next.componet';
|
|
8
|
+
import { HlmPaginationPreviousComponent } from './lib/hlm-pagination-previous.componet';
|
|
9
|
+
import { HlmPaginationDirective } from './lib/hlm-pagination.directive';
|
|
10
|
+
|
|
11
|
+
export * from './lib/hlm-pagination-content.directive';
|
|
12
|
+
export * from './lib/hlm-pagination-ellipsis.componet';
|
|
13
|
+
export * from './lib/hlm-pagination-item.directive';
|
|
14
|
+
export * from './lib/hlm-pagination-link.directive';
|
|
15
|
+
export * from './lib/hlm-pagination-next.componet';
|
|
16
|
+
export * from './lib/hlm-pagination-previous.componet';
|
|
17
|
+
export * from './lib/hlm-pagination.directive';
|
|
18
|
+
|
|
19
|
+
export const HlmPaginationImports = [
|
|
20
|
+
HlmPaginationDirective,
|
|
21
|
+
HlmPaginationContentDirective,
|
|
22
|
+
HlmPaginationItemDirective,
|
|
23
|
+
HlmPaginationLinkDirective,
|
|
24
|
+
HlmPaginationPreviousComponent,
|
|
25
|
+
HlmPaginationNextComponent,
|
|
26
|
+
HlmPaginationEllipsisComponent,
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
29
|
+
@NgModule({
|
|
30
|
+
imports: [...HlmPaginationImports],
|
|
31
|
+
exports: [...HlmPaginationImports],
|
|
32
|
+
})
|
|
33
|
+
export class HlmPaginationModule {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import { cva, VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
export const paginationContentVariants = cva('flex flex-row items-center gap-1', {
|
|
6
|
+
variants: {},
|
|
7
|
+
defaultVariants: {},
|
|
8
|
+
});
|
|
9
|
+
export type PaginationContentVariants = VariantProps<typeof paginationContentVariants>;
|
|
10
|
+
|
|
11
|
+
@Directive({
|
|
12
|
+
selector: '[hlmPaginationContent]',
|
|
13
|
+
standalone: true,
|
|
14
|
+
host: {
|
|
15
|
+
'[class]': '_computedClass()',
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
export class HlmPaginationContentDirective {
|
|
19
|
+
public readonly class = input('');
|
|
20
|
+
protected readonly _computedClass = computed(() => hlm(paginationContentVariants(), this.class()));
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
|
+
import { lucideMoreHorizontal } from '@ng-icons/lucide';
|
|
3
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
5
|
+
import { HlmPaginationLinkDirective } from './hlm-pagination-link.directive';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'hlm-pagination-ellipsis',
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [HlmPaginationLinkDirective, HlmIconComponent],
|
|
11
|
+
providers: [provideIcons({ lucideMoreHorizontal })],
|
|
12
|
+
template: `
|
|
13
|
+
<span [class]="_computedClass()">
|
|
14
|
+
<hlm-icon size="sm" name="lucideMoreHorizontal" />
|
|
15
|
+
<span class="sr-only">More pages</span>
|
|
16
|
+
</span>
|
|
17
|
+
`,
|
|
18
|
+
})
|
|
19
|
+
export class HlmPaginationEllipsisComponent {
|
|
20
|
+
public readonly class = input('');
|
|
21
|
+
|
|
22
|
+
protected _computedClass = computed(() => hlm('flex h-9 w-9 items-center justify-center', this.class()));
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import { cva, VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
export const paginationItemVariants = cva('', {
|
|
6
|
+
variants: {},
|
|
7
|
+
defaultVariants: {},
|
|
8
|
+
});
|
|
9
|
+
export type PaginationItemVariants = VariantProps<typeof paginationItemVariants>;
|
|
10
|
+
|
|
11
|
+
@Directive({
|
|
12
|
+
selector: '[hlmPaginationItem]',
|
|
13
|
+
standalone: true,
|
|
14
|
+
host: {
|
|
15
|
+
'[class]': '_computedClass()',
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
export class HlmPaginationItemDirective {
|
|
19
|
+
public readonly class = input('');
|
|
20
|
+
|
|
21
|
+
protected _computedClass = computed(() => hlm(paginationItemVariants(), this.class()));
|
|
22
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { booleanAttribute, computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { RouterLink } from '@angular/router';
|
|
3
|
+
import { buttonVariants, ButtonVariants } from '@spartan-ng/ui-button-helm';
|
|
4
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
5
|
+
import { cva, VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
export const paginationLinkVariants = cva('', {
|
|
8
|
+
variants: {},
|
|
9
|
+
defaultVariants: {},
|
|
10
|
+
});
|
|
11
|
+
export type PaginationLinkVariants = VariantProps<typeof paginationLinkVariants>;
|
|
12
|
+
|
|
13
|
+
@Directive({
|
|
14
|
+
selector: '[hlmPaginationLink]',
|
|
15
|
+
standalone: true,
|
|
16
|
+
hostDirectives: [
|
|
17
|
+
{
|
|
18
|
+
directive: RouterLink,
|
|
19
|
+
inputs: [
|
|
20
|
+
'target',
|
|
21
|
+
'queryParams',
|
|
22
|
+
'fragment',
|
|
23
|
+
'queryParamsHandling',
|
|
24
|
+
'state',
|
|
25
|
+
'info',
|
|
26
|
+
'relativeTo',
|
|
27
|
+
'preserveFragment',
|
|
28
|
+
'skipLocationChange',
|
|
29
|
+
'replaceUrl',
|
|
30
|
+
'routerLink: link',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
host: {
|
|
35
|
+
'[class]': '_computedClass()',
|
|
36
|
+
'[attr.aria-current]': 'isActive() ? "page" : null',
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
export class HlmPaginationLinkDirective {
|
|
40
|
+
public readonly class = input('');
|
|
41
|
+
public readonly isActive = input(false, { transform: booleanAttribute });
|
|
42
|
+
public readonly size = input<ButtonVariants['size']>('icon');
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
public readonly link = input<string | any[] | null | undefined>();
|
|
45
|
+
|
|
46
|
+
protected _computedClass = computed(() =>
|
|
47
|
+
hlm(
|
|
48
|
+
paginationLinkVariants(),
|
|
49
|
+
buttonVariants({
|
|
50
|
+
variant: this.isActive() ? 'outline' : 'ghost',
|
|
51
|
+
size: this.size(),
|
|
52
|
+
}),
|
|
53
|
+
this.class(),
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
}
|
package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.componet.ts.template
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 { HlmPaginationLinkDirective } from './hlm-pagination-link.directive';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'hlm-pagination-next',
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [HlmPaginationLinkDirective, HlmIconComponent],
|
|
11
|
+
providers: [provideIcons({ lucideChevronRight })],
|
|
12
|
+
template: `
|
|
13
|
+
<a
|
|
14
|
+
[class]="_computedClass()"
|
|
15
|
+
hlmPaginationLink
|
|
16
|
+
[link]="link()"
|
|
17
|
+
size="default"
|
|
18
|
+
[attr.aria-label]="'Go to next page'"
|
|
19
|
+
>
|
|
20
|
+
<span>Next</span>
|
|
21
|
+
<hlm-icon size="sm" name="lucideChevronRight" />
|
|
22
|
+
</a>
|
|
23
|
+
`,
|
|
24
|
+
})
|
|
25
|
+
export class HlmPaginationNextComponent {
|
|
26
|
+
public readonly class = input('');
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
public readonly link = input<string | any[] | null | undefined>();
|
|
29
|
+
|
|
30
|
+
protected _computedClass = computed(() => hlm('gap-1 pr-2.5', this.class()));
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, computed, input } from '@angular/core';
|
|
2
|
+
import { lucideChevronLeft } from '@ng-icons/lucide';
|
|
3
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
5
|
+
import { HlmPaginationLinkDirective } from './hlm-pagination-link.directive';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'hlm-pagination-previous',
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [HlmPaginationLinkDirective, HlmIconComponent],
|
|
11
|
+
providers: [provideIcons({ lucideChevronLeft })],
|
|
12
|
+
template: `
|
|
13
|
+
<a
|
|
14
|
+
[class]="_computedClass()"
|
|
15
|
+
hlmPaginationLink
|
|
16
|
+
[link]="link()"
|
|
17
|
+
size="default"
|
|
18
|
+
[attr.aria-label]="'Go to previous page'"
|
|
19
|
+
>
|
|
20
|
+
<hlm-icon size="sm" name="lucideChevronLeft" />
|
|
21
|
+
<span>Previous</span>
|
|
22
|
+
</a>
|
|
23
|
+
`,
|
|
24
|
+
})
|
|
25
|
+
export class HlmPaginationPreviousComponent {
|
|
26
|
+
public readonly class = input('');
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
public readonly link = input<string | any[] | null | undefined>();
|
|
29
|
+
|
|
30
|
+
protected _computedClass = computed(() => hlm('gap-1 pr-2.5', this.class()));
|
|
31
|
+
}
|
package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination.directive.ts.template
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
+
import { cva, VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
|
|
6
|
+
export const paginationVariants = cva('mx-auto flex w-full justify-center', {
|
|
7
|
+
variants: {},
|
|
8
|
+
defaultVariants: {},
|
|
9
|
+
});
|
|
10
|
+
export type PaginationVariants = VariantProps<typeof paginationVariants>;
|
|
11
|
+
|
|
12
|
+
@Directive({
|
|
13
|
+
selector: '[hlmPagination]',
|
|
14
|
+
standalone: true,
|
|
15
|
+
host: {
|
|
16
|
+
'[class]': '_computedClass()',
|
|
17
|
+
'[attr.role]': '"navigation"',
|
|
18
|
+
'[attr.aria-label]': '"pagination"',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
export class HlmPaginationDirective {
|
|
22
|
+
public readonly class = input<ClassValue>('');
|
|
23
|
+
|
|
24
|
+
protected _computedClass = computed(() => hlm(paginationVariants(), this.class()));
|
|
25
|
+
}
|
|
@@ -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: 'pagination', internalName: 'ui-pagination-helm', publicName: 'ui-pagination-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-pagination-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,YAAY,EAC3B,YAAY,EAAE,oBAAoB,EAClC,UAAU,EAAE,oBAAoB,IAC/B,CAAC;IACJ,CAAC;CAAA;AAPD,8BAOC"}
|
package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-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 HlmPopoverCloseDirective {
|
|
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-popover-helm/files/lib/hlm-popover-content.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
|
|
|
@@ -21,17 +21,11 @@ export class HlmPopoverContentDirective {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this._userCls.set(userCls);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
31
|
-
private _generateClass() {
|
|
32
|
-
return hlm(
|
|
24
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
25
|
+
protected _computedClass = computed(() =>
|
|
26
|
+
hlm(
|
|
33
27
|
'relative border-border w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
34
|
-
this.
|
|
35
|
-
)
|
|
36
|
-
|
|
28
|
+
this.userClass(),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
37
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Directive, DoCheck, ElementRef, Renderer2, computed, effect, inject, input, signal } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
@@ -14,16 +14,10 @@ export class HlmProgressIndicatorDirective implements DoCheck {
|
|
|
14
14
|
private _renderer = inject(Renderer2);
|
|
15
15
|
private readonly _value = signal(0);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
24
|
-
private _generateClass() {
|
|
25
|
-
return hlm('inline-flex transform-gpu h-full w-full flex-1 bg-primary transition-all', this._userCls());
|
|
26
|
-
}
|
|
17
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
18
|
+
protected _computedClass = computed(() =>
|
|
19
|
+
hlm('inline-flex transform-gpu h-full w-full flex-1 bg-primary transition-all', this.userClass()),
|
|
20
|
+
);
|
|
27
21
|
|
|
28
22
|
constructor() {
|
|
29
23
|
effect(() => {
|
package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.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,8 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmProgressDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm('inline-flex relative h-4 w-full overflow-hidden rounded-full bg-secondary', this._userCls());
|
|
22
|
-
}
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() =>
|
|
15
|
+
hlm('inline-flex relative h-4 w-full overflow-hidden rounded-full bg-secondary', this.userClass()),
|
|
16
|
+
);
|
|
23
17
|
}
|
package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-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,14 +10,6 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmRadioGroupDirective {
|
|
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('block', this._userCls());
|
|
22
|
-
}
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() => hlm('block', this.userClass()));
|
|
23
15
|
}
|
|
@@ -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
|
|
|
@@ -19,14 +19,6 @@ const btnLike =
|
|
|
19
19
|
`,
|
|
20
20
|
})
|
|
21
21
|
export class HlmRadioIndicatorComponent {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
set class(userCls: ClassValue) {
|
|
25
|
-
this._userCls.set(userCls);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
29
|
-
private _generateClass() {
|
|
30
|
-
return hlm('relative inline-flex h-4 w-4', this._userCls());
|
|
31
|
-
}
|
|
22
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
23
|
+
protected _computedClass = computed(() => hlm('relative inline-flex h-4 w-4', this.userClass()));
|
|
32
24
|
}
|
package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.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,8 @@ import { ClassValue } from 'clsx';
|
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
export class HlmRadioDirective {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm('group [&.brn-radio-disabled]:text-muted-foreground flex items-center space-x-2', this._userCls());
|
|
22
|
-
}
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected _computedClass = computed(() =>
|
|
15
|
+
hlm('group [&.brn-radio-disabled]:text-muted-foreground flex items-center space-x-2', this.userClass()),
|
|
16
|
+
);
|
|
23
17
|
}
|