@spartan-ng/cli 0.0.1-alpha.366 → 0.0.1-alpha.367
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/src/generators/base/generator.js +22 -25
- package/src/generators/base/generator.js.map +1 -1
- package/src/generators/base/lib/build-dependency-array.js +6 -6
- package/src/generators/base/lib/build-dependency-array.js.map +1 -1
- package/src/generators/base/lib/get-target-library-directory.js +3 -2
- package/src/generators/base/lib/get-target-library-directory.js.map +1 -1
- package/src/generators/base/lib/initialize-angular-library.js +38 -19
- package/src/generators/base/lib/initialize-angular-library.js.map +1 -1
- package/src/generators/base/versions.d.ts +22 -22
- package/src/generators/base/versions.js +22 -22
- package/src/generators/base/versions.js.map +1 -1
- package/src/generators/theme/compat.js +2 -1
- package/src/generators/theme/compat.js.map +1 -1
- package/src/generators/theme/generator.js +45 -48
- package/src/generators/theme/generator.js.map +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.js +12 -7
- package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
- package/src/generators/ui/add-dependent-primitive.js +12 -26
- package/src/generators/ui/add-dependent-primitive.js.map +1 -1
- package/src/generators/ui/compat.js +3 -2
- package/src/generators/ui/compat.js.map +1 -1
- package/src/generators/ui/generator.js +86 -64
- package/src/generators/ui/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-icon.directive.ts.template +3 -10
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-accordion-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-cancel-button.directive.ts.template +3 -8
- package/src/generators/ui/libs/ui-alert-dialog-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-alert-dialog-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-alert-dialog-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-description.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-icon.directive.ts.template +4 -10
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-title.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert.directive.ts.template +4 -8
- package/src/generators/ui/libs/ui-alert-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-alert-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-alert-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.spec.ts.template +2 -1
- package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.ts.template +9 -11
- package/src/generators/ui/libs/ui-aspect-ratio-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-aspect-ratio-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-aspect-ratio-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/fallback/hlm-avatar-fallback.directive.spec.ts.template +2 -2
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/fallback/hlm-avatar-fallback.directive.ts.template +2 -2
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.spec.ts.template +3 -3
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +6 -10
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.spec.ts.template +2 -2
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-avatar-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-avatar-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +9 -22
- package/src/generators/ui/libs/ui-badge-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-badge-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-badge-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/index.ts.template +32 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-ellipsis.component.ts.template +23 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-item.directive.ts.template +16 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-link.directive.ts.template +36 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-list.directive.ts.template +18 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-page.directive.ts.template +19 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb-separator.component.ts.template +30 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/breadcrumb.directive.ts.template +19 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-breadcrumb-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-button-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-button-helm/files/index.ts.template +1 -0
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.directive.ts.template +13 -16
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.token.ts.template +22 -0
- package/src/generators/ui/libs/ui-button-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-button-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-button-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-calendar-helm/files/index.ts.template +10 -0
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.component.ts.template +160 -0
- package/src/generators/ui/libs/ui-calendar-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-calendar-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-calendar-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-card-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-card-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-card-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template +3 -3
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template +7 -3
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.component.ts.template +11 -15
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-previous.component.ts.template +14 -15
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template +8 -8
- package/src/generators/ui/libs/ui-carousel-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-carousel-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox-checkicon.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +11 -27
- package/src/generators/ui/libs/ui-checkbox-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-checkbox-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-checkbox-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.directive.ts.template +5 -9
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +3 -3
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template +3 -9
- package/src/generators/ui/libs/ui-command-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-command-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-command-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog.service.ts.template +3 -3
- package/src/generators/ui/libs/ui-dialog-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-dialog-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/form-field.spec.ts.template +4 -2
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-error.directive.ts.template +1 -0
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-form-field.component.ts.template +6 -7
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-hint.directive.ts.template +1 -0
- package/src/generators/ui/libs/ui-form-field-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-form-field-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-form-field-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-hover-card-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-hover-card-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-hover-card-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-icon-helm/files/index.ts.template +1 -0
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.spec.ts.template +5 -5
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.ts.template +26 -48
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.token.ts.template +23 -0
- package/src/generators/ui/libs/ui-icon-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-icon-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-icon-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +26 -26
- package/src/generators/ui/libs/ui-input-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-input-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-input-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +14 -13
- package/src/generators/ui/libs/ui-label-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-label-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-label-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-icon.directive.ts.template +3 -9
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-menu-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-menu-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/index.ts.template +3 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination.component.ts.template +269 -0
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-content.directive.ts.template +3 -2
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-ellipsis.component.ts.template +7 -7
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-item.directive.ts.template +4 -2
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-link.directive.ts.template +8 -6
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.component.ts.template +10 -12
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-previous.component.ts.template +10 -12
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination.directive.ts.template +6 -4
- package/src/generators/ui/libs/ui-pagination-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-pagination-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-content.directive.ts.template +3 -3
- package/src/generators/ui/libs/ui-popover-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-popover-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-popover-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +12 -22
- package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-progress-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-progress-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-progress-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-radio-group-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-radio-group-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-radio-group-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-scroll-area-helm/files/lib/hlm-scroll-area.component.ts.template +15 -44
- package/src/generators/ui/libs/ui-scroll-area-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-scroll-area-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-scroll-area-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-content.directive.ts.template +2 -10
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +4 -10
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.component.ts.template +2 -10
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +4 -7
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-value.directive.ts.template +0 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select.directive.ts.template +0 -1
- package/src/generators/ui/libs/ui-select-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-select-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-select-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-separator-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-separator-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-separator-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +4 -4
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-overlay.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-sheet-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-skeleton-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-skeleton-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-skeleton-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-slider-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-slider-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-slider-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-sonner-helm/files/lib/hlm-toaster.component.ts.template +21 -17
- package/src/generators/ui/libs/ui-sonner-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-sonner-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-sonner-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-spinner-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-spinner-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-spinner-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-ng-model.component.ignore.spec.ts.template +1 -0
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.directive.ts.template +2 -1
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +37 -59
- package/src/generators/ui/libs/ui-switch-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-switch-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-switch-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-caption.component.ts.template +1 -1
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-table.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-table-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-table-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-table-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-paginated-list.component.ts.template +16 -13
- package/src/generators/ui/libs/ui-tabs-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-tabs-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle-group.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-toggle-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-toggle-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-tooltip-helm/files/lib/hlm-tooltip-trigger.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-tooltip-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-tooltip-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-tooltip-helm/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-typography-helm/generator.d.ts +1 -1
- package/src/generators/ui/libs/ui-typography-helm/generator.js +7 -4
- package/src/generators/ui/libs/ui-typography-helm/generator.js.map +1 -1
- package/src/generators/ui/primivite-deps.js +2 -2
- package/src/generators/ui/primivite-deps.js.map +1 -1
- package/src/generators/ui/primivites.d.ts +1 -1
- package/src/generators/ui/schema.json +0 -1
- package/src/generators/ui/supported-ui-libraries.json +184 -130
- package/src/utils/config.d.ts +5 -0
- package/src/utils/config.js +26 -0
- package/src/utils/config.js.map +1 -0
- package/src/utils/version-utils.js +3 -4
- package/src/utils/version-utils.js.map +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { Component, booleanAttribute, computed, input, model, numberAttribute, viewChild } from '@angular/core';
|
|
3
|
+
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
4
|
+
import { buttonVariants } from '@spartan-ng/ui-button-helm';
|
|
5
|
+
import {
|
|
6
|
+
BrnCalendarCellButtonDirective,
|
|
7
|
+
BrnCalendarCellDirective,
|
|
8
|
+
BrnCalendarDirective,
|
|
9
|
+
BrnCalendarGridDirective,
|
|
10
|
+
BrnCalendarHeaderDirective,
|
|
11
|
+
BrnCalendarNextButtonDirective,
|
|
12
|
+
BrnCalendarPreviousButtonDirective,
|
|
13
|
+
BrnCalendarWeekDirective,
|
|
14
|
+
BrnCalendarWeekdayDirective,
|
|
15
|
+
Weekday,
|
|
16
|
+
injectBrnCalendarI18n,
|
|
17
|
+
} from '@spartan-ng/ui-calendar-brain';
|
|
18
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
19
|
+
import { injectDateAdapter } from '@spartan-ng/ui-date-time';
|
|
20
|
+
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
standalone: true,
|
|
24
|
+
selector: 'hlm-calendar',
|
|
25
|
+
imports: [
|
|
26
|
+
BrnCalendarDirective,
|
|
27
|
+
BrnCalendarHeaderDirective,
|
|
28
|
+
BrnCalendarNextButtonDirective,
|
|
29
|
+
BrnCalendarPreviousButtonDirective,
|
|
30
|
+
BrnCalendarWeekdayDirective,
|
|
31
|
+
BrnCalendarWeekDirective,
|
|
32
|
+
BrnCalendarCellButtonDirective,
|
|
33
|
+
BrnCalendarCellDirective,
|
|
34
|
+
BrnCalendarGridDirective,
|
|
35
|
+
HlmIconComponent,
|
|
36
|
+
],
|
|
37
|
+
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
38
|
+
template: `
|
|
39
|
+
<div
|
|
40
|
+
brnCalendar
|
|
41
|
+
[min]="min()"
|
|
42
|
+
[max]="max()"
|
|
43
|
+
[disabled]="disabled()"
|
|
44
|
+
[(date)]="date"
|
|
45
|
+
[dateDisabled]="dateDisabled()"
|
|
46
|
+
[weekStartsOn]="weekStartsOn()"
|
|
47
|
+
[defaultFocusedDate]="defaultFocusedDate()"
|
|
48
|
+
class="rounded-md border p-3"
|
|
49
|
+
>
|
|
50
|
+
<div class="inline-flex flex-col space-y-4">
|
|
51
|
+
<!-- Header -->
|
|
52
|
+
<div class="space-y-4">
|
|
53
|
+
<div class="relative flex items-center justify-center pt-1">
|
|
54
|
+
<div brnCalendarHeader class="text-sm font-medium">
|
|
55
|
+
{{ heading() }}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="flex items-center space-x-1">
|
|
59
|
+
<button
|
|
60
|
+
brnCalendarPreviousButton
|
|
61
|
+
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 whitespace-nowrap rounded-md border bg-transparent p-0 text-sm font-medium opacity-50 transition-colors hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
62
|
+
>
|
|
63
|
+
<hlm-icon name="lucideChevronLeft" size="sm" />
|
|
64
|
+
</button>
|
|
65
|
+
|
|
66
|
+
<button
|
|
67
|
+
brnCalendarNextButton
|
|
68
|
+
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 whitespace-nowrap rounded-md border bg-transparent p-0 text-sm font-medium opacity-50 transition-colors hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
69
|
+
>
|
|
70
|
+
<hlm-icon name="lucideChevronRight" size="sm" />
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<table class="w-full border-collapse space-y-1" brnCalendarGrid>
|
|
77
|
+
<thead>
|
|
78
|
+
<tr class="flex">
|
|
79
|
+
<th
|
|
80
|
+
*brnCalendarWeekday="let weekday"
|
|
81
|
+
scope="col"
|
|
82
|
+
class="text-muted-foreground w-9 rounded-md text-[0.8rem] font-normal"
|
|
83
|
+
[attr.aria-label]="i18n.labelWeekday(weekday)"
|
|
84
|
+
>
|
|
85
|
+
{{ i18n.formatWeekdayName(weekday) }}
|
|
86
|
+
</th>
|
|
87
|
+
</tr>
|
|
88
|
+
</thead>
|
|
89
|
+
|
|
90
|
+
<tbody role="rowgroup">
|
|
91
|
+
<tr *brnCalendarWeek="let week" class="mt-2 flex w-full">
|
|
92
|
+
@for (date of week; track dateAdapter.getTime(date)) {
|
|
93
|
+
<td
|
|
94
|
+
brnCalendarCell
|
|
95
|
+
class="data-[selected]:data-[outside]:bg-accent/50 data-[selected]:bg-accent relative h-9 w-9 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"
|
|
96
|
+
>
|
|
97
|
+
<button brnCalendarCellButton [date]="date" [class]="btnClass">
|
|
98
|
+
{{ dateAdapter.getDate(date) }}
|
|
99
|
+
</button>
|
|
100
|
+
</td>
|
|
101
|
+
}
|
|
102
|
+
</tr>
|
|
103
|
+
</tbody>
|
|
104
|
+
</table>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
`,
|
|
108
|
+
})
|
|
109
|
+
export class HlmCalendarComponent<T> {
|
|
110
|
+
/** Access the calendar i18n */
|
|
111
|
+
protected readonly i18n = injectBrnCalendarI18n();
|
|
112
|
+
|
|
113
|
+
/** Access the date time adapter */
|
|
114
|
+
protected readonly dateAdapter = injectDateAdapter<T>();
|
|
115
|
+
|
|
116
|
+
/** The minimum date that can be selected.*/
|
|
117
|
+
public readonly min = input<T>();
|
|
118
|
+
|
|
119
|
+
/* * The maximum date that can be selected. */
|
|
120
|
+
public readonly max = input<T>();
|
|
121
|
+
|
|
122
|
+
/** Determine if the date picker is disabled. */
|
|
123
|
+
public readonly disabled = input<boolean, BooleanInput>(false, {
|
|
124
|
+
transform: booleanAttribute,
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
/** The selected value. */
|
|
128
|
+
public readonly date = model<T>();
|
|
129
|
+
|
|
130
|
+
/** Whether a specific date is disabled. */
|
|
131
|
+
public readonly dateDisabled = input<(date: T) => boolean>(() => false);
|
|
132
|
+
|
|
133
|
+
/** The day the week starts on */
|
|
134
|
+
public readonly weekStartsOn = input<Weekday, NumberInput>(0, {
|
|
135
|
+
transform: (v: unknown) => numberAttribute(v) as Weekday,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/** The default focused date. */
|
|
139
|
+
public readonly defaultFocusedDate = input<T>();
|
|
140
|
+
|
|
141
|
+
/** Access the calendar directive */
|
|
142
|
+
private readonly _calendar = viewChild.required(BrnCalendarDirective);
|
|
143
|
+
|
|
144
|
+
/** Get the heading for the current month and year */
|
|
145
|
+
protected heading = computed(() =>
|
|
146
|
+
this.i18n.formatHeader(
|
|
147
|
+
this.dateAdapter.getMonth(this._calendar().focusedDate()),
|
|
148
|
+
this.dateAdapter.getYear(this._calendar().focusedDate()),
|
|
149
|
+
),
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
protected readonly btnClass = hlm(
|
|
153
|
+
buttonVariants({ variant: 'ghost' }),
|
|
154
|
+
'h-9 w-9 p-0 font-normal aria-selected:opacity-100',
|
|
155
|
+
'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',
|
|
156
|
+
'data-[today]:bg-accent data-[today]:text-accent-foreground',
|
|
157
|
+
'data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground',
|
|
158
|
+
'data-[disabled]:text-muted-foreground data-[disabled]:opacity-50',
|
|
159
|
+
);
|
|
160
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generator = generator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'calendar',
|
|
10
|
+
internalName: 'ui-calendar-helm',
|
|
11
|
+
publicName: 'ui-calendar-helm',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-calendar-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,UAAU;QACzB,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,kBAAkB;KAC9B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generator = generator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const generator_1 = require("../../../base/generator");
|
|
6
|
-
function generator(tree, options) {
|
|
7
|
-
return
|
|
8
|
-
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'card',
|
|
10
|
+
internalName: 'ui-card-helm',
|
|
11
|
+
publicName: 'ui-card-helm',
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-card-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-card-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,MAAM;QACrB,YAAY,EAAE,cAAc;QAC5B,UAAU,EAAE,cAAc;KAC1B,CAAC,CAAC;AACJ,CAAC"}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template
CHANGED
|
@@ -16,10 +16,10 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
16
16
|
`,
|
|
17
17
|
})
|
|
18
18
|
export class HlmCarouselContentComponent {
|
|
19
|
-
private
|
|
19
|
+
private readonly _orientation = inject(HlmCarouselComponent).orientation;
|
|
20
20
|
|
|
21
|
-
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
+
public _userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
22
|
protected _computedClass = computed(() =>
|
|
23
|
-
hlm('flex', this.
|
|
23
|
+
hlm('flex', this._orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', this._userClass()),
|
|
24
24
|
);
|
|
25
25
|
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template
CHANGED
|
@@ -18,9 +18,13 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
18
18
|
`,
|
|
19
19
|
})
|
|
20
20
|
export class HlmCarouselItemComponent {
|
|
21
|
-
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
|
-
private
|
|
21
|
+
public _userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
|
+
private readonly _orientation = inject(HlmCarouselComponent).orientation;
|
|
23
23
|
protected _computedClass = computed(() =>
|
|
24
|
-
hlm(
|
|
24
|
+
hlm(
|
|
25
|
+
'min-w-0 shrink-0 grow-0 basis-full',
|
|
26
|
+
this._orientation() === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
27
|
+
this._userClass(),
|
|
28
|
+
),
|
|
25
29
|
);
|
|
26
30
|
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.component.ts.template
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
untracked,
|
|
10
10
|
} from '@angular/core';
|
|
11
11
|
import { lucideArrowRight } from '@ng-icons/lucide';
|
|
12
|
-
import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
|
|
12
|
+
import { HlmButtonDirective, provideBrnButtonConfig } from '@spartan-ng/ui-button-helm';
|
|
13
13
|
import { hlm } from '@spartan-ng/ui-core';
|
|
14
14
|
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
15
15
|
import type { ClassValue } from 'clsx';
|
|
@@ -23,10 +23,10 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
23
23
|
encapsulation: ViewEncapsulation.None,
|
|
24
24
|
host: {
|
|
25
25
|
'[disabled]': 'isDisabled()',
|
|
26
|
-
'(click)': '
|
|
26
|
+
'(click)': '_carousel.scrollNext()',
|
|
27
27
|
},
|
|
28
28
|
hostDirectives: [{ directive: HlmButtonDirective, inputs: ['variant', 'size'] }],
|
|
29
|
-
providers: [provideIcons({ lucideArrowRight })],
|
|
29
|
+
providers: [provideIcons({ lucideArrowRight }), provideBrnButtonConfig({ variant: 'outline', size: 'icon' })],
|
|
30
30
|
imports: [HlmIconComponent],
|
|
31
31
|
template: `
|
|
32
32
|
<hlm-icon size="sm" name="lucideArrowRight" />
|
|
@@ -34,29 +34,25 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
34
34
|
`,
|
|
35
35
|
})
|
|
36
36
|
export class HlmCarouselNextComponent {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
private readonly _button = inject(HlmButtonDirective);
|
|
38
|
+
private readonly _carousel = inject(HlmCarouselComponent);
|
|
39
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
40
|
+
private readonly _computedClass = computed(() =>
|
|
40
41
|
hlm(
|
|
41
42
|
'absolute h-8 w-8 rounded-full',
|
|
42
|
-
this.
|
|
43
|
+
this._carousel.orientation() === 'horizontal'
|
|
43
44
|
? '-right-12 top-1/2 -translate-y-1/2'
|
|
44
45
|
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
45
|
-
this.
|
|
46
|
+
this.userClass(),
|
|
46
47
|
),
|
|
47
48
|
);
|
|
48
|
-
protected isDisabled = () => !this.
|
|
49
|
+
protected readonly isDisabled = () => !this._carousel.canScrollNext();
|
|
49
50
|
|
|
50
51
|
constructor() {
|
|
51
|
-
const button = inject(HlmButtonDirective);
|
|
52
|
-
|
|
53
|
-
button.variant = 'outline';
|
|
54
|
-
button.size = 'icon';
|
|
55
|
-
|
|
56
52
|
effect(() => {
|
|
57
53
|
const computedClass = this._computedClass();
|
|
58
54
|
|
|
59
|
-
untracked(() =>
|
|
55
|
+
untracked(() => this._button.setClass(computedClass));
|
|
60
56
|
});
|
|
61
57
|
}
|
|
62
58
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
untracked,
|
|
10
10
|
} from '@angular/core';
|
|
11
11
|
import { lucideArrowLeft } from '@ng-icons/lucide';
|
|
12
|
-
import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
|
|
12
|
+
import { HlmButtonDirective, provideBrnButtonConfig } from '@spartan-ng/ui-button-helm';
|
|
13
13
|
import { hlm } from '@spartan-ng/ui-core';
|
|
14
14
|
import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
|
|
15
15
|
import type { ClassValue } from 'clsx';
|
|
@@ -23,10 +23,10 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
23
23
|
encapsulation: ViewEncapsulation.None,
|
|
24
24
|
host: {
|
|
25
25
|
'[disabled]': 'isDisabled()',
|
|
26
|
-
'(click)': '
|
|
26
|
+
'(click)': '_carousel.scrollPrev()',
|
|
27
27
|
},
|
|
28
28
|
hostDirectives: [{ directive: HlmButtonDirective, inputs: ['variant', 'size'] }],
|
|
29
|
-
providers: [provideIcons({ lucideArrowLeft })],
|
|
29
|
+
providers: [provideIcons({ lucideArrowLeft }), provideBrnButtonConfig({ variant: 'outline', size: 'icon' })],
|
|
30
30
|
imports: [HlmIconComponent],
|
|
31
31
|
template: `
|
|
32
32
|
<hlm-icon size="sm" name="lucideArrowLeft" />
|
|
@@ -34,29 +34,28 @@ import { HlmCarouselComponent } from './hlm-carousel.component';
|
|
|
34
34
|
`,
|
|
35
35
|
})
|
|
36
36
|
export class HlmCarouselPreviousComponent {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
protected
|
|
37
|
+
private readonly _button = inject(HlmButtonDirective);
|
|
38
|
+
|
|
39
|
+
protected readonly _carousel = inject(HlmCarouselComponent);
|
|
40
|
+
|
|
41
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
42
|
+
|
|
43
|
+
private readonly _computedClass = computed(() =>
|
|
40
44
|
hlm(
|
|
41
45
|
'absolute h-8 w-8 rounded-full',
|
|
42
|
-
this.
|
|
46
|
+
this._carousel.orientation() === 'horizontal'
|
|
43
47
|
? '-left-12 top-1/2 -translate-y-1/2'
|
|
44
48
|
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
45
|
-
this.
|
|
49
|
+
this.userClass(),
|
|
46
50
|
),
|
|
47
51
|
);
|
|
48
|
-
protected isDisabled = () => !this.
|
|
52
|
+
protected readonly isDisabled = () => !this._carousel.canScrollPrev();
|
|
49
53
|
|
|
50
54
|
constructor() {
|
|
51
|
-
const button = inject(HlmButtonDirective);
|
|
52
|
-
|
|
53
|
-
button.variant = 'outline';
|
|
54
|
-
button.size = 'icon';
|
|
55
|
-
|
|
56
55
|
effect(() => {
|
|
57
56
|
const computedClass = this._computedClass();
|
|
58
57
|
|
|
59
|
-
untracked(() =>
|
|
58
|
+
untracked(() => this._button.setClass(computedClass));
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
61
|
}
|
package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template
CHANGED
|
@@ -47,22 +47,22 @@ import {
|
|
|
47
47
|
export class HlmCarouselComponent {
|
|
48
48
|
@ViewChild(EmblaCarouselDirective) protected emblaCarousel?: EmblaCarouselDirective;
|
|
49
49
|
|
|
50
|
-
_userClass = input<ClassValue>('', { alias: 'class' });
|
|
50
|
+
public _userClass = input<ClassValue>('', { alias: 'class' });
|
|
51
51
|
protected _computedClass = computed(() => hlm('relative', this._userClass()));
|
|
52
52
|
|
|
53
|
-
orientation = input<'horizontal' | 'vertical'>('horizontal');
|
|
54
|
-
options: InputSignal<Omit<EmblaOptionsType, 'axis'> | undefined> = input();
|
|
55
|
-
plugins: InputSignal<EmblaPluginType[]> = input([] as EmblaPluginType[]);
|
|
53
|
+
public orientation = input<'horizontal' | 'vertical'>('horizontal');
|
|
54
|
+
public options: InputSignal<Omit<EmblaOptionsType, 'axis'> | undefined> = input();
|
|
55
|
+
public plugins: InputSignal<EmblaPluginType[]> = input([] as EmblaPluginType[]);
|
|
56
56
|
|
|
57
57
|
protected emblaOptions: Signal<EmblaOptionsType> = computed(() => ({
|
|
58
58
|
...this.options(),
|
|
59
59
|
axis: this.orientation() === 'horizontal' ? 'x' : 'y',
|
|
60
60
|
}));
|
|
61
61
|
|
|
62
|
-
private _canScrollPrev = signal(false);
|
|
63
|
-
canScrollPrev = this._canScrollPrev.asReadonly();
|
|
64
|
-
private _canScrollNext = signal(false);
|
|
65
|
-
canScrollNext = this._canScrollNext.asReadonly();
|
|
62
|
+
private readonly _canScrollPrev = signal(false);
|
|
63
|
+
public canScrollPrev = this._canScrollPrev.asReadonly();
|
|
64
|
+
private readonly _canScrollNext = signal(false);
|
|
65
|
+
public canScrollNext = this._canScrollNext.asReadonly();
|
|
66
66
|
|
|
67
67
|
protected onEmblaEvent(event: EmblaEventType) {
|
|
68
68
|
const emblaApi = this.emblaCarousel?.emblaApi;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generator = generator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const generator_1 = require("../../../base/generator");
|
|
6
|
-
function generator(tree, options) {
|
|
7
|
-
return
|
|
8
|
-
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'carousel',
|
|
10
|
+
internalName: 'ui-carousel-helm',
|
|
11
|
+
publicName: 'ui-carousel-helm',
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-carousel-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-carousel-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,UAAU;QACzB,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,kBAAkB;KAC9B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -18,7 +18,7 @@ import type { ClassValue } from 'clsx';
|
|
|
18
18
|
`,
|
|
19
19
|
})
|
|
20
20
|
export class HlmCheckboxCheckIconComponent {
|
|
21
|
-
private _brnCheckbox = inject(BrnCheckboxComponent);
|
|
21
|
+
private readonly _brnCheckbox = inject(BrnCheckboxComponent);
|
|
22
22
|
protected _checked = this._brnCheckbox?.isChecked;
|
|
23
23
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
24
24
|
|
package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
EventEmitter,
|
|
4
|
-
Output,
|
|
5
|
-
booleanAttribute,
|
|
6
|
-
computed,
|
|
7
|
-
effect,
|
|
8
|
-
forwardRef,
|
|
9
|
-
input,
|
|
10
|
-
model,
|
|
11
|
-
signal,
|
|
12
|
-
} from '@angular/core';
|
|
1
|
+
import { Component, booleanAttribute, computed, forwardRef, input, model, output, signal } from '@angular/core';
|
|
13
2
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
3
|
import { BrnCheckboxComponent } from '@spartan-ng/ui-checkbox-brain';
|
|
15
4
|
import { hlm } from '@spartan-ng/ui-core';
|
|
@@ -32,7 +21,7 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
32
21
|
[name]="name()"
|
|
33
22
|
[class]="_computedClass()"
|
|
34
23
|
[checked]="checked()"
|
|
35
|
-
[disabled]="
|
|
24
|
+
[disabled]="state().disabled()"
|
|
36
25
|
[required]="required()"
|
|
37
26
|
[aria-label]="ariaLabel()"
|
|
38
27
|
[aria-labelledby]="ariaLabelledby()"
|
|
@@ -59,7 +48,7 @@ export class HlmCheckboxComponent {
|
|
|
59
48
|
'group inline-flex border border-foreground shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring' +
|
|
60
49
|
' focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:text-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-background',
|
|
61
50
|
this.userClass(),
|
|
62
|
-
this.
|
|
51
|
+
this.state().disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
63
52
|
),
|
|
64
53
|
);
|
|
65
54
|
|
|
@@ -80,25 +69,20 @@ export class HlmCheckboxComponent {
|
|
|
80
69
|
public readonly name = input<string | null>(null);
|
|
81
70
|
public readonly required = input(false, { transform: booleanAttribute });
|
|
82
71
|
|
|
83
|
-
protected readonly _disabled = signal(false);
|
|
84
72
|
public readonly disabled = input(false, { transform: booleanAttribute });
|
|
85
73
|
|
|
86
|
-
|
|
87
|
-
()
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
{ allowSignalWrites: true },
|
|
91
|
-
);
|
|
74
|
+
protected readonly state = computed(() => ({
|
|
75
|
+
disabled: signal(this.disabled()),
|
|
76
|
+
}));
|
|
92
77
|
|
|
93
78
|
// icon inputs
|
|
94
79
|
public readonly checkIconName = input<string>('lucideCheck');
|
|
95
|
-
public readonly checkIconClass = input<
|
|
80
|
+
public readonly checkIconClass = input<ClassValue>('');
|
|
96
81
|
|
|
97
|
-
|
|
98
|
-
public changed = new EventEmitter<boolean>();
|
|
82
|
+
public readonly changed = output<boolean>();
|
|
99
83
|
|
|
100
84
|
protected _handleChange(): void {
|
|
101
|
-
if (this.
|
|
85
|
+
if (this.state().disabled()) return;
|
|
102
86
|
|
|
103
87
|
const previousChecked = this.checked();
|
|
104
88
|
this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
@@ -112,7 +96,7 @@ export class HlmCheckboxComponent {
|
|
|
112
96
|
writeValue(value: any): void {
|
|
113
97
|
this.checked.set(!!value);
|
|
114
98
|
}
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function,,@typescript-eslint/no-explicit-any
|
|
116
100
|
protected _onChange = (_: any) => {};
|
|
117
101
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
118
102
|
protected _onTouched = () => {};
|
|
@@ -128,6 +112,6 @@ export class HlmCheckboxComponent {
|
|
|
128
112
|
}
|
|
129
113
|
|
|
130
114
|
setDisabledState(isDisabled: boolean): void {
|
|
131
|
-
this.
|
|
115
|
+
this.state().disabled.set(isDisabled);
|
|
132
116
|
}
|
|
133
117
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generator = generator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const generator_1 = require("../../../base/generator");
|
|
6
|
-
function generator(tree, options) {
|
|
7
|
-
return
|
|
8
|
-
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'checkbox',
|
|
10
|
+
internalName: 'ui-checkbox-helm',
|
|
11
|
+
publicName: 'ui-checkbox-helm',
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-checkbox-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-checkbox-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,UAAU;QACzB,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,kBAAkB;KAC9B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Directive, computed,
|
|
2
|
-
import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
|
+
import { HlmButtonDirective, provideBrnButtonConfig } from '@spartan-ng/ui-button-helm';
|
|
3
3
|
import { hlm } from '@spartan-ng/ui-core';
|
|
4
4
|
import type { ClassValue } from 'clsx';
|
|
5
5
|
|
|
@@ -7,16 +7,12 @@ import type { ClassValue } from 'clsx';
|
|
|
7
7
|
selector: '[hlmCmdDialogCloseBtn]',
|
|
8
8
|
standalone: true,
|
|
9
9
|
hostDirectives: [HlmButtonDirective],
|
|
10
|
+
providers: [provideBrnButtonConfig({ variant: 'ghost' })],
|
|
10
11
|
host: {
|
|
11
|
-
'[class]': '
|
|
12
|
+
'[class]': 'computedClass()',
|
|
12
13
|
},
|
|
13
14
|
})
|
|
14
15
|
export class HlmCommandDialogCloseButtonDirective {
|
|
15
|
-
private _hlmBtn = inject(HlmButtonDirective, { host: true });
|
|
16
|
-
constructor() {
|
|
17
|
-
this._hlmBtn.variant = 'ghost';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
|
-
protected
|
|
17
|
+
protected readonly computedClass = computed(() => hlm('!p-1 !h-5 !w-5', this.userClass()));
|
|
22
18
|
}
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template
CHANGED
|
@@ -12,10 +12,10 @@ import { HlmCommandDirective } from './hlm-command.directive';
|
|
|
12
12
|
},
|
|
13
13
|
})
|
|
14
14
|
export class HlmCommandDialogDirective {
|
|
15
|
-
private _stateProvider = injectExposesStateProvider({ host: true });
|
|
15
|
+
private readonly _stateProvider = injectExposesStateProvider({ host: true });
|
|
16
16
|
public state = this._stateProvider.state ?? signal('closed').asReadonly();
|
|
17
|
-
private _renderer = inject(Renderer2);
|
|
18
|
-
private _element = inject(ElementRef);
|
|
17
|
+
private readonly _renderer = inject(Renderer2);
|
|
18
|
+
private readonly _element = inject(ElementRef);
|
|
19
19
|
|
|
20
20
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
21
21
|
protected _computedClass = computed(() =>
|
package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import { Directive, computed,
|
|
1
|
+
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
-
import {
|
|
3
|
+
import { provideHlmIconConfig } from '@spartan-ng/ui-icon-helm';
|
|
4
4
|
import type { ClassValue } from 'clsx';
|
|
5
5
|
|
|
6
6
|
@Directive({
|
|
7
7
|
selector: '[hlmCmdIcon]',
|
|
8
8
|
standalone: true,
|
|
9
|
+
providers: [provideHlmIconConfig({ size: 'none' })],
|
|
9
10
|
host: {
|
|
10
11
|
'[class]': '_computedClass()',
|
|
11
12
|
},
|
|
12
13
|
})
|
|
13
14
|
export class HlmCommandItemIconDirective {
|
|
14
|
-
private _menuIcon = inject(HlmIconComponent, { host: true, optional: true });
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
if (!this._menuIcon) return;
|
|
18
|
-
this._menuIcon.size = 'none';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
15
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
22
16
|
protected _computedClass = computed(() => hlm('mr-2 h-4 w-4', this.userClass()));
|
|
23
17
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
2
|
+
import type { HlmBaseGeneratorSchema } from '../../../base/schema';
|
|
3
3
|
export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|