@egose/shadcn-theme-ng 0.0.27 → 0.1.0
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/README.md +130 -13
- package/accordion/README.md +3 -0
- package/accordion/fesm2022/accordion.mjs +148 -0
- package/accordion/package.json +25 -0
- package/accordion/types/accordion.d.ts +49 -0
- package/alert/README.md +2 -63
- package/alert/fesm2022/alert.mjs +58 -53
- package/alert/package.json +25 -0
- package/alert-dialog/README.md +11 -0
- package/alert-dialog/fesm2022/alert-dialog.mjs +287 -0
- package/alert-dialog/package.json +25 -0
- package/alert-dialog/types/alert-dialog.d.ts +90 -0
- package/aspect-ratio/README.md +11 -0
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +62 -0
- package/aspect-ratio/package.json +25 -0
- package/aspect-ratio/types/aspect-ratio.d.ts +21 -0
- package/autocomplete/README.md +3 -0
- package/autocomplete/fesm2022/autocomplete.mjs +391 -0
- package/autocomplete/package.json +24 -0
- package/autocomplete/types/autocomplete.d.ts +96 -0
- package/avatar/README.md +11 -0
- package/avatar/fesm2022/avatar.mjs +178 -0
- package/avatar/package.json +25 -0
- package/avatar/types/avatar.d.ts +50 -0
- package/badge/README.md +2 -63
- package/badge/fesm2022/badge.mjs +69 -63
- package/badge/package.json +25 -0
- package/basic-alert/README.md +2 -63
- package/basic-alert/fesm2022/basic-alert.mjs +14 -22
- package/basic-alert/package.json +24 -0
- package/breadcrumb/README.md +11 -0
- package/breadcrumb/fesm2022/breadcrumb.mjs +218 -0
- package/breadcrumb/package.json +25 -0
- package/breadcrumb/types/breadcrumb.d.ts +57 -0
- package/button/README.md +2 -63
- package/button/fesm2022/button.mjs +201 -177
- package/button/package.json +25 -0
- package/button/{index.d.ts → types/button.d.ts} +31 -10
- package/button-group/README.md +11 -0
- package/button-group/fesm2022/button-group.mjs +102 -0
- package/button-group/package.json +25 -0
- package/button-group/types/button-group.d.ts +30 -0
- package/calendar/README.md +2 -63
- package/calendar/fesm2022/calendar.mjs +178 -570
- package/calendar/package.json +24 -0
- package/calendar/types/calendar.d.ts +94 -0
- package/card/README.md +11 -0
- package/card/fesm2022/card.mjs +169 -0
- package/card/package.json +25 -0
- package/card/types/card.d.ts +54 -0
- package/carousel/README.md +11 -0
- package/carousel/fesm2022/carousel.mjs +267 -0
- package/carousel/package.json +25 -0
- package/carousel/types/carousel.d.ts +84 -0
- package/checkbox/README.md +3 -0
- package/checkbox/fesm2022/checkbox.mjs +113 -0
- package/checkbox/package.json +24 -0
- package/checkbox/types/checkbox.d.ts +56 -0
- package/collapsible/README.md +11 -0
- package/collapsible/fesm2022/collapsible.mjs +77 -0
- package/collapsible/package.json +25 -0
- package/collapsible/types/collapsible.d.ts +27 -0
- package/combobox/README.md +11 -0
- package/combobox/fesm2022/combobox.mjs +547 -0
- package/combobox/package.json +25 -0
- package/combobox/types/combobox.d.ts +151 -0
- package/command/README.md +11 -0
- package/command/fesm2022/command.mjs +301 -0
- package/command/package.json +25 -0
- package/command/types/command.d.ts +89 -0
- package/confirmation-dialog/README.md +3 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +79 -0
- package/confirmation-dialog/package.json +24 -0
- package/confirmation-dialog/types/confirmation-dialog.d.ts +28 -0
- package/context-menu/README.md +11 -0
- package/context-menu/fesm2022/context-menu.mjs +89 -0
- package/context-menu/package.json +25 -0
- package/context-menu/types/context-menu.d.ts +34 -0
- package/date-picker/README.md +2 -63
- package/date-picker/fesm2022/date-picker.mjs +1104 -352
- package/date-picker/package.json +24 -0
- package/date-picker/types/date-picker.d.ts +555 -0
- package/dialog/README.md +3 -0
- package/dialog/fesm2022/dialog.mjs +281 -0
- package/dialog/package.json +24 -0
- package/dialog/types/dialog.d.ts +95 -0
- package/drawer/README.md +11 -0
- package/drawer/fesm2022/drawer.mjs +261 -0
- package/drawer/package.json +25 -0
- package/drawer/types/drawer.d.ts +76 -0
- package/dropdown-menu/README.md +11 -0
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +554 -0
- package/dropdown-menu/package.json +25 -0
- package/dropdown-menu/types/dropdown-menu.d.ts +180 -0
- package/empty/README.md +11 -0
- package/empty/fesm2022/empty.mjs +151 -0
- package/empty/package.json +25 -0
- package/empty/types/empty.d.ts +54 -0
- package/field/README.md +11 -0
- package/field/fesm2022/field.mjs +351 -0
- package/field/package.json +25 -0
- package/field/types/field.d.ts +107 -0
- package/form-checkbox/README.md +3 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs +94 -0
- package/form-checkbox/package.json +24 -0
- package/form-checkbox/types/form-checkbox.d.ts +33 -0
- package/form-date-picker/README.md +2 -63
- package/form-date-picker/fesm2022/form-date-picker.mjs +74 -120
- package/form-date-picker/package.json +24 -0
- package/form-date-picker/{index.d.ts → types/form-date-picker.d.ts} +7 -1
- package/form-field/README.md +2 -63
- package/form-field/fesm2022/form-field.mjs +54 -28
- package/form-field/package.json +25 -0
- package/form-field/types/form-field.d.ts +46 -0
- package/form-field-simple/README.md +2 -63
- package/form-field-simple/fesm2022/form-field-simple.mjs +15 -10
- package/form-field-simple/package.json +24 -0
- package/form-searchable-multiselect/README.md +3 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +98 -0
- package/form-searchable-multiselect/package.json +24 -0
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +36 -0
- package/form-select/README.md +2 -63
- package/form-select/fesm2022/form-select.mjs +85 -141
- package/form-select/package.json +24 -0
- package/form-select/{index.d.ts → types/form-select.d.ts} +7 -1
- package/form-text-input/README.md +2 -63
- package/form-text-input/fesm2022/form-text-input.mjs +86 -171
- package/form-text-input/package.json +24 -0
- package/form-text-input/{index.d.ts → types/form-text-input.d.ts} +9 -12
- package/form-textarea/README.md +2 -63
- package/form-textarea/fesm2022/form-textarea.mjs +77 -128
- package/form-textarea/package.json +24 -0
- package/form-textarea/{index.d.ts → types/form-textarea.d.ts} +8 -1
- package/hover-card/README.md +11 -0
- package/hover-card/fesm2022/hover-card.mjs +123 -0
- package/hover-card/package.json +25 -0
- package/hover-card/types/hover-card.d.ts +36 -0
- package/icon/README.md +2 -63
- package/icon/fesm2022/icon.mjs +12 -10
- package/icon/package.json +25 -0
- package/input/README.md +2 -63
- package/input/fesm2022/input.mjs +25 -70
- package/input/package.json +25 -0
- package/input/types/input.d.ts +19 -0
- package/input-group/README.md +11 -0
- package/input-group/fesm2022/input-group.mjs +199 -0
- package/input-group/package.json +25 -0
- package/input-group/types/input-group.d.ts +52 -0
- package/input-otp/README.md +11 -0
- package/input-otp/fesm2022/input-otp.mjs +141 -0
- package/input-otp/package.json +25 -0
- package/input-otp/types/input-otp.d.ts +43 -0
- package/item/README.md +11 -0
- package/item/fesm2022/item.mjs +278 -0
- package/item/package.json +25 -0
- package/item/types/item.d.ts +101 -0
- package/kbd/README.md +11 -0
- package/kbd/fesm2022/kbd.mjs +61 -0
- package/kbd/package.json +25 -0
- package/kbd/types/kbd.d.ts +22 -0
- package/label/README.md +2 -63
- package/label/fesm2022/label.mjs +12 -11
- package/label/package.json +25 -0
- package/label/{index.d.ts → types/label.d.ts} +1 -1
- package/layout-simple/README.md +3 -0
- package/layout-simple/fesm2022/layout-simple.mjs +388 -0
- package/layout-simple/package.json +24 -0
- package/layout-simple/types/layout-simple.d.ts +167 -0
- package/menu/README.md +3 -0
- package/menu/fesm2022/menu.mjs +455 -0
- package/menu/package.json +24 -0
- package/menu/types/menu.d.ts +137 -0
- package/menubar/README.md +11 -0
- package/menubar/fesm2022/menubar.mjs +108 -0
- package/menubar/package.json +25 -0
- package/menubar/types/menubar.d.ts +40 -0
- package/native-select/README.md +11 -0
- package/native-select/fesm2022/native-select.mjs +207 -0
- package/native-select/package.json +25 -0
- package/native-select/types/native-select.d.ts +70 -0
- package/navigation-menu/README.md +11 -0
- package/navigation-menu/fesm2022/navigation-menu.mjs +194 -0
- package/navigation-menu/package.json +25 -0
- package/navigation-menu/types/navigation-menu.d.ts +54 -0
- package/package.json +284 -63
- package/pagination/README.md +11 -0
- package/pagination/fesm2022/pagination.mjs +522 -0
- package/pagination/package.json +25 -0
- package/pagination/types/pagination.d.ts +192 -0
- package/popover/README.md +2 -63
- package/popover/fesm2022/popover.mjs +124 -30
- package/popover/package.json +24 -0
- package/popover/types/popover.d.ts +54 -0
- package/progress/README.md +11 -0
- package/progress/fesm2022/progress.mjs +77 -0
- package/progress/package.json +25 -0
- package/progress/types/progress.d.ts +27 -0
- package/radio-group/README.md +3 -0
- package/radio-group/fesm2022/radio-group.mjs +207 -0
- package/radio-group/package.json +25 -0
- package/radio-group/types/radio-group.d.ts +71 -0
- package/resizable/README.md +11 -0
- package/resizable/fesm2022/resizable.mjs +103 -0
- package/resizable/package.json +25 -0
- package/resizable/types/resizable.d.ts +32 -0
- package/scroll-area/README.md +11 -0
- package/scroll-area/fesm2022/scroll-area.mjs +51 -0
- package/scroll-area/package.json +25 -0
- package/scroll-area/types/scroll-area.d.ts +16 -0
- package/searchable-multiselect/README.md +3 -0
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +136 -0
- package/searchable-multiselect/package.json +24 -0
- package/searchable-multiselect/types/searchable-multiselect.d.ts +45 -0
- package/select/README.md +2 -63
- package/select/fesm2022/select.mjs +340 -198
- package/select/package.json +25 -0
- package/select/types/select.d.ts +121 -0
- package/separator/README.md +2 -63
- package/separator/fesm2022/separator.mjs +17 -15
- package/separator/package.json +24 -0
- package/separator/{index.d.ts → types/separator.d.ts} +4 -5
- package/sheet/README.md +2 -63
- package/sheet/fesm2022/sheet.mjs +56 -61
- package/sheet/package.json +24 -0
- package/sidebar/README.md +11 -0
- package/sidebar/fesm2022/sidebar.mjs +846 -0
- package/sidebar/package.json +25 -0
- package/sidebar/types/sidebar.d.ts +237 -0
- package/skeleton/README.md +11 -0
- package/skeleton/fesm2022/skeleton.mjs +44 -0
- package/skeleton/package.json +25 -0
- package/skeleton/types/skeleton.d.ts +16 -0
- package/slider/README.md +11 -0
- package/slider/fesm2022/slider.mjs +74 -0
- package/slider/package.json +25 -0
- package/slider/types/slider.d.ts +19 -0
- package/sonner/README.md +2 -63
- package/sonner/fesm2022/sonner.mjs +34 -39
- package/sonner/package.json +25 -0
- package/spinner/README.md +2 -63
- package/spinner/fesm2022/spinner.mjs +20 -16
- package/spinner/package.json +25 -0
- package/switch/README.md +2 -63
- package/switch/fesm2022/switch.mjs +28 -27
- package/switch/package.json +25 -0
- package/table/README.md +11 -0
- package/table/fesm2022/table.mjs +211 -0
- package/table/package.json +25 -0
- package/table/types/table.d.ts +87 -0
- package/tabs/README.md +3 -0
- package/tabs/fesm2022/tabs.mjs +210 -0
- package/tabs/package.json +25 -0
- package/tabs/types/tabs.d.ts +71 -0
- package/textarea/README.md +11 -0
- package/textarea/fesm2022/textarea.mjs +47 -0
- package/textarea/package.json +25 -0
- package/textarea/types/textarea.d.ts +18 -0
- package/toggle/README.md +11 -0
- package/toggle/fesm2022/toggle.mjs +78 -0
- package/toggle/package.json +25 -0
- package/toggle/types/toggle.d.ts +27 -0
- package/toggle-group/README.md +11 -0
- package/toggle-group/fesm2022/toggle-group.mjs +117 -0
- package/toggle-group/package.json +25 -0
- package/toggle-group/types/toggle-group.d.ts +45 -0
- package/tooltip/README.md +3 -0
- package/tooltip/fesm2022/tooltip.mjs +72 -0
- package/tooltip/package.json +25 -0
- package/tooltip/types/tooltip.d.ts +22 -0
- package/typography/README.md +11 -0
- package/typography/fesm2022/typography.mjs +242 -0
- package/typography/package.json +25 -0
- package/typography/types/typography.d.ts +94 -0
- package/utils/README.md +2 -63
- package/utils/fesm2022/utils.mjs +209 -2
- package/utils/package.json +25 -0
- package/utils/types/utils.d.ts +13 -0
- package/alert/fesm2022/alert.mjs.map +0 -1
- package/badge/fesm2022/badge.mjs.map +0 -1
- package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
- package/button/fesm2022/button.mjs.map +0 -1
- package/calendar/fesm2022/calendar.mjs.map +0 -1
- package/calendar/index.d.ts +0 -111
- package/date-picker/fesm2022/date-picker.mjs.map +0 -1
- package/date-picker/index.d.ts +0 -227
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
- package/form-field/fesm2022/form-field.mjs.map +0 -1
- package/form-field/index.d.ts +0 -37
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
- package/form-select/fesm2022/form-select.mjs.map +0 -1
- package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
- package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
- package/icon/fesm2022/icon.mjs.map +0 -1
- package/input/fesm2022/input.mjs.map +0 -1
- package/input/index.d.ts +0 -41
- package/label/fesm2022/label.mjs.map +0 -1
- package/popover/fesm2022/popover.mjs.map +0 -1
- package/popover/index.d.ts +0 -30
- package/select/fesm2022/select.mjs.map +0 -1
- package/select/index.d.ts +0 -92
- package/separator/fesm2022/separator.mjs.map +0 -1
- package/sheet/fesm2022/sheet.mjs.map +0 -1
- package/sonner/fesm2022/sonner.mjs.map +0 -1
- package/spinner/fesm2022/spinner.mjs.map +0 -1
- package/switch/fesm2022/switch.mjs.map +0 -1
- package/utils/fesm2022/utils.mjs.map +0 -1
- package/utils/index.d.ts +0 -5
- /package/alert/{index.d.ts → types/alert.d.ts} +0 -0
- /package/badge/{index.d.ts → types/badge.d.ts} +0 -0
- /package/basic-alert/{index.d.ts → types/basic-alert.d.ts} +0 -0
- /package/form-field-simple/{index.d.ts → types/form-field-simple.d.ts} +0 -0
- /package/icon/{index.d.ts → types/icon.d.ts} +0 -0
- /package/sheet/{index.d.ts → types/sheet.d.ts} +0 -0
- /package/sonner/{index.d.ts → types/sonner.d.ts} +0 -0
- /package/spinner/{index.d.ts → types/spinner.d.ts} +0 -0
- /package/switch/{index.d.ts → types/switch.d.ts} +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { viewChild, inject, input, computed, signal, ChangeDetectionStrategy, Component, Directive, effect, untracked, NgModule } from '@angular/core';
|
|
3
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
4
|
+
import { classes, hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { EmblaCarouselDirective } from 'embla-carousel-angular';
|
|
6
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
7
|
+
import { lucideArrowRight, lucideArrowLeft } from '@ng-icons/lucide';
|
|
8
|
+
import * as i1 from '@egose/shadcn-theme-ng/button';
|
|
9
|
+
import { HlmBtn, provideBrnButtonConfig } from '@egose/shadcn-theme-ng/button';
|
|
10
|
+
|
|
11
|
+
class HlmCarousel {
|
|
12
|
+
_emblaCarousel = viewChild.required(EmblaCarouselDirective, /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "_emblaCarousel" }] : /* istanbul ignore next */ []));
|
|
14
|
+
_dir = inject(Directionality);
|
|
15
|
+
orientation = input('horizontal', /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
17
|
+
options = input(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [undefined, { debugName: "options" }] : /* istanbul ignore next */ []));
|
|
19
|
+
plugins = input([], /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "plugins" }] : /* istanbul ignore next */ []));
|
|
21
|
+
_emblaOptions = computed(() => ({
|
|
22
|
+
// Default embla's direction to the ambient layout direction so the carousel scrolls RTL
|
|
23
|
+
// automatically; an explicit `direction` in `options` still wins.
|
|
24
|
+
direction: this._dir.valueSignal(),
|
|
25
|
+
...this.options(),
|
|
26
|
+
axis: this.orientation() === 'horizontal' ? 'x' : 'y',
|
|
27
|
+
}), /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "_emblaOptions" }] : /* istanbul ignore next */ []));
|
|
29
|
+
_canScrollPrev = signal(false, /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "_canScrollPrev" }] : /* istanbul ignore next */ []));
|
|
31
|
+
canScrollPrev = this._canScrollPrev.asReadonly();
|
|
32
|
+
_canScrollNext = signal(false, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "_canScrollNext" }] : /* istanbul ignore next */ []));
|
|
34
|
+
canScrollNext = this._canScrollNext.asReadonly();
|
|
35
|
+
_currentSlide = signal(0, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "_currentSlide" }] : /* istanbul ignore next */ []));
|
|
37
|
+
currentSlide = this._currentSlide.asReadonly();
|
|
38
|
+
_slideCount = signal(0, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "_slideCount" }] : /* istanbul ignore next */ []));
|
|
40
|
+
slideCount = this._slideCount.asReadonly();
|
|
41
|
+
constructor() {
|
|
42
|
+
classes(() => "relative");
|
|
43
|
+
}
|
|
44
|
+
onEmblaEvent(event) {
|
|
45
|
+
const emblaApi = this._emblaCarousel().emblaApi;
|
|
46
|
+
if (!emblaApi) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (event === 'select' || event === 'init' || event === 'reInit') {
|
|
50
|
+
this._canScrollPrev.set(emblaApi.canScrollPrev());
|
|
51
|
+
this._canScrollNext.set(emblaApi.canScrollNext());
|
|
52
|
+
this._currentSlide.set(emblaApi.selectedScrollSnap());
|
|
53
|
+
this._slideCount.set(emblaApi.scrollSnapList().length);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
onKeydown(event) {
|
|
57
|
+
if (event.key === 'ArrowLeft') {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
this._emblaCarousel().scrollPrev();
|
|
60
|
+
}
|
|
61
|
+
else if (event.key === 'ArrowRight') {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
this._emblaCarousel().scrollNext();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
scrollPrev() {
|
|
67
|
+
this._emblaCarousel().scrollPrev();
|
|
68
|
+
}
|
|
69
|
+
scrollNext() {
|
|
70
|
+
this._emblaCarousel().scrollNext();
|
|
71
|
+
}
|
|
72
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarousel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.3", type: HlmCarousel, isStandalone: true, selector: "hlm-carousel", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "carousel", "role": "region", "aria-roledescription": "carousel" }, listeners: { "keydown": "onKeydown($event)" } }, viewQueries: [{ propertyName: "_emblaCarousel", first: true, predicate: EmblaCarouselDirective, descendants: true, isSignal: true }], ngImport: i0, template: "\n <div\n emblaCarousel\n class=\"overflow-hidden\"\n [plugins]=\"plugins()\"\n [options]=\"_emblaOptions()\"\n [subscribeToEvents]=\"['init', 'select', 'reInit']\"\n (emblaChange)=\"onEmblaEvent($event)\"\n >\n <ng-content select=\"[hlmCarouselContent],hlm-carousel-content\" />\n </div>\n <ng-content />\n ", isInline: true, dependencies: [{ kind: "directive", type: EmblaCarouselDirective, selector: "[emblaCarousel]", inputs: ["options", "plugins", "subscribeToEvents", "eventsThrottleTime"], outputs: ["emblaChange"], exportAs: ["emblaCarousel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
|
+
}
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarousel, decorators: [{
|
|
76
|
+
type: Component,
|
|
77
|
+
args: [{
|
|
78
|
+
selector: 'hlm-carousel',
|
|
79
|
+
imports: [EmblaCarouselDirective],
|
|
80
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
81
|
+
host: {
|
|
82
|
+
'data-slot': 'carousel',
|
|
83
|
+
role: 'region',
|
|
84
|
+
'aria-roledescription': 'carousel',
|
|
85
|
+
'(keydown)': 'onKeydown($event)',
|
|
86
|
+
},
|
|
87
|
+
template: "\n <div\n emblaCarousel\n class=\"overflow-hidden\"\n [plugins]=\"plugins()\"\n [options]=\"_emblaOptions()\"\n [subscribeToEvents]=\"['init', 'select', 'reInit']\"\n (emblaChange)=\"onEmblaEvent($event)\"\n >\n <ng-content select=\"[hlmCarouselContent],hlm-carousel-content\" />\n </div>\n <ng-content />\n ",
|
|
88
|
+
}]
|
|
89
|
+
}], ctorParameters: () => [], propDecorators: { _emblaCarousel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EmblaCarouselDirective), { isSignal: true }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], plugins: [{ type: i0.Input, args: [{ isSignal: true, alias: "plugins", required: false }] }] } });
|
|
90
|
+
|
|
91
|
+
class HlmCarouselContent {
|
|
92
|
+
_orientation = inject(HlmCarousel).orientation;
|
|
93
|
+
constructor() {
|
|
94
|
+
classes(() => ["flex", this._orientation() === 'horizontal' ? "-ml-4" : "-mt-4 flex-col"]);
|
|
95
|
+
}
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
97
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselContent, isStandalone: true, selector: "[hlmCarouselContent],hlm-carousel-content", host: { attributes: { "data-slot": "carousel-content" } }, ngImport: i0 });
|
|
98
|
+
}
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselContent, decorators: [{
|
|
100
|
+
type: Directive,
|
|
101
|
+
args: [{
|
|
102
|
+
selector: '[hlmCarouselContent],hlm-carousel-content',
|
|
103
|
+
host: {
|
|
104
|
+
'data-slot': 'carousel-content',
|
|
105
|
+
},
|
|
106
|
+
}]
|
|
107
|
+
}], ctorParameters: () => [] });
|
|
108
|
+
|
|
109
|
+
class HlmCarouselItem {
|
|
110
|
+
_orientation = inject(HlmCarousel).orientation;
|
|
111
|
+
constructor() {
|
|
112
|
+
classes(() => ["min-w-0 shrink-0 grow-0 basis-full", this._orientation() === 'horizontal' ? "pl-4" : "pt-4"]);
|
|
113
|
+
}
|
|
114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
115
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselItem, isStandalone: true, selector: "[hlmCarouselItem],hlm-carousel-item", host: { attributes: { "data-slot": "carousel-item", "role": "group", "aria-roledescription": "slide" } }, ngImport: i0 });
|
|
116
|
+
}
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselItem, decorators: [{
|
|
118
|
+
type: Directive,
|
|
119
|
+
args: [{
|
|
120
|
+
selector: '[hlmCarouselItem],hlm-carousel-item',
|
|
121
|
+
host: {
|
|
122
|
+
'data-slot': 'carousel-item',
|
|
123
|
+
role: 'group',
|
|
124
|
+
'aria-roledescription': 'slide',
|
|
125
|
+
},
|
|
126
|
+
}]
|
|
127
|
+
}], ctorParameters: () => [] });
|
|
128
|
+
|
|
129
|
+
class HlmCarouselNext {
|
|
130
|
+
_button = inject(HlmBtn);
|
|
131
|
+
_carousel = inject(HlmCarousel);
|
|
132
|
+
_computedClass = computed(() => hlm("rounded-full absolute h-8 w-8", this._carousel.orientation() === 'horizontal'
|
|
133
|
+
? "-end-12 top-1/2 -translate-y-1/2"
|
|
134
|
+
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90"), /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
136
|
+
isDisabled = () => !this._carousel.canScrollNext();
|
|
137
|
+
constructor() {
|
|
138
|
+
effect(() => {
|
|
139
|
+
const computedClass = this._computedClass();
|
|
140
|
+
untracked(() => this._button.setClass(computedClass));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselNext, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
144
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselNext, isStandalone: true, selector: "button[hlm-carousel-next], button[hlmCarouselNext]", host: { attributes: { "data-slot": "carousel-next" }, listeners: { "click": "_carousel.scrollNext()" }, properties: { "disabled": "isDisabled()" } }, providers: [provideIcons({ lucideArrowRight }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })], hostDirectives: [{ directive: i1.HlmBtn, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0, template: "\n <ng-icon name=\"lucideArrowRight\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Next slide</span>\n ", isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselNext, decorators: [{
|
|
147
|
+
type: Component,
|
|
148
|
+
args: [{
|
|
149
|
+
selector: 'button[hlm-carousel-next], button[hlmCarouselNext]',
|
|
150
|
+
imports: [NgIcon],
|
|
151
|
+
providers: [provideIcons({ lucideArrowRight }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })],
|
|
152
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
153
|
+
hostDirectives: [{ directive: HlmBtn, inputs: ['variant', 'size'] }],
|
|
154
|
+
host: {
|
|
155
|
+
'data-slot': 'carousel-next',
|
|
156
|
+
'[disabled]': 'isDisabled()',
|
|
157
|
+
'(click)': '_carousel.scrollNext()',
|
|
158
|
+
},
|
|
159
|
+
template: "\n <ng-icon name=\"lucideArrowRight\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Next slide</span>\n ",
|
|
160
|
+
}]
|
|
161
|
+
}], ctorParameters: () => [] });
|
|
162
|
+
|
|
163
|
+
class HlmCarouselPrevious {
|
|
164
|
+
_button = inject(HlmBtn);
|
|
165
|
+
_carousel = inject(HlmCarousel);
|
|
166
|
+
_computedClass = computed(() => hlm("rounded-full absolute h-8 w-8", this._carousel.orientation() === 'horizontal'
|
|
167
|
+
? "-start-12 top-1/2 -translate-y-1/2"
|
|
168
|
+
: "-top-12 left-1/2 -translate-x-1/2 rotate-90"), /* @ts-ignore */
|
|
169
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
170
|
+
isDisabled = () => !this._carousel.canScrollPrev();
|
|
171
|
+
constructor() {
|
|
172
|
+
effect(() => {
|
|
173
|
+
const computedClass = this._computedClass();
|
|
174
|
+
untracked(() => this._button.setClass(computedClass));
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselPrevious, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselPrevious, isStandalone: true, selector: "button[hlm-carousel-previous], button[hlmCarouselPrevious]", host: { attributes: { "data-slot": "carousel-previous" }, listeners: { "click": "_carousel.scrollPrev()" }, properties: { "disabled": "isDisabled()" } }, providers: [provideIcons({ lucideArrowLeft }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })], hostDirectives: [{ directive: i1.HlmBtn, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0, template: "\n <ng-icon name=\"lucideArrowLeft\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Previous slide</span>\n ", isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselPrevious, decorators: [{
|
|
181
|
+
type: Component,
|
|
182
|
+
args: [{
|
|
183
|
+
selector: 'button[hlm-carousel-previous], button[hlmCarouselPrevious]',
|
|
184
|
+
imports: [NgIcon],
|
|
185
|
+
providers: [provideIcons({ lucideArrowLeft }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })],
|
|
186
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
187
|
+
hostDirectives: [{ directive: HlmBtn, inputs: ['variant', 'size'] }],
|
|
188
|
+
host: {
|
|
189
|
+
'data-slot': 'carousel-previous',
|
|
190
|
+
'[disabled]': 'isDisabled()',
|
|
191
|
+
'(click)': '_carousel.scrollPrev()',
|
|
192
|
+
},
|
|
193
|
+
template: "\n <ng-icon name=\"lucideArrowLeft\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Previous slide</span>\n ",
|
|
194
|
+
}]
|
|
195
|
+
}], ctorParameters: () => [] });
|
|
196
|
+
|
|
197
|
+
class HlmCarouselSlideDisplay {
|
|
198
|
+
_carousel = inject(HlmCarousel);
|
|
199
|
+
_currentSlide = computed(() => this._carousel.currentSlide() + 1, /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "_currentSlide" }] : /* istanbul ignore next */ []));
|
|
201
|
+
slideClass = input('text-muted-foreground text-sm', /* @ts-ignore */
|
|
202
|
+
...(ngDevMode ? [{ debugName: "slideClass" }] : /* istanbul ignore next */ []));
|
|
203
|
+
/** Screen reader only text for the slide display */
|
|
204
|
+
label = input('Slide', /* @ts-ignore */
|
|
205
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
206
|
+
_labelContent = computed(() => {
|
|
207
|
+
const currentSlide = this._currentSlide();
|
|
208
|
+
const slideCount = this._carousel.slideCount();
|
|
209
|
+
return `${this.label()} ${currentSlide} of ${slideCount} is displayed`;
|
|
210
|
+
}, /* @ts-ignore */
|
|
211
|
+
...(ngDevMode ? [{ debugName: "_labelContent" }] : /* istanbul ignore next */ []));
|
|
212
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselSlideDisplay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
213
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmCarouselSlideDisplay, isStandalone: true, selector: "hlm-carousel-slide-display", inputs: { slideClass: { classPropertyName: "slideClass", publicName: "slideClass", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "carousel-slide-display" } }, ngImport: i0, template: "\n <span class=\"sr-only\">{{ _labelContent() }}</span>\n <div aria-hidden=\"true\" [class]=\"slideClass()\">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>\n ", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
214
|
+
}
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselSlideDisplay, decorators: [{
|
|
216
|
+
type: Component,
|
|
217
|
+
args: [{
|
|
218
|
+
selector: 'hlm-carousel-slide-display',
|
|
219
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
220
|
+
host: {
|
|
221
|
+
'data-slot': 'carousel-slide-display',
|
|
222
|
+
},
|
|
223
|
+
template: "\n <span class=\"sr-only\">{{ _labelContent() }}</span>\n <div aria-hidden=\"true\" [class]=\"slideClass()\">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>\n ",
|
|
224
|
+
}]
|
|
225
|
+
}], propDecorators: { slideClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "slideClass", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
|
|
226
|
+
|
|
227
|
+
/*
|
|
228
|
+
* Public API Surface of carousel
|
|
229
|
+
*/
|
|
230
|
+
const HlmCarouselImports = [
|
|
231
|
+
HlmCarousel,
|
|
232
|
+
HlmCarouselContent,
|
|
233
|
+
HlmCarouselItem,
|
|
234
|
+
HlmCarouselPrevious,
|
|
235
|
+
HlmCarouselNext,
|
|
236
|
+
HlmCarouselSlideDisplay,
|
|
237
|
+
];
|
|
238
|
+
class HlmCarouselModule {
|
|
239
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
240
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, imports: [HlmCarousel,
|
|
241
|
+
HlmCarouselContent,
|
|
242
|
+
HlmCarouselItem,
|
|
243
|
+
HlmCarouselPrevious,
|
|
244
|
+
HlmCarouselNext,
|
|
245
|
+
HlmCarouselSlideDisplay], exports: [HlmCarousel,
|
|
246
|
+
HlmCarouselContent,
|
|
247
|
+
HlmCarouselItem,
|
|
248
|
+
HlmCarouselPrevious,
|
|
249
|
+
HlmCarouselNext,
|
|
250
|
+
HlmCarouselSlideDisplay] });
|
|
251
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, imports: [HlmCarouselPrevious,
|
|
252
|
+
HlmCarouselNext] });
|
|
253
|
+
}
|
|
254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, decorators: [{
|
|
255
|
+
type: NgModule,
|
|
256
|
+
args: [{
|
|
257
|
+
imports: [...HlmCarouselImports],
|
|
258
|
+
exports: [...HlmCarouselImports],
|
|
259
|
+
}]
|
|
260
|
+
}] });
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Generated bundle index. Do not edit.
|
|
264
|
+
*/
|
|
265
|
+
|
|
266
|
+
export { HlmCarousel, HlmCarouselContent, HlmCarouselImports, HlmCarouselItem, HlmCarouselModule, HlmCarouselNext, HlmCarouselPrevious, HlmCarouselSlideDisplay };
|
|
267
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "carousel",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^22.0.0",
|
|
6
|
+
"@angular/core": "^22.0.0",
|
|
7
|
+
"@spartan-ng/brain": "^1.1.1"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"module": "fesm2022/carousel.mjs",
|
|
14
|
+
"typings": "types/carousel.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./types/carousel.d.ts",
|
|
21
|
+
"default": "./fesm2022/carousel.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Signal, InputSignal } from '@angular/core';
|
|
3
|
+
import { EmblaOptionsType, EmblaPluginType, EmblaEventType } from 'embla-carousel';
|
|
4
|
+
import { EmblaCarouselDirective } from 'embla-carousel-angular';
|
|
5
|
+
import * as i1 from '@egose/shadcn-theme-ng/button';
|
|
6
|
+
import { ClassValue } from 'clsx';
|
|
7
|
+
|
|
8
|
+
declare class HlmCarousel {
|
|
9
|
+
protected readonly _emblaCarousel: Signal<EmblaCarouselDirective>;
|
|
10
|
+
private readonly _dir;
|
|
11
|
+
readonly orientation: InputSignal<"horizontal" | "vertical">;
|
|
12
|
+
readonly options: InputSignal<Omit<EmblaOptionsType, 'axis'> | undefined>;
|
|
13
|
+
readonly plugins: InputSignal<EmblaPluginType[]>;
|
|
14
|
+
protected readonly _emblaOptions: Signal<EmblaOptionsType>;
|
|
15
|
+
private readonly _canScrollPrev;
|
|
16
|
+
readonly canScrollPrev: Signal<boolean>;
|
|
17
|
+
private readonly _canScrollNext;
|
|
18
|
+
readonly canScrollNext: Signal<boolean>;
|
|
19
|
+
private readonly _currentSlide;
|
|
20
|
+
readonly currentSlide: Signal<number>;
|
|
21
|
+
private readonly _slideCount;
|
|
22
|
+
readonly slideCount: Signal<number>;
|
|
23
|
+
constructor();
|
|
24
|
+
protected onEmblaEvent(event: EmblaEventType): void;
|
|
25
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
26
|
+
scrollPrev(): void;
|
|
27
|
+
scrollNext(): void;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarousel, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmCarousel, "hlm-carousel", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "plugins": { "alias": "plugins"; "required": false; "isSignal": true; }; }, {}, never, ["[hlmCarouselContent],hlm-carousel-content", "*"], true, never>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare class HlmCarouselContent {
|
|
33
|
+
private readonly _orientation;
|
|
34
|
+
constructor();
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarouselContent, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmCarouselContent, "[hlmCarouselContent],hlm-carousel-content", never, {}, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class HlmCarouselItem {
|
|
40
|
+
private readonly _orientation;
|
|
41
|
+
constructor();
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarouselItem, never>;
|
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmCarouselItem, "[hlmCarouselItem],hlm-carousel-item", never, {}, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class HlmCarouselNext {
|
|
47
|
+
private readonly _button;
|
|
48
|
+
protected readonly _carousel: HlmCarousel;
|
|
49
|
+
private readonly _computedClass;
|
|
50
|
+
protected readonly isDisabled: () => boolean;
|
|
51
|
+
constructor();
|
|
52
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarouselNext, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmCarouselNext, "button[hlm-carousel-next], button[hlmCarouselNext]", never, {}, {}, never, never, true, [{ directive: typeof i1.HlmBtn; inputs: { "variant": "variant"; "size": "size"; }; outputs: {}; }]>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class HlmCarouselPrevious {
|
|
57
|
+
private readonly _button;
|
|
58
|
+
protected readonly _carousel: HlmCarousel;
|
|
59
|
+
private readonly _computedClass;
|
|
60
|
+
protected readonly isDisabled: () => boolean;
|
|
61
|
+
constructor();
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarouselPrevious, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmCarouselPrevious, "button[hlm-carousel-previous], button[hlmCarouselPrevious]", never, {}, {}, never, never, true, [{ directive: typeof i1.HlmBtn; inputs: { "variant": "variant"; "size": "size"; }; outputs: {}; }]>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare class HlmCarouselSlideDisplay {
|
|
67
|
+
protected readonly _carousel: HlmCarousel;
|
|
68
|
+
protected readonly _currentSlide: i0.Signal<number>;
|
|
69
|
+
readonly slideClass: i0.InputSignal<ClassValue>;
|
|
70
|
+
/** Screen reader only text for the slide display */
|
|
71
|
+
readonly label: i0.InputSignal<string>;
|
|
72
|
+
protected readonly _labelContent: i0.Signal<string>;
|
|
73
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarouselSlideDisplay, never>;
|
|
74
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmCarouselSlideDisplay, "hlm-carousel-slide-display", never, { "slideClass": { "alias": "slideClass"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare const HlmCarouselImports: readonly [typeof HlmCarousel, typeof HlmCarouselContent, typeof HlmCarouselItem, typeof HlmCarouselPrevious, typeof HlmCarouselNext, typeof HlmCarouselSlideDisplay];
|
|
78
|
+
declare class HlmCarouselModule {
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmCarouselModule, never>;
|
|
80
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmCarouselModule, never, [typeof HlmCarousel, typeof HlmCarouselContent, typeof HlmCarouselItem, typeof HlmCarouselPrevious, typeof HlmCarouselNext, typeof HlmCarouselSlideDisplay], [typeof HlmCarousel, typeof HlmCarouselContent, typeof HlmCarouselItem, typeof HlmCarouselPrevious, typeof HlmCarouselNext, typeof HlmCarouselSlideDisplay]>;
|
|
81
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmCarouselModule>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { HlmCarousel, HlmCarouselContent, HlmCarouselImports, HlmCarouselItem, HlmCarouselModule, HlmCarouselNext, HlmCarouselPrevious, HlmCarouselSlideDisplay };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Checkbox Subpath
|
|
2
|
+
|
|
3
|
+
This project ships only as `@egose/shadcn-theme-ng/checkbox` or `@egose/shadcn-theme-ng-tw/checkbox`. See the [package README](../../README.md) for installation, compatibility, Tailwind variant, test, and release guidance. Do not publish this project directory independently.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { forwardRef, input, computed, model, booleanAttribute, signal, output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { provideIcons, NgIcon } from '@ng-icons/core';
|
|
5
|
+
import { lucideCheck } from '@ng-icons/lucide';
|
|
6
|
+
import { BrnCheckbox } from '@spartan-ng/brain/checkbox';
|
|
7
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
9
|
+
|
|
10
|
+
const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
11
|
+
provide: NG_VALUE_ACCESSOR,
|
|
12
|
+
useExisting: forwardRef(() => HlmCheckbox),
|
|
13
|
+
multi: true,
|
|
14
|
+
};
|
|
15
|
+
class HlmCheckbox {
|
|
16
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
17
|
+
_computedClass = computed(() => hlm("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 shadow-xs peer size-4 shrink-0 cursor-default rounded-[4px] border outline-none transition-shadow focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", this.userClass(), this.disabledState() ? "cursor-not-allowed opacity-50" : ''), /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
19
|
+
/** Used to set the id on the underlying brn element. */
|
|
20
|
+
id = input(null, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
23
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
24
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
25
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
26
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
27
|
+
ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
28
|
+
/** The checked state of the checkbox. */
|
|
29
|
+
checked = model(false, /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/** The name attribute of the checkbox. */
|
|
32
|
+
name = input(null, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
34
|
+
/** Whether the checkbox is required. */
|
|
35
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
36
|
+
/** Whether the checkbox is disabled. */
|
|
37
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
38
|
+
/** Additional visual/interaction lock that does not write to a reactive form control. */
|
|
39
|
+
wrapperDisabled = input(false, { ...(ngDevMode ? { debugName: "wrapperDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
40
|
+
formDisabled = signal(false, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
42
|
+
disabledState = computed(() => this.disabled() || this.wrapperDisabled() || this.formDisabled(), /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
44
|
+
changed = output();
|
|
45
|
+
_onChange;
|
|
46
|
+
_onTouched;
|
|
47
|
+
_handleChange() {
|
|
48
|
+
if (this.disabledState())
|
|
49
|
+
return;
|
|
50
|
+
const previousChecked = this.checked();
|
|
51
|
+
this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
52
|
+
this._onChange?.(!previousChecked);
|
|
53
|
+
this.changed.emit(!previousChecked);
|
|
54
|
+
}
|
|
55
|
+
/** CONTROL VALUE ACCESSOR */
|
|
56
|
+
writeValue(value) {
|
|
57
|
+
this.checked.set(!!value);
|
|
58
|
+
}
|
|
59
|
+
registerOnChange(fn) {
|
|
60
|
+
this._onChange = fn;
|
|
61
|
+
}
|
|
62
|
+
registerOnTouched(fn) {
|
|
63
|
+
this._onTouched = fn;
|
|
64
|
+
}
|
|
65
|
+
setDisabledState(isDisabled) {
|
|
66
|
+
this.formDisabled.set(isDisabled);
|
|
67
|
+
}
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: HlmCheckbox, isStandalone: true, selector: "hlm-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, wrapperDisabled: { classPropertyName: "wrapperDisabled", publicName: "wrapperDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", changed: "changed" }, host: { properties: { "attr.id": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null", "attr.data-disabled": "disabledState() ? \"\" : null" }, classAttribute: "contents peer" }, providers: [HLM_CHECKBOX_VALUE_ACCESSOR], ngImport: i0, template: "\n <brn-checkbox\n [id]=\"id()\"\n [name]=\"name()\"\n [class]=\"_computedClass()\"\n [checked]=\"checked()\"\n [disabled]=\"disabledState()\"\n [required]=\"required()\"\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledby()\"\n [aria-describedby]=\"ariaDescribedby()\"\n (changed)=\"_handleChange()\"\n (touched)=\"_onTouched?.()\"\n >\n @if (checked()) {\n <span class=\"flex items-center justify-center text-current transition-none\">\n <ng-icon hlm size=\"14px\" name=\"lucideCheck\" />\n </span>\n }\n </brn-checkbox>\n ", isInline: true, dependencies: [{ kind: "component", type: BrnCheckbox, selector: "brn-checkbox", inputs: ["checked", "indeterminate", "id", "name", "class", "hostStyles", "aria-label", "aria-labelledby", "aria-describedby", "required", "disabled", "forceInvalid"], outputs: ["checkedChange", "indeterminateChange", "touched"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }], viewProviders: [provideIcons({ lucideCheck })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCheckbox, decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: 'hlm-checkbox',
|
|
75
|
+
imports: [BrnCheckbox, NgIcon, HlmIcon],
|
|
76
|
+
template: "\n <brn-checkbox\n [id]=\"id()\"\n [name]=\"name()\"\n [class]=\"_computedClass()\"\n [checked]=\"checked()\"\n [disabled]=\"disabledState()\"\n [required]=\"required()\"\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledby()\"\n [aria-describedby]=\"ariaDescribedby()\"\n (changed)=\"_handleChange()\"\n (touched)=\"_onTouched?.()\"\n >\n @if (checked()) {\n <span class=\"flex items-center justify-center text-current transition-none\">\n <ng-icon hlm size=\"14px\" name=\"lucideCheck\" />\n </span>\n }\n </brn-checkbox>\n ",
|
|
77
|
+
host: {
|
|
78
|
+
class: 'contents peer',
|
|
79
|
+
'[attr.id]': 'null',
|
|
80
|
+
'[attr.aria-label]': 'null',
|
|
81
|
+
'[attr.aria-labelledby]': 'null',
|
|
82
|
+
'[attr.aria-describedby]': 'null',
|
|
83
|
+
'[attr.data-disabled]': 'disabledState() ? "" : null',
|
|
84
|
+
},
|
|
85
|
+
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
86
|
+
viewProviders: [provideIcons({ lucideCheck })],
|
|
87
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88
|
+
}]
|
|
89
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], wrapperDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapperDisabled", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
* Public API Surface of checkbox
|
|
93
|
+
*/
|
|
94
|
+
const HlmCheckboxImports = [HlmCheckbox];
|
|
95
|
+
class HlmCheckboxModule {
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
97
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmCheckboxModule, imports: [HlmCheckbox], exports: [HlmCheckbox] });
|
|
98
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCheckboxModule, imports: [HlmCheckboxImports] });
|
|
99
|
+
}
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCheckboxModule, decorators: [{
|
|
101
|
+
type: NgModule,
|
|
102
|
+
args: [{
|
|
103
|
+
imports: [...HlmCheckboxImports],
|
|
104
|
+
exports: [...HlmCheckboxImports],
|
|
105
|
+
}]
|
|
106
|
+
}] });
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Generated bundle index. Do not edit.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
export { HLM_CHECKBOX_VALUE_ACCESSOR, HlmCheckbox, HlmCheckboxImports, HlmCheckboxModule };
|
|
113
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "checkbox",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.3.0 || ^22.0.0",
|
|
6
|
+
"@angular/core": "^20.3.0 || ^22.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/checkbox.mjs",
|
|
13
|
+
"typings": "types/checkbox.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/checkbox.d.ts",
|
|
20
|
+
"default": "./fesm2022/checkbox.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
4
|
+
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
|
|
7
|
+
declare const HLM_CHECKBOX_VALUE_ACCESSOR: {
|
|
8
|
+
provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
|
|
9
|
+
useExisting: _angular_core.Type<any>;
|
|
10
|
+
multi: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare class HlmCheckbox implements ControlValueAccessor {
|
|
13
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
14
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
15
|
+
/** Used to set the id on the underlying brn element. */
|
|
16
|
+
readonly id: _angular_core.InputSignal<string | null>;
|
|
17
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
18
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
19
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
20
|
+
readonly ariaLabelledby: _angular_core.InputSignal<string | null>;
|
|
21
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
22
|
+
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
23
|
+
/** The checked state of the checkbox. */
|
|
24
|
+
readonly checked: _angular_core.ModelSignal<CheckboxValue>;
|
|
25
|
+
/** The name attribute of the checkbox. */
|
|
26
|
+
readonly name: _angular_core.InputSignal<string | null>;
|
|
27
|
+
/** Whether the checkbox is required. */
|
|
28
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
29
|
+
/** Whether the checkbox is disabled. */
|
|
30
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
31
|
+
/** Additional visual/interaction lock that does not write to a reactive form control. */
|
|
32
|
+
readonly wrapperDisabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
33
|
+
private readonly formDisabled;
|
|
34
|
+
readonly disabledState: _angular_core.Signal<boolean>;
|
|
35
|
+
readonly changed: _angular_core.OutputEmitterRef<boolean>;
|
|
36
|
+
protected _onChange?: ChangeFn<CheckboxValue>;
|
|
37
|
+
protected _onTouched?: TouchFn;
|
|
38
|
+
protected _handleChange(): void;
|
|
39
|
+
/** CONTROL VALUE ACCESSOR */
|
|
40
|
+
writeValue(value: CheckboxValue): void;
|
|
41
|
+
registerOnChange(fn: ChangeFn<CheckboxValue>): void;
|
|
42
|
+
registerOnTouched(fn: TouchFn): void;
|
|
43
|
+
setDisabledState(isDisabled: boolean): void;
|
|
44
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCheckbox, never>;
|
|
45
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmCheckbox, "hlm-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "wrapperDisabled": { "alias": "wrapperDisabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; }, never, never, true, never>;
|
|
46
|
+
}
|
|
47
|
+
type CheckboxValue = boolean | 'indeterminate';
|
|
48
|
+
|
|
49
|
+
declare const HlmCheckboxImports: readonly [typeof HlmCheckbox];
|
|
50
|
+
declare class HlmCheckboxModule {
|
|
51
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCheckboxModule, never>;
|
|
52
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmCheckboxModule, never, [typeof HlmCheckbox], [typeof HlmCheckbox]>;
|
|
53
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmCheckboxModule>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { HLM_CHECKBOX_VALUE_ACCESSOR, HlmCheckbox, HlmCheckboxImports, HlmCheckboxModule };
|