@spartan-ng/cli 0.0.1-alpha.533 → 0.0.1-alpha.535
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/generators/base/generator.js +1 -1
- package/src/generators/base/generator.js.map +1 -1
- package/src/generators/base/lib/build-dependency-array.d.ts +3 -3
- package/src/generators/base/lib/build-dependency-array.js +4 -3
- package/src/generators/base/lib/build-dependency-array.js.map +1 -1
- package/src/generators/base/versions.d.ts +4 -5
- package/src/generators/base/versions.js +5 -6
- package/src/generators/base/versions.js.map +1 -1
- package/src/generators/theme/__snapshots__/generator.spec.ts.snap +142 -376
- package/src/generators/theme/generator.js +1 -1
- package/src/generators/theme/generator.js.map +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.d.ts +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.js +19 -14
- package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
- package/src/generators/theme/libs/colors.d.ts +5 -10
- package/src/generators/theme/libs/colors.js +322 -195
- package/src/generators/theme/libs/colors.js.map +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.ts.template +11 -11
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-item.ts.template +1 -0
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-item.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-list.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-search-input.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-search.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete.ts.template +14 -27
- package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.ts.template +1 -1
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/hlm-breadcrumb-list.ts.template +1 -1
- package/src/generators/ui/libs/ui-button-group-helm/files/lib/hlm-button-group-separator.ts.template +1 -1
- package/src/generators/ui/libs/ui-button-group-helm/files/lib/hlm-button-group-text.ts.template +1 -1
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.ts.template +2 -2
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-multi.ts.template +4 -35
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-range.ts.template +4 -35
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.ts.template +4 -38
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-footer.ts.template +1 -1
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-header.ts.template +1 -1
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-title.ts.template +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.ts.template +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-previous.ts.template +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.ts.template +27 -26
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.ts.template +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.ts.template +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.ts.template +1 -1
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker-multi.ts.template +2 -2
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker.ts.template +2 -2
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-range-picker.ts.template +2 -2
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-close.ts.template +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.ts.template +1 -1
- package/src/generators/ui/libs/ui-empty-helm/files/lib/hlm-empty-content.ts.template +1 -1
- package/src/generators/ui/libs/ui-empty-helm/files/lib/hlm-empty.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-input-group-addon.ts.template +3 -3
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-input-group-text.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-input-group.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp-slot.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp.ts.template +1 -1
- package/src/generators/ui/libs/ui-item-helm/files/index.ts.template +35 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-actions.ts.template +15 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-content.ts.template +17 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-description.ts.template +21 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-footer.ts.template +17 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-group.ts.template +12 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-header.ts.template +17 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-media.ts.template +41 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-separator.ts.template +15 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-title.ts.template +17 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item-token.ts.template +41 -0
- package/src/generators/ui/libs/ui-item-helm/files/lib/hlm-item.ts.template +49 -0
- package/src/generators/ui/libs/ui-item-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-item-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-item-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-kbd-helm/files/lib/hlm-kbd.ts.template +1 -1
- package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-checkbox.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination-query-params.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination.ts.template +1 -1
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-close.ts.template +1 -1
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-indicator.ts.template +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.ts.template +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.ts.template +1 -1
- package/src/generators/ui/libs/ui-separator-helm/files/lib/hlm-separator.ts.template +4 -6
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-close.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-group-action.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-group-label.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-action.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-badge.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-button.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-rail.ts.template +1 -1
- package/src/generators/ui/libs/ui-slider-helm/files/lib/hlm-slider.ts.template +2 -2
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.ts.template +1 -1
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.ts.template +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-content.ts.template +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-trigger.ts.template +1 -1
- package/src/generators/ui/libs/ui-textarea-helm/files/lib/hlm-textarea.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-group.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-item.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle.ts.template +1 -1
- package/src/generators/ui/primitive-deps.js +3 -2
- package/src/generators/ui/primitive-deps.js.map +1 -1
- package/src/generators/ui/primitives.d.ts +1 -1
- package/src/generators/ui/supported-ui-libraries.json +41 -32
- package/src/utils/get-tailwind-version.d.ts +2 -0
- package/src/utils/get-tailwind-version.js +18 -0
- package/src/utils/get-tailwind-version.js.map +1 -0
package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.ts.template
CHANGED
|
@@ -5,25 +5,25 @@ import type { ClassValue } from 'clsx';
|
|
|
5
5
|
|
|
6
6
|
@Component({
|
|
7
7
|
selector: 'hlm-accordion-content',
|
|
8
|
-
template: `
|
|
9
|
-
<div [attr.inert]="_addInert()" [style]="contentStyle()">
|
|
10
|
-
<div class="flex flex-col gap-4 text-balance pb-4 pt-0">
|
|
11
|
-
<ng-content />
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
`,
|
|
15
8
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
9
|
encapsulation: ViewEncapsulation.None,
|
|
17
10
|
host: {
|
|
18
11
|
'[class]': '_computedClass()',
|
|
19
12
|
},
|
|
13
|
+
hostDirectives: [{ directive: BrnAccordionContent, inputs: ['style'] }],
|
|
14
|
+
template: `
|
|
15
|
+
<div class="flex flex-col gap-4 pt-0 pb-4 text-balance">
|
|
16
|
+
<ng-content />
|
|
17
|
+
</div>
|
|
18
|
+
`,
|
|
20
19
|
})
|
|
21
|
-
export class HlmAccordionContent
|
|
20
|
+
export class HlmAccordionContent {
|
|
22
21
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
23
|
-
public readonly contentStyle = input<string>('overflow: hidden');
|
|
24
22
|
|
|
25
23
|
protected readonly _computedClass = computed(() => {
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return hlm(
|
|
25
|
+
'text-sm transition-all data-[state=closed]:h-0 data-[state=open]:h-[var(--brn-accordion-content-height)]',
|
|
26
|
+
this.userClass(),
|
|
27
|
+
);
|
|
28
28
|
});
|
|
29
29
|
}
|
package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.ts.template
CHANGED
|
@@ -15,7 +15,7 @@ export class HlmAccordionTrigger {
|
|
|
15
15
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
16
16
|
protected readonly _computedClass = computed(() =>
|
|
17
17
|
hlm(
|
|
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 outline-none
|
|
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(),
|
|
20
20
|
),
|
|
21
21
|
);
|
package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-item.ts.template
CHANGED
|
@@ -26,7 +26,7 @@ export class HlmAutocompleteItem {
|
|
|
26
26
|
/** The styles to apply */
|
|
27
27
|
protected readonly _computedClass = computed(() =>
|
|
28
28
|
hlm(
|
|
29
|
-
'data-[selected]:bg-accent data-[selected=true]:text-accent-foreground [&>ng-icon]:text-muted-foreground
|
|
29
|
+
'data-[selected]:bg-accent data-[selected=true]:text-accent-foreground [&>ng-icon]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[hidden]:hidden [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:text-base',
|
|
30
30
|
this.userClass(),
|
|
31
31
|
),
|
|
32
32
|
);
|
package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-list.ts.template
CHANGED
|
@@ -22,6 +22,6 @@ export class HlmAutocompleteList {
|
|
|
22
22
|
|
|
23
23
|
/** The styles to apply */
|
|
24
24
|
protected readonly _computedClass = computed(() =>
|
|
25
|
-
hlm('block max-h-60 overflow-
|
|
25
|
+
hlm('block max-h-60 overflow-x-hidden overflow-y-auto', this.userClass()),
|
|
26
26
|
);
|
|
27
27
|
}
|
|
@@ -6,7 +6,7 @@ import type { ClassValue } from 'clsx';
|
|
|
6
6
|
@Component({
|
|
7
7
|
selector: 'input[hlm-autocomplete-search-input]',
|
|
8
8
|
template: '',
|
|
9
|
-
hostDirectives: [{ directive: BrnAutocompleteSearchInput, inputs: ['value'] }],
|
|
9
|
+
hostDirectives: [{ directive: BrnAutocompleteSearchInput, inputs: ['value'], outputs: ['valueChange'] }],
|
|
10
10
|
host: {
|
|
11
11
|
'[class]': '_computedClass()',
|
|
12
12
|
},
|
package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-search.ts.template
CHANGED
|
@@ -21,7 +21,7 @@ export class HlmAutocompleteSearch {
|
|
|
21
21
|
/** The styles to apply */
|
|
22
22
|
protected readonly _computedClass = computed(() =>
|
|
23
23
|
hlm(
|
|
24
|
-
'border-input focus-within:border-ring bg-background focus-within:ring-ring/50
|
|
24
|
+
'border-input focus-within:border-ring bg-background focus-within:ring-ring/50 dark:bg-input/30 flex h-9 min-w-0 items-center gap-2 rounded-md border px-3 shadow-xs focus-within:ring-[3px] [&>_ng-icon]:flex-none [&>_ng-icon]:opacity-50',
|
|
25
25
|
this.userClass(),
|
|
26
26
|
),
|
|
27
27
|
);
|
|
@@ -88,8 +88,7 @@ export const HLM_AUTOCOMPLETE_VALUE_ACCESSOR = {
|
|
|
88
88
|
[placeholder]="searchPlaceholderText()"
|
|
89
89
|
[disabled]="_disabled()"
|
|
90
90
|
[value]="_search()"
|
|
91
|
-
(
|
|
92
|
-
(keydown.arrowDown)="_openPopover()"
|
|
91
|
+
(valueChange)="_onSearchChanged($event)"
|
|
93
92
|
/>
|
|
94
93
|
|
|
95
94
|
<button
|
|
@@ -152,7 +151,8 @@ export class HlmAutocomplete<T> implements ControlValueAccessor {
|
|
|
152
151
|
private static _id = 0;
|
|
153
152
|
private readonly _config = injectHlmAutocompleteConfig<T>();
|
|
154
153
|
|
|
155
|
-
private readonly
|
|
154
|
+
private readonly _brnAutocomplete = viewChild.required(BrnAutocomplete);
|
|
155
|
+
|
|
156
156
|
private readonly _inputRef = viewChild.required('input', { read: ElementRef });
|
|
157
157
|
|
|
158
158
|
protected readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
@@ -232,40 +232,23 @@ export class HlmAutocomplete<T> implements ControlValueAccessor {
|
|
|
232
232
|
protected _onChange?: ChangeFn<T | null>;
|
|
233
233
|
protected _onTouched?: TouchFn;
|
|
234
234
|
|
|
235
|
-
protected _setPopoverState(state: 'open' | 'closed') {
|
|
236
|
-
if (state === 'open') {
|
|
237
|
-
this._brnPopover().open();
|
|
238
|
-
} else {
|
|
239
|
-
this._brnPopover().close();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
protected _openPopover() {
|
|
244
|
-
if (this._search() || this.filteredOptions().length > 0) {
|
|
245
|
-
// only open if there's a search term or options to show
|
|
246
|
-
this._brnPopover().open();
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
235
|
protected _toggleOptions() {
|
|
251
236
|
if (this._search() || this.filteredOptions().length > 0) {
|
|
252
237
|
// only toggle if there's a search term or options to show
|
|
253
|
-
|
|
254
|
-
this._setPopoverState(state === 'open' ? 'closed' : 'open');
|
|
238
|
+
this._brnAutocomplete().toggle();
|
|
255
239
|
}
|
|
256
240
|
|
|
257
241
|
this._inputRef().nativeElement.focus();
|
|
258
242
|
}
|
|
259
243
|
|
|
260
|
-
protected _onSearchChanged(
|
|
261
|
-
|
|
262
|
-
this.
|
|
263
|
-
this.searchChange.emit(input.value);
|
|
244
|
+
protected _onSearchChanged(value: string) {
|
|
245
|
+
this._search.set(value);
|
|
246
|
+
this.searchChange.emit(value);
|
|
264
247
|
|
|
265
248
|
this._clearOption();
|
|
266
249
|
|
|
267
|
-
if (this.
|
|
268
|
-
this.
|
|
250
|
+
if (!this._brnAutocomplete().isExpanded() && value.length > 0) {
|
|
251
|
+
this._brnAutocomplete().open();
|
|
269
252
|
}
|
|
270
253
|
}
|
|
271
254
|
|
|
@@ -285,12 +268,16 @@ export class HlmAutocomplete<T> implements ControlValueAccessor {
|
|
|
285
268
|
this._search.set(searchValue);
|
|
286
269
|
this.searchChange.emit(searchValue);
|
|
287
270
|
|
|
288
|
-
this.
|
|
271
|
+
this._brnAutocomplete().close();
|
|
289
272
|
}
|
|
290
273
|
|
|
291
274
|
/** CONTROL VALUE ACCESSOR */
|
|
292
275
|
public writeValue(value: T | null): void {
|
|
293
276
|
this._value.set(value ? value : undefined);
|
|
277
|
+
|
|
278
|
+
const searchValue = value ? this.transformValueToSearch()(value) : '';
|
|
279
|
+
this._search.set(searchValue);
|
|
280
|
+
this.searchChange.emit(searchValue);
|
|
294
281
|
}
|
|
295
282
|
|
|
296
283
|
public registerOnChange(fn: ChangeFn<T | null>): void {
|
|
@@ -4,7 +4,7 @@ import { type VariantProps, cva } from 'class-variance-authority';
|
|
|
4
4
|
import type { ClassValue } from 'clsx';
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva(
|
|
7
|
-
'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden
|
|
7
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&_ng-icon]:pointer-events-none [&_ng-icon]:size-3',
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -12,6 +12,6 @@ export class HlmBreadcrumbList {
|
|
|
12
12
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
13
13
|
|
|
14
14
|
protected readonly _computedClass = computed(() =>
|
|
15
|
-
hlm('text-muted-foreground flex flex-wrap items-center gap-1.5 break-words
|
|
15
|
+
hlm('text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5', this.userClass()),
|
|
16
16
|
);
|
|
17
17
|
}
|
package/src/generators/ui/libs/ui-button-group-helm/files/lib/hlm-button-group-separator.ts.template
CHANGED
|
@@ -17,7 +17,7 @@ export class HlmButtonGroupSeparator {
|
|
|
17
17
|
|
|
18
18
|
protected readonly _computedClass = computed(() =>
|
|
19
19
|
hlm(
|
|
20
|
-
'bg-input relative inline-flex shrink-0 self-stretch data-[orientation=horizontal]:h-px data-[orientation=
|
|
20
|
+
'bg-input relative inline-flex shrink-0 self-stretch data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-px',
|
|
21
21
|
this.userClass(),
|
|
22
22
|
),
|
|
23
23
|
);
|
package/src/generators/ui/libs/ui-button-group-helm/files/lib/hlm-button-group-text.ts.template
CHANGED
|
@@ -13,7 +13,7 @@ export class HlmButtonGroupText {
|
|
|
13
13
|
|
|
14
14
|
protected readonly _computedClass = computed(() =>
|
|
15
15
|
hlm(
|
|
16
|
-
"bg-muted
|
|
16
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_ng-icon]:pointer-events-none [&_ng-icon:not([class*='size-'])]:size-4",
|
|
17
17
|
this.userClass(),
|
|
18
18
|
),
|
|
19
19
|
);
|
|
@@ -6,7 +6,7 @@ import type { ClassValue } from 'clsx';
|
|
|
6
6
|
import { injectBrnButtonConfig } from './hlm-button.token';
|
|
7
7
|
|
|
8
8
|
export const buttonVariants = cva(
|
|
9
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hallo inline-flex shrink-0 items-center justify-center gap-2
|
|
9
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hallo inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0 [&_ng-icon:not([class*='size-'])]:size-4",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
@@ -14,7 +14,7 @@ export const buttonVariants = cva(
|
|
|
14
14
|
destructive:
|
|
15
15
|
'bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white',
|
|
16
16
|
outline:
|
|
17
|
-
'bg-background
|
|
17
|
+
'bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs',
|
|
18
18
|
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
19
19
|
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
|
20
20
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
@@ -12,21 +12,7 @@ import {
|
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
14
14
|
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
15
|
-
import {
|
|
16
|
-
BrnCalendarCell,
|
|
17
|
-
BrnCalendarCellButton,
|
|
18
|
-
BrnCalendarGrid,
|
|
19
|
-
BrnCalendarHeader,
|
|
20
|
-
BrnCalendarMonthSelect,
|
|
21
|
-
BrnCalendarMulti,
|
|
22
|
-
BrnCalendarNextButton,
|
|
23
|
-
BrnCalendarPreviousButton,
|
|
24
|
-
BrnCalendarWeek,
|
|
25
|
-
BrnCalendarWeekday,
|
|
26
|
-
BrnCalendarYearSelect,
|
|
27
|
-
injectBrnCalendarI18n,
|
|
28
|
-
type Weekday,
|
|
29
|
-
} from '@spartan-ng/brain/calendar';
|
|
15
|
+
import { BrnCalendarImports, BrnCalendarMulti, injectBrnCalendarI18n, type Weekday } from '@spartan-ng/brain/calendar';
|
|
30
16
|
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
31
17
|
import { BrnSelectImports } from '@spartan-ng/brain/select';
|
|
32
18
|
import { buttonVariants } from '<%- importAlias %>/button';
|
|
@@ -37,24 +23,7 @@ import type { ClassValue } from 'clsx';
|
|
|
37
23
|
|
|
38
24
|
@Component({
|
|
39
25
|
selector: 'hlm-calendar-multi',
|
|
40
|
-
imports: [
|
|
41
|
-
BrnCalendarMulti,
|
|
42
|
-
BrnCalendarHeader,
|
|
43
|
-
BrnCalendarNextButton,
|
|
44
|
-
BrnCalendarPreviousButton,
|
|
45
|
-
BrnCalendarWeekday,
|
|
46
|
-
BrnCalendarWeek,
|
|
47
|
-
BrnCalendarCellButton,
|
|
48
|
-
BrnCalendarCell,
|
|
49
|
-
BrnCalendarGrid,
|
|
50
|
-
NgIcon,
|
|
51
|
-
HlmIcon,
|
|
52
|
-
BrnCalendarMonthSelect,
|
|
53
|
-
NgTemplateOutlet,
|
|
54
|
-
BrnSelectImports,
|
|
55
|
-
HlmSelectImports,
|
|
56
|
-
BrnCalendarYearSelect,
|
|
57
|
-
],
|
|
26
|
+
imports: [BrnCalendarImports, NgIcon, HlmIcon, NgTemplateOutlet, BrnSelectImports, HlmSelectImports],
|
|
58
27
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
59
28
|
template: `
|
|
60
29
|
<div
|
|
@@ -122,14 +91,14 @@ import type { ClassValue } from 'clsx';
|
|
|
122
91
|
<div class="flex items-center space-x-1">
|
|
123
92
|
<button
|
|
124
93
|
brnCalendarPreviousButton
|
|
125
|
-
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute left-1 inline-flex h-7 w-7 items-center justify-center
|
|
94
|
+
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute left-1 inline-flex h-7 w-7 items-center justify-center rounded-md border bg-transparent p-0 text-sm font-medium whitespace-nowrap opacity-50 transition-colors hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
126
95
|
>
|
|
127
96
|
<ng-icon hlm name="lucideChevronLeft" size="sm" />
|
|
128
97
|
</button>
|
|
129
98
|
|
|
130
99
|
<button
|
|
131
100
|
brnCalendarNextButton
|
|
132
|
-
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute right-1 inline-flex h-7 w-7 items-center justify-center
|
|
101
|
+
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute right-1 inline-flex h-7 w-7 items-center justify-center rounded-md border bg-transparent p-0 text-sm font-medium whitespace-nowrap opacity-50 transition-colors hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
133
102
|
>
|
|
134
103
|
<ng-icon hlm name="lucideChevronRight" size="sm" />
|
|
135
104
|
</button>
|
|
@@ -12,21 +12,7 @@ import {
|
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
14
14
|
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
15
|
-
import {
|
|
16
|
-
BrnCalendarCell,
|
|
17
|
-
BrnCalendarCellButton,
|
|
18
|
-
BrnCalendarGrid,
|
|
19
|
-
BrnCalendarHeader,
|
|
20
|
-
BrnCalendarMonthSelect,
|
|
21
|
-
BrnCalendarNextButton,
|
|
22
|
-
BrnCalendarPreviousButton,
|
|
23
|
-
BrnCalendarRange,
|
|
24
|
-
BrnCalendarWeek,
|
|
25
|
-
BrnCalendarWeekday,
|
|
26
|
-
BrnCalendarYearSelect,
|
|
27
|
-
injectBrnCalendarI18n,
|
|
28
|
-
type Weekday,
|
|
29
|
-
} from '@spartan-ng/brain/calendar';
|
|
15
|
+
import { BrnCalendarImports, BrnCalendarRange, injectBrnCalendarI18n, type Weekday } from '@spartan-ng/brain/calendar';
|
|
30
16
|
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
31
17
|
import { BrnSelectImports } from '@spartan-ng/brain/select';
|
|
32
18
|
import { buttonVariants } from '<%- importAlias %>/button';
|
|
@@ -37,24 +23,7 @@ import type { ClassValue } from 'clsx';
|
|
|
37
23
|
|
|
38
24
|
@Component({
|
|
39
25
|
selector: 'hlm-calendar-range',
|
|
40
|
-
imports: [
|
|
41
|
-
BrnCalendarHeader,
|
|
42
|
-
BrnCalendarNextButton,
|
|
43
|
-
BrnCalendarPreviousButton,
|
|
44
|
-
BrnCalendarWeekday,
|
|
45
|
-
BrnCalendarWeek,
|
|
46
|
-
BrnCalendarCellButton,
|
|
47
|
-
BrnCalendarCell,
|
|
48
|
-
BrnCalendarGrid,
|
|
49
|
-
NgIcon,
|
|
50
|
-
HlmIcon,
|
|
51
|
-
BrnCalendarRange,
|
|
52
|
-
BrnCalendarMonthSelect,
|
|
53
|
-
HlmSelectImports,
|
|
54
|
-
BrnSelectImports,
|
|
55
|
-
BrnCalendarYearSelect,
|
|
56
|
-
NgTemplateOutlet,
|
|
57
|
-
],
|
|
26
|
+
imports: [BrnCalendarImports, NgIcon, HlmIcon, HlmSelectImports, BrnSelectImports, NgTemplateOutlet],
|
|
58
27
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
59
28
|
template: `
|
|
60
29
|
<div
|
|
@@ -121,14 +90,14 @@ import type { ClassValue } from 'clsx';
|
|
|
121
90
|
<div class="flex items-center space-x-1">
|
|
122
91
|
<button
|
|
123
92
|
brnCalendarPreviousButton
|
|
124
|
-
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute left-1 inline-flex h-7 w-7 items-center justify-center
|
|
93
|
+
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute left-1 inline-flex h-7 w-7 items-center justify-center rounded-md border bg-transparent p-0 text-sm font-medium whitespace-nowrap opacity-50 transition-colors hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
125
94
|
>
|
|
126
95
|
<ng-icon hlm name="lucideChevronLeft" size="sm" />
|
|
127
96
|
</button>
|
|
128
97
|
|
|
129
98
|
<button
|
|
130
99
|
brnCalendarNextButton
|
|
131
|
-
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute right-1 inline-flex h-7 w-7 items-center justify-center
|
|
100
|
+
class="ring-offset-background focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground absolute right-1 inline-flex h-7 w-7 items-center justify-center rounded-md border bg-transparent p-0 text-sm font-medium whitespace-nowrap opacity-50 transition-colors hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
132
101
|
>
|
|
133
102
|
<ng-icon hlm name="lucideChevronRight" size="sm" />
|
|
134
103
|
</button>
|
|
@@ -12,21 +12,7 @@ import {
|
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
14
14
|
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
15
|
-
import {
|
|
16
|
-
BrnCalendar,
|
|
17
|
-
BrnCalendarCell,
|
|
18
|
-
BrnCalendarCellButton,
|
|
19
|
-
BrnCalendarGrid,
|
|
20
|
-
BrnCalendarHeader,
|
|
21
|
-
BrnCalendarMonthSelect,
|
|
22
|
-
BrnCalendarNextButton,
|
|
23
|
-
BrnCalendarPreviousButton,
|
|
24
|
-
BrnCalendarWeek,
|
|
25
|
-
BrnCalendarWeekday,
|
|
26
|
-
BrnCalendarYearSelect,
|
|
27
|
-
injectBrnCalendarI18n,
|
|
28
|
-
type Weekday,
|
|
29
|
-
} from '@spartan-ng/brain/calendar';
|
|
15
|
+
import { BrnCalendar, BrnCalendarImports, injectBrnCalendarI18n, type Weekday } from '@spartan-ng/brain/calendar';
|
|
30
16
|
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
31
17
|
import { BrnSelectImports } from '@spartan-ng/brain/select';
|
|
32
18
|
import { buttonVariants } from '<%- importAlias %>/button';
|
|
@@ -37,27 +23,7 @@ import type { ClassValue } from 'clsx';
|
|
|
37
23
|
|
|
38
24
|
@Component({
|
|
39
25
|
selector: 'hlm-calendar',
|
|
40
|
-
imports: [
|
|
41
|
-
BrnCalendar,
|
|
42
|
-
BrnCalendarHeader,
|
|
43
|
-
BrnCalendarNextButton,
|
|
44
|
-
BrnCalendarPreviousButton,
|
|
45
|
-
BrnCalendarWeekday,
|
|
46
|
-
BrnCalendarWeek,
|
|
47
|
-
BrnCalendarCellButton,
|
|
48
|
-
BrnCalendarCell,
|
|
49
|
-
BrnCalendarGrid,
|
|
50
|
-
NgIcon,
|
|
51
|
-
HlmIcon,
|
|
52
|
-
BrnSelectImports,
|
|
53
|
-
HlmSelectImports,
|
|
54
|
-
BrnCalendarPreviousButton,
|
|
55
|
-
BrnCalendarMonthSelect,
|
|
56
|
-
BrnCalendarMonthSelect,
|
|
57
|
-
BrnCalendarMonthSelect,
|
|
58
|
-
BrnCalendarYearSelect,
|
|
59
|
-
NgTemplateOutlet,
|
|
60
|
-
],
|
|
26
|
+
imports: [BrnCalendarImports, NgIcon, HlmIcon, BrnSelectImports, HlmSelectImports, NgTemplateOutlet],
|
|
61
27
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
62
28
|
template: `
|
|
63
29
|
<div
|
|
@@ -123,14 +89,14 @@ import type { ClassValue } from 'clsx';
|
|
|
123
89
|
<div class="flex items-center space-x-1">
|
|
124
90
|
<button
|
|
125
91
|
brnCalendarPreviousButton
|
|
126
|
-
class="focus-visible:ring-ring hover:bg-accent hover:text-accent-foreground text-popover-foreground absolute left-1 inline-flex size-8 items-center justify-center
|
|
92
|
+
class="focus-visible:ring-ring hover:bg-accent hover:text-accent-foreground text-popover-foreground absolute left-1 inline-flex size-8 items-center justify-center rounded-md bg-transparent p-0 text-sm font-medium whitespace-nowrap transition-colors hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
127
93
|
>
|
|
128
94
|
<ng-icon hlm name="lucideChevronLeft" size="sm" />
|
|
129
95
|
</button>
|
|
130
96
|
|
|
131
97
|
<button
|
|
132
98
|
brnCalendarNextButton
|
|
133
|
-
class="focus-visible:ring-ring hover:bg-accent hover:text-accent-foreground text-popover-foreground absolute right-1 inline-flex size-8 items-center justify-center
|
|
99
|
+
class="focus-visible:ring-ring hover:bg-accent hover:text-accent-foreground text-popover-foreground absolute right-1 inline-flex size-8 items-center justify-center rounded-md bg-transparent p-0 text-sm font-medium whitespace-nowrap transition-colors hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
134
100
|
>
|
|
135
101
|
<ng-icon hlm name="lucideChevronRight" size="sm" />
|
|
136
102
|
</button>
|
|
@@ -10,5 +10,5 @@ import type { ClassValue } from 'clsx';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmCardFooter {
|
|
12
12
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
13
|
-
protected readonly _computedClass = computed(() => hlm('[.border-t]:pt-6
|
|
13
|
+
protected readonly _computedClass = computed(() => hlm('flex items-center px-6 [.border-t]:pt-6', this.userClass()));
|
|
14
14
|
}
|
|
@@ -12,7 +12,7 @@ export class HlmCardHeader {
|
|
|
12
12
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
13
13
|
protected readonly _computedClass = computed(() =>
|
|
14
14
|
hlm(
|
|
15
|
-
'@container/card-header has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6
|
|
15
|
+
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
|
16
16
|
this.userClass(),
|
|
17
17
|
),
|
|
18
18
|
);
|
|
@@ -10,5 +10,5 @@ import type { ClassValue } from 'clsx';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmCardTitle {
|
|
12
12
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
13
|
-
protected readonly _computedClass = computed(() => hlm('font-semibold
|
|
13
|
+
protected readonly _computedClass = computed(() => hlm('leading-none font-semibold', this.userClass()));
|
|
14
14
|
}
|
|
@@ -40,7 +40,7 @@ export class HlmCarouselNext {
|
|
|
40
40
|
hlm(
|
|
41
41
|
'absolute h-8 w-8 rounded-full',
|
|
42
42
|
this._carousel.orientation() === 'horizontal'
|
|
43
|
-
? '
|
|
43
|
+
? 'top-1/2 -right-12 -translate-y-1/2'
|
|
44
44
|
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
45
45
|
this.userClass(),
|
|
46
46
|
),
|
|
@@ -43,7 +43,7 @@ export class HlmCarouselPrevious {
|
|
|
43
43
|
hlm(
|
|
44
44
|
'absolute h-8 w-8 rounded-full',
|
|
45
45
|
this._carousel.orientation() === 'horizontal'
|
|
46
|
-
? '
|
|
46
|
+
? 'top-1/2 -left-12 -translate-y-1/2'
|
|
47
47
|
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
48
48
|
this.userClass(),
|
|
49
49
|
),
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
computed,
|
|
7
7
|
forwardRef,
|
|
8
8
|
input,
|
|
9
|
+
linkedSignal,
|
|
9
10
|
model,
|
|
10
11
|
output,
|
|
11
|
-
signal,
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
14
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
@@ -34,15 +34,16 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
34
34
|
[name]="name()"
|
|
35
35
|
[class]="_computedClass()"
|
|
36
36
|
[checked]="checked()"
|
|
37
|
-
[
|
|
37
|
+
[(indeterminate)]="indeterminate"
|
|
38
|
+
[disabled]="_disabled()"
|
|
38
39
|
[required]="required()"
|
|
39
40
|
[aria-label]="ariaLabel()"
|
|
40
41
|
[aria-labelledby]="ariaLabelledby()"
|
|
41
42
|
[aria-describedby]="ariaDescribedby()"
|
|
42
|
-
(checkedChange)="_handleChange()"
|
|
43
|
+
(checkedChange)="_handleChange($event)"
|
|
43
44
|
(touched)="_onTouched?.()"
|
|
44
45
|
>
|
|
45
|
-
@if (checked()) {
|
|
46
|
+
@if (checked() || indeterminate()) {
|
|
46
47
|
<span class="flex items-center justify-center text-current transition-none">
|
|
47
48
|
<ng-icon hlm size="14px" name="lucideCheck" />
|
|
48
49
|
</span>
|
|
@@ -55,7 +56,7 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
55
56
|
'[attr.aria-label]': 'null',
|
|
56
57
|
'[attr.aria-labelledby]': 'null',
|
|
57
58
|
'[attr.aria-describedby]': 'null',
|
|
58
|
-
'[attr.data-disabled]': '
|
|
59
|
+
'[attr.data-disabled]': '_disabled() ? "" : null',
|
|
59
60
|
},
|
|
60
61
|
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
61
62
|
viewProviders: [provideIcons({ lucideCheck })],
|
|
@@ -66,9 +67,9 @@ export class HlmCheckbox implements ControlValueAccessor {
|
|
|
66
67
|
|
|
67
68
|
protected readonly _computedClass = computed(() =>
|
|
68
69
|
hlm(
|
|
69
|
-
'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
|
|
70
|
+
'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 peer size-4 shrink-0 cursor-default rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
70
71
|
this.userClass(),
|
|
71
|
-
this.
|
|
72
|
+
this._disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
72
73
|
),
|
|
73
74
|
);
|
|
74
75
|
|
|
@@ -85,10 +86,16 @@ export class HlmCheckbox implements ControlValueAccessor {
|
|
|
85
86
|
public readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });
|
|
86
87
|
|
|
87
88
|
/** The checked state of the checkbox. */
|
|
88
|
-
public readonly checked = model<
|
|
89
|
+
public readonly checked = model<boolean>(false);
|
|
89
90
|
|
|
90
91
|
/** Emits when checked state changes. */
|
|
91
|
-
public readonly checkedChange = output<
|
|
92
|
+
public readonly checkedChange = output<boolean>();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The indeterminate state of the checkbox.
|
|
96
|
+
* For example, a "select all/deselect all" checkbox may be in the indeterminate state when some but not all of its sub-controls are checked.
|
|
97
|
+
*/
|
|
98
|
+
public readonly indeterminate = model<boolean>(false);
|
|
92
99
|
|
|
93
100
|
/** The name attribute of the checkbox. */
|
|
94
101
|
public readonly name = input<string | null>(null);
|
|
@@ -99,28 +106,24 @@ export class HlmCheckbox implements ControlValueAccessor {
|
|
|
99
106
|
/** Whether the checkbox is disabled. */
|
|
100
107
|
public readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
101
108
|
|
|
102
|
-
protected readonly
|
|
103
|
-
disabled: signal(this.disabled()),
|
|
104
|
-
}));
|
|
109
|
+
protected readonly _disabled = linkedSignal(this.disabled);
|
|
105
110
|
|
|
106
|
-
protected _onChange?: ChangeFn<
|
|
111
|
+
protected _onChange?: ChangeFn<boolean>;
|
|
107
112
|
protected _onTouched?: TouchFn;
|
|
108
113
|
|
|
109
|
-
protected _handleChange(): void {
|
|
110
|
-
if (this.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this.
|
|
114
|
-
this._onChange?.(!previousChecked);
|
|
115
|
-
this.checkedChange.emit(!previousChecked);
|
|
114
|
+
protected _handleChange(value: boolean): void {
|
|
115
|
+
if (this._disabled()) return;
|
|
116
|
+
this.checked.set(value);
|
|
117
|
+
this.checkedChange.emit(value);
|
|
118
|
+
this._onChange?.(value);
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/** CONTROL VALUE ACCESSOR */
|
|
119
|
-
writeValue(value:
|
|
120
|
-
this.checked.set(
|
|
122
|
+
writeValue(value: boolean): void {
|
|
123
|
+
this.checked.set(value);
|
|
121
124
|
}
|
|
122
125
|
|
|
123
|
-
registerOnChange(fn: ChangeFn<
|
|
126
|
+
registerOnChange(fn: ChangeFn<boolean>): void {
|
|
124
127
|
this._onChange = fn;
|
|
125
128
|
}
|
|
126
129
|
|
|
@@ -129,8 +132,6 @@ export class HlmCheckbox implements ControlValueAccessor {
|
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
setDisabledState(isDisabled: boolean): void {
|
|
132
|
-
this.
|
|
135
|
+
this._disabled.set(isDisabled);
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
|
-
|
|
136
|
-
type CheckboxValue = boolean | 'indeterminate';
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.ts.template
CHANGED
|
@@ -17,7 +17,7 @@ export class HlmCommandDialogCloseButton {
|
|
|
17
17
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
18
18
|
protected readonly _computedClass = computed(() =>
|
|
19
19
|
hlm(
|
|
20
|
-
'focus-visible:ring-ring hover:bg-accent hover:text-accent-foreground ring-offset-background absolute
|
|
20
|
+
'focus-visible:ring-ring hover:bg-accent hover:text-accent-foreground ring-offset-background absolute top-3 right-3 inline-flex !h-5 h-10 !w-5 items-center justify-center rounded-md !p-1 px-4 py-2 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none',
|
|
21
21
|
this.userClass(),
|
|
22
22
|
),
|
|
23
23
|
);
|
|
@@ -26,7 +26,7 @@ export class HlmCommandItem {
|
|
|
26
26
|
/** The styles to apply */
|
|
27
27
|
protected readonly _computedClass = computed(() =>
|
|
28
28
|
hlm(
|
|
29
|
-
'data-[selected]:bg-accent data-[selected=true]:text-accent-foreground [&>ng-icon]:text-muted-foreground
|
|
29
|
+
'data-[selected]:bg-accent data-[selected=true]:text-accent-foreground [&>ng-icon]:text-muted-foreground relative flex w-full 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 data-[hidden]:hidden [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:text-base',
|
|
30
30
|
this.userClass(),
|
|
31
31
|
),
|
|
32
32
|
);
|