@ngbase/adk 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 +57 -0
- package/a11y/accessibility-group.d.ts +49 -0
- package/a11y/accessibility-item.d.ts +49 -0
- package/a11y/accessibility.service.d.ts +17 -0
- package/a11y/autofocus.d.ts +12 -0
- package/a11y/focus-trap.d.ts +15 -0
- package/a11y/index.d.ts +5 -0
- package/a11y/public-api.d.ts +4 -0
- package/accordion/accordion-content.d.ts +8 -0
- package/accordion/accordion-group.d.ts +10 -0
- package/accordion/accordion-header.d.ts +7 -0
- package/accordion/accordion-item.d.ts +10 -0
- package/accordion/index.d.ts +5 -0
- package/accordion/public-api.d.ts +4 -0
- package/autocomplete/autocomplete-input.d.ts +21 -0
- package/autocomplete/autocomplete.d.ts +25 -0
- package/autocomplete/index.d.ts +5 -0
- package/autocomplete/public-api.d.ts +2 -0
- package/avatar/avatar.d.ts +22 -0
- package/avatar/index.d.ts +5 -0
- package/avatar/public-api.d.ts +1 -0
- package/bidi/direction.service.d.ts +14 -0
- package/bidi/index.d.ts +5 -0
- package/bidi/public-api.d.ts +1 -0
- package/breadcrumb/breadcrumb-link.d.ts +7 -0
- package/breadcrumb/breadcrumb-separator.d.ts +10 -0
- package/breadcrumb/breadcrumb.d.ts +12 -0
- package/breadcrumb/breadcrumbs.d.ts +7 -0
- package/breadcrumb/index.d.ts +5 -0
- package/breadcrumb/public-api.d.ts +4 -0
- package/cache/cache-config.d.ts +22 -0
- package/cache/cache.d.ts +17 -0
- package/cache/cache.interecptor.d.ts +2 -0
- package/cache/index.d.ts +5 -0
- package/cache/public-api.d.ts +3 -0
- package/carousel/carousel-item.d.ts +7 -0
- package/carousel/carousel-next.d.ts +8 -0
- package/carousel/carousel.d.ts +61 -0
- package/carousel/index.d.ts +5 -0
- package/carousel/public-api.d.ts +3 -0
- package/checkbox/checkbox.d.ts +22 -0
- package/checkbox/index.d.ts +5 -0
- package/checkbox/public-api.d.ts +1 -0
- package/chip/chip-group.d.ts +7 -0
- package/chip/chip.d.ts +19 -0
- package/chip/index.d.ts +5 -0
- package/chip/public-api.d.ts +2 -0
- package/clipboard/clipboard.d.ts +7 -0
- package/clipboard/index.d.ts +5 -0
- package/clipboard/public-api.d.ts +1 -0
- package/collections/SelectionModel.d.ts +14 -0
- package/collections/index.d.ts +5 -0
- package/collections/public-api.d.ts +1 -0
- package/color-picker/color-input.d.ts +16 -0
- package/color-picker/color-picker-trigger.d.ts +30 -0
- package/color-picker/color-picker.d.ts +72 -0
- package/color-picker/index.d.ts +5 -0
- package/color-picker/public-api.d.ts +3 -0
- package/color-picker/utils.d.ts +21 -0
- package/cookies/cookie.service.d.ts +32 -0
- package/cookies/index.d.ts +5 -0
- package/cookies/public-api.d.ts +1 -0
- package/datepicker/calendar.d.ts +121 -0
- package/datepicker/datepicker-trigger.d.ts +49 -0
- package/datepicker/datepicker.d.ts +54 -0
- package/datepicker/index.d.ts +5 -0
- package/datepicker/native-date-adapter.d.ts +33 -0
- package/datepicker/public-api.d.ts +5 -0
- package/datepicker/time.d.ts +42 -0
- package/dialog/dialog.animation.d.ts +3 -0
- package/dialog/dialog.d.ts +49 -0
- package/dialog/dialog.service.d.ts +7 -0
- package/dialog/index.d.ts +5 -0
- package/dialog/public-api.d.ts +3 -0
- package/drag/drag-drop.d.ts +37 -0
- package/drag/drag-move.d.ts +17 -0
- package/drag/drag.d.ts +53 -0
- package/drag/index.d.ts +5 -0
- package/drag/public-api.d.ts +3 -0
- package/fesm2022/ngbase-adk-a11y.mjs +617 -0
- package/fesm2022/ngbase-adk-a11y.mjs.map +1 -0
- package/fesm2022/ngbase-adk-accordion.mjs +117 -0
- package/fesm2022/ngbase-adk-accordion.mjs.map +1 -0
- package/fesm2022/ngbase-adk-autocomplete.mjs +150 -0
- package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -0
- package/fesm2022/ngbase-adk-avatar.mjs +69 -0
- package/fesm2022/ngbase-adk-avatar.mjs.map +1 -0
- package/fesm2022/ngbase-adk-bidi.mjs +42 -0
- package/fesm2022/ngbase-adk-bidi.mjs.map +1 -0
- package/fesm2022/ngbase-adk-breadcrumb.mjs +103 -0
- package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -0
- package/fesm2022/ngbase-adk-cache.mjs +127 -0
- package/fesm2022/ngbase-adk-cache.mjs.map +1 -0
- package/fesm2022/ngbase-adk-carousel.mjs +337 -0
- package/fesm2022/ngbase-adk-carousel.mjs.map +1 -0
- package/fesm2022/ngbase-adk-checkbox.mjs +78 -0
- package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -0
- package/fesm2022/ngbase-adk-chip.mjs +60 -0
- package/fesm2022/ngbase-adk-chip.mjs.map +1 -0
- package/fesm2022/ngbase-adk-clipboard.mjs +41 -0
- package/fesm2022/ngbase-adk-clipboard.mjs.map +1 -0
- package/fesm2022/ngbase-adk-collections.mjs +39 -0
- package/fesm2022/ngbase-adk-collections.mjs.map +1 -0
- package/fesm2022/ngbase-adk-color-picker.mjs +580 -0
- package/fesm2022/ngbase-adk-color-picker.mjs.map +1 -0
- package/fesm2022/ngbase-adk-cookies.mjs +81 -0
- package/fesm2022/ngbase-adk-cookies.mjs.map +1 -0
- package/fesm2022/ngbase-adk-datepicker.mjs +1130 -0
- package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -0
- package/fesm2022/ngbase-adk-dialog.mjs +223 -0
- package/fesm2022/ngbase-adk-dialog.mjs.map +1 -0
- package/fesm2022/ngbase-adk-drag.mjs +406 -0
- package/fesm2022/ngbase-adk-drag.mjs.map +1 -0
- package/fesm2022/ngbase-adk-form-field.mjs +364 -0
- package/fesm2022/ngbase-adk-form-field.mjs.map +1 -0
- package/fesm2022/ngbase-adk-hover-card.mjs +79 -0
- package/fesm2022/ngbase-adk-hover-card.mjs.map +1 -0
- package/fesm2022/ngbase-adk-icon.mjs +90 -0
- package/fesm2022/ngbase-adk-icon.mjs.map +1 -0
- package/fesm2022/ngbase-adk-inline-edit.mjs +127 -0
- package/fesm2022/ngbase-adk-inline-edit.mjs.map +1 -0
- package/fesm2022/ngbase-adk-jwt.mjs +90 -0
- package/fesm2022/ngbase-adk-jwt.mjs.map +1 -0
- package/fesm2022/ngbase-adk-keys.mjs +219 -0
- package/fesm2022/ngbase-adk-keys.mjs.map +1 -0
- package/fesm2022/ngbase-adk-layout.mjs +100 -0
- package/fesm2022/ngbase-adk-layout.mjs.map +1 -0
- package/fesm2022/ngbase-adk-list.mjs +110 -0
- package/fesm2022/ngbase-adk-list.mjs.map +1 -0
- package/fesm2022/ngbase-adk-mask.mjs +234 -0
- package/fesm2022/ngbase-adk-mask.mjs.map +1 -0
- package/fesm2022/ngbase-adk-menu.mjs +546 -0
- package/fesm2022/ngbase-adk-menu.mjs.map +1 -0
- package/fesm2022/ngbase-adk-network.mjs +90 -0
- package/fesm2022/ngbase-adk-network.mjs.map +1 -0
- package/fesm2022/ngbase-adk-pagination.mjs +187 -0
- package/fesm2022/ngbase-adk-pagination.mjs.map +1 -0
- package/fesm2022/ngbase-adk-popover.mjs +953 -0
- package/fesm2022/ngbase-adk-popover.mjs.map +1 -0
- package/fesm2022/ngbase-adk-portal.mjs +279 -0
- package/fesm2022/ngbase-adk-portal.mjs.map +1 -0
- package/fesm2022/ngbase-adk-progress.mjs +57 -0
- package/fesm2022/ngbase-adk-progress.mjs.map +1 -0
- package/fesm2022/ngbase-adk-radio.mjs +129 -0
- package/fesm2022/ngbase-adk-radio.mjs.map +1 -0
- package/fesm2022/ngbase-adk-resizable.mjs +367 -0
- package/fesm2022/ngbase-adk-resizable.mjs.map +1 -0
- package/fesm2022/ngbase-adk-scroll-area.mjs +232 -0
- package/fesm2022/ngbase-adk-scroll-area.mjs.map +1 -0
- package/fesm2022/ngbase-adk-select.mjs +599 -0
- package/fesm2022/ngbase-adk-select.mjs.map +1 -0
- package/fesm2022/ngbase-adk-selectable.mjs +79 -0
- package/fesm2022/ngbase-adk-selectable.mjs.map +1 -0
- package/fesm2022/ngbase-adk-sidenav.mjs +209 -0
- package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -0
- package/fesm2022/ngbase-adk-slider.mjs +337 -0
- package/fesm2022/ngbase-adk-slider.mjs.map +1 -0
- package/fesm2022/ngbase-adk-sonner.mjs +176 -0
- package/fesm2022/ngbase-adk-sonner.mjs.map +1 -0
- package/fesm2022/ngbase-adk-stepper.mjs +211 -0
- package/fesm2022/ngbase-adk-stepper.mjs.map +1 -0
- package/fesm2022/ngbase-adk-switch.mjs +115 -0
- package/fesm2022/ngbase-adk-switch.mjs.map +1 -0
- package/fesm2022/ngbase-adk-table.mjs +348 -0
- package/fesm2022/ngbase-adk-table.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tabs.mjs +386 -0
- package/fesm2022/ngbase-adk-tabs.mjs.map +1 -0
- package/fesm2022/ngbase-adk-test.mjs +267 -0
- package/fesm2022/ngbase-adk-test.mjs.map +1 -0
- package/fesm2022/ngbase-adk-toggle-group.mjs +114 -0
- package/fesm2022/ngbase-adk-toggle-group.mjs.map +1 -0
- package/fesm2022/ngbase-adk-toggle.mjs +48 -0
- package/fesm2022/ngbase-adk-toggle.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tooltip.mjs +237 -0
- package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tour.mjs +312 -0
- package/fesm2022/ngbase-adk-tour.mjs.map +1 -0
- package/fesm2022/ngbase-adk-translate.mjs +162 -0
- package/fesm2022/ngbase-adk-translate.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tree.mjs +301 -0
- package/fesm2022/ngbase-adk-tree.mjs.map +1 -0
- package/fesm2022/ngbase-adk-utils.mjs +228 -0
- package/fesm2022/ngbase-adk-utils.mjs.map +1 -0
- package/fesm2022/ngbase-adk-virtualizer.mjs +198 -0
- package/fesm2022/ngbase-adk-virtualizer.mjs.map +1 -0
- package/fesm2022/ngbase-adk.mjs +6 -0
- package/fesm2022/ngbase-adk.mjs.map +1 -0
- package/form-field/auto-height.d.ts +9 -0
- package/form-field/error.d.ts +18 -0
- package/form-field/form-field.d.ts +14 -0
- package/form-field/index.d.ts +5 -0
- package/form-field/input.d.ts +16 -0
- package/form-field/label.d.ts +7 -0
- package/form-field/otp.d.ts +48 -0
- package/form-field/public-api.d.ts +6 -0
- package/hover-card/hover-card.d.ts +18 -0
- package/hover-card/index.d.ts +5 -0
- package/hover-card/public-api.d.ts +1 -0
- package/icon/icon.d.ts +12 -0
- package/icon/icon.service.d.ts +12 -0
- package/icon/index.d.ts +5 -0
- package/icon/public-api.d.ts +2 -0
- package/index.d.ts +5 -0
- package/inline-edit/index.d.ts +5 -0
- package/inline-edit/inline-edit.d.ts +47 -0
- package/inline-edit/public-api.d.ts +1 -0
- package/jwt/index.d.ts +5 -0
- package/jwt/jwt.service.d.ts +27 -0
- package/jwt/public-api.d.ts +1 -0
- package/keys/index.d.ts +5 -0
- package/keys/keys.service.d.ts +13 -0
- package/keys/public-api.d.ts +2 -0
- package/keys/shortcuts.service.d.ts +38 -0
- package/layout/index.d.ts +5 -0
- package/layout/layout.d.ts +16 -0
- package/layout/public-api.d.ts +1 -0
- package/list/index.d.ts +5 -0
- package/list/list.d.ts +20 -0
- package/list/list.directive.d.ts +12 -0
- package/list/public-api.d.ts +2 -0
- package/mask/index.d.ts +5 -0
- package/mask/mask-pipe.d.ts +7 -0
- package/mask/mask.d.ts +25 -0
- package/mask/public-api.d.ts +2 -0
- package/menu/context-menu.d.ts +21 -0
- package/menu/index.d.ts +5 -0
- package/menu/mention.d.ts +18 -0
- package/menu/menu-trigger.d.ts +34 -0
- package/menu/menu.d.ts +52 -0
- package/menu/navigation-menu.d.ts +19 -0
- package/menu/public-api.d.ts +5 -0
- package/network/index.d.ts +5 -0
- package/network/network.interceptor.d.ts +6 -0
- package/network/network.service.d.ts +18 -0
- package/network/public-api.d.ts +2 -0
- package/package.json +247 -0
- package/pagination/index.d.ts +5 -0
- package/pagination/pagination.d.ts +28 -0
- package/pagination/public-api.d.ts +1 -0
- package/popover/base-popover.service.d.ts +16 -0
- package/popover/index.d.ts +5 -0
- package/popover/popover-trigger.d.ts +21 -0
- package/popover/popover.d.ts +50 -0
- package/popover/popover.service.d.ts +42 -0
- package/popover/public-api.d.ts +5 -0
- package/popover/utils.d.ts +85 -0
- package/portal/dialog-ref.d.ts +71 -0
- package/portal/index.d.ts +5 -0
- package/portal/portal-base.service.d.ts +19 -0
- package/portal/portal-close.directive.d.ts +8 -0
- package/portal/portal.component.d.ts +7 -0
- package/portal/portal.service.d.ts +16 -0
- package/portal/public-api.d.ts +5 -0
- package/progress/index.d.ts +5 -0
- package/progress/progress.d.ts +13 -0
- package/progress/public-api.d.ts +1 -0
- package/public-api.d.ts +2 -0
- package/radio/index.d.ts +5 -0
- package/radio/public-api.d.ts +2 -0
- package/radio/radio-group.d.ts +19 -0
- package/radio/radio.d.ts +22 -0
- package/resizable/index.d.ts +5 -0
- package/resizable/public-api.d.ts +2 -0
- package/resizable/resizable-group.d.ts +22 -0
- package/resizable/resizable.d.ts +50 -0
- package/scroll-area/index.d.ts +5 -0
- package/scroll-area/public-api.d.ts +1 -0
- package/scroll-area/scroll-area.d.ts +56 -0
- package/select/index.d.ts +5 -0
- package/select/list-selection.d.ts +7 -0
- package/select/option-group.d.ts +7 -0
- package/select/option.d.ts +25 -0
- package/select/public-api.d.ts +6 -0
- package/select/select-base.d.ts +64 -0
- package/select/select-input.d.ts +23 -0
- package/select/select.d.ts +50 -0
- package/selectable/index.d.ts +5 -0
- package/selectable/public-api.d.ts +2 -0
- package/selectable/selectable-item.d.ts +12 -0
- package/selectable/selectable.d.ts +19 -0
- package/sidenav/index.d.ts +5 -0
- package/sidenav/public-api.d.ts +3 -0
- package/sidenav/sidenav-header.d.ts +31 -0
- package/sidenav/sidenav.d.ts +23 -0
- package/sidenav/sidenav.service.d.ts +18 -0
- package/slider/index.d.ts +5 -0
- package/slider/public-api.d.ts +1 -0
- package/slider/slider.d.ts +73 -0
- package/sonner/index.d.ts +5 -0
- package/sonner/public-api.d.ts +2 -0
- package/sonner/sonner.d.ts +24 -0
- package/sonner/sonner.service.d.ts +21 -0
- package/stepper/animation.d.ts +1 -0
- package/stepper/index.d.ts +5 -0
- package/stepper/public-api.d.ts +3 -0
- package/stepper/step.d.ts +24 -0
- package/stepper/stepper.d.ts +26 -0
- package/switch/index.d.ts +5 -0
- package/switch/public-api.d.ts +1 -0
- package/switch/switch.d.ts +44 -0
- package/table/body-cell.d.ts +11 -0
- package/table/body-row.d.ts +21 -0
- package/table/column.d.ts +10 -0
- package/table/head-cell.d.ts +12 -0
- package/table/head-row.d.ts +21 -0
- package/table/index.d.ts +5 -0
- package/table/public-api.d.ts +8 -0
- package/table/table.d.ts +32 -0
- package/tabs/index.d.ts +5 -0
- package/tabs/public-api.d.ts +2 -0
- package/tabs/tab-group.d.ts +52 -0
- package/tabs/tab.d.ts +31 -0
- package/test/index.d.ts +5 -0
- package/test/public-api.d.ts +1 -0
- package/test/utils.d.ts +62 -0
- package/toggle/index.d.ts +5 -0
- package/toggle/public-api.d.ts +1 -0
- package/toggle/toggle.d.ts +13 -0
- package/toggle-group/index.d.ts +5 -0
- package/toggle-group/public-api.d.ts +2 -0
- package/toggle-group/toggle-group.d.ts +25 -0
- package/toggle-group/toggle-item.d.ts +14 -0
- package/tooltip/index.d.ts +5 -0
- package/tooltip/public-api.d.ts +2 -0
- package/tooltip/tooltip.d.ts +20 -0
- package/tooltip/tooltip.directive.d.ts +34 -0
- package/tooltip/tooltip.service.d.ts +26 -0
- package/tour/animation.d.ts +2 -0
- package/tour/index.d.ts +5 -0
- package/tour/public-api.d.ts +5 -0
- package/tour/tour-base.d.ts +21 -0
- package/tour/tour-step.d.ts +11 -0
- package/tour/tour.d.ts +9 -0
- package/tour/tour.service.d.ts +30 -0
- package/translate/config.d.ts +16 -0
- package/translate/index.d.ts +5 -0
- package/translate/public-api.d.ts +3 -0
- package/translate/translate.d.ts +11 -0
- package/translate/translate.service.d.ts +31 -0
- package/tree/index.d.ts +5 -0
- package/tree/public-api.d.ts +3 -0
- package/tree/tree-node.d.ts +28 -0
- package/tree/tree-toggle.d.ts +16 -0
- package/tree/tree.d.ts +55 -0
- package/utils/animation.d.ts +3 -0
- package/utils/disposals.d.ts +7 -0
- package/utils/index.d.ts +5 -0
- package/utils/number-only.d.ts +22 -0
- package/utils/public-api.d.ts +6 -0
- package/utils/range.pipe.d.ts +7 -0
- package/utils/ssr.d.ts +2 -0
- package/utils/utils.d.ts +27 -0
- package/virtualizer/index.d.ts +5 -0
- package/virtualizer/public-api.d.ts +1 -0
- package/virtualizer/virtualizer.d.ts +42 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, computed, Directive, contentChildren } from '@angular/core';
|
|
3
|
+
import { injectDirectionality } from '@ngbase/adk/bidi';
|
|
4
|
+
|
|
5
|
+
class NgbBreadcrumb {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.breadcrumbs = inject(NgbBreadcrumbs);
|
|
8
|
+
this.active = computed(() => {
|
|
9
|
+
const items = this.breadcrumbs.items();
|
|
10
|
+
return items.indexOf(this) === items.length - 1;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
14
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbBreadcrumb, isStandalone: true, selector: "[ngbBreadcrumb]", host: { attributes: { "role": "link" }, properties: { "attr.aria-current": "active() ? 'page' : null", "attr.aria-disabled": "active()" } }, ngImport: i0 }); }
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumb, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
selector: '[ngbBreadcrumb]',
|
|
20
|
+
host: {
|
|
21
|
+
'[attr.aria-current]': "active() ? 'page' : null",
|
|
22
|
+
'[attr.aria-disabled]': 'active()',
|
|
23
|
+
role: 'link',
|
|
24
|
+
},
|
|
25
|
+
}]
|
|
26
|
+
}] });
|
|
27
|
+
function provideBreadcrumb(breadcrumb) {
|
|
28
|
+
return { provide: NgbBreadcrumb, useExisting: breadcrumb };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
class NgbBreadcrumbs {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.items = contentChildren(NgbBreadcrumb);
|
|
34
|
+
}
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbs, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
36
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbBreadcrumbs, isStandalone: true, selector: "[ngbBreadcrumbs]", host: { attributes: { "aria-label": "breadcrumb" } }, queries: [{ propertyName: "items", predicate: NgbBreadcrumb, isSignal: true }], ngImport: i0 }); }
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbs, decorators: [{
|
|
39
|
+
type: Directive,
|
|
40
|
+
args: [{
|
|
41
|
+
selector: '[ngbBreadcrumbs]',
|
|
42
|
+
host: {
|
|
43
|
+
'aria-label': 'breadcrumb',
|
|
44
|
+
},
|
|
45
|
+
}]
|
|
46
|
+
}] });
|
|
47
|
+
|
|
48
|
+
class NgbBreadcrumbLink {
|
|
49
|
+
constructor() {
|
|
50
|
+
this.breadcrumb = inject(NgbBreadcrumb);
|
|
51
|
+
}
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbLink, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
53
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbBreadcrumbLink, isStandalone: true, selector: "[ngbBreadcrumbLink]", host: { attributes: { "role": "link" }, properties: { "tabIndex": "breadcrumb.active() ? -1 : 0", "attr.aria-current": "breadcrumb.active() ? 'page' : null", "attr.aria-disabled": "breadcrumb.active() || null" } }, ngImport: i0 }); }
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbLink, decorators: [{
|
|
56
|
+
type: Directive,
|
|
57
|
+
args: [{
|
|
58
|
+
selector: '[ngbBreadcrumbLink]',
|
|
59
|
+
host: {
|
|
60
|
+
'[tabIndex]': 'breadcrumb.active() ? -1 : 0',
|
|
61
|
+
'[attr.aria-current]': "breadcrumb.active() ? 'page' : null",
|
|
62
|
+
'[attr.aria-disabled]': 'breadcrumb.active() || null',
|
|
63
|
+
role: 'link',
|
|
64
|
+
},
|
|
65
|
+
}]
|
|
66
|
+
}] });
|
|
67
|
+
|
|
68
|
+
class NgbBreadcrumbSeparatorAria {
|
|
69
|
+
constructor() {
|
|
70
|
+
this.dir = injectDirectionality();
|
|
71
|
+
}
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbSeparatorAria, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
73
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbBreadcrumbSeparatorAria, isStandalone: true, selector: "[ngbBreadcrumbSeparatorAria]", host: { attributes: { "tabindex": "-1", "aria-hidden": "true", "role": "presentation" }, properties: { "style.transform": "dir.isRtl() ? \"rotate(180deg)\" : \"\"" } }, ngImport: i0 }); }
|
|
74
|
+
}
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbSeparatorAria, decorators: [{
|
|
76
|
+
type: Directive,
|
|
77
|
+
args: [{
|
|
78
|
+
selector: '[ngbBreadcrumbSeparatorAria]',
|
|
79
|
+
host: {
|
|
80
|
+
tabindex: '-1',
|
|
81
|
+
'aria-hidden': 'true',
|
|
82
|
+
role: 'presentation',
|
|
83
|
+
'[style.transform]': 'dir.isRtl() ? "rotate(180deg)" : ""',
|
|
84
|
+
},
|
|
85
|
+
}]
|
|
86
|
+
}] });
|
|
87
|
+
class NgbBreadcrumbSeparator {
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
89
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbBreadcrumbSeparator, isStandalone: true, selector: "[ngbBreadcrumbsSeparator]", ngImport: i0 }); }
|
|
90
|
+
}
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBreadcrumbSeparator, decorators: [{
|
|
92
|
+
type: Directive,
|
|
93
|
+
args: [{
|
|
94
|
+
selector: '[ngbBreadcrumbsSeparator]',
|
|
95
|
+
}]
|
|
96
|
+
}] });
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Generated bundle index. Do not edit.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
export { NgbBreadcrumb, NgbBreadcrumbLink, NgbBreadcrumbSeparator, NgbBreadcrumbSeparatorAria, NgbBreadcrumbs, provideBreadcrumb };
|
|
103
|
+
//# sourceMappingURL=ngbase-adk-breadcrumb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngbase-adk-breadcrumb.mjs","sources":["../../../projects/adk/breadcrumb/breadcrumb.ts","../../../projects/adk/breadcrumb/breadcrumbs.ts","../../../projects/adk/breadcrumb/breadcrumb-link.ts","../../../projects/adk/breadcrumb/breadcrumb-separator.ts","../../../projects/adk/breadcrumb/ngbase-adk-breadcrumb.ts"],"sourcesContent":["import { computed, Directive, inject, Type } from '@angular/core';\nimport { NgbBreadcrumbs } from './breadcrumbs';\n\n@Directive({\n selector: '[ngbBreadcrumb]',\n host: {\n '[attr.aria-current]': \"active() ? 'page' : null\",\n '[attr.aria-disabled]': 'active()',\n role: 'link',\n },\n})\nexport class NgbBreadcrumb {\n private breadcrumbs = inject(NgbBreadcrumbs);\n readonly active = computed(() => {\n const items = this.breadcrumbs.items();\n return items.indexOf(this) === items.length - 1;\n });\n}\n\nexport function provideBreadcrumb(breadcrumb: Type<NgbBreadcrumb>) {\n return { provide: NgbBreadcrumb, useExisting: breadcrumb };\n}\n","import { contentChildren, Directive } from '@angular/core';\nimport { NgbBreadcrumb } from './breadcrumb';\n\n@Directive({\n selector: '[ngbBreadcrumbs]',\n host: {\n 'aria-label': 'breadcrumb',\n },\n})\nexport class NgbBreadcrumbs {\n readonly items = contentChildren(NgbBreadcrumb);\n}\n","import { Directive, inject } from '@angular/core';\nimport { NgbBreadcrumb } from './public-api';\n\n@Directive({\n selector: '[ngbBreadcrumbLink]',\n host: {\n '[tabIndex]': 'breadcrumb.active() ? -1 : 0',\n '[attr.aria-current]': \"breadcrumb.active() ? 'page' : null\",\n '[attr.aria-disabled]': 'breadcrumb.active() || null',\n role: 'link',\n },\n})\nexport class NgbBreadcrumbLink {\n readonly breadcrumb = inject(NgbBreadcrumb);\n}\n","import { Directive } from '@angular/core';\nimport { injectDirectionality } from '@ngbase/adk/bidi';\n\n@Directive({\n selector: '[ngbBreadcrumbSeparatorAria]',\n host: {\n tabindex: '-1',\n 'aria-hidden': 'true',\n role: 'presentation',\n '[style.transform]': 'dir.isRtl() ? \"rotate(180deg)\" : \"\"',\n },\n})\nexport class NgbBreadcrumbSeparatorAria {\n readonly dir = injectDirectionality();\n}\n\n@Directive({\n selector: '[ngbBreadcrumbsSeparator]',\n})\nexport class NgbBreadcrumbSeparator {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAWa,aAAa,CAAA;AAR1B,IAAA,WAAA,GAAA;AASU,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC;AACnC,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAAC,MAAK;YAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;AACtC,YAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;AACjD,SAAC,CAAC;AACH;8GANY,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,mBAAA,EAAA,0BAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBARzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE;AACJ,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,IAAI,EAAE,MAAM;AACb,qBAAA;AACF,iBAAA;;AASK,SAAU,iBAAiB,CAAC,UAA+B,EAAA;IAC/D,OAAO,EAAE,OAAO,EAAE,aAA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,EAAA,2BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,2BAA2B;AACtC,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, inject, InjectionToken } from '@angular/core';
|
|
3
|
+
import { HTTP_INTERCEPTORS, HttpResponse } from '@angular/common/http';
|
|
4
|
+
import { of, tap } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
class Cache {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.cache = new Map();
|
|
9
|
+
this.defaultConfig = {
|
|
10
|
+
timeToLive: 0, // 0 means no expiration
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
setConfig(config) {
|
|
14
|
+
this.defaultConfig = { ...this.defaultConfig, ...config };
|
|
15
|
+
}
|
|
16
|
+
get(url) {
|
|
17
|
+
const cachedResponse = this.getFromCache(url);
|
|
18
|
+
return cachedResponse;
|
|
19
|
+
}
|
|
20
|
+
clearCache(url) {
|
|
21
|
+
if (url) {
|
|
22
|
+
this.cache.delete(url);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.cache.clear();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
isCached(url) {
|
|
29
|
+
return this.cache.has(url);
|
|
30
|
+
}
|
|
31
|
+
getFromCache(url) {
|
|
32
|
+
const cached = this.cache.get(url);
|
|
33
|
+
if (!cached)
|
|
34
|
+
return null;
|
|
35
|
+
const isExpired = cached.config.timeToLive > 0 && Date.now() - cached.lastUpdated > cached.config.timeToLive;
|
|
36
|
+
if (isExpired) {
|
|
37
|
+
this.cache.delete(url);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return cached.response;
|
|
41
|
+
}
|
|
42
|
+
addToCache(url, response, config) {
|
|
43
|
+
this.cache.set(url, {
|
|
44
|
+
url,
|
|
45
|
+
response,
|
|
46
|
+
lastUpdated: Date.now(),
|
|
47
|
+
config,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Cache, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Cache, providedIn: 'root' }); }
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Cache, decorators: [{
|
|
54
|
+
type: Injectable,
|
|
55
|
+
args: [{ providedIn: 'root' }]
|
|
56
|
+
}] });
|
|
57
|
+
const injectCache = () => inject(Cache);
|
|
58
|
+
|
|
59
|
+
const CACHE_CONFIG = new InjectionToken('CACHE_CONFIG', {
|
|
60
|
+
factory: () => ({
|
|
61
|
+
enabled: true,
|
|
62
|
+
cacheable: {
|
|
63
|
+
methods: ['GET'],
|
|
64
|
+
urls: [],
|
|
65
|
+
},
|
|
66
|
+
excludeUrls: [],
|
|
67
|
+
defaultTimeToLive: 300000,
|
|
68
|
+
}),
|
|
69
|
+
});
|
|
70
|
+
function provideCache(fn) {
|
|
71
|
+
return [
|
|
72
|
+
Cache,
|
|
73
|
+
{ provide: CACHE_CONFIG, useFactory: fn },
|
|
74
|
+
{ provide: HTTP_INTERCEPTORS, useFactory: cacheInterceptor, multi: true },
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const cacheInterceptor = (request, next) => {
|
|
79
|
+
const cache = injectCache();
|
|
80
|
+
const config = inject(CACHE_CONFIG);
|
|
81
|
+
// If not cacheable, return the response
|
|
82
|
+
if (!shouldCache(request, config)) {
|
|
83
|
+
return next(request);
|
|
84
|
+
}
|
|
85
|
+
// Check for cache control headers
|
|
86
|
+
const noCache = request.headers.get('Cache-Control') === 'no-cache';
|
|
87
|
+
if (noCache) {
|
|
88
|
+
cache.clearCache(request.url);
|
|
89
|
+
return next(request);
|
|
90
|
+
}
|
|
91
|
+
// Get cache config for this request
|
|
92
|
+
const timeToLive = config.defaultTimeToLive;
|
|
93
|
+
// Try to get from cache
|
|
94
|
+
const cachedResponse = cache.get(request.url);
|
|
95
|
+
if (cachedResponse) {
|
|
96
|
+
return of(new HttpResponse({ body: cachedResponse }));
|
|
97
|
+
}
|
|
98
|
+
// If not in cache, make the request and cache the response
|
|
99
|
+
return next(request).pipe(tap(event => {
|
|
100
|
+
if (event instanceof HttpResponse) {
|
|
101
|
+
cache.addToCache(request.url, event.body, { timeToLive: config.defaultTimeToLive });
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
function shouldCache(request, config) {
|
|
106
|
+
// Fall back to global config
|
|
107
|
+
if (!config.enabled) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (!config.cacheable.methods.includes(request.method)) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (config.excludeUrls.some(url => request.url.includes(url))) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (config.cacheable.urls.length > 0) {
|
|
117
|
+
return config.cacheable.urls.some(url => request.url.includes(url));
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Generated bundle index. Do not edit.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
export { cacheInterceptor, injectCache, provideCache };
|
|
127
|
+
//# sourceMappingURL=ngbase-adk-cache.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngbase-adk-cache.mjs","sources":["../../../projects/adk/cache/cache.ts","../../../projects/adk/cache/cache-config.ts","../../../projects/adk/cache/cache.interecptor.ts","../../../projects/adk/cache/ngbase-adk-cache.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\n\nexport interface CacheConfig {\n timeToLive: number;\n}\n\ninterface CacheEntry<T = unknown> {\n url: string;\n response: T;\n lastUpdated: number;\n config: CacheConfig;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class Cache {\n private cache = new Map<string, CacheEntry>();\n private defaultConfig: CacheConfig = {\n timeToLive: 0, // 0 means no expiration\n };\n\n setConfig(config: Partial<CacheConfig>) {\n this.defaultConfig = { ...this.defaultConfig, ...config };\n }\n\n get<T>(url: string): T {\n const cachedResponse = this.getFromCache(url);\n return cachedResponse as T;\n }\n\n clearCache(url?: string) {\n if (url) {\n this.cache.delete(url);\n } else {\n this.cache.clear();\n }\n }\n\n isCached(url: string): boolean {\n return this.cache.has(url);\n }\n\n private getFromCache<T>(url: string): T | null {\n const cached = this.cache.get(url) as CacheEntry<T> | undefined;\n if (!cached) return null;\n\n const isExpired =\n cached.config.timeToLive > 0 && Date.now() - cached.lastUpdated > cached.config.timeToLive;\n if (isExpired) {\n this.cache.delete(url);\n return null;\n }\n\n return cached.response;\n }\n\n addToCache(url: string, response: any, config: CacheConfig) {\n this.cache.set(url, {\n url,\n response,\n lastUpdated: Date.now(),\n config,\n });\n }\n}\n\nexport const injectCache = () => inject(Cache);\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { InjectionToken } from '@angular/core';\nimport { Cache } from './cache';\nimport { cacheInterceptor } from './cache.interecptor';\n\nexport type CacheInterceptorConfig = Partial<InternalCacheInterceptorConfig>;\n\nexport interface InternalCacheInterceptorConfig {\n enabled: boolean;\n cacheable: {\n methods: string[];\n urls: string[];\n };\n excludeUrls: string[];\n defaultTimeToLive: number;\n}\n\nexport const CACHE_CONFIG = new InjectionToken<CacheInterceptorConfig>('CACHE_CONFIG', {\n factory: () => ({\n enabled: true,\n cacheable: {\n methods: ['GET'],\n urls: [],\n },\n excludeUrls: [],\n defaultTimeToLive: 300000,\n }),\n});\n\nexport function provideCache(fn: () => CacheInterceptorConfig) {\n return [\n Cache,\n { provide: CACHE_CONFIG, useFactory: fn },\n { provide: HTTP_INTERCEPTORS, useFactory: cacheInterceptor, multi: true },\n ];\n}\n","import { HttpInterceptorFn, HttpRequest, HttpResponse } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { of, tap } from 'rxjs';\nimport { injectCache } from './cache';\nimport { CACHE_CONFIG, InternalCacheInterceptorConfig } from './cache-config';\n\nexport const cacheInterceptor: HttpInterceptorFn = (request, next) => {\n const cache = injectCache();\n const config = inject(CACHE_CONFIG) as InternalCacheInterceptorConfig;\n\n // If not cacheable, return the response\n if (!shouldCache(request, config)) {\n return next(request);\n }\n\n // Check for cache control headers\n const noCache = request.headers.get('Cache-Control') === 'no-cache';\n if (noCache) {\n cache.clearCache(request.url);\n return next(request);\n }\n\n // Get cache config for this request\n const timeToLive = config.defaultTimeToLive;\n\n // Try to get from cache\n const cachedResponse = cache.get(request.url);\n if (cachedResponse) {\n return of(new HttpResponse({ body: cachedResponse }));\n }\n\n // If not in cache, make the request and cache the response\n return next(request).pipe(\n tap(event => {\n if (event instanceof HttpResponse) {\n cache.addToCache(request.url, event.body, { timeToLive: config.defaultTimeToLive! });\n }\n }),\n );\n};\n\nfunction shouldCache(\n request: HttpRequest<unknown>,\n config: InternalCacheInterceptorConfig,\n): boolean {\n // Fall back to global config\n if (!config.enabled) {\n return false;\n }\n\n if (!config.cacheable.methods.includes(request.method)) {\n return false;\n }\n\n if (config.excludeUrls.some(url => request.url.includes(url))) {\n return false;\n }\n\n if (config.cacheable.urls.length > 0) {\n return config.cacheable.urls.some(url => request.url.includes(url));\n }\n\n return false;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAca,KAAK,CAAA;AADlB,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,GAAG,EAAsB;AACrC,QAAA,IAAA,CAAA,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AM,GAAG,CAAC,EAAE;QACpC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;;AAGrE,IAAA,OAAO,KAAK;AACd;;AC/DA;;AAEG;;;;"}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Directive, viewChild, contentChildren, signal, computed, afterNextRender, effect, untracked, input } from '@angular/core';
|
|
3
|
+
import { injectDirectionality } from '@ngbase/adk/bidi';
|
|
4
|
+
import * as i1 from '@ngbase/adk/drag';
|
|
5
|
+
import { Drag } from '@ngbase/adk/drag';
|
|
6
|
+
|
|
7
|
+
class NgbCarouselItem {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.el = inject(ElementRef);
|
|
10
|
+
}
|
|
11
|
+
get width() {
|
|
12
|
+
const el = this.el.nativeElement;
|
|
13
|
+
return el.getBoundingClientRect?.().width ?? el.offsetWidth; // SSR: fallback to offsetWidth
|
|
14
|
+
}
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
16
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbCarouselItem, isStandalone: true, selector: "[ngbCarouselItem]", ngImport: i0 }); }
|
|
17
|
+
}
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselItem, decorators: [{
|
|
19
|
+
type: Directive,
|
|
20
|
+
args: [{
|
|
21
|
+
selector: '[ngbCarouselItem]',
|
|
22
|
+
}]
|
|
23
|
+
}] });
|
|
24
|
+
|
|
25
|
+
class NgbCarouselContainer {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.el = inject((ElementRef));
|
|
28
|
+
}
|
|
29
|
+
get width() {
|
|
30
|
+
return this.el.nativeElement.clientWidth;
|
|
31
|
+
}
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselContainer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
33
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbCarouselContainer, isStandalone: true, selector: "[ngbCarouselContainer]", hostDirectives: [{ directive: i1.Drag }], ngImport: i0 }); }
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselContainer, decorators: [{
|
|
36
|
+
type: Directive,
|
|
37
|
+
args: [{
|
|
38
|
+
selector: '[ngbCarouselContainer]',
|
|
39
|
+
hostDirectives: [Drag],
|
|
40
|
+
}]
|
|
41
|
+
}] });
|
|
42
|
+
class NgbCarouselSubContainer {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.el = inject((ElementRef));
|
|
45
|
+
this.dir = injectDirectionality();
|
|
46
|
+
}
|
|
47
|
+
updateScrollPosition(x, skipDirection = false) {
|
|
48
|
+
const el = this.el.nativeElement;
|
|
49
|
+
if (this.dir.isRtl() && !skipDirection) {
|
|
50
|
+
el.style.transform = `translate3d(${x}px, 0, 0)`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
el.style.transform = `translate3d(${-x}px, 0, 0)`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselSubContainer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
57
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbCarouselSubContainer, isStandalone: true, selector: "[ngbCarouselSubContainer]", ngImport: i0 }); }
|
|
58
|
+
}
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselSubContainer, decorators: [{
|
|
60
|
+
type: Directive,
|
|
61
|
+
args: [{
|
|
62
|
+
selector: '[ngbCarouselSubContainer]',
|
|
63
|
+
}]
|
|
64
|
+
}] });
|
|
65
|
+
class NgbCarousel {
|
|
66
|
+
constructor() {
|
|
67
|
+
this.drag = viewChild.required(Drag);
|
|
68
|
+
this.dir = injectDirectionality();
|
|
69
|
+
this.mainContainer = viewChild.required(NgbCarouselContainer);
|
|
70
|
+
this.subContainer = viewChild.required(NgbCarouselSubContainer);
|
|
71
|
+
this.items = contentChildren(NgbCarouselItem);
|
|
72
|
+
this.current = signal(0);
|
|
73
|
+
this.animationId = 0;
|
|
74
|
+
// this can be overridden by the ui carousel component
|
|
75
|
+
this.velocity = 1.1;
|
|
76
|
+
this.itemsPerStep = computed(() => {
|
|
77
|
+
const _ = this.isReady();
|
|
78
|
+
const items = this.items();
|
|
79
|
+
// const totalWidth = this.totalWidth();
|
|
80
|
+
const containerWidth = this.containerWidth;
|
|
81
|
+
// const scrollableWidth = totalWidth - containerWidth || 1;
|
|
82
|
+
const v = Math.ceil(containerWidth / (items[0].width || 1));
|
|
83
|
+
return v;
|
|
84
|
+
});
|
|
85
|
+
this.totalWidth = computed(() => {
|
|
86
|
+
const _ = this.isReady();
|
|
87
|
+
const items = this.items();
|
|
88
|
+
return items.reduce((acc, item) => acc + item.width, 0);
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* This is the total number of steps that can be taken.
|
|
92
|
+
* It is computed based on the container width and the width of the last item.
|
|
93
|
+
* It is used to determine the number of steps that can be taken.
|
|
94
|
+
* We have to consider gap between items like padding or margin or flex gap.
|
|
95
|
+
*/
|
|
96
|
+
this.totalSteps = computed(() => {
|
|
97
|
+
// const containerWidth = this.containerWidth;
|
|
98
|
+
const items = this.items();
|
|
99
|
+
if (!items.length || !this.itemsPerStep())
|
|
100
|
+
return 0;
|
|
101
|
+
// console.log('totalSteps', items.length, this.itemsPerStep());
|
|
102
|
+
// const totalWidth = this.totalWidth();
|
|
103
|
+
// const scrollableWidth = totalWidth;
|
|
104
|
+
// if (scrollableWidth <= 0) return 1; // All items fit in container
|
|
105
|
+
// // Calculate effective step size based on the smallest item width
|
|
106
|
+
// // const minItemWidth = Math.min(...items.map(item => item.width));
|
|
107
|
+
// const v = Math.max(1, Math.floor(scrollableWidth / containerWidth));
|
|
108
|
+
// console.log('totalSteps', v, scrollableWidth, containerWidth, scrollableWidth / containerWidth);
|
|
109
|
+
// return v;
|
|
110
|
+
const itemsPerStep = this.itemsPerStep();
|
|
111
|
+
// const totalWidth = this.totalWidth();
|
|
112
|
+
// const scrollableWidth = totalWidth - this.containerWidth;
|
|
113
|
+
// return Math.max(1, Math.floor(scrollableWidth / itemsPerStep));
|
|
114
|
+
return Math.ceil(items.length / itemsPerStep);
|
|
115
|
+
});
|
|
116
|
+
this.isReady = signal(false, { equal: () => false });
|
|
117
|
+
this.isFirst = computed(() => this.current() === 0);
|
|
118
|
+
this.isLast = computed(() => this.current() === this.totalSteps() - 1);
|
|
119
|
+
this.currentScroll = 0;
|
|
120
|
+
afterNextRender(() => {
|
|
121
|
+
this.isReady.set(true);
|
|
122
|
+
this.drag().events.subscribe(event => {
|
|
123
|
+
event.event?.preventDefault();
|
|
124
|
+
requestAnimationFrame(() => {
|
|
125
|
+
if (event.type === 'start') {
|
|
126
|
+
cancelAnimationFrame(this.animationId);
|
|
127
|
+
this.currentScroll = this.x();
|
|
128
|
+
}
|
|
129
|
+
else if (event.type === 'move') {
|
|
130
|
+
this.currentScroll = this.x() - event.x;
|
|
131
|
+
this.subContainer().updateScrollPosition(this.currentScroll, true);
|
|
132
|
+
}
|
|
133
|
+
else if (event.type === 'end') {
|
|
134
|
+
const step = this.getStepBasedOnX(this.currentScroll, event.direction, event.velocity);
|
|
135
|
+
this.go(step, event.velocity);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
effect(cleanup => {
|
|
141
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
142
|
+
const observer = new ResizeObserver(() => {
|
|
143
|
+
requestAnimationFrame(() => this.isReady.set(true));
|
|
144
|
+
});
|
|
145
|
+
observer.observe(this.mainContainer().el.nativeElement);
|
|
146
|
+
cleanup(() => observer.disconnect());
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
// if the total steps changes, we need to update the current step
|
|
150
|
+
// also make sure the most visible item is the current item
|
|
151
|
+
effect(() => {
|
|
152
|
+
const totalSteps = this.totalSteps();
|
|
153
|
+
const _ = this.dir.isRtl();
|
|
154
|
+
const __ = this.isReady();
|
|
155
|
+
// console.log('effect', totalSteps, this.itemsPerStep());
|
|
156
|
+
untracked(() => {
|
|
157
|
+
const current = this.current();
|
|
158
|
+
const step = current >= totalSteps ? totalSteps - 1 : current;
|
|
159
|
+
this.go(step, this.velocity, true);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
x() {
|
|
164
|
+
const current = this.current() * this.itemsPerStep();
|
|
165
|
+
const items = this.items();
|
|
166
|
+
if (this.containerWidth > this.totalWidth())
|
|
167
|
+
return 0;
|
|
168
|
+
const totalWidth = this.totalWidth() - this.containerWidth;
|
|
169
|
+
const x = items.slice(0, current).reduce((a, item) => a + item.width, 0);
|
|
170
|
+
return Math.min(x, totalWidth);
|
|
171
|
+
}
|
|
172
|
+
get containerWidth() {
|
|
173
|
+
return this.mainContainer().width;
|
|
174
|
+
}
|
|
175
|
+
next(step = 1) {
|
|
176
|
+
const current = this.current();
|
|
177
|
+
const nextStep = Math.min(current + step, this.totalSteps() - 1);
|
|
178
|
+
this.go(nextStep);
|
|
179
|
+
}
|
|
180
|
+
prev(step = 1) {
|
|
181
|
+
const current = this.current();
|
|
182
|
+
const index = Math.max(current - step, 0);
|
|
183
|
+
this.go(index);
|
|
184
|
+
}
|
|
185
|
+
go(step, velocity = this.velocity, withoutAnimation = false) {
|
|
186
|
+
// const totalSteps = this.totalSteps();
|
|
187
|
+
if (step < 0 || step >= this.totalSteps()) {
|
|
188
|
+
console.log('out of bounds step', step, this.totalSteps());
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
this.current.set(step);
|
|
192
|
+
this.animateToX(velocity, withoutAnimation); // Adjust the scaling factor as needed
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Determines the appropriate step based on scroll position, direction and velocity
|
|
196
|
+
* @param scrollX Current scroll position
|
|
197
|
+
* @param direction Drag direction
|
|
198
|
+
* @param velocity Drag velocity
|
|
199
|
+
* @returns The calculated step index
|
|
200
|
+
*/
|
|
201
|
+
getStepBasedOnX(scrollX, direction, velocity) {
|
|
202
|
+
const currentStep = this.current();
|
|
203
|
+
const totalSteps = this.totalSteps();
|
|
204
|
+
const isRtl = this.dir.isRtl();
|
|
205
|
+
// In RTL mode, invert the direction
|
|
206
|
+
const effectiveDirection = isRtl ? (direction === 'left' ? 'right' : 'left') : direction;
|
|
207
|
+
// Prevent movement on last step when trying to go forward
|
|
208
|
+
if (currentStep === totalSteps - 1 && effectiveDirection === 'left') {
|
|
209
|
+
return currentStep;
|
|
210
|
+
}
|
|
211
|
+
// Use velocity to determine step change
|
|
212
|
+
const VELOCITY_THRESHOLD = 0.3;
|
|
213
|
+
if (Math.abs(velocity) > VELOCITY_THRESHOLD) {
|
|
214
|
+
if (effectiveDirection === 'left') {
|
|
215
|
+
return Math.min(currentStep + 1, totalSteps - 1);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
return Math.max(currentStep - 1, 0);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// If velocity is low, stay at current step
|
|
222
|
+
return currentStep;
|
|
223
|
+
}
|
|
224
|
+
// private updateScrollPosition(x = this.currentScroll) {
|
|
225
|
+
// const el = this.subContainer().nativeElement;
|
|
226
|
+
// if (this.dir.isRtl()) {
|
|
227
|
+
// el.style.transform = `translate3d(${x}px, 0, 0)`;
|
|
228
|
+
// } else {
|
|
229
|
+
// el.style.transform = `translate3d(${-x}px, 0, 0)`;
|
|
230
|
+
// }
|
|
231
|
+
// }
|
|
232
|
+
animateToX(velocity, withoutAnimation = false) {
|
|
233
|
+
velocity = Math.max(velocity, this.velocity);
|
|
234
|
+
let lastTime = Date.now();
|
|
235
|
+
const targetScroll = this.x();
|
|
236
|
+
const startScroll = this.currentScroll;
|
|
237
|
+
const isRtl = this.dir.isRtl();
|
|
238
|
+
// In RTL, invert the distance calculation
|
|
239
|
+
const distance = isRtl ? startScroll - targetScroll : targetScroll - startScroll;
|
|
240
|
+
const duration = Math.abs(distance / velocity);
|
|
241
|
+
let elapsedTime = 0;
|
|
242
|
+
const easeOutQuad = (t) => t * (2 - t);
|
|
243
|
+
const subContainer = this.subContainer();
|
|
244
|
+
const animate = () => {
|
|
245
|
+
const now = Date.now();
|
|
246
|
+
const dt = now - lastTime;
|
|
247
|
+
lastTime = now;
|
|
248
|
+
elapsedTime += dt;
|
|
249
|
+
const progress = Math.min(elapsedTime / duration, 1);
|
|
250
|
+
const easedProgress = easeOutQuad(progress);
|
|
251
|
+
// Calculate scroll position based on direction
|
|
252
|
+
this.currentScroll = isRtl
|
|
253
|
+
? startScroll - distance * easedProgress
|
|
254
|
+
: startScroll + distance * easedProgress;
|
|
255
|
+
subContainer.updateScrollPosition(this.currentScroll);
|
|
256
|
+
if (progress < 1) {
|
|
257
|
+
this.animationId = requestAnimationFrame(animate);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
cancelAnimationFrame(this.animationId);
|
|
261
|
+
if (!withoutAnimation) {
|
|
262
|
+
this.animationId = requestAnimationFrame(animate);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this.currentScroll = targetScroll;
|
|
266
|
+
subContainer.updateScrollPosition(this.currentScroll);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
snapToNearest(velocity = this.velocity) {
|
|
270
|
+
const items = this.items();
|
|
271
|
+
let nearestIndex = 0;
|
|
272
|
+
let minDistance = Infinity;
|
|
273
|
+
for (let i = 0; i < items.length; i++) {
|
|
274
|
+
const itemPosition = items.slice(0, i).reduce((acc, item) => acc + item.width, 0);
|
|
275
|
+
const distance = Math.abs(this.currentScroll - itemPosition);
|
|
276
|
+
if (distance < minDistance) {
|
|
277
|
+
minDistance = distance;
|
|
278
|
+
nearestIndex = i;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const step = Math.floor(nearestIndex / this.itemsPerStep());
|
|
282
|
+
this.go(step, velocity);
|
|
283
|
+
// this.current.set(nearestIndex);
|
|
284
|
+
// this.currentScroll = this.x();
|
|
285
|
+
// this.updateScrollPosition();
|
|
286
|
+
}
|
|
287
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarousel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
288
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbCarousel, isStandalone: true, selector: "[ngbCarousel]", queries: [{ propertyName: "items", predicate: NgbCarouselItem, isSignal: true }], viewQueries: [{ propertyName: "drag", first: true, predicate: Drag, descendants: true, isSignal: true }, { propertyName: "mainContainer", first: true, predicate: NgbCarouselContainer, descendants: true, isSignal: true }, { propertyName: "subContainer", first: true, predicate: NgbCarouselSubContainer, descendants: true, isSignal: true }], exportAs: ["ngbCarousel"], ngImport: i0 }); }
|
|
289
|
+
}
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarousel, decorators: [{
|
|
291
|
+
type: Directive,
|
|
292
|
+
args: [{
|
|
293
|
+
selector: '[ngbCarousel]',
|
|
294
|
+
exportAs: 'ngbCarousel',
|
|
295
|
+
}]
|
|
296
|
+
}], ctorParameters: () => [] });
|
|
297
|
+
function provideCarousel(carousel) {
|
|
298
|
+
return { provide: NgbCarousel, useExisting: carousel };
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
class NgbCarouselButton {
|
|
302
|
+
constructor() {
|
|
303
|
+
this.carousel = inject(NgbCarousel);
|
|
304
|
+
this.ngbCarouselButton = input.required();
|
|
305
|
+
}
|
|
306
|
+
clicked(event) {
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
const no = this.ngbCarouselButton();
|
|
309
|
+
if (no === 'next') {
|
|
310
|
+
this.carousel.next();
|
|
311
|
+
}
|
|
312
|
+
else if (no === 'prev') {
|
|
313
|
+
this.carousel.prev();
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
this.carousel.go(no);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
320
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbCarouselButton, isStandalone: true, selector: "[ngbCarouselButton]", inputs: { ngbCarouselButton: { classPropertyName: "ngbCarouselButton", publicName: "ngbCarouselButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "clicked($event)" } }, ngImport: i0 }); }
|
|
321
|
+
}
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbCarouselButton, decorators: [{
|
|
323
|
+
type: Directive,
|
|
324
|
+
args: [{
|
|
325
|
+
selector: '[ngbCarouselButton]',
|
|
326
|
+
host: {
|
|
327
|
+
'(click)': 'clicked($event)',
|
|
328
|
+
},
|
|
329
|
+
}]
|
|
330
|
+
}] });
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Generated bundle index. Do not edit.
|
|
334
|
+
*/
|
|
335
|
+
|
|
336
|
+
export { NgbCarousel, NgbCarouselButton, NgbCarouselContainer, NgbCarouselItem, NgbCarouselSubContainer, provideCarousel };
|
|
337
|
+
//# sourceMappingURL=ngbase-adk-carousel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngbase-adk-carousel.mjs","sources":["../../../projects/adk/carousel/carousel-item.ts","../../../projects/adk/carousel/carousel.ts","../../../projects/adk/carousel/carousel-next.ts","../../../projects/adk/carousel/ngbase-adk-carousel.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\n\n@Directive({\n selector: '[ngbCarouselItem]',\n})\nexport class NgbCarouselItem {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n get width() {\n const el = this.el.nativeElement;\n return el.getBoundingClientRect?.().width ?? el.offsetWidth; // SSR: fallback to offsetWidth\n }\n}\n","import {\n Directive,\n ElementRef,\n afterNextRender,\n computed,\n contentChildren,\n effect,\n inject,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { injectDirectionality } from '@ngbase/adk/bidi';\nimport { Drag } from '@ngbase/adk/drag';\nimport { NgbCarouselItem } from './carousel-item';\n\n@Directive({\n selector: '[ngbCarouselContainer]',\n hostDirectives: [Drag],\n})\nexport class NgbCarouselContainer {\n readonly el = inject(ElementRef<HTMLElement>);\n\n get width() {\n return this.el.nativeElement.clientWidth;\n }\n}\n\n@Directive({\n selector: '[ngbCarouselSubContainer]',\n})\nexport class NgbCarouselSubContainer {\n private el = inject(ElementRef<HTMLElement>);\n private dir = injectDirectionality();\n\n updateScrollPosition(x: number, skipDirection = false) {\n const el = this.el.nativeElement;\n if (this.dir.isRtl() && !skipDirection) {\n el.style.transform = `translate3d(${x}px, 0, 0)`;\n } else {\n el.style.transform = `translate3d(${-x}px, 0, 0)`;\n }\n }\n}\n\n@Directive({\n selector: '[ngbCarousel]',\n exportAs: 'ngbCarousel',\n})\nexport class NgbCarousel {\n private drag = viewChild.required(Drag);\n private dir = injectDirectionality();\n private mainContainer = viewChild.required(NgbCarouselContainer);\n private subContainer = viewChild.required(NgbCarouselSubContainer);\n private items = contentChildren(NgbCarouselItem);\n readonly current = signal(0);\n private animationId = 0;\n // this can be overridden by the ui carousel component\n velocity = 1.1;\n\n readonly itemsPerStep = computed(() => {\n const _ = this.isReady();\n const items = this.items();\n // const totalWidth = this.totalWidth();\n const containerWidth = this.containerWidth;\n // const scrollableWidth = totalWidth - containerWidth || 1;\n const v = Math.ceil(containerWidth / (items[0].width || 1));\n return v;\n });\n\n private readonly totalWidth = computed(() => {\n const _ = this.isReady();\n const items = this.items();\n return items.reduce((acc, item) => acc + item.width, 0);\n });\n\n /**\n * This is the total number of steps that can be taken.\n * It is computed based on the container width and the width of the last item.\n * It is used to determine the number of steps that can be taken.\n * We have to consider gap between items like padding or margin or flex gap.\n */\n readonly totalSteps = computed(() => {\n // const containerWidth = this.containerWidth;\n const items = this.items();\n if (!items.length || !this.itemsPerStep()) return 0;\n\n // console.log('totalSteps', items.length, this.itemsPerStep());\n\n // const totalWidth = this.totalWidth();\n // const scrollableWidth = totalWidth;\n\n // if (scrollableWidth <= 0) return 1; // All items fit in container\n\n // // Calculate effective step size based on the smallest item width\n // // const minItemWidth = Math.min(...items.map(item => item.width));\n // const v = Math.max(1, Math.floor(scrollableWidth / containerWidth));\n // console.log('totalSteps', v, scrollableWidth, containerWidth, scrollableWidth / containerWidth);\n // return v;\n const itemsPerStep = this.itemsPerStep();\n // const totalWidth = this.totalWidth();\n // const scrollableWidth = totalWidth - this.containerWidth;\n // return Math.max(1, Math.floor(scrollableWidth / itemsPerStep));\n return Math.ceil(items.length / itemsPerStep);\n });\n\n private readonly isReady = signal(false, { equal: () => false });\n readonly isFirst = computed(() => this.current() === 0);\n readonly isLast = computed(() => this.current() === this.totalSteps() - 1);\n private currentScroll = 0;\n\n constructor() {\n afterNextRender(() => {\n this.isReady.set(true);\n this.drag().events.subscribe(event => {\n event.event?.preventDefault();\n requestAnimationFrame(() => {\n if (event.type === 'start') {\n cancelAnimationFrame(this.animationId);\n this.currentScroll = this.x();\n } else if (event.type === 'move') {\n this.currentScroll = this.x() - event.x;\n this.subContainer().updateScrollPosition(this.currentScroll, true);\n } else if (event.type === 'end') {\n const step = this.getStepBasedOnX(\n this.currentScroll,\n event.direction!,\n event.velocity!, // Convert to pixels/second\n );\n this.go(step, event.velocity!);\n }\n });\n });\n });\n\n effect(cleanup => {\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => this.isReady.set(true));\n });\n observer.observe(this.mainContainer().el.nativeElement);\n cleanup(() => observer.disconnect());\n }\n });\n\n // if the total steps changes, we need to update the current step\n // also make sure the most visible item is the current item\n effect(() => {\n const totalSteps = this.totalSteps();\n const _ = this.dir.isRtl();\n const __ = this.isReady();\n // console.log('effect', totalSteps, this.itemsPerStep());\n untracked(() => {\n const current = this.current();\n const step = current >= totalSteps ? totalSteps - 1 : current;\n this.go(step, this.velocity, true);\n });\n });\n }\n\n x() {\n const current = this.current() * this.itemsPerStep();\n const items = this.items();\n if (this.containerWidth > this.totalWidth()) return 0;\n\n const totalWidth = this.totalWidth() - this.containerWidth;\n\n const x = items.slice(0, current).reduce((a, item) => a + item.width, 0);\n return Math.min(x, totalWidth);\n }\n\n private get containerWidth() {\n return this.mainContainer().width;\n }\n\n next(step = 1) {\n const current = this.current();\n const nextStep = Math.min(current + step, this.totalSteps() - 1);\n this.go(nextStep);\n }\n\n prev(step = 1) {\n const current = this.current();\n const index = Math.max(current - step, 0);\n this.go(index);\n }\n\n go(step: number, velocity = this.velocity, withoutAnimation = false) {\n // const totalSteps = this.totalSteps();\n if (step < 0 || step >= this.totalSteps()) {\n console.log('out of bounds step', step, this.totalSteps());\n return;\n }\n this.current.set(step);\n this.animateToX(velocity, withoutAnimation); // Adjust the scaling factor as needed\n }\n\n /**\n * Determines the appropriate step based on scroll position, direction and velocity\n * @param scrollX Current scroll position\n * @param direction Drag direction\n * @param velocity Drag velocity\n * @returns The calculated step index\n */\n private getStepBasedOnX(scrollX: number, direction: 'left' | 'right', velocity: number): number {\n const currentStep = this.current();\n const totalSteps = this.totalSteps();\n const isRtl = this.dir.isRtl();\n\n // In RTL mode, invert the direction\n const effectiveDirection = isRtl ? (direction === 'left' ? 'right' : 'left') : direction;\n\n // Prevent movement on last step when trying to go forward\n if (currentStep === totalSteps - 1 && effectiveDirection === 'left') {\n return currentStep;\n }\n\n // Use velocity to determine step change\n const VELOCITY_THRESHOLD = 0.3;\n if (Math.abs(velocity) > VELOCITY_THRESHOLD) {\n if (effectiveDirection === 'left') {\n return Math.min(currentStep + 1, totalSteps - 1);\n } else {\n return Math.max(currentStep - 1, 0);\n }\n }\n\n // If velocity is low, stay at current step\n return currentStep;\n }\n\n // private updateScrollPosition(x = this.currentScroll) {\n // const el = this.subContainer().nativeElement;\n // if (this.dir.isRtl()) {\n // el.style.transform = `translate3d(${x}px, 0, 0)`;\n // } else {\n // el.style.transform = `translate3d(${-x}px, 0, 0)`;\n // }\n // }\n\n private animateToX(velocity: number, withoutAnimation = false) {\n velocity = Math.max(velocity, this.velocity);\n let lastTime = Date.now();\n const targetScroll = this.x();\n const startScroll = this.currentScroll;\n const isRtl = this.dir.isRtl();\n\n // In RTL, invert the distance calculation\n const distance = isRtl ? startScroll - targetScroll : targetScroll - startScroll;\n const duration = Math.abs(distance / velocity);\n let elapsedTime = 0;\n\n const easeOutQuad = (t: number) => t * (2 - t);\n const subContainer = this.subContainer();\n\n const animate = () => {\n const now = Date.now();\n const dt = now - lastTime;\n lastTime = now;\n elapsedTime += dt;\n\n const progress = Math.min(elapsedTime / duration, 1);\n const easedProgress = easeOutQuad(progress);\n\n // Calculate scroll position based on direction\n this.currentScroll = isRtl\n ? startScroll - distance * easedProgress\n : startScroll + distance * easedProgress;\n\n subContainer.updateScrollPosition(this.currentScroll);\n\n if (progress < 1) {\n this.animationId = requestAnimationFrame(animate);\n }\n };\n\n cancelAnimationFrame(this.animationId);\n if (!withoutAnimation) {\n this.animationId = requestAnimationFrame(animate);\n } else {\n this.currentScroll = targetScroll;\n subContainer.updateScrollPosition(this.currentScroll);\n }\n }\n\n private snapToNearest(velocity = this.velocity) {\n const items = this.items();\n let nearestIndex = 0;\n let minDistance = Infinity;\n\n for (let i = 0; i < items.length; i++) {\n const itemPosition = items.slice(0, i).reduce((acc, item) => acc + item.width, 0);\n const distance = Math.abs(this.currentScroll - itemPosition);\n if (distance < minDistance) {\n minDistance = distance;\n nearestIndex = i;\n }\n }\n\n const step = Math.floor(nearestIndex / this.itemsPerStep());\n\n this.go(step, velocity);\n // this.current.set(nearestIndex);\n // this.currentScroll = this.x();\n // this.updateScrollPosition();\n }\n}\n\nexport function provideCarousel(carousel: typeof NgbCarousel) {\n return { provide: NgbCarousel, useExisting: carousel };\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { NgbCarousel } from './carousel';\n\n@Directive({\n selector: '[ngbCarouselButton]',\n host: {\n '(click)': 'clicked($event)',\n },\n})\nexport class NgbCarouselButton {\n private readonly carousel = inject(NgbCarousel);\n\n readonly ngbCarouselButton = input.required<number | 'next' | 'prev'>();\n\n clicked(event: Event) {\n event.preventDefault();\n const no = this.ngbCarouselButton();\n if (no === 'next') {\n this.carousel.next();\n } else if (no === 'prev') {\n this.carousel.prev();\n } else {\n this.carousel.go(no);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAKa,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAMlE;AAJC,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa;AAChC,QAAA,OAAO,EAAE,CAAC,qBAAqB,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC;;8GALnD,e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