@ngbase/adk 0.1.1 → 0.1.3
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/a11y/accessibility-group.d.ts +2 -5
- package/accordion/accordion-item.d.ts +7 -1
- package/accordion/public-api.d.ts +1 -1
- package/autocomplete/autocomplete-input.d.ts +2 -4
- package/autocomplete/autocomplete.d.ts +13 -4
- package/avatar/avatar.d.ts +1 -1
- package/breadcrumb/breadcrumb.d.ts +2 -3
- package/breadcrumb/public-api.d.ts +1 -1
- package/carousel/carousel.d.ts +3 -3
- package/checkbox/checkbox.d.ts +11 -3
- package/checkbox/public-api.d.ts +1 -1
- package/chip/chip.d.ts +2 -2
- package/datepicker/calendar.d.ts +3 -3
- package/datepicker/datepicker-trigger.d.ts +22 -5
- package/datepicker/datepicker.d.ts +4 -3
- package/datepicker/time.d.ts +2 -2
- package/dialog/dialog.d.ts +1 -1
- package/drag/drag.d.ts +1 -2
- package/fesm2022/ngbase-adk-a11y.mjs +29 -26
- package/fesm2022/ngbase-adk-a11y.mjs.map +1 -1
- package/fesm2022/ngbase-adk-accordion.mjs +16 -3
- package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
- package/fesm2022/ngbase-adk-autocomplete.mjs +23 -52
- package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
- package/fesm2022/ngbase-adk-avatar.mjs +2 -2
- package/fesm2022/ngbase-adk-avatar.mjs.map +1 -1
- package/fesm2022/ngbase-adk-breadcrumb.mjs +2 -2
- package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngbase-adk-carousel.mjs +7 -7
- package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
- package/fesm2022/ngbase-adk-checkbox.mjs +8 -6
- package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -1
- package/fesm2022/ngbase-adk-chip.mjs +4 -2
- package/fesm2022/ngbase-adk-chip.mjs.map +1 -1
- package/fesm2022/ngbase-adk-datepicker.mjs +187 -350
- package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
- package/fesm2022/ngbase-adk-dialog.mjs +14 -15
- package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
- package/fesm2022/ngbase-adk-drag.mjs +1 -2
- package/fesm2022/ngbase-adk-drag.mjs.map +1 -1
- package/fesm2022/ngbase-adk-form-field.mjs +2 -156
- package/fesm2022/ngbase-adk-form-field.mjs.map +1 -1
- package/fesm2022/ngbase-adk-list.mjs +2 -2
- package/fesm2022/ngbase-adk-list.mjs.map +1 -1
- package/fesm2022/ngbase-adk-mask.mjs +5 -3
- package/fesm2022/ngbase-adk-mask.mjs.map +1 -1
- package/fesm2022/ngbase-adk-menu.mjs +34 -34
- package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
- package/fesm2022/ngbase-adk-otp.mjs +164 -0
- package/fesm2022/ngbase-adk-otp.mjs.map +1 -0
- package/fesm2022/ngbase-adk-pagination.mjs +10 -67
- package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
- package/fesm2022/ngbase-adk-popover.mjs +434 -556
- package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
- package/fesm2022/ngbase-adk-portal.mjs +5 -10
- package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
- package/fesm2022/ngbase-adk-radio.mjs +8 -19
- package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
- package/fesm2022/ngbase-adk-resizable.mjs +10 -43
- package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
- package/fesm2022/ngbase-adk-select.mjs +87 -185
- package/fesm2022/ngbase-adk-select.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sheet.mjs +95 -0
- package/fesm2022/ngbase-adk-sheet.mjs.map +1 -0
- package/fesm2022/ngbase-adk-sidenav.mjs +2 -2
- package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -1
- package/fesm2022/ngbase-adk-slider.mjs +12 -23
- package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
- package/fesm2022/ngbase-adk-sonner.mjs +13 -63
- package/fesm2022/ngbase-adk-sonner.mjs.map +1 -1
- package/fesm2022/ngbase-adk-stepper.mjs +16 -114
- package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
- package/fesm2022/ngbase-adk-switch.mjs +2 -2
- package/fesm2022/ngbase-adk-switch.mjs.map +1 -1
- package/fesm2022/ngbase-adk-table.mjs +17 -35
- package/fesm2022/ngbase-adk-table.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tabs.mjs +14 -94
- package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
- package/fesm2022/ngbase-adk-test.mjs +11 -1
- package/fesm2022/ngbase-adk-test.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tooltip.mjs +49 -39
- package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tour.mjs +3 -3
- package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
- package/fesm2022/ngbase-adk-tree.mjs +11 -43
- package/fesm2022/ngbase-adk-tree.mjs.map +1 -1
- package/fesm2022/ngbase-adk-utils.mjs +12 -9
- package/fesm2022/ngbase-adk-utils.mjs.map +1 -1
- package/form-field/public-api.d.ts +0 -1
- package/mask/mask.d.ts +1 -2
- package/menu/menu-trigger.d.ts +3 -3
- package/menu/menu.d.ts +13 -7
- package/otp/index.d.ts +5 -0
- package/{form-field → otp}/otp.d.ts +1 -1
- package/otp/public-api.d.ts +1 -0
- package/package.json +27 -19
- package/pagination/pagination.d.ts +7 -3
- package/popover/base-popover.service.d.ts +1 -1
- package/popover/popover-arrow.ng.d.ts +34 -0
- package/popover/popover.d.ts +17 -7
- package/popover/popover.service.d.ts +5 -4
- package/popover/public-api.d.ts +1 -0
- package/popover/utils.d.ts +32 -48
- package/portal/dialog-ref.d.ts +0 -1
- package/portal/portal-base.service.d.ts +3 -3
- package/portal/portal-close.directive.d.ts +3 -2
- package/radio/radio.d.ts +5 -1
- package/resizable/resizable-group.d.ts +2 -2
- package/resizable/resizable.d.ts +2 -2
- package/select/option-group.d.ts +3 -3
- package/select/option.d.ts +1 -1
- package/select/select-base.d.ts +8 -6
- package/select/select.d.ts +6 -3
- package/sheet/index.d.ts +5 -0
- package/sheet/public-api.d.ts +2 -0
- package/sheet/sheet.d.ts +26 -0
- package/sheet/sheet.service.d.ts +13 -0
- package/sidenav/public-api.d.ts +1 -1
- package/sidenav/sidenav.d.ts +1 -1
- package/slider/public-api.d.ts +1 -1
- package/slider/slider.d.ts +6 -5
- package/sonner/sonner.d.ts +2 -1
- package/stepper/animation.d.ts +1 -1
- package/stepper/step.d.ts +1 -1
- package/stepper/stepper.d.ts +2 -2
- package/switch/switch.d.ts +1 -1
- package/table/body-row.d.ts +3 -3
- package/table/head-row.d.ts +3 -3
- package/table/table.d.ts +3 -3
- package/tabs/tab-group.d.ts +4 -4
- package/tabs/tab.d.ts +2 -2
- package/test/utils.d.ts +19 -3
- package/tooltip/public-api.d.ts +1 -1
- package/tooltip/tooltip.d.ts +5 -1
- package/tooltip/tooltip.directive.d.ts +1 -1
- package/tooltip/tooltip.service.d.ts +4 -2
- package/tour/tour.service.d.ts +3 -4
- package/tree/public-api.d.ts +2 -2
- package/tree/tree-node.d.ts +2 -2
- package/tree/tree.d.ts +2 -2
- package/utils/utils.d.ts +5 -4
- package/schematics/collection.json +0 -15
- package/schematics/components/files/accordion/accordion.ts.template +0 -55
- package/schematics/components/files/accordion/index.ts.template +0 -5
- package/schematics/components/files/alert/alert.ts.template +0 -62
- package/schematics/components/files/alert/index.ts.template +0 -1
- package/schematics/components/files/autocomplete/autocomplete.ts.template +0 -48
- package/schematics/components/files/autocomplete/index.ts.template +0 -5
- package/schematics/components/files/avatar/avatar.ts.template +0 -31
- package/schematics/components/files/avatar/index.ts.template +0 -1
- package/schematics/components/files/badge/badge.ts.template +0 -11
- package/schematics/components/files/badge/index.ts.template +0 -1
- package/schematics/components/files/breadcrumb/breadcrumb.ts.template +0 -49
- package/schematics/components/files/breadcrumb/index.ts.template +0 -1
- package/schematics/components/files/button/button.ts.template +0 -29
- package/schematics/components/files/button/index.ts.template +0 -5
- package/schematics/components/files/card/card.ts.template +0 -11
- package/schematics/components/files/card/index.ts.template +0 -5
- package/schematics/components/files/carousel/carousel.ts.template +0 -44
- package/schematics/components/files/carousel/index.ts.template +0 -1
- package/schematics/components/files/checkbox/checkbox.ts.template +0 -46
- package/schematics/components/files/checkbox/focus-style.directive.ts.template +0 -12
- package/schematics/components/files/checkbox/index.ts.template +0 -6
- package/schematics/components/files/chip/chip.ts.template +0 -36
- package/schematics/components/files/chip/index.ts.template +0 -1
- package/schematics/components/files/color-picker/color-picker.ts.template +0 -104
- package/schematics/components/files/color-picker/index.ts.template +0 -5
- package/schematics/components/files/command/command.ts.template +0 -82
- package/schematics/components/files/command/index.ts.template +0 -1
- package/schematics/components/files/datepicker/calendar.ts.template +0 -117
- package/schematics/components/files/datepicker/datepicker-trigger.ts.template +0 -27
- package/schematics/components/files/datepicker/datepicker.ts.template +0 -28
- package/schematics/components/files/datepicker/index.ts.template +0 -3
- package/schematics/components/files/datepicker/time.ts.template +0 -46
- package/schematics/components/files/dialog/dialog.ts.template +0 -89
- package/schematics/components/files/dialog/index.ts.template +0 -5
- package/schematics/components/files/drawer/drawer.ts.template +0 -104
- package/schematics/components/files/drawer/index.ts.template +0 -5
- package/schematics/components/files/form-field/index.ts.template +0 -7
- package/schematics/components/files/form-field/input-style.directive.ts.template +0 -11
- package/schematics/components/files/form-field/input.ts.template +0 -100
- package/schematics/components/files/form-field/otp.ts.template +0 -37
- package/schematics/components/files/hover-card/hover-card.ts.template +0 -13
- package/schematics/components/files/hover-card/index.ts.template +0 -5
- package/schematics/components/files/icon/icon.ts.template +0 -16
- package/schematics/components/files/icon/index.ts.template +0 -1
- package/schematics/components/files/inline-edit/index.ts.template +0 -1
- package/schematics/components/files/inline-edit/inline-edit.ts.template +0 -24
- package/schematics/components/files/keys/index.ts.template +0 -5
- package/schematics/components/files/keys/key.ts.template +0 -35
- package/schematics/components/files/list/index.ts.template +0 -5
- package/schematics/components/files/list/list.ts.template +0 -28
- package/schematics/components/files/mask/index.ts.template +0 -1
- package/schematics/components/files/mask/mask.ts.template +0 -8
- package/schematics/components/files/menu/context-menu.ts.template +0 -14
- package/schematics/components/files/menu/index.ts.template +0 -8
- package/schematics/components/files/menu/mention.ts.template +0 -14
- package/schematics/components/files/menu/menu.ts.template +0 -37
- package/schematics/components/files/menu/navigation-menu.ts.template +0 -8
- package/schematics/components/files/pagination/index.ts.template +0 -1
- package/schematics/components/files/pagination/pagination.ts.template +0 -71
- package/schematics/components/files/picasa/index.ts.template +0 -1
- package/schematics/components/files/picasa/picasa-base.component.ts.template +0 -80
- package/schematics/components/files/picasa/picasa.component.ts.template +0 -57
- package/schematics/components/files/picasa/picasa.directive.ts.template +0 -41
- package/schematics/components/files/picasa/picase.service.ts.template +0 -24
- package/schematics/components/files/popover/index.ts.template +0 -1
- package/schematics/components/files/popover/popover.ts.template +0 -87
- package/schematics/components/files/progress/index.ts.template +0 -5
- package/schematics/components/files/progress/progress.ts.template +0 -14
- package/schematics/components/files/radio/index.ts.template +0 -5
- package/schematics/components/files/radio/radio.ts.template +0 -40
- package/schematics/components/files/resizable/index.ts.template +0 -5
- package/schematics/components/files/resizable/resizable.ts.template +0 -56
- package/schematics/components/files/scroll-area/index.ts.template +0 -1
- package/schematics/components/files/scroll-area/scroll-area.ts.template +0 -40
- package/schematics/components/files/select/index.ts.template +0 -8
- package/schematics/components/files/select/list-selection.ts.template +0 -15
- package/schematics/components/files/select/option.ts.template +0 -34
- package/schematics/components/files/select/select-input.ts.template +0 -21
- package/schematics/components/files/select/select.ts.template +0 -96
- package/schematics/components/files/selectable/index.ts.template +0 -1
- package/schematics/components/files/selectable/selectable.ts.template +0 -34
- package/schematics/components/files/separator/index.ts.template +0 -5
- package/schematics/components/files/separator/separator.ts.template +0 -19
- package/schematics/components/files/sheet/index.ts.template +0 -5
- package/schematics/components/files/sheet/sheet.ts.template +0 -134
- package/schematics/components/files/sidenav/index.ts.template +0 -1
- package/schematics/components/files/sidenav/sidenav.ts.template +0 -48
- package/schematics/components/files/skeleton/index.ts.template +0 -1
- package/schematics/components/files/skeleton/skeleton.ts.template +0 -15
- package/schematics/components/files/slider/index.ts.template +0 -5
- package/schematics/components/files/slider/slider.ts.template +0 -42
- package/schematics/components/files/sonner/index.ts.template +0 -5
- package/schematics/components/files/sonner/sonner.ts.template +0 -58
- package/schematics/components/files/spinner/index.ts.template +0 -1
- package/schematics/components/files/spinner/spinner.ts.template +0 -79
- package/schematics/components/files/stepper/index.ts.template +0 -1
- package/schematics/components/files/stepper/stepper.ts.template +0 -88
- package/schematics/components/files/switch/index.ts.template +0 -5
- package/schematics/components/files/switch/switch.ts.template +0 -29
- package/schematics/components/files/table/body-cell.ts.template +0 -19
- package/schematics/components/files/table/body-row.ts.template +0 -21
- package/schematics/components/files/table/column.ts.template +0 -8
- package/schematics/components/files/table/head-cell.ts.template +0 -19
- package/schematics/components/files/table/head-row.ts.template +0 -27
- package/schematics/components/files/table/index.ts.template +0 -26
- package/schematics/components/files/table/table.ts.template +0 -20
- package/schematics/components/files/tabs/index.ts.template +0 -5
- package/schematics/components/files/tabs/tab.ts.template +0 -89
- package/schematics/components/files/theme/index.ts.template +0 -2
- package/schematics/components/files/theme/theme-button.component.ts.template +0 -26
- package/schematics/components/files/theme/theme.component.ts.template +0 -165
- package/schematics/components/files/theme/theme.service.ts.template +0 -44
- package/schematics/components/files/toggle/index.ts.template +0 -5
- package/schematics/components/files/toggle/toggle.ts.template +0 -13
- package/schematics/components/files/toggle-group/index.ts.template +0 -5
- package/schematics/components/files/toggle-group/toggle-group.ts.template +0 -25
- package/schematics/components/files/tooltip/index.ts.template +0 -5
- package/schematics/components/files/tooltip/tooltip.ts.template +0 -40
- package/schematics/components/files/tour/index.ts.template +0 -3
- package/schematics/components/files/tour/tour-step.ts.template +0 -8
- package/schematics/components/files/tour/tour.service.ts.template +0 -7
- package/schematics/components/files/tour/tour.ts.template +0 -8
- package/schematics/components/files/tree/index.ts.template +0 -1
- package/schematics/components/files/tree/tree.ts.template +0 -66
- package/schematics/components/index.d.ts +0 -3
- package/schematics/components/index.js +0 -17
- package/schematics/components/index.js.map +0 -1
- package/schematics/components/index.ts +0 -29
- package/schematics/components/schema.d.ts +0 -6
- package/schematics/components/schema.js +0 -3
- package/schematics/components/schema.js.map +0 -1
- package/schematics/components/schema.json +0 -137
- package/schematics/components/schema.ts +0 -6
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Directive, signal,
|
|
2
|
+
import { input, Directive, signal, Injectable, inject } from '@angular/core';
|
|
3
3
|
import { basePortal } from '@ngbase/adk/portal';
|
|
4
4
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
5
5
|
import { uniqueId } from '@ngbase/adk/utils';
|
|
6
6
|
|
|
7
|
+
const sonnerAnimation = trigger('sonnerAnimation', [
|
|
8
|
+
state('1', style({ transform: 'none', opacity: 1 })),
|
|
9
|
+
state('void', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
10
|
+
state('0', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
11
|
+
transition('* => *', animate('300ms ease-out')),
|
|
12
|
+
]);
|
|
7
13
|
class SonnerBase {
|
|
8
14
|
constructor() {
|
|
9
15
|
this.ngbSonnerBase = input.required();
|
|
10
16
|
}
|
|
11
17
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SonnerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
12
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: SonnerBase, isStandalone: true, selector: "[ngbSonnerBase]", inputs: { ngbSonnerBase: { classPropertyName: "ngbSonnerBase", publicName: "ngbSonnerBase", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style": "{\n 'z-index': -ngbSonnerBase(),\n bottom: 16 * ngbSonnerBase() + 'px',\n visibility: ngbSonnerBase() < 3 ? 'visible' : 'hidden',\n transform: 'scale(' + (1 - ngbSonnerBase() * 0.08) + ')',\n opacity: ngbSonnerBase() < 3 ? 1 : 0,\n }", "@
|
|
18
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: SonnerBase, isStandalone: true, selector: "[ngbSonnerBase]", inputs: { ngbSonnerBase: { classPropertyName: "ngbSonnerBase", publicName: "ngbSonnerBase", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style": "{\n 'z-index': -ngbSonnerBase(),\n bottom: 16 * ngbSonnerBase() + 'px',\n visibility: ngbSonnerBase() < 3 ? 'visible' : 'hidden',\n transform: 'scale(' + (1 - ngbSonnerBase() * 0.08) + ')',\n opacity: ngbSonnerBase() < 3 ? 1 : 0,\n }", "@sonnerAnimation": "" }, styleAttribute: "position: absolute; right: 0; display: flex; flex-direction: column;" }, exportAs: ["ngbSonnerBase"], ngImport: i0 }); }
|
|
13
19
|
}
|
|
14
20
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SonnerBase, decorators: [{
|
|
15
21
|
type: Directive,
|
|
@@ -25,7 +31,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
25
31
|
transform: 'scale(' + (1 - ngbSonnerBase() * 0.08) + ')',
|
|
26
32
|
opacity: ngbSonnerBase() < 3 ? 1 : 0,
|
|
27
33
|
}`,
|
|
28
|
-
'[@
|
|
34
|
+
'[@sonnerAnimation]': '',
|
|
29
35
|
},
|
|
30
36
|
}]
|
|
31
37
|
}] });
|
|
@@ -49,69 +55,13 @@ class NgbSonner {
|
|
|
49
55
|
clear() {
|
|
50
56
|
this.messages.set([]);
|
|
51
57
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSonner, deps: [], target: i0.ɵɵFactoryTarget.
|
|
53
|
-
static { this.ɵ
|
|
54
|
-
<ul class="fixed bottom-0 right-0 flex flex-col gap-2">
|
|
55
|
-
@for (msg of messages(); track msg.id) {
|
|
56
|
-
<li
|
|
57
|
-
[ngbSonnerBase]="$index"
|
|
58
|
-
class="{{
|
|
59
|
-
'm-4 w-96 gap-1 rounded-lg border bg-foreground p-4 shadow-lg transition-all duration-300' +
|
|
60
|
-
(msg.type === 'success' ? ' bg-green-50 text-green-600' : '') +
|
|
61
|
-
(msg.type === 'error' ? ' bg-red-50 text-red-600' : '') +
|
|
62
|
-
(msg.type === 'warning' ? ' bg-yellow-50 text-yellow-600' : '')
|
|
63
|
-
}}"
|
|
64
|
-
>
|
|
65
|
-
<h4 class="flex items-center gap-2 font-semibold">{{ msg.message }}</h4>
|
|
66
|
-
@if (msg.data?.description) {
|
|
67
|
-
<p class="text-muted">{{ msg.data?.description }}</p>
|
|
68
|
-
}
|
|
69
|
-
</li>
|
|
70
|
-
}
|
|
71
|
-
</ul>
|
|
72
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: SonnerBase, selector: "[ngbSonnerBase]", inputs: ["ngbSonnerBase"], exportAs: ["ngbSonnerBase"] }], animations: [
|
|
73
|
-
trigger('slideInOutAnimation', [
|
|
74
|
-
state('1', style({ transform: 'none', opacity: 1 })),
|
|
75
|
-
state('void', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
76
|
-
state('0', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
77
|
-
transition('* => *', animate('300ms ease-out')),
|
|
78
|
-
]),
|
|
79
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSonner, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
59
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSonner, isStandalone: true, selector: "ngb-sonner", ngImport: i0 }); }
|
|
80
60
|
}
|
|
81
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSonner, decorators: [{
|
|
82
|
-
type:
|
|
62
|
+
type: Directive,
|
|
83
63
|
args: [{
|
|
84
64
|
selector: 'ngb-sonner',
|
|
85
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
86
|
-
imports: [SonnerBase],
|
|
87
|
-
template: `
|
|
88
|
-
<ul class="fixed bottom-0 right-0 flex flex-col gap-2">
|
|
89
|
-
@for (msg of messages(); track msg.id) {
|
|
90
|
-
<li
|
|
91
|
-
[ngbSonnerBase]="$index"
|
|
92
|
-
class="{{
|
|
93
|
-
'm-4 w-96 gap-1 rounded-lg border bg-foreground p-4 shadow-lg transition-all duration-300' +
|
|
94
|
-
(msg.type === 'success' ? ' bg-green-50 text-green-600' : '') +
|
|
95
|
-
(msg.type === 'error' ? ' bg-red-50 text-red-600' : '') +
|
|
96
|
-
(msg.type === 'warning' ? ' bg-yellow-50 text-yellow-600' : '')
|
|
97
|
-
}}"
|
|
98
|
-
>
|
|
99
|
-
<h4 class="flex items-center gap-2 font-semibold">{{ msg.message }}</h4>
|
|
100
|
-
@if (msg.data?.description) {
|
|
101
|
-
<p class="text-muted">{{ msg.data?.description }}</p>
|
|
102
|
-
}
|
|
103
|
-
</li>
|
|
104
|
-
}
|
|
105
|
-
</ul>
|
|
106
|
-
`,
|
|
107
|
-
animations: [
|
|
108
|
-
trigger('slideInOutAnimation', [
|
|
109
|
-
state('1', style({ transform: 'none', opacity: 1 })),
|
|
110
|
-
state('void', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
111
|
-
state('0', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
112
|
-
transition('* => *', animate('300ms ease-out')),
|
|
113
|
-
]),
|
|
114
|
-
],
|
|
115
65
|
}]
|
|
116
66
|
}] });
|
|
117
67
|
|
|
@@ -172,5 +122,5 @@ function ngbSonnerPortal(component) {
|
|
|
172
122
|
* Generated bundle index. Do not edit.
|
|
173
123
|
*/
|
|
174
124
|
|
|
175
|
-
export { NgbSonner, SonnerBase, SonnerService, ngbSonnerPortal };
|
|
125
|
+
export { NgbSonner, SonnerBase, SonnerService, ngbSonnerPortal, sonnerAnimation };
|
|
176
126
|
//# sourceMappingURL=ngbase-adk-sonner.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngbase-adk-sonner.mjs","sources":["../../../projects/adk/sonner/sonner.ts","../../../projects/adk/sonner/sonner.service.ts","../../../projects/adk/sonner/public-api.ts","../../../projects/adk/sonner/ngbase-adk-sonner.ts"],"sourcesContent":["import { animate, state, style, transition, trigger } from '@angular/animations';\nimport { ChangeDetectionStrategy, Component, Directive, input, signal } from '@angular/core';\nimport { uniqueId } from '@ngbase/adk/utils';\n\n@Directive({\n selector: '[ngbSonnerBase]',\n exportAs: 'ngbSonnerBase',\n host: {\n style: `position: absolute; right: 0; display: flex; flex-direction: column;`,\n '[style]': `{\n 'z-index': -ngbSonnerBase(),\n bottom: 16 * ngbSonnerBase() + 'px',\n visibility: ngbSonnerBase() < 3 ? 'visible' : 'hidden',\n transform: 'scale(' + (1 - ngbSonnerBase() * 0.08) + ')',\n opacity: ngbSonnerBase() < 3 ? 1 : 0,\n }`,\n '[@slideInOutAnimation]': '',\n },\n})\nexport class SonnerBase {\n readonly ngbSonnerBase = input.required<number>();\n}\n\n@Component({\n selector: 'ngb-sonner',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SonnerBase],\n template: `\n <ul class=\"fixed bottom-0 right-0 flex flex-col gap-2\">\n @for (msg of messages(); track msg.id) {\n <li\n [ngbSonnerBase]=\"$index\"\n class=\"{{\n 'm-4 w-96 gap-1 rounded-lg border bg-foreground p-4 shadow-lg transition-all duration-300' +\n (msg.type === 'success' ? ' bg-green-50 text-green-600' : '') +\n (msg.type === 'error' ? ' bg-red-50 text-red-600' : '') +\n (msg.type === 'warning' ? ' bg-yellow-50 text-yellow-600' : '')\n }}\"\n >\n <h4 class=\"flex items-center gap-2 font-semibold\">{{ msg.message }}</h4>\n @if (msg.data?.description) {\n <p class=\"text-muted\">{{ msg.data?.description }}</p>\n }\n </li>\n }\n </ul>\n `,\n animations: [\n trigger('slideInOutAnimation', [\n state('1', style({ transform: 'none', opacity: 1 })),\n state('void', style({ transform: 'translateY(100%)', opacity: 0 })),\n state('0', style({ transform: 'translateY(100%)', opacity: 0 })),\n transition('* => *', animate('300ms ease-out')),\n ]),\n ],\n})\nexport class NgbSonner {\n readonly messages = signal<SonnerMessage[]>([]);\n\n addMessage(message: string, type: SonnerType, data?: SonnerData) {\n const id = uniqueId();\n const { timeout = 3000 } = data ?? {};\n\n // push the new message to the top of the list\n // so that it will be displayed first\n // also the index is less than 3, the message will be visible\n this.messages.update(x => [{ id, message, data, type }, ...x]);\n\n if (timeout === 0) return;\n setTimeout(() => {\n this.messages.update(x => x.filter(msg => msg.id !== id));\n }, timeout);\n }\n\n clear() {\n this.messages.set([]);\n }\n}\n\nexport interface SonnerMessage {\n message: string;\n data?: SonnerData;\n type?: SonnerType;\n id?: string;\n}\n\nexport type SonnerType = 'default' | 'success' | 'error' | 'warning' | 'info';\n\nexport interface SonnerData {\n description?: string;\n timeout?: number;\n}\n","import { ComponentRef, inject, Injectable, Type } from '@angular/core';\nimport { basePortal, DialogRef } from '@ngbase/adk/portal';\nimport { NgbSonner, SonnerData, SonnerType } from './sonner';\n\n@Injectable({ providedIn: 'root' })\nexport class SonnerService {\n private NAME = 'sonner';\n private base = basePortal(this.NAME, NgbSonner);\n private sonner: { parent: ComponentRef<NgbSonner>; diaRef: DialogRef<NgbSonner> } | undefined;\n\n updateSonner(component: Type<NgbSonner> = NgbSonner) {\n this.base.updateBaseComponent(component);\n }\n\n addMessage(message: string, type: SonnerType, data?: SonnerData) {\n if (!this.sonner) {\n const { parent, diaRef } = this.base.open();\n this.sonner = { parent, diaRef };\n }\n this.sonner.parent.instance.addMessage(message, type, data);\n }\n\n closeAll() {\n this.sonner?.parent.instance.clear();\n }\n}\n\nexport function ngbSonnerPortal(component?: Type<NgbSonner>) {\n const sonnerService = inject(SonnerService);\n\n sonnerService.updateSonner(component);\n\n function closeAll() {\n sonnerService.closeAll();\n }\n\n function message(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'default', data);\n }\n\n function success(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'success', data);\n }\n\n function error(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'error', data);\n }\n\n function warning(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'warning', data);\n }\n\n function info(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'info', data);\n }\n\n return { message, success, error, warning, info, closeAll };\n}\n","/*\n * Public API Surface of sonner\n */\n\nexport * from './sonner.service';\nexport * from './sonner';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAmBa,UAAU,CAAA;AAfvB,IAAA,WAAA,GAAA;AAgBW,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAU;AAClD;8GAFY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,aAAA,EAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,uQAAA,EAAA,sBAAA,EAAA,EAAA,EAAA,EAAA,cAAA,EAAA,sEAAA,EAAA,EAAA,QAA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AC,OAAe,EAAE,IAAiB,EAAA;QAC9C,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC;;AAGjD,IAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC7D;;ACzDA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngbase-adk-sonner.mjs","sources":["../../../projects/adk/sonner/sonner.ts","../../../projects/adk/sonner/sonner.service.ts","../../../projects/adk/sonner/public-api.ts","../../../projects/adk/sonner/ngbase-adk-sonner.ts"],"sourcesContent":["import { animate, state, style, transition, trigger } from '@angular/animations';\nimport { Directive, input, signal } from '@angular/core';\nimport { uniqueId } from '@ngbase/adk/utils';\n\nexport const sonnerAnimation = trigger('sonnerAnimation', [\n state('1', style({ transform: 'none', opacity: 1 })),\n state('void', style({ transform: 'translateY(100%)', opacity: 0 })),\n state('0', style({ transform: 'translateY(100%)', opacity: 0 })),\n transition('* => *', animate('300ms ease-out')),\n]);\n\n@Directive({\n selector: '[ngbSonnerBase]',\n exportAs: 'ngbSonnerBase',\n host: {\n style: `position: absolute; right: 0; display: flex; flex-direction: column;`,\n '[style]': `{\n 'z-index': -ngbSonnerBase(),\n bottom: 16 * ngbSonnerBase() + 'px',\n visibility: ngbSonnerBase() < 3 ? 'visible' : 'hidden',\n transform: 'scale(' + (1 - ngbSonnerBase() * 0.08) + ')',\n opacity: ngbSonnerBase() < 3 ? 1 : 0,\n }`,\n '[@sonnerAnimation]': '',\n },\n})\nexport class SonnerBase {\n readonly ngbSonnerBase = input.required<number>();\n}\n\n@Directive({\n selector: 'ngb-sonner',\n})\nexport class NgbSonner {\n readonly messages = signal<SonnerMessage[]>([]);\n\n addMessage(message: string, type: SonnerType, data?: SonnerData) {\n const id = uniqueId();\n const { timeout = 3000 } = data ?? {};\n\n // push the new message to the top of the list\n // so that it will be displayed first\n // also the index is less than 3, the message will be visible\n this.messages.update(x => [{ id, message, data, type }, ...x]);\n\n if (timeout === 0) return;\n setTimeout(() => {\n this.messages.update(x => x.filter(msg => msg.id !== id));\n }, timeout);\n }\n\n clear() {\n this.messages.set([]);\n }\n}\n\nexport interface SonnerMessage {\n message: string;\n data?: SonnerData;\n type?: SonnerType;\n id?: string;\n}\n\nexport type SonnerType = 'default' | 'success' | 'error' | 'warning' | 'info';\n\nexport interface SonnerData {\n description?: string;\n timeout?: number;\n}\n","import { ComponentRef, inject, Injectable, Type } from '@angular/core';\nimport { basePortal, DialogRef } from '@ngbase/adk/portal';\nimport { NgbSonner, SonnerData, SonnerType } from './sonner';\n\n@Injectable({ providedIn: 'root' })\nexport class SonnerService {\n private NAME = 'sonner';\n private base = basePortal(this.NAME, NgbSonner);\n private sonner: { parent: ComponentRef<NgbSonner>; diaRef: DialogRef<NgbSonner> } | undefined;\n\n updateSonner(component: Type<NgbSonner> = NgbSonner) {\n this.base.updateBaseComponent(component);\n }\n\n addMessage(message: string, type: SonnerType, data?: SonnerData) {\n if (!this.sonner) {\n const { parent, diaRef } = this.base.open();\n this.sonner = { parent, diaRef };\n }\n this.sonner.parent.instance.addMessage(message, type, data);\n }\n\n closeAll() {\n this.sonner?.parent.instance.clear();\n }\n}\n\nexport function ngbSonnerPortal(component?: Type<NgbSonner>) {\n const sonnerService = inject(SonnerService);\n\n sonnerService.updateSonner(component);\n\n function closeAll() {\n sonnerService.closeAll();\n }\n\n function message(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'default', data);\n }\n\n function success(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'success', data);\n }\n\n function error(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'error', data);\n }\n\n function warning(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'warning', data);\n }\n\n function info(message: string, data?: SonnerData) {\n sonnerService.addMessage(message, 'info', data);\n }\n\n return { message, success, error, warning, info, closeAll };\n}\n","/*\n * Public API Surface of sonner\n */\n\nexport * from './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AA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AAuB5B,SAAU,eAAe,CAAC,SAA2B,EAAA;AACzD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AAE3C,IAAA,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC;AAErC,IAAA,SAAS,QAAQ,GAAA;QACf,aAAa,CAAC,QAAQ,EAAE;;AAG1B,IAAA,SAAS,OAAO,CAAC,OAAe,EAAE,IAAiB,EAAA;QACjD,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC;;AAGpD,IAAA,SAAS,OAAO,CAAC,OAAe,EAAE,IAAiB,EAAA;QACjD,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC;;AAGpD,IAAA,SAAS,KAAK,CAAC,OAAe,EAAE,IAAiB,EAAA;QAC/C,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC;;AAGlD,IAAA,SAAS,OAAO,CAAC,OAAe,EAAE,IAAiB,EAAA;QACjD,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC;;AAGpD,IAAA,SAAS,IAAI,CAAC,OAAe,EAAE,IAAiB,EAAA;QAC9C,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC;;AAGjD,IAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC7D;;ACzDA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, contentChild, TemplateRef, viewChild, input, computed,
|
|
2
|
+
import { inject, contentChild, TemplateRef, viewChild, input, computed, Directive, contentChildren, model } from '@angular/core';
|
|
4
3
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
5
4
|
|
|
6
|
-
const slideAnimation = trigger('slide', [
|
|
7
|
-
state('void', style({ height: '0', overflow: 'hidden' })),
|
|
8
|
-
state('*', style({ height: '*' })),
|
|
9
|
-
transition('void => *', animate('200ms ease')),
|
|
10
|
-
transition('* => void', animate('200ms ease')),
|
|
11
|
-
]);
|
|
12
|
-
|
|
13
5
|
class NgbStep {
|
|
14
6
|
constructor() {
|
|
15
7
|
this.stepper = inject(NgbStepper);
|
|
@@ -22,30 +14,13 @@ class NgbStep {
|
|
|
22
14
|
this.horizontalTemplate = computed(() => this.stepper.direction() === 'horizontal' && this.template());
|
|
23
15
|
this.verticalTemplate = computed(() => this.stepper.direction() === 'vertical' && this.template());
|
|
24
16
|
}
|
|
25
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbStep, deps: [], target: i0.ɵɵFactoryTarget.
|
|
26
|
-
static { this.ɵ
|
|
27
|
-
<ng-container *ngTemplateOutlet="template" />
|
|
28
|
-
}
|
|
29
|
-
<ng-template #stepContainer>
|
|
30
|
-
<div class="py-4">
|
|
31
|
-
<ng-content />
|
|
32
|
-
</div>
|
|
33
|
-
</ng-template> `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbStep, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
18
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbStep, isStandalone: true, selector: "[ngbStep]", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "header", first: true, predicate: NgbStepHeader, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "stepContainer", first: true, predicate: ["stepContainer"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0 }); }
|
|
34
19
|
}
|
|
35
20
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbStep, decorators: [{
|
|
36
|
-
type:
|
|
21
|
+
type: Directive,
|
|
37
22
|
args: [{
|
|
38
23
|
selector: '[ngbStep]',
|
|
39
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
40
|
-
imports: [NgTemplateOutlet],
|
|
41
|
-
template: `@if (horizontalTemplate(); as template) {
|
|
42
|
-
<ng-container *ngTemplateOutlet="template" />
|
|
43
|
-
}
|
|
44
|
-
<ng-template #stepContainer>
|
|
45
|
-
<div class="py-4">
|
|
46
|
-
<ng-content />
|
|
47
|
-
</div>
|
|
48
|
-
</ng-template> `,
|
|
49
24
|
}]
|
|
50
25
|
}] });
|
|
51
26
|
class NgbStepHeader {
|
|
@@ -108,104 +83,31 @@ class NgbStepper {
|
|
|
108
83
|
prevStep() {
|
|
109
84
|
this.activeIndex.update(index => Math.max(index - 1, 0));
|
|
110
85
|
}
|
|
111
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbStepper, deps: [], target: i0.ɵɵFactoryTarget.
|
|
112
|
-
static { this.ɵ
|
|
113
|
-
<div class="flex justify-between" [class.flex-col]="direction() === 'vertical'">
|
|
114
|
-
@for (step of steps(); track step) {
|
|
115
|
-
<div
|
|
116
|
-
[ngbStepperStep]="$index"
|
|
117
|
-
class="{{
|
|
118
|
-
'relative flex [&:not(:last-child)]:flex-1 [&:not(:last-child)]:after:mx-2 [&:not(:last-child)]:after:block [&:not(:last-child)]:after:flex-1 [&:not(:last-child)]:after:bg-background [&:not(:last-child)]:after:transition-colors' +
|
|
119
|
-
(activeIndex() > $index ? ' [&:not(:last-child)]:after:bg-primary' : '') +
|
|
120
|
-
(direction() === 'vertical'
|
|
121
|
-
? ' flex-col [&:not(:last-child)]:after:absolute [&:not(:last-child)]:after:bottom-0 [&:not(:last-child)]:after:left-3 [&:not(:last-child)]:after:top-10 [&:not(:last-child)]:after:w-0.5'
|
|
122
|
-
: 'items-center [&:not(:last-child)]:after:h-0.5')
|
|
123
|
-
}}"
|
|
124
|
-
>
|
|
125
|
-
<div class="flex items-center">
|
|
126
|
-
<div
|
|
127
|
-
class="mr-2 grid aspect-square w-10 place-content-center rounded-full border-2 transition-colors"
|
|
128
|
-
[class.bg-primary]="activeIndex() > $index"
|
|
129
|
-
[class.border-primary]="activeIndex() >= $index"
|
|
130
|
-
>
|
|
131
|
-
{{ $index + 1 }}
|
|
132
|
-
</div>
|
|
133
|
-
@if (step.header(); as header) {
|
|
134
|
-
<ng-container *ngTemplateOutlet="header" />
|
|
135
|
-
} @else {
|
|
136
|
-
{{ step.title() }}
|
|
137
|
-
}
|
|
138
|
-
</div>
|
|
139
|
-
@if (step.verticalTemplate(); as template) {
|
|
140
|
-
<div class="ml-12 min-h-4">
|
|
141
|
-
<div [@slide]>
|
|
142
|
-
<ng-container *ngTemplateOutlet="template" />
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
}
|
|
146
|
-
</div>
|
|
147
|
-
}
|
|
148
|
-
</div>
|
|
149
|
-
<ng-content />
|
|
150
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgbStepperStep, selector: "[ngbStepperStep]", inputs: ["ngbStepperStep"] }], animations: [slideAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
86
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbStepper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
87
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbStepper, isStandalone: true, selector: "[ngbStepper]", inputs: { activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange" }, queries: [{ propertyName: "steps", predicate: NgbStep, isSignal: true }], exportAs: ["ngbStepper"], ngImport: i0 }); }
|
|
151
88
|
}
|
|
152
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbStepper, decorators: [{
|
|
153
|
-
type:
|
|
90
|
+
type: Directive,
|
|
154
91
|
args: [{
|
|
155
92
|
selector: '[ngbStepper]',
|
|
156
93
|
exportAs: 'ngbStepper',
|
|
157
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
158
|
-
imports: [NgTemplateOutlet, NgbStepperStep],
|
|
159
|
-
template: `
|
|
160
|
-
<div class="flex justify-between" [class.flex-col]="direction() === 'vertical'">
|
|
161
|
-
@for (step of steps(); track step) {
|
|
162
|
-
<div
|
|
163
|
-
[ngbStepperStep]="$index"
|
|
164
|
-
class="{{
|
|
165
|
-
'relative flex [&:not(:last-child)]:flex-1 [&:not(:last-child)]:after:mx-2 [&:not(:last-child)]:after:block [&:not(:last-child)]:after:flex-1 [&:not(:last-child)]:after:bg-background [&:not(:last-child)]:after:transition-colors' +
|
|
166
|
-
(activeIndex() > $index ? ' [&:not(:last-child)]:after:bg-primary' : '') +
|
|
167
|
-
(direction() === 'vertical'
|
|
168
|
-
? ' flex-col [&:not(:last-child)]:after:absolute [&:not(:last-child)]:after:bottom-0 [&:not(:last-child)]:after:left-3 [&:not(:last-child)]:after:top-10 [&:not(:last-child)]:after:w-0.5'
|
|
169
|
-
: 'items-center [&:not(:last-child)]:after:h-0.5')
|
|
170
|
-
}}"
|
|
171
|
-
>
|
|
172
|
-
<div class="flex items-center">
|
|
173
|
-
<div
|
|
174
|
-
class="mr-2 grid aspect-square w-10 place-content-center rounded-full border-2 transition-colors"
|
|
175
|
-
[class.bg-primary]="activeIndex() > $index"
|
|
176
|
-
[class.border-primary]="activeIndex() >= $index"
|
|
177
|
-
>
|
|
178
|
-
{{ $index + 1 }}
|
|
179
|
-
</div>
|
|
180
|
-
@if (step.header(); as header) {
|
|
181
|
-
<ng-container *ngTemplateOutlet="header" />
|
|
182
|
-
} @else {
|
|
183
|
-
{{ step.title() }}
|
|
184
|
-
}
|
|
185
|
-
</div>
|
|
186
|
-
@if (step.verticalTemplate(); as template) {
|
|
187
|
-
<div class="ml-12 min-h-4">
|
|
188
|
-
<div [@slide]>
|
|
189
|
-
<ng-container *ngTemplateOutlet="template" />
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
}
|
|
193
|
-
</div>
|
|
194
|
-
}
|
|
195
|
-
</div>
|
|
196
|
-
<ng-content />
|
|
197
|
-
`,
|
|
198
|
-
animations: [slideAnimation],
|
|
199
94
|
}]
|
|
200
95
|
}] });
|
|
201
|
-
const
|
|
96
|
+
const aliasStepper = (stepper) => ({
|
|
202
97
|
provide: NgbStepper,
|
|
203
98
|
useExisting: stepper,
|
|
204
99
|
});
|
|
205
100
|
|
|
101
|
+
const stepperAnimation = trigger('slide', [
|
|
102
|
+
state('void', style({ height: '0', overflow: 'hidden' })),
|
|
103
|
+
state('*', style({ height: '*' })),
|
|
104
|
+
transition('void => *', animate('200ms ease')),
|
|
105
|
+
transition('* => void', animate('200ms ease')),
|
|
106
|
+
]);
|
|
107
|
+
|
|
206
108
|
/**
|
|
207
109
|
* Generated bundle index. Do not edit.
|
|
208
110
|
*/
|
|
209
111
|
|
|
210
|
-
export { NgbStep, NgbStepHeader, NgbStepper, NgbStepperStep,
|
|
112
|
+
export { NgbStep, NgbStepHeader, NgbStepper, NgbStepperStep, aliasStepper, provideStep, stepperAnimation };
|
|
211
113
|
//# sourceMappingURL=ngbase-adk-stepper.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngbase-adk-stepper.mjs","sources":["../../../projects/adk/stepper/animation.ts","../../../projects/adk/stepper/step.ts","../../../projects/adk/stepper/stepper.ts","../../../projects/adk/stepper/ngbase-adk-stepper.ts"],"sourcesContent":["import { trigger, state, style, transition, animate } from '@angular/animations';\n\nexport const slideAnimation = trigger('slide', [\n state('void', style({ height: '0', overflow: 'hidden' })),\n state('*', style({ height: '*' })),\n transition('void => *', animate('200ms ease')),\n transition('* => void', animate('200ms ease')),\n]);\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n TemplateRef,\n computed,\n contentChild,\n inject,\n input,\n viewChild,\n} from '@angular/core';\nimport { NgbStepper } from './stepper';\n\n@Component({\n selector: '[ngbStep]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n template: `@if (horizontalTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template\" />\n }\n <ng-template #stepContainer>\n <div class=\"py-4\">\n <ng-content />\n </div>\n </ng-template> `,\n})\nexport class NgbStep {\n readonly stepper = inject(NgbStepper);\n readonly header = contentChild(NgbStepHeader, { read: TemplateRef });\n readonly stepContainer = viewChild.required('stepContainer', { read: TemplateRef });\n\n readonly title = input<any>('Tab');\n\n readonly index = computed(() => this.stepper.steps().indexOf(this));\n readonly active = computed(() => this.stepper.activeIndex() === this.index());\n private readonly template = computed(() => (this.active() ? this.stepContainer() : null));\n readonly horizontalTemplate = computed(\n () => this.stepper.direction() === 'horizontal' && this.template(),\n );\n readonly verticalTemplate = computed(\n () => this.stepper.direction() === 'vertical' && this.template(),\n );\n}\n\n@Directive({\n selector: '[ngbStepHeader]',\n})\nexport class NgbStepHeader {}\n\nexport const provideStep = (step: typeof NgbStep) => ({\n provide: NgbStep,\n useExisting: step,\n});\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n Directive,\n inject,\n input,\n model,\n} from '@angular/core';\nimport { slideAnimation } from './animation';\nimport { NgbStep } from './step';\n\n@Directive({\n selector: '[ngbStepperStep]',\n host: {\n '[attr.data-status]': 'status()',\n '[attr.aria-current]': 'status() === \"active\" ? true : undefined',\n '[attr.data-orientation]': 'stepper.direction()',\n '[attr.data-index]': '!last() ? true : undefined',\n },\n})\nexport class NgbStepperStep {\n readonly stepper = inject(NgbStepper);\n readonly ngbStepperStep = input(0);\n readonly last = computed(() => this.ngbStepperStep() === this.stepper.steps().length - 1);\n readonly status = computed(() => {\n const index = this.ngbStepperStep();\n const activeIndex = this.stepper.activeIndex();\n\n if (index < activeIndex) return 'completed';\n if (index === activeIndex) return 'active';\n return 'inactive';\n });\n}\n\n@Component({\n selector: '[ngbStepper]',\n exportAs: 'ngbStepper',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, NgbStepperStep],\n template: `\n <div class=\"flex justify-between\" [class.flex-col]=\"direction() === 'vertical'\">\n @for (step of steps(); track step) {\n <div\n [ngbStepperStep]=\"$index\"\n class=\"{{\n 'relative flex [&:not(:last-child)]:flex-1 [&:not(:last-child)]:after:mx-2 [&:not(:last-child)]:after:block [&:not(:last-child)]:after:flex-1 [&:not(:last-child)]:after:bg-background [&:not(:last-child)]:after:transition-colors' +\n (activeIndex() > $index ? ' [&:not(:last-child)]:after:bg-primary' : '') +\n (direction() === 'vertical'\n ? ' flex-col [&:not(:last-child)]:after:absolute [&:not(:last-child)]:after:bottom-0 [&:not(:last-child)]:after:left-3 [&:not(:last-child)]:after:top-10 [&:not(:last-child)]:after:w-0.5'\n : 'items-center [&:not(:last-child)]:after:h-0.5')\n }}\"\n >\n <div class=\"flex items-center\">\n <div\n class=\"mr-2 grid aspect-square w-10 place-content-center rounded-full border-2 transition-colors\"\n [class.bg-primary]=\"activeIndex() > $index\"\n [class.border-primary]=\"activeIndex() >= $index\"\n >\n {{ $index + 1 }}\n </div>\n @if (step.header(); as header) {\n <ng-container *ngTemplateOutlet=\"header\" />\n } @else {\n {{ step.title() }}\n }\n </div>\n @if (step.verticalTemplate(); as template) {\n <div class=\"ml-12 min-h-4\">\n <div [@slide]>\n <ng-container *ngTemplateOutlet=\"template\" />\n </div>\n </div>\n }\n </div>\n }\n </div>\n <ng-content />\n `,\n animations: [slideAnimation],\n})\nexport class NgbStepper {\n readonly steps = contentChildren(NgbStep);\n readonly activeIndex = model(0);\n readonly direction = input<'horizontal' | 'vertical'>('horizontal');\n\n readonly first = computed(() => this.activeIndex() === 0);\n readonly last = computed(() => this.activeIndex() === this.steps().length - 1);\n readonly completed = computed(() => this.activeIndex() === this.steps().length);\n\n nextStep() {\n this.activeIndex.update(index => Math.min(index + 1, this.steps().length));\n }\n\n prevStep() {\n this.activeIndex.update(index => Math.max(index - 1, 0));\n }\n}\n\nexport const provideStepper = (stepper: typeof NgbStepper) => ({\n provide: NgbStepper,\n useExisting: stepper,\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEa,MAAA,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE;AAC7C,IAAA,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAClC,IAAA,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;AAC9C,IAAA,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAA;;MCoBY,OAAO,CAAA;AAbpB,IAAA,WAAA,GAAA;AAcW,QAAA,IAAA,CAAA,OAAO,G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,MAAA,EAAA,CAAA,CAAA;;2FAEjB,UAAU,EAAA,UAAA,EAAA,CAAA;kBA9CtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,cAAc,CAAC;AAC3C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCT,EAAA,CAAA;oBACD,UAAU,EAAE,CAAC,cAAc,CAAC;AAC7B,iBAAA;;MAmBY,cAAc,GAAG,CAAC,OAA0B,MAAM;AAC7D,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,WAAW,EAAE,OAAO;AACrB,CAAA;;ACxGD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngbase-adk-stepper.mjs","sources":["../../../projects/adk/stepper/step.ts","../../../projects/adk/stepper/stepper.ts","../../../projects/adk/stepper/animation.ts","../../../projects/adk/stepper/ngbase-adk-stepper.ts"],"sourcesContent":["import {\n Directive,\n TemplateRef,\n computed,\n contentChild,\n inject,\n input,\n viewChild,\n} from '@angular/core';\nimport { NgbStepper } from './stepper';\n\n@Directive({\n selector: '[ngbStep]',\n})\nexport class NgbStep {\n readonly stepper = inject(NgbStepper);\n readonly header = contentChild(NgbStepHeader, { read: TemplateRef });\n readonly stepContainer = viewChild.required('stepContainer', { read: TemplateRef });\n\n readonly title = input<any>('Tab');\n\n readonly index = computed(() => this.stepper.steps().indexOf(this));\n readonly active = computed(() => this.stepper.activeIndex() === this.index());\n private readonly template = computed(() => (this.active() ? this.stepContainer() : null));\n readonly horizontalTemplate = computed(\n () => this.stepper.direction() === 'horizontal' && this.template(),\n );\n readonly verticalTemplate = computed(\n () => this.stepper.direction() === 'vertical' && this.template(),\n );\n}\n\n@Directive({\n selector: '[ngbStepHeader]',\n})\nexport class NgbStepHeader {}\n\nexport const provideStep = (step: typeof NgbStep) => ({\n provide: NgbStep,\n useExisting: step,\n});\n","import { computed, contentChildren, Directive, inject, input, model } from '@angular/core';\nimport { NgbStep } from './step';\n\n@Directive({\n selector: '[ngbStepperStep]',\n host: {\n '[attr.data-status]': 'status()',\n '[attr.aria-current]': 'status() === \"active\" ? true : undefined',\n '[attr.data-orientation]': 'stepper.direction()',\n '[attr.data-index]': '!last() ? true : undefined',\n },\n})\nexport class NgbStepperStep {\n readonly stepper = inject(NgbStepper);\n readonly ngbStepperStep = input(0);\n readonly last = computed(() => this.ngbStepperStep() === this.stepper.steps().length - 1);\n readonly status = computed(() => {\n const index = this.ngbStepperStep();\n const activeIndex = this.stepper.activeIndex();\n\n if (index < activeIndex) return 'completed';\n if (index === activeIndex) return 'active';\n return 'inactive';\n });\n}\n\n@Directive({\n selector: '[ngbStepper]',\n exportAs: 'ngbStepper',\n})\nexport class NgbStepper {\n readonly steps = contentChildren(NgbStep);\n\n readonly activeIndex = model(0);\n readonly direction = input<'horizontal' | 'vertical'>('horizontal');\n\n readonly first = computed(() => this.activeIndex() === 0);\n readonly last = computed(() => this.activeIndex() === this.steps().length - 1);\n readonly completed = computed(() => this.activeIndex() === this.steps().length);\n\n nextStep() {\n this.activeIndex.update(index => Math.min(index + 1, this.steps().length));\n }\n\n prevStep() {\n this.activeIndex.update(index => Math.max(index - 1, 0));\n }\n}\n\nexport const aliasStepper = (stepper: typeof NgbStepper) => ({\n provide: NgbStepper,\n useExisting: stepper,\n});\n","import { trigger, state, style, transition, animate } from '@angular/animations';\n\nexport const stepperAnimation = trigger('slide', [\n state('void', style({ height: '0', overflow: 'hidden' })),\n state('*', style({ height: '*' })),\n transition('void => *', animate('200ms ease')),\n transition('* => void', animate('200ms ease')),\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAca,OAAO,CAAA;AAHpB,IAAA,WAAA,GAAA;AAIW,QAAA,IA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A,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAD7B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACvB,iBAAA;;MAoBY,YAAY,GAAG,CAAC,OAA0B,MAAM;AAC3D,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,WAAW,EAAE,OAAO;AACrB,CAAA;;AClDY,MAAA,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE;AAC/C,IAAA,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAClC,IAAA,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;AAC9C,IAAA,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAA;;ACPD;;AAEG;;;;"}
|
|
@@ -99,7 +99,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
99
99
|
function _provide(ngbSwitch) {
|
|
100
100
|
return [provideValueAccessor(ngbSwitch)];
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function aliasSwitch(ngbSwitch) {
|
|
103
103
|
return [_provide(ngbSwitch), { provide: NgbSwitch, useExisting: ngbSwitch }];
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -111,5 +111,5 @@ function provideSwitch(ngbSwitch) {
|
|
|
111
111
|
* Generated bundle index. Do not edit.
|
|
112
112
|
*/
|
|
113
113
|
|
|
114
|
-
export { NgbSwitch, NgbSwitchLabel, NgbSwitchThumb, NgbSwitchTrack,
|
|
114
|
+
export { NgbSwitch, NgbSwitchLabel, NgbSwitchThumb, NgbSwitchTrack, aliasSwitch };
|
|
115
115
|
//# sourceMappingURL=ngbase-adk-switch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngbase-adk-switch.mjs","sources":["../../../projects/adk/switch/switch.ts","../../../projects/adk/switch/public-api.ts","../../../projects/adk/switch/ngbase-adk-switch.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n model,\n output,\n Type,\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { Directionality } from '@ngbase/adk/bidi';\nimport { provideValueAccessor, uniqueId } from '@ngbase/adk/utils';\n\n@Directive({\n selector: 'button[ngbSwitchTrack]',\n exportAs: 'ngbSwitchTrack',\n host: {\n type: 'button',\n role: 'switch',\n '[id]': 'switch.id',\n '(click)': 'switch.updateValue()',\n '[disabled]': 'switch.disabled()',\n '[attr.aria-checked]': 'checked()',\n },\n})\nexport class NgbSwitchTrack {\n readonly switch = inject(NgbSwitch);\n readonly checked = computed(() => this.switch.checked());\n}\n\n@Directive({\n selector: '[ngbSwitchThumb]',\n exportAs: 'ngbSwitchThumb',\n host: {\n '[attr.aria-checked]': 'checked()',\n },\n})\nexport class NgbSwitchThumb {\n readonly switch = inject(NgbSwitch);\n private readonly dir = inject(Directionality);\n readonly checked = computed(() => this.switch.checked());\n readonly rtl = this.dir.isRtl;\n}\n\n@Directive({\n selector: '[ngbSwitchLabel]',\n host: {\n '[attr.for]': 'switch.id',\n },\n})\nexport class NgbSwitchLabel {\n readonly switch = inject(NgbSwitch);\n}\n\n@Directive({\n selector: '[ngbSwitch]',\n exportAs: 'ngbSwitch',\n providers: [_provide(NgbSwitch)],\n})\nexport class NgbSwitch implements ControlValueAccessor {\n readonly id = uniqueId();\n readonly change = output<boolean>();\n readonly checked = model(false);\n readonly disabled = input(false, { transform: booleanAttribute });\n\n private onChange?: (value: any) => {};\n private onTouched?: () => {};\n\n updateValue() {\n this.checked.update(v => !v);\n const checked = this.checked();\n this.onChange?.(checked);\n this.onTouched?.();\n this.change.emit(checked);\n }\n\n writeValue(value: any): void {\n this.checked.set(value);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n}\n\nfunction _provide(ngbSwitch: typeof NgbSwitch) {\n return [provideValueAccessor(ngbSwitch)];\n}\n\nexport function
|
|
1
|
+
{"version":3,"file":"ngbase-adk-switch.mjs","sources":["../../../projects/adk/switch/switch.ts","../../../projects/adk/switch/public-api.ts","../../../projects/adk/switch/ngbase-adk-switch.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n model,\n output,\n Type,\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { Directionality } from '@ngbase/adk/bidi';\nimport { provideValueAccessor, uniqueId } from '@ngbase/adk/utils';\n\n@Directive({\n selector: 'button[ngbSwitchTrack]',\n exportAs: 'ngbSwitchTrack',\n host: {\n type: 'button',\n role: 'switch',\n '[id]': 'switch.id',\n '(click)': 'switch.updateValue()',\n '[disabled]': 'switch.disabled()',\n '[attr.aria-checked]': 'checked()',\n },\n})\nexport class NgbSwitchTrack {\n readonly switch = inject(NgbSwitch);\n readonly checked = computed(() => this.switch.checked());\n}\n\n@Directive({\n selector: '[ngbSwitchThumb]',\n exportAs: 'ngbSwitchThumb',\n host: {\n '[attr.aria-checked]': 'checked()',\n },\n})\nexport class NgbSwitchThumb {\n readonly switch = inject(NgbSwitch);\n private readonly dir = inject(Directionality);\n readonly checked = computed(() => this.switch.checked());\n readonly rtl = this.dir.isRtl;\n}\n\n@Directive({\n selector: '[ngbSwitchLabel]',\n host: {\n '[attr.for]': 'switch.id',\n },\n})\nexport class NgbSwitchLabel {\n readonly switch = inject(NgbSwitch);\n}\n\n@Directive({\n selector: '[ngbSwitch]',\n exportAs: 'ngbSwitch',\n providers: [_provide(NgbSwitch)],\n})\nexport class NgbSwitch implements ControlValueAccessor {\n readonly id = uniqueId();\n readonly change = output<boolean>();\n readonly checked = model(false);\n readonly disabled = input(false, { transform: booleanAttribute });\n\n private onChange?: (value: any) => {};\n private onTouched?: () => {};\n\n updateValue() {\n this.checked.update(v => !v);\n const checked = this.checked();\n this.onChange?.(checked);\n this.onTouched?.();\n this.change.emit(checked);\n }\n\n writeValue(value: any): void {\n this.checked.set(value);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n}\n\nfunction _provide(ngbSwitch: typeof NgbSwitch) {\n return [provideValueAccessor(ngbSwitch)];\n}\n\nexport function aliasSwitch(ngbSwitch: Type<NgbSwitch>) {\n return [_provide(ngbSwitch), { provide: NgbSwitch, useExisting: ngbSwitch }];\n}\n","/*\n * Public API Surface of switch\n */\n\nexport * from './switch';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA0Ba,cAAc,CAAA;AAZ3B,IAAA,WAAA,GAAA;AAaW,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1B,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;AACzD;8GAHY,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,sBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAA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SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAC9E;;AChGA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Directive, input, contentChild, TemplateRef, viewChild, ViewContainerRef, effect,
|
|
2
|
+
import { inject, Directive, input, contentChild, TemplateRef, viewChild, ViewContainerRef, effect, InjectionToken, Injector, IterableDiffers, contentChildren, untracked } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class NgbHead {
|
|
5
5
|
constructor() {
|
|
@@ -104,7 +104,7 @@ class NgbHeadRow {
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
const cols = this.headDef.ngbHeadRowDef();
|
|
107
|
-
columns.forEach(column => {
|
|
107
|
+
columns.forEach((column, index) => {
|
|
108
108
|
if (!cols?.includes(column.ngbColumn())) {
|
|
109
109
|
if (this.ref.has(column)) {
|
|
110
110
|
const ref = this.ref.get(column);
|
|
@@ -114,7 +114,10 @@ class NgbHeadRow {
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
if (!this.ref.has(column)) {
|
|
117
|
-
|
|
117
|
+
// maintain the order of the columns
|
|
118
|
+
const ref = this.container().createEmbeddedView(column.heads(), undefined, {
|
|
119
|
+
index,
|
|
120
|
+
});
|
|
118
121
|
this.ref.set(column, ref);
|
|
119
122
|
}
|
|
120
123
|
});
|
|
@@ -123,17 +126,14 @@ class NgbHeadRow {
|
|
|
123
126
|
ngOnDestroy() {
|
|
124
127
|
this.container().clear();
|
|
125
128
|
}
|
|
126
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbHeadRow, deps: [], target: i0.ɵɵFactoryTarget.
|
|
127
|
-
static { this.ɵ
|
|
129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbHeadRow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
130
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbHeadRow, isStandalone: true, selector: "[ngbHeadRow]", host: { properties: { "attr.data-sticky": "headDef.ngbHeadRowDefSticky()" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0 }); }
|
|
128
131
|
}
|
|
129
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbHeadRow, decorators: [{
|
|
130
|
-
type:
|
|
133
|
+
type: Directive,
|
|
131
134
|
args: [{
|
|
132
135
|
selector: '[ngbHeadRow]',
|
|
133
|
-
template: `<ng-container #container />`,
|
|
134
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
135
136
|
host: {
|
|
136
|
-
// '[class]': `headDef.ngbHeadRowDefSticky() ? 'sticky top-0 bg-foreground' : ''`,
|
|
137
137
|
'[attr.data-sticky]': 'headDef.ngbHeadRowDefSticky()',
|
|
138
138
|
},
|
|
139
139
|
}]
|
|
@@ -142,6 +142,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
142
142
|
const ROW_TOKEN = new InjectionToken('ROW_TOKEN');
|
|
143
143
|
class NgbTable {
|
|
144
144
|
constructor() {
|
|
145
|
+
this.injector = inject(Injector);
|
|
146
|
+
this.differs = inject(IterableDiffers);
|
|
145
147
|
this.thead = viewChild('thead', { read: ViewContainerRef });
|
|
146
148
|
this.tbody = viewChild('tbody', { read: ViewContainerRef });
|
|
147
149
|
this.bodyRowDef = contentChildren(NgbBodyRowDef, { read: TemplateRef });
|
|
@@ -149,8 +151,6 @@ class NgbTable {
|
|
|
149
151
|
this.columns = contentChildren(NgbColumn);
|
|
150
152
|
this.data = input.required();
|
|
151
153
|
this.trackBy = input((_, item) => item);
|
|
152
|
-
this.injector = inject(Injector);
|
|
153
|
-
this.differs = inject(IterableDiffers);
|
|
154
154
|
this._values = new WeakMap();
|
|
155
155
|
this.valuesTracker = new Map();
|
|
156
156
|
let headerRendered = false;
|
|
@@ -227,29 +227,13 @@ class NgbTable {
|
|
|
227
227
|
context.index = renderIndex;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbTable, deps: [], target: i0.ɵɵFactoryTarget.
|
|
231
|
-
static { this.ɵ
|
|
232
|
-
<thead>
|
|
233
|
-
<ng-container #thead />
|
|
234
|
-
</thead>
|
|
235
|
-
<tbody>
|
|
236
|
-
<ng-container #tbody />
|
|
237
|
-
</tbody>
|
|
238
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
230
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbTable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
231
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbTable, isStandalone: true, selector: "table[ngbTable]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "bodyRowDef", predicate: NgbBodyRowDef, read: TemplateRef, isSignal: true }, { propertyName: "headRowDef", first: true, predicate: NgbHeadRowDef, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "columns", predicate: NgbColumn, isSignal: true }], viewQueries: [{ propertyName: "thead", first: true, predicate: ["thead"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "tbody", first: true, predicate: ["tbody"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0 }); }
|
|
239
232
|
}
|
|
240
233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbTable, decorators: [{
|
|
241
|
-
type:
|
|
234
|
+
type: Directive,
|
|
242
235
|
args: [{
|
|
243
236
|
selector: 'table[ngbTable]',
|
|
244
|
-
template: `
|
|
245
|
-
<thead>
|
|
246
|
-
<ng-container #thead />
|
|
247
|
-
</thead>
|
|
248
|
-
<tbody>
|
|
249
|
-
<ng-container #tbody />
|
|
250
|
-
</tbody>
|
|
251
|
-
`,
|
|
252
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
253
237
|
}]
|
|
254
238
|
}], ctorParameters: () => [] });
|
|
255
239
|
class TableOutletContext {
|
|
@@ -315,15 +299,13 @@ class NgbBodyRow {
|
|
|
315
299
|
this.container().clear();
|
|
316
300
|
this.ref.clear();
|
|
317
301
|
}
|
|
318
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBodyRow, deps: [], target: i0.ɵɵFactoryTarget.
|
|
319
|
-
static { this.ɵ
|
|
302
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBodyRow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
303
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbBodyRow, isStandalone: true, selector: "[ngbBodyRow]", viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0 }); }
|
|
320
304
|
}
|
|
321
305
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbBodyRow, decorators: [{
|
|
322
|
-
type:
|
|
306
|
+
type: Directive,
|
|
323
307
|
args: [{
|
|
324
308
|
selector: '[ngbBodyRow]',
|
|
325
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
326
|
-
template: `<ng-container #container />`,
|
|
327
309
|
}]
|
|
328
310
|
}], ctorParameters: () => [] });
|
|
329
311
|
|