@spartan-ng/cli 0.0.1-alpha.488 → 0.0.1-alpha.490
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/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-multi.component.ts.template +13 -13
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.component.ts.template +13 -13
- 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 +3 -7
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-slide-display.component.ts.template +9 -9
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template +8 -8
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +6 -6
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker-multi.component.ts.template +12 -12
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker.component.ts.template +12 -12
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-description.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.directive.ts.template +3 -1
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-form-field.component.ts.template +2 -2
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +3 -3
- package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-checkbox.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.directive.ts.template +1 -1
- 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.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-sub-menu.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination-query-params.component.ts.template +10 -10
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination.component.ts.template +11 -11
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.component.ts.template +2 -2
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-previous.component.ts.template +2 -2
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-close.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-content.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +4 -4
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-indicator.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.component.ts.template +16 -3
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +5 -5
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-close.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +3 -1
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-description.directive.ts.template +1 -1
- 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/files/lib/hlm-sheet-title.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-slider-helm/files/lib/hlm-slider.component.ts.template +3 -3
- package/src/generators/ui/libs/ui-spinner-helm/files/lib/hlm-spinner.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-content.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-list.component.ts.template +3 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-paginated-list.component.ts.template +13 -13
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h4.directive.ts.template +1 -1
- package/src/generators/ui/supported-ui-libraries.json +40 -40
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import type { ClassValue } from 'clsx';
|
|
|
13
13
|
})
|
|
14
14
|
export class HlmAccordionTriggerDirective {
|
|
15
15
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
16
|
-
protected _computedClass = computed(() =>
|
|
16
|
+
protected readonly _computedClass = computed(() =>
|
|
17
17
|
hlm(
|
|
18
18
|
'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>[hlmAccIcon]]:rotate-180',
|
|
19
19
|
this.userClass(),
|
|
@@ -11,7 +11,7 @@ import type { ClassValue } from 'clsx';
|
|
|
11
11
|
'[class]': '_computedClass()',
|
|
12
12
|
},
|
|
13
13
|
template: `
|
|
14
|
-
@if (
|
|
14
|
+
@if (_image()?.canShow()) {
|
|
15
15
|
<ng-content select="[hlmAvatarImage],[brnAvatarImage]" />
|
|
16
16
|
} @else {
|
|
17
17
|
<ng-content select="[hlmAvatarFallback],[brnAvatarFallback]" />
|
package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-multi.component.ts.template
CHANGED
|
@@ -65,7 +65,7 @@ import type { ClassValue } from 'clsx';
|
|
|
65
65
|
<div class="space-y-4">
|
|
66
66
|
<div class="relative flex items-center justify-center pt-1">
|
|
67
67
|
<div brnCalendarHeader class="text-sm font-medium">
|
|
68
|
-
{{
|
|
68
|
+
{{ _heading() }}
|
|
69
69
|
</div>
|
|
70
70
|
|
|
71
71
|
<div class="flex items-center space-x-1">
|
|
@@ -93,22 +93,22 @@ import type { ClassValue } from 'clsx';
|
|
|
93
93
|
*brnCalendarWeekday="let weekday"
|
|
94
94
|
scope="col"
|
|
95
95
|
class="text-muted-foreground w-8 rounded-md text-[0.8rem] font-normal"
|
|
96
|
-
[attr.aria-label]="
|
|
96
|
+
[attr.aria-label]="_i18n.labelWeekday(weekday)"
|
|
97
97
|
>
|
|
98
|
-
{{
|
|
98
|
+
{{ _i18n.formatWeekdayName(weekday) }}
|
|
99
99
|
</th>
|
|
100
100
|
</tr>
|
|
101
101
|
</thead>
|
|
102
102
|
|
|
103
103
|
<tbody role="rowgroup">
|
|
104
104
|
<tr *brnCalendarWeek="let week" class="mt-2 flex w-full">
|
|
105
|
-
@for (date of week; track
|
|
105
|
+
@for (date of week; track _dateAdapter.getTime(date)) {
|
|
106
106
|
<td
|
|
107
107
|
brnCalendarCell
|
|
108
108
|
class="data-[selected]:data-[outside]:bg-accent/50 data-[selected]:bg-accent relative h-8 w-8 p-0 text-center text-sm focus-within:relative focus-within:z-20 first:data-[selected]:rounded-l-md last:data-[selected]:rounded-r-md [&:has([aria-selected].day-range-end)]:rounded-r-md"
|
|
109
109
|
>
|
|
110
|
-
<button brnCalendarCellButton [date]="date" [class]="
|
|
111
|
-
{{
|
|
110
|
+
<button brnCalendarCellButton [date]="date" [class]="_btnClass">
|
|
111
|
+
{{ _dateAdapter.getDate(date) }}
|
|
112
112
|
</button>
|
|
113
113
|
</td>
|
|
114
114
|
}
|
|
@@ -126,10 +126,10 @@ export class HlmCalendarMultiComponent<T> {
|
|
|
126
126
|
protected readonly _computedCalenderClass = computed(() => hlm('rounded-md border p-3', this.calendarClass()));
|
|
127
127
|
|
|
128
128
|
/** Access the calendar i18n */
|
|
129
|
-
protected readonly
|
|
129
|
+
protected readonly _i18n = injectBrnCalendarI18n();
|
|
130
130
|
|
|
131
131
|
/** Access the date time adapter */
|
|
132
|
-
protected readonly
|
|
132
|
+
protected readonly _dateAdapter = injectDateAdapter<T>();
|
|
133
133
|
|
|
134
134
|
/** The minimum date that can be selected.*/
|
|
135
135
|
public readonly min = input<T>();
|
|
@@ -170,14 +170,14 @@ export class HlmCalendarMultiComponent<T> {
|
|
|
170
170
|
private readonly _calendar = viewChild.required(BrnCalendarMultiDirective);
|
|
171
171
|
|
|
172
172
|
/** Get the heading for the current month and year */
|
|
173
|
-
protected
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
173
|
+
protected readonly _heading = computed(() =>
|
|
174
|
+
this._i18n.formatHeader(
|
|
175
|
+
this._dateAdapter.getMonth(this._calendar().focusedDate()),
|
|
176
|
+
this._dateAdapter.getYear(this._calendar().focusedDate()),
|
|
177
177
|
),
|
|
178
178
|
);
|
|
179
179
|
|
|
180
|
-
protected readonly
|
|
180
|
+
protected readonly _btnClass = hlm(
|
|
181
181
|
buttonVariants({ variant: 'ghost' }),
|
|
182
182
|
'size-8 p-0 font-normal aria-selected:opacity-100',
|
|
183
183
|
'data-[outside]:text-muted-foreground data-[outside]:opacity-50 data-[outside]:aria-selected:bg-accent/50 data-[outside]:aria-selected:text-muted-foreground data-[outside]:aria-selected:opacity-30',
|
package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.component.ts.template
CHANGED
|
@@ -63,7 +63,7 @@ import type { ClassValue } from 'clsx';
|
|
|
63
63
|
<div class="space-y-4">
|
|
64
64
|
<div class="relative flex items-center justify-center pt-1">
|
|
65
65
|
<div brnCalendarHeader class="text-sm font-medium">
|
|
66
|
-
{{
|
|
66
|
+
{{ _heading() }}
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
69
|
<div class="flex items-center space-x-1">
|
|
@@ -91,22 +91,22 @@ import type { ClassValue } from 'clsx';
|
|
|
91
91
|
*brnCalendarWeekday="let weekday"
|
|
92
92
|
scope="col"
|
|
93
93
|
class="text-muted-foreground w-8 rounded-md text-[0.8rem] font-normal"
|
|
94
|
-
[attr.aria-label]="
|
|
94
|
+
[attr.aria-label]="_i18n.labelWeekday(weekday)"
|
|
95
95
|
>
|
|
96
|
-
{{
|
|
96
|
+
{{ _i18n.formatWeekdayName(weekday) }}
|
|
97
97
|
</th>
|
|
98
98
|
</tr>
|
|
99
99
|
</thead>
|
|
100
100
|
|
|
101
101
|
<tbody role="rowgroup">
|
|
102
102
|
<tr *brnCalendarWeek="let week" class="mt-2 flex w-full">
|
|
103
|
-
@for (date of week; track
|
|
103
|
+
@for (date of week; track _dateAdapter.getTime(date)) {
|
|
104
104
|
<td
|
|
105
105
|
brnCalendarCell
|
|
106
106
|
class="data-[selected]:data-[outside]:bg-accent/50 data-[selected]:bg-accent relative size-8 p-0 text-center text-sm focus-within:relative focus-within:z-20 first:data-[selected]:rounded-l-md last:data-[selected]:rounded-r-md [&:has([aria-selected].day-range-end)]:rounded-r-md"
|
|
107
107
|
>
|
|
108
|
-
<button brnCalendarCellButton [date]="date" [class]="
|
|
109
|
-
{{
|
|
108
|
+
<button brnCalendarCellButton [date]="date" [class]="_btnClass">
|
|
109
|
+
{{ _dateAdapter.getDate(date) }}
|
|
110
110
|
</button>
|
|
111
111
|
</td>
|
|
112
112
|
}
|
|
@@ -124,10 +124,10 @@ export class HlmCalendarComponent<T> {
|
|
|
124
124
|
protected readonly _computedCalenderClass = computed(() => hlm('rounded-md border p-3', this.calendarClass()));
|
|
125
125
|
|
|
126
126
|
/** Access the calendar i18n */
|
|
127
|
-
protected readonly
|
|
127
|
+
protected readonly _i18n = injectBrnCalendarI18n();
|
|
128
128
|
|
|
129
129
|
/** Access the date time adapter */
|
|
130
|
-
protected readonly
|
|
130
|
+
protected readonly _dateAdapter = injectDateAdapter<T>();
|
|
131
131
|
|
|
132
132
|
/** The minimum date that can be selected.*/
|
|
133
133
|
public readonly min = input<T>();
|
|
@@ -158,14 +158,14 @@ export class HlmCalendarComponent<T> {
|
|
|
158
158
|
private readonly _calendar = viewChild.required(BrnCalendarDirective);
|
|
159
159
|
|
|
160
160
|
/** Get the heading for the current month and year */
|
|
161
|
-
protected
|
|
162
|
-
this.
|
|
163
|
-
this.
|
|
164
|
-
this.
|
|
161
|
+
protected readonly _heading = computed(() =>
|
|
162
|
+
this._i18n.formatHeader(
|
|
163
|
+
this._dateAdapter.getMonth(this._calendar().focusedDate()),
|
|
164
|
+
this._dateAdapter.getYear(this._calendar().focusedDate()),
|
|
165
165
|
),
|
|
166
166
|
);
|
|
167
167
|
|
|
168
|
-
protected readonly
|
|
168
|
+
protected readonly _btnClass = hlm(
|
|
169
169
|
buttonVariants({ variant: 'ghost' }),
|
|
170
170
|
'size-8 p-0 font-normal aria-selected:opacity-100',
|
|
171
171
|
'data-[outside]:text-muted-foreground data-[outside]:opacity-50 data-[outside]:aria-selected:bg-accent/50 data-[outside]:aria-selected:text-muted-foreground data-[outside]:aria-selected:opacity-30',
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template
CHANGED
|
@@ -17,8 +17,8 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
17
17
|
export class HlmCarouselContentComponent {
|
|
18
18
|
private readonly _orientation = inject(HlmCarouselComponent).orientation;
|
|
19
19
|
|
|
20
|
-
public
|
|
21
|
-
protected _computedClass = computed(() =>
|
|
22
|
-
hlm('flex', this._orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', this.
|
|
20
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
protected readonly _computedClass = computed(() =>
|
|
22
|
+
hlm('flex', this._orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', this.userClass()),
|
|
23
23
|
);
|
|
24
24
|
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template
CHANGED
|
@@ -17,13 +17,9 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
17
17
|
`,
|
|
18
18
|
})
|
|
19
19
|
export class HlmCarouselItemComponent {
|
|
20
|
-
public
|
|
20
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
21
|
private readonly _orientation = inject(HlmCarouselComponent).orientation;
|
|
22
|
-
protected _computedClass = computed(() =>
|
|
23
|
-
hlm(
|
|
24
|
-
'min-w-0 shrink-0 grow-0 basis-full',
|
|
25
|
-
this._orientation() === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
26
|
-
this._userClass(),
|
|
27
|
-
),
|
|
22
|
+
protected readonly _computedClass = computed(() =>
|
|
23
|
+
hlm('min-w-0 shrink-0 grow-0 basis-full', this._orientation() === 'horizontal' ? 'pl-4' : 'pt-4', this.userClass()),
|
|
28
24
|
);
|
|
29
25
|
}
|
|
@@ -5,9 +5,9 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: 'hlm-carousel-slide-display',
|
|
7
7
|
template: `
|
|
8
|
-
<span class="sr-only">{{
|
|
8
|
+
<span class="sr-only">{{ _labelContent() }}</span>
|
|
9
9
|
<div aria-hidden="true" class="text-muted-foreground text-sm">
|
|
10
|
-
{{
|
|
10
|
+
{{ _currentSlide() }} / {{ _carousel.slideCount() }}
|
|
11
11
|
</div>
|
|
12
12
|
`,
|
|
13
13
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -16,18 +16,18 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
16
16
|
},
|
|
17
17
|
})
|
|
18
18
|
export class HlmCarouselSlideDisplayComponent {
|
|
19
|
-
protected readonly
|
|
19
|
+
protected readonly _carousel = inject(HlmCarouselComponent);
|
|
20
20
|
|
|
21
|
-
protected readonly
|
|
21
|
+
protected readonly _currentSlide = computed(() => this._carousel.currentSlide() + 1);
|
|
22
22
|
|
|
23
|
-
public
|
|
24
|
-
protected _computedClass = computed(() => this.
|
|
23
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
24
|
+
protected _computedClass = computed(() => this.userClass());
|
|
25
25
|
|
|
26
26
|
public readonly label = input('Slide');
|
|
27
27
|
|
|
28
|
-
protected readonly
|
|
29
|
-
const currentSlide = this.
|
|
30
|
-
const slideCount = this.
|
|
28
|
+
protected readonly _labelContent = computed(() => {
|
|
29
|
+
const currentSlide = this._currentSlide();
|
|
30
|
+
const slideCount = this._carousel.slideCount();
|
|
31
31
|
return `${this.label()} ${currentSlide} of ${slideCount} is displayed`;
|
|
32
32
|
});
|
|
33
33
|
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
emblaCarousel
|
|
35
35
|
class="overflow-hidden"
|
|
36
36
|
[plugins]="plugins()"
|
|
37
|
-
[options]="
|
|
37
|
+
[options]="_emblaOptions()"
|
|
38
38
|
[subscribeToEvents]="['init', 'select', 'reInit']"
|
|
39
39
|
(emblaChange)="onEmblaEvent($event)"
|
|
40
40
|
>
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
`,
|
|
45
45
|
})
|
|
46
46
|
export class HlmCarouselComponent {
|
|
47
|
-
protected
|
|
47
|
+
protected readonly _emblaCarousel = viewChild.required(EmblaCarouselDirective);
|
|
48
48
|
|
|
49
49
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
50
50
|
protected readonly _computedClass = computed(() => hlm('relative', this.userClass()));
|
|
@@ -53,7 +53,7 @@ export class HlmCarouselComponent {
|
|
|
53
53
|
public readonly options: InputSignal<Omit<EmblaOptionsType, 'axis'> | undefined> = input();
|
|
54
54
|
public readonly plugins: InputSignal<EmblaPluginType[]> = input([] as EmblaPluginType[]);
|
|
55
55
|
|
|
56
|
-
protected
|
|
56
|
+
protected readonly _emblaOptions: Signal<EmblaOptionsType> = computed(() => ({
|
|
57
57
|
...this.options(),
|
|
58
58
|
axis: this.orientation() === 'horizontal' ? 'x' : 'y',
|
|
59
59
|
}));
|
|
@@ -69,7 +69,7 @@ export class HlmCarouselComponent {
|
|
|
69
69
|
public readonly slideCount = this._slideCount.asReadonly();
|
|
70
70
|
|
|
71
71
|
protected onEmblaEvent(event: EmblaEventType) {
|
|
72
|
-
const emblaApi = this.
|
|
72
|
+
const emblaApi = this._emblaCarousel().emblaApi;
|
|
73
73
|
|
|
74
74
|
if (!emblaApi) {
|
|
75
75
|
return;
|
|
@@ -88,18 +88,18 @@ export class HlmCarouselComponent {
|
|
|
88
88
|
protected onKeydown(event: KeyboardEvent) {
|
|
89
89
|
if (event.key === 'ArrowLeft') {
|
|
90
90
|
event.preventDefault();
|
|
91
|
-
this.
|
|
91
|
+
this._emblaCarousel().scrollPrev();
|
|
92
92
|
} else if (event.key === 'ArrowRight') {
|
|
93
93
|
event.preventDefault();
|
|
94
|
-
this.
|
|
94
|
+
this._emblaCarousel().scrollNext();
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
scrollPrev() {
|
|
99
|
-
this.
|
|
99
|
+
this._emblaCarousel().scrollPrev();
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
scrollNext() {
|
|
103
|
-
this.
|
|
103
|
+
this._emblaCarousel().scrollNext();
|
|
104
104
|
}
|
|
105
105
|
}
|
package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template
CHANGED
|
@@ -34,7 +34,7 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
34
34
|
[name]="name()"
|
|
35
35
|
[class]="_computedClass()"
|
|
36
36
|
[checked]="checked()"
|
|
37
|
-
[disabled]="
|
|
37
|
+
[disabled]="_state().disabled()"
|
|
38
38
|
[required]="required()"
|
|
39
39
|
[aria-label]="ariaLabel()"
|
|
40
40
|
[aria-labelledby]="ariaLabelledby()"
|
|
@@ -55,7 +55,7 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
55
55
|
'[attr.aria-label]': 'null',
|
|
56
56
|
'[attr.aria-labelledby]': 'null',
|
|
57
57
|
'[attr.aria-describedby]': 'null',
|
|
58
|
-
'[attr.data-disabled]': '
|
|
58
|
+
'[attr.data-disabled]': '_state().disabled() ? "" : null',
|
|
59
59
|
},
|
|
60
60
|
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
61
61
|
viewProviders: [provideIcons({ lucideCheck })],
|
|
@@ -68,7 +68,7 @@ export class HlmCheckboxComponent implements ControlValueAccessor {
|
|
|
68
68
|
hlm(
|
|
69
69
|
'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 cursor-default',
|
|
70
70
|
this.userClass(),
|
|
71
|
-
this.
|
|
71
|
+
this._state().disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
72
72
|
),
|
|
73
73
|
);
|
|
74
74
|
|
|
@@ -96,7 +96,7 @@ export class HlmCheckboxComponent implements ControlValueAccessor {
|
|
|
96
96
|
/** Whether the checkbox is disabled. */
|
|
97
97
|
public readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
98
98
|
|
|
99
|
-
protected readonly
|
|
99
|
+
protected readonly _state = computed(() => ({
|
|
100
100
|
disabled: signal(this.disabled()),
|
|
101
101
|
}));
|
|
102
102
|
|
|
@@ -106,7 +106,7 @@ export class HlmCheckboxComponent implements ControlValueAccessor {
|
|
|
106
106
|
protected _onTouched?: TouchFn;
|
|
107
107
|
|
|
108
108
|
protected _handleChange(): void {
|
|
109
|
-
if (this.
|
|
109
|
+
if (this._state().disabled()) return;
|
|
110
110
|
|
|
111
111
|
const previousChecked = this.checked();
|
|
112
112
|
this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
@@ -128,7 +128,7 @@ export class HlmCheckboxComponent implements ControlValueAccessor {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
setDisabledState(isDisabled: boolean): void {
|
|
131
|
-
this.
|
|
131
|
+
this._state().disabled.set(isDisabled);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template
CHANGED
|
@@ -19,7 +19,7 @@ export class HlmCommandDialogDirective {
|
|
|
19
19
|
private readonly _searchInput = contentChild(BrnCommandSearchInputToken, { read: ElementRef });
|
|
20
20
|
|
|
21
21
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
|
-
protected _computedClass = computed(() =>
|
|
22
|
+
protected readonly _computedClass = computed(() =>
|
|
23
23
|
hlm(
|
|
24
24
|
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%]',
|
|
25
25
|
this.userClass(),
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.component.ts.template
CHANGED
|
@@ -38,7 +38,7 @@ export class HlmCommandItemComponent {
|
|
|
38
38
|
/*** The styles to apply */
|
|
39
39
|
protected readonly _computedClass = computed(() =>
|
|
40
40
|
hlm(
|
|
41
|
-
'data-[selected]:bg-accent data-[selected=true]:text-accent-foreground [&>ng-icon]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:text-base w-full',
|
|
41
|
+
'data-[selected]:bg-accent data-[selected=true]:text-accent-foreground [&>ng-icon]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:text-base w-full data-[hidden]:hidden',
|
|
42
42
|
this.userClass(),
|
|
43
43
|
),
|
|
44
44
|
);
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.component.ts.template
CHANGED
|
@@ -22,6 +22,6 @@ export class HlmCommandListComponent {
|
|
|
22
22
|
|
|
23
23
|
/** The styles to apply */
|
|
24
24
|
protected readonly _computedClass = computed(() =>
|
|
25
|
-
hlm('
|
|
25
|
+
hlm('max-h-[300px] overflow-x-hidden overflow-y-auto', this.userClass()),
|
|
26
26
|
);
|
|
27
27
|
}
|
|
@@ -43,12 +43,12 @@ export const HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR = {
|
|
|
43
43
|
],
|
|
44
44
|
providers: [HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR, provideIcons({ lucideCalendar })],
|
|
45
45
|
template: `
|
|
46
|
-
<brn-popover sideOffset="5" [state]="
|
|
47
|
-
<button type="button" [class]="_computedClass()" [disabled]="
|
|
46
|
+
<brn-popover sideOffset="5" [state]="_popoverState()" (stateChanged)="_popoverState.set($event)">
|
|
47
|
+
<button type="button" [class]="_computedClass()" [disabled]="_state().disabled()" brnPopoverTrigger>
|
|
48
48
|
<ng-icon hlm size="sm" name="lucideCalendar" />
|
|
49
49
|
|
|
50
50
|
<span class="truncate">
|
|
51
|
-
@if (
|
|
51
|
+
@if (_formattedDate(); as formattedDate) {
|
|
52
52
|
{{ formattedDate }}
|
|
53
53
|
} @else {
|
|
54
54
|
<ng-content />
|
|
@@ -64,7 +64,7 @@ export const HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR = {
|
|
|
64
64
|
[max]="max()"
|
|
65
65
|
[minSelection]="minSelection()"
|
|
66
66
|
[maxSelection]="maxSelection()"
|
|
67
|
-
[disabled]="
|
|
67
|
+
[disabled]="_state().disabled()"
|
|
68
68
|
(dateChange)="_handleChange($event)"
|
|
69
69
|
/>
|
|
70
70
|
</div>
|
|
@@ -125,13 +125,13 @@ export class HlmDatePickerMultiComponent<T> implements ControlValueAccessor {
|
|
|
125
125
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
126
126
|
public readonly transformDates = input<(date: T[]) => T[]>(this._config.transformDates);
|
|
127
127
|
|
|
128
|
-
protected readonly
|
|
128
|
+
protected readonly _popoverState = signal<BrnDialogState | null>(null);
|
|
129
129
|
|
|
130
|
-
protected readonly
|
|
130
|
+
protected readonly _state = computed(() => ({
|
|
131
131
|
disabled: signal(this.disabled()),
|
|
132
132
|
}));
|
|
133
133
|
|
|
134
|
-
protected readonly
|
|
134
|
+
protected readonly _formattedDate = computed(() => {
|
|
135
135
|
const dates = this.date();
|
|
136
136
|
return dates ? this.formatDates()(dates) : undefined;
|
|
137
137
|
});
|
|
@@ -144,7 +144,7 @@ export class HlmDatePickerMultiComponent<T> implements ControlValueAccessor {
|
|
|
144
144
|
protected _handleChange(value: T[] | undefined) {
|
|
145
145
|
if (value === undefined) return;
|
|
146
146
|
|
|
147
|
-
if (this.
|
|
147
|
+
if (this._state().disabled()) return;
|
|
148
148
|
const transformedDate = this.transformDates()(value);
|
|
149
149
|
|
|
150
150
|
this.date.set(transformedDate);
|
|
@@ -152,7 +152,7 @@ export class HlmDatePickerMultiComponent<T> implements ControlValueAccessor {
|
|
|
152
152
|
this.changed.emit(transformedDate);
|
|
153
153
|
|
|
154
154
|
if (this.autoCloseOnMaxSelection() && this.date()?.length === this.maxSelection()) {
|
|
155
|
-
this.
|
|
155
|
+
this._popoverState.set('closed');
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -173,14 +173,14 @@ export class HlmDatePickerMultiComponent<T> implements ControlValueAccessor {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
setDisabledState(isDisabled: boolean): void {
|
|
176
|
-
this.
|
|
176
|
+
this._state().disabled.set(isDisabled);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
open() {
|
|
180
|
-
this.
|
|
180
|
+
this._popoverState.set('open');
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
close() {
|
|
184
|
-
this.
|
|
184
|
+
this._popoverState.set('closed');
|
|
185
185
|
}
|
|
186
186
|
}
|
package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker.component.ts.template
CHANGED
|
@@ -42,10 +42,10 @@ export const HLM_DATE_PICKER_VALUE_ACCESSOR = {
|
|
|
42
42
|
],
|
|
43
43
|
providers: [HLM_DATE_PICKER_VALUE_ACCESSOR, provideIcons({ lucideChevronDown })],
|
|
44
44
|
template: `
|
|
45
|
-
<brn-popover sideOffset="5" [state]="
|
|
46
|
-
<button type="button" [class]="_computedClass()" [disabled]="
|
|
45
|
+
<brn-popover sideOffset="5" [state]="_popoverState()" (stateChanged)="_popoverState.set($event)">
|
|
46
|
+
<button type="button" [class]="_computedClass()" [disabled]="_state().disabled()" brnPopoverTrigger>
|
|
47
47
|
<span class="truncate">
|
|
48
|
-
@if (
|
|
48
|
+
@if (_formattedDate(); as formattedDate) {
|
|
49
49
|
{{ formattedDate }}
|
|
50
50
|
} @else {
|
|
51
51
|
<ng-content />
|
|
@@ -61,7 +61,7 @@ export const HLM_DATE_PICKER_VALUE_ACCESSOR = {
|
|
|
61
61
|
[date]="date()"
|
|
62
62
|
[min]="min()"
|
|
63
63
|
[max]="max()"
|
|
64
|
-
[disabled]="
|
|
64
|
+
[disabled]="_state().disabled()"
|
|
65
65
|
(dateChange)="_handleChange($event)"
|
|
66
66
|
/>
|
|
67
67
|
</div>
|
|
@@ -112,13 +112,13 @@ export class HlmDatePickerComponent<T> implements ControlValueAccessor {
|
|
|
112
112
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
113
113
|
public readonly transformDate = input<(date: T) => T>(this._config.transformDate);
|
|
114
114
|
|
|
115
|
-
protected readonly
|
|
115
|
+
protected readonly _popoverState = signal<BrnDialogState | null>(null);
|
|
116
116
|
|
|
117
|
-
protected readonly
|
|
117
|
+
protected readonly _state = computed(() => ({
|
|
118
118
|
disabled: signal(this.disabled()),
|
|
119
119
|
}));
|
|
120
120
|
|
|
121
|
-
protected readonly
|
|
121
|
+
protected readonly _formattedDate = computed(() => {
|
|
122
122
|
const date = this.date();
|
|
123
123
|
return date ? this.formatDate()(date) : undefined;
|
|
124
124
|
});
|
|
@@ -129,7 +129,7 @@ export class HlmDatePickerComponent<T> implements ControlValueAccessor {
|
|
|
129
129
|
protected _onTouched?: TouchFn;
|
|
130
130
|
|
|
131
131
|
protected _handleChange(value: T) {
|
|
132
|
-
if (this.
|
|
132
|
+
if (this._state().disabled()) return;
|
|
133
133
|
const transformedDate = this.transformDate()(value);
|
|
134
134
|
|
|
135
135
|
this.date.set(transformedDate);
|
|
@@ -137,7 +137,7 @@ export class HlmDatePickerComponent<T> implements ControlValueAccessor {
|
|
|
137
137
|
this.changed.emit(transformedDate);
|
|
138
138
|
|
|
139
139
|
if (this.autoCloseOnSelect()) {
|
|
140
|
-
this.
|
|
140
|
+
this._popoverState.set('closed');
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -158,14 +158,14 @@ export class HlmDatePickerComponent<T> implements ControlValueAccessor {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
setDisabledState(isDisabled: boolean): void {
|
|
161
|
-
this.
|
|
161
|
+
this._state().disabled.set(isDisabled);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
open() {
|
|
165
|
-
this.
|
|
165
|
+
this._popoverState.set('open');
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
close() {
|
|
169
|
-
this.
|
|
169
|
+
this._popoverState.set('closed');
|
|
170
170
|
}
|
|
171
171
|
}
|
package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-description.directive.ts.template
CHANGED
|
@@ -12,5 +12,5 @@ import type { ClassValue } from 'clsx';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmDialogDescriptionDirective {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm('text-sm text-muted-foreground', this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm('text-sm text-muted-foreground', this.userClass()));
|
|
16
16
|
}
|
package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.directive.ts.template
CHANGED
|
@@ -12,5 +12,7 @@ import type { ClassValue } from 'clsx';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmDialogTitleDirective {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() =>
|
|
15
|
+
protected readonly _computedClass = computed(() =>
|
|
16
|
+
hlm('text-lg font-semibold leading-none tracking-tight', this.userClass()),
|
|
17
|
+
);
|
|
16
18
|
}
|
package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-form-field.component.ts.template
CHANGED
|
@@ -17,7 +17,7 @@ import { HlmErrorDirective } from './hlm-error.directive';
|
|
|
17
17
|
template: `
|
|
18
18
|
<ng-content />
|
|
19
19
|
|
|
20
|
-
@switch (
|
|
20
|
+
@switch (_hasDisplayedMessage()) {
|
|
21
21
|
@case ('error') {
|
|
22
22
|
<ng-content select="hlm-error" />
|
|
23
23
|
}
|
|
@@ -38,7 +38,7 @@ export class HlmFormFieldComponent {
|
|
|
38
38
|
|
|
39
39
|
public readonly errorChildren = contentChildren(HlmErrorDirective);
|
|
40
40
|
|
|
41
|
-
protected readonly
|
|
41
|
+
protected readonly _hasDisplayedMessage = computed<'error' | 'hint'>(() =>
|
|
42
42
|
this.errorChildren() && this.errorChildren().length > 0 && this.control()?.errorState() ? 'error' : 'hint',
|
|
43
43
|
);
|
|
44
44
|
|
|
@@ -48,11 +48,11 @@ type InputVariants = VariantProps<typeof inputVariants>;
|
|
|
48
48
|
export class HlmInputDirective implements BrnFormFieldControl, DoCheck {
|
|
49
49
|
public readonly error = input<InputVariants['error']>('auto');
|
|
50
50
|
|
|
51
|
-
protected readonly
|
|
51
|
+
protected readonly _state = linkedSignal(() => ({ error: this.error() }));
|
|
52
52
|
|
|
53
53
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
54
54
|
protected readonly _computedClass = computed(() =>
|
|
55
|
-
hlm(inputVariants({ error: this.
|
|
55
|
+
hlm(inputVariants({ error: this._state().error }), this.userClass()),
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
private readonly _injector = inject(Injector);
|
|
@@ -92,6 +92,6 @@ export class HlmInputDirective implements BrnFormFieldControl, DoCheck {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
setError(error: InputVariants['error']) {
|
|
95
|
-
this.
|
|
95
|
+
this._state.set({ error });
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -20,7 +20,7 @@ export class HlmLabelDirective {
|
|
|
20
20
|
|
|
21
21
|
protected readonly _computedClass = computed(() =>
|
|
22
22
|
hlm(
|
|
23
|
-
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-data-[disabled]:cursor-not-allowed peer-data-[disabled]:opacity-50',
|
|
23
|
+
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-data-[disabled]:cursor-not-allowed peer-data-[disabled]:opacity-50 has-[[disabled]]:cursor-not-allowed has-[[disabled]]:opacity-50',
|
|
24
24
|
this.userClass(),
|
|
25
25
|
),
|
|
26
26
|
);
|
package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.directive.ts.template
CHANGED
|
@@ -12,7 +12,7 @@ import type { ClassValue } from 'clsx';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmMenuBarItemDirective {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() =>
|
|
15
|
+
protected readonly _computedClass = computed(() =>
|
|
16
16
|
hlm(
|
|
17
17
|
'focus:bg-accent focus:text-accent-foreground aria-expanded:bg-accent aria-expanded:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-none select-none',
|
|
18
18
|
this.userClass(),
|
package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-checkbox.directive.ts.template
CHANGED
|
@@ -18,7 +18,7 @@ import type { ClassValue } from 'clsx';
|
|
|
18
18
|
})
|
|
19
19
|
export class HlmMenuItemCheckboxDirective {
|
|
20
20
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
-
protected _computedClass = computed(() =>
|
|
21
|
+
protected readonly _computedClass = computed(() =>
|
|
22
22
|
hlm(
|
|
23
23
|
'group w-full relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 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',
|
|
24
24
|
this.userClass(),
|
package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.directive.ts.template
CHANGED
|
@@ -18,7 +18,7 @@ import type { ClassValue } from 'clsx';
|
|
|
18
18
|
})
|
|
19
19
|
export class HlmMenuItemRadioDirective {
|
|
20
20
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
-
protected _computedClass = computed(() =>
|
|
21
|
+
protected readonly _computedClass = computed(() =>
|
|
22
22
|
hlm(
|
|
23
23
|
'group w-full relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 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',
|
|
24
24
|
this.userClass(),
|