@bootkit/ng0 0.0.0-alpha.2 → 0.0.0-alpha.21
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/common/index.d.ts +118 -6
- package/components/accordion/index.d.ts +1 -1
- package/components/backdrop/index.d.ts +12 -0
- package/components/button/index.d.ts +48 -0
- package/components/card/index.d.ts +27 -0
- package/components/code/index.d.ts +35 -0
- package/components/confirmation/index.d.ts +66 -0
- package/components/dropdown/index.d.ts +78 -0
- package/components/form-field/index.d.ts +72 -0
- package/components/list/index.d.ts +127 -0
- package/components/modal/index.d.ts +22 -4
- package/components/nav/index.d.ts +23 -19
- package/components/pagination/index.d.ts +35 -9
- package/components/popover/index.d.ts +1 -1
- package/components/select/index.d.ts +116 -0
- package/components/sidenav/index.d.ts +59 -0
- package/components/stepper/index.d.ts +26 -0
- package/components/table/index.d.ts +273 -0
- package/components/toast/index.d.ts +1 -1
- package/components/tooltip/index.d.ts +1 -1
- package/components/vertical-menu/index.d.ts +61 -0
- package/data/index.d.ts +258 -46
- package/date/index.d.ts +34 -0
- package/fesm2022/bootkit-ng0-common.mjs +89 -11
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-accordion.mjs +13 -13
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-backdrop.mjs +46 -0
- package/fesm2022/bootkit-ng0-components-backdrop.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-button.mjs +119 -0
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-card.mjs +62 -0
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-code.mjs +70 -0
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-collapse.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +167 -0
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-dropdown.mjs +189 -0
- package/fesm2022/bootkit-ng0-components-dropdown.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs +147 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-list.mjs +331 -0
- package/fesm2022/bootkit-ng0-components-list.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs +40 -23
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-nav.mjs +58 -59
- package/fesm2022/bootkit-ng0-components-nav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs +9 -9
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-overlay.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-pagination.mjs +58 -23
- package/fesm2022/bootkit-ng0-components-pagination.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-popover.mjs +10 -10
- package/fesm2022/bootkit-ng0-components-popover.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-select.mjs +427 -0
- package/fesm2022/bootkit-ng0-components-select.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +153 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs +91 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-table.mjs +461 -0
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-toast.mjs +7 -7
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-tooltip.mjs +8 -8
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +161 -0
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-data.mjs +291 -90
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-date.mjs +50 -0
- package/fesm2022/bootkit-ng0-date.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-file.mjs +50 -0
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-form.mjs +514 -0
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-http.mjs +225 -179
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization-locales.mjs +115 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization.mjs +481 -0
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs +51 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-script.mjs +59 -0
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-security.mjs +17 -15
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/file/index.d.ts +22 -0
- package/form/index.d.ts +127 -0
- package/http/index.d.ts +141 -40
- package/localization/index.d.ts +305 -0
- package/localization/locales/index.d.ts +7 -0
- package/package.json +90 -10
- package/platform/browser/index.d.ts +22 -0
- package/script/index.d.ts +27 -0
- package/security/index.d.ts +3 -9
|
@@ -1,65 +1,61 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, Directive, HostBinding, HostListener, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { model, input, Directive, HostBinding, HostListener, computed, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
|
|
6
6
|
class NavDirective {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The active item.
|
|
9
|
+
*/
|
|
10
|
+
activeItem = model(0, ...(ngDevMode ? [{ debugName: "activeItem" }] : []));
|
|
11
|
+
/**
|
|
12
|
+
* Whether the navigation is disabled.
|
|
13
|
+
*/
|
|
14
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
15
|
+
constructor() {
|
|
14
16
|
}
|
|
15
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
16
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: NavDirective, isStandalone: true, selector: "[ng0Nav]", inputs: { activeItem: { classPropertyName: "activeItem", publicName: "activeItem", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItem: "activeItemChange" }, exportAs: ["ng0Nav"], ngImport: i0 });
|
|
17
19
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavDirective, decorators: [{
|
|
19
21
|
type: Directive,
|
|
20
22
|
args: [{
|
|
21
23
|
selector: '[ng0Nav]',
|
|
22
24
|
exportAs: 'ng0Nav',
|
|
23
25
|
standalone: true,
|
|
24
26
|
}]
|
|
25
|
-
}], ctorParameters: () => [
|
|
27
|
+
}], ctorParameters: () => [] });
|
|
26
28
|
|
|
27
29
|
class NavItemDirective {
|
|
28
30
|
elementRef;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
disabled = input(false);
|
|
33
|
-
constructor(elementRef, _renderer, _nav) {
|
|
31
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id", alias: 'ng0NavItem' }] : [{ alias: 'ng0NavItem' }]));
|
|
32
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
33
|
+
constructor(elementRef) {
|
|
34
34
|
this.elementRef = elementRef;
|
|
35
|
-
this._renderer = _renderer;
|
|
36
|
-
this._nav = _nav;
|
|
37
35
|
}
|
|
38
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
39
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavItemDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
37
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: NavItemDirective, isStandalone: true, selector: "[ng0NavItem]", inputs: { id: { classPropertyName: "id", publicName: "ng0NavItem", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ng0NavItem"], ngImport: i0 });
|
|
40
38
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavItemDirective, decorators: [{
|
|
42
40
|
type: Directive,
|
|
43
41
|
args: [{
|
|
44
42
|
selector: '[ng0NavItem]',
|
|
45
43
|
exportAs: 'ng0NavItem',
|
|
46
44
|
standalone: true,
|
|
47
45
|
}]
|
|
48
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }
|
|
46
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
49
47
|
|
|
50
48
|
class NavLinkDirective {
|
|
51
49
|
elementRef;
|
|
52
|
-
_renderer;
|
|
53
50
|
_nav;
|
|
54
51
|
_navItem;
|
|
55
|
-
constructor(elementRef,
|
|
52
|
+
constructor(elementRef, _nav, _navItem) {
|
|
56
53
|
this.elementRef = elementRef;
|
|
57
|
-
this._renderer = _renderer;
|
|
58
54
|
this._nav = _nav;
|
|
59
55
|
this._navItem = _navItem;
|
|
60
56
|
}
|
|
61
57
|
_onClick() {
|
|
62
|
-
this._nav.activeItem.set(this._navItem.id);
|
|
58
|
+
this._nav.activeItem.set(this._navItem.id());
|
|
63
59
|
}
|
|
64
60
|
get _active() {
|
|
65
61
|
return this._nav.activeItem() === this._navItem.id();
|
|
@@ -67,17 +63,17 @@ class NavLinkDirective {
|
|
|
67
63
|
get _disabled() {
|
|
68
64
|
return this._nav.disabled() || this._navItem.disabled();
|
|
69
65
|
}
|
|
70
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
71
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavLinkDirective, deps: [{ token: i0.ElementRef }, { token: NavDirective }, { token: NavItemDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
67
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.1", type: NavLinkDirective, isStandalone: true, selector: "[ng0NavLink]", host: { listeners: { "click": "_onClick()" }, properties: { "class.active": "this._active", "class.disabled": "this._disabled" } }, exportAs: ["ng0NavLink"], ngImport: i0 });
|
|
72
68
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavLinkDirective, decorators: [{
|
|
74
70
|
type: Directive,
|
|
75
71
|
args: [{
|
|
76
72
|
selector: '[ng0NavLink]',
|
|
77
73
|
exportAs: 'ng0NavLink',
|
|
78
74
|
standalone: true,
|
|
79
75
|
}]
|
|
80
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type:
|
|
76
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: NavDirective }, { type: NavItemDirective }], propDecorators: { _onClick: [{
|
|
81
77
|
type: HostListener,
|
|
82
78
|
args: ['click']
|
|
83
79
|
}], _active: [{
|
|
@@ -88,30 +84,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
88
84
|
args: ['class.disabled']
|
|
89
85
|
}] } });
|
|
90
86
|
|
|
91
|
-
class
|
|
87
|
+
class NavContentDirective {
|
|
92
88
|
templateRef;
|
|
93
|
-
id = input.required({ alias: '
|
|
89
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id", alias: 'ng0NavContent' }] : [{ alias: 'ng0NavContent' }]));
|
|
94
90
|
constructor(templateRef) {
|
|
95
91
|
this.templateRef = templateRef;
|
|
96
92
|
}
|
|
97
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
98
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
94
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: NavContentDirective, isStandalone: true, selector: "[ng0NavContent]", inputs: { id: { classPropertyName: "id", publicName: "ng0NavContent", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["ng0NavContent"], ngImport: i0 });
|
|
99
95
|
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavContentDirective, decorators: [{
|
|
101
97
|
type: Directive,
|
|
102
98
|
args: [{
|
|
103
|
-
selector: '[
|
|
104
|
-
exportAs: '
|
|
99
|
+
selector: '[ng0NavContent]',
|
|
100
|
+
exportAs: 'ng0NavContent',
|
|
105
101
|
standalone: true,
|
|
106
102
|
}]
|
|
107
103
|
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
108
104
|
|
|
109
|
-
class
|
|
105
|
+
class NavContentContainerComponent {
|
|
110
106
|
_elementRef;
|
|
111
107
|
_renderer;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
/**
|
|
109
|
+
* The navigation directive that this content belongs to.
|
|
110
|
+
*/
|
|
111
|
+
nav = input.required(...(ngDevMode ? [{ debugName: "nav" }] : []));
|
|
112
|
+
_contents;
|
|
113
|
+
_activeItem = computed(() => this.nav().activeItem(), ...(ngDevMode ? [{ debugName: "_activeItem" }] : []));
|
|
115
114
|
constructor(_elementRef, _renderer) {
|
|
116
115
|
this._elementRef = _elementRef;
|
|
117
116
|
this._renderer = _renderer;
|
|
@@ -119,38 +118,38 @@ class TabContentComponent {
|
|
|
119
118
|
ngOnInit() {
|
|
120
119
|
this._renderer.addClass(this._elementRef.nativeElement, 'tab-content');
|
|
121
120
|
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
123
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavContentContainerComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: NavContentContainerComponent, isStandalone: true, selector: "ng0-navcontent-container", inputs: { nav: { classPropertyName: "nav", publicName: "nav", isSignal: true, isRequired: true, transformFunction: null } }, queries: [{ propertyName: "_contents", predicate: NavContentDirective }], exportAs: ["ng0Navcontent"], ngImport: i0, template: "@for (content of _contents; track $index) {\r\n @if(content.id() === _activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"content.templateRef;\"></ng-container>\r\n }\r\n}\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
124
123
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavContentContainerComponent, decorators: [{
|
|
126
125
|
type: Component,
|
|
127
|
-
args: [{ selector: 'ng0-
|
|
128
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: {
|
|
126
|
+
args: [{ selector: 'ng0-navcontent-container', exportAs: 'ng0Navcontent', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "@for (content of _contents; track $index) {\r\n @if(content.id() === _activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"content.templateRef;\"></ng-container>\r\n }\r\n}\r\n", styles: [":host{display:block}\n"] }]
|
|
127
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { _contents: [{
|
|
129
128
|
type: ContentChildren,
|
|
130
|
-
args: [
|
|
129
|
+
args: [NavContentDirective]
|
|
131
130
|
}] } });
|
|
132
131
|
|
|
133
132
|
const items = [
|
|
134
133
|
NavDirective,
|
|
135
134
|
NavItemDirective,
|
|
136
135
|
NavLinkDirective,
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
NavContentContainerComponent,
|
|
137
|
+
NavContentDirective
|
|
139
138
|
];
|
|
140
139
|
class NavModule {
|
|
141
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
142
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
141
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: NavModule, imports: [NavDirective,
|
|
143
142
|
NavItemDirective,
|
|
144
143
|
NavLinkDirective,
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
NavContentContainerComponent,
|
|
145
|
+
NavContentDirective], exports: [NavDirective,
|
|
147
146
|
NavItemDirective,
|
|
148
147
|
NavLinkDirective,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
148
|
+
NavContentContainerComponent,
|
|
149
|
+
NavContentDirective] });
|
|
150
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavModule, imports: [NavContentContainerComponent] });
|
|
152
151
|
}
|
|
153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NavModule, decorators: [{
|
|
154
153
|
type: NgModule,
|
|
155
154
|
args: [{
|
|
156
155
|
imports: items,
|
|
@@ -162,5 +161,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
162
161
|
* Generated bundle index. Do not edit.
|
|
163
162
|
*/
|
|
164
163
|
|
|
165
|
-
export { NavDirective, NavItemDirective, NavLinkDirective, NavModule
|
|
164
|
+
export { NavContentContainerComponent, NavContentDirective, NavDirective, NavItemDirective, NavLinkDirective, NavModule };
|
|
166
165
|
//# sourceMappingURL=bootkit-ng0-components-nav.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-nav.mjs","sources":["../../../projects/ng0/components/nav/nav.directive.ts","../../../projects/ng0/components/nav/nav-item.directive.ts","../../../projects/ng0/components/nav/nav-link.directive.ts","../../../projects/ng0/components/nav/tab-pane.directive.ts","../../../projects/ng0/components/nav/tab-content.component.ts","../../../projects/ng0/components/nav/tab-content.component.html","../../../projects/ng0/components/nav/nav.module.ts","../../../projects/ng0/components/nav/bootkit-ng0-components-nav.ts"],"sourcesContent":["import { Directive, ElementRef, Renderer2, input, model } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Nav]',\r\n exportAs: 'ng0Nav',\r\n standalone: true,\r\n})\r\nexport class NavDirective {\r\n activeItem = model<any>(0);\r\n disabled = input(false);\r\n\r\n constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {\r\n }\r\n}\r\n","import { Directive, ElementRef, Renderer2, input } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\n\r\n@Directive({\r\n selector: '[ng0NavItem]',\r\n exportAs: 'ng0NavItem',\r\n standalone: true,\r\n})\r\nexport class NavItemDirective {\r\n id = input.required<any>({alias: 'ng0NavItem'});\r\n disabled = input(false);\r\n\r\n constructor(public elementRef: ElementRef, private _renderer: Renderer2, private _nav: NavDirective) {\r\n }\r\n}\r\n","import { Directive, ElementRef, HostBinding, HostListener, Renderer2, input } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\nimport { NavItemDirective } from './nav-item.directive';\r\n\r\n@Directive({\r\n selector: '[ng0NavLink]',\r\n exportAs: 'ng0NavLink',\r\n standalone: true,\r\n})\r\nexport class NavLinkDirective {\r\n constructor(public elementRef: ElementRef, private _renderer: Renderer2, private _nav: NavDirective, private _navItem: NavItemDirective) {\r\n }\r\n\r\n @HostListener('click')\r\n private _onClick() {\r\n this._nav.activeItem.set(this._navItem.id);\r\n }\r\n\r\n @HostBinding('class.active') \r\n private get _active() {\r\n return this._nav.activeItem() === this._navItem.id();\r\n }\r\n\r\n @HostBinding('class.disabled') \r\n private get _disabled() {\r\n return this._nav.disabled() || this._navItem.disabled();\r\n }\r\n}\r\n","import { Directive, input, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0TabPane]',\r\n exportAs: 'ng0TabPane',\r\n standalone: true,\r\n})\r\nexport class TabPaneDirective {\r\n id = input.required<any>({alias: 'ng0TabPane'});\r\n \r\n constructor(public templateRef: TemplateRef<any>) {\r\n }\r\n}\r\n","import { Component, ContentChildren, QueryList, ElementRef, Renderer2, OnInit, input, ChangeDetectionStrategy } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { TabPaneDirective } from './tab-pane.directive';\r\nimport { NavDirective } from './nav.directive';\r\n\r\n@Component({\r\n selector: 'ng0-tab-content',\r\n exportAs: 'ng0TabContent',\r\n templateUrl: './tab-content.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule]\r\n})\r\nexport class TabContentComponent implements OnInit {\r\n nav = input.required<NavDirective>();\r\n\r\n @ContentChildren(TabPaneDirective) protected _panes: QueryList<TabPaneDirective>;\r\n\r\n disabled = input(false);\r\n\r\n constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this._renderer.addClass(this._elementRef.nativeElement, 'tab-content');\r\n }\r\n}\r\n","@for (pane of _panes; track $index) {\r\n @if(pane.id() === nav().activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"pane.templateRef;\"></ng-container>\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\nimport { NavLinkDirective } from './nav-link.directive';\r\nimport { TabContentComponent } from './tab-content.component';\r\nimport { TabPaneDirective } from './tab-pane.directive';\r\nimport { NavItemDirective } from './nav-item.directive';\r\n\r\nconst items = [\r\n NavDirective,\r\n NavItemDirective,\r\n NavLinkDirective,\r\n TabContentComponent,\r\n TabPaneDirective\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items\r\n})\r\nexport class NavModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NavDirective","i2.NavItemDirective"],"mappings":";;;;;MAOa,YAAY,CAAA;AAIC,IAAA,WAAA;AAAiC,IAAA,SAAA;AAHrD,IAAA,UAAU,GAAG,KAAK,CAAM,CAAC,CAAC;AAC1B,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;IAEvB,WAAoB,CAAA,WAAuB,EAAU,SAAoB,EAAA;QAArD,IAAW,CAAA,WAAA,GAAX,WAAW;QAAsB,IAAS,CAAA,SAAA,GAAT,SAAS;;uGAJvD,YAAY,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,SAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,E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IACZ,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB;CACD;MAMY,SAAS,CAAA;uGAAT,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,YAXpB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;AACnB,YAAA,gBAAgB,aAJhB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;YACnB,gBAAgB,CAAA,EAAA,CAAA;AAOL,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,YARpB,mBAAmB,CAAA,EAAA,CAAA;;2FAQR,SAAS,EAAA,UAAA,EAAA,CAAA;kBAJrB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACV,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-nav.mjs","sources":["../../../projects/ng0/components/nav/nav.directive.ts","../../../projects/ng0/components/nav/nav-item.directive.ts","../../../projects/ng0/components/nav/nav-link.directive.ts","../../../projects/ng0/components/nav/nav-content.directive.ts","../../../projects/ng0/components/nav/nav-content-container.component.ts","../../../projects/ng0/components/nav/nav-content-container.component.html","../../../projects/ng0/components/nav/nav.module.ts","../../../projects/ng0/components/nav/bootkit-ng0-components-nav.ts"],"sourcesContent":["import { Directive, ElementRef, Renderer2, input, model } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Nav]',\r\n exportAs: 'ng0Nav',\r\n standalone: true,\r\n})\r\nexport class NavDirective {\r\n /**\r\n * The active item.\r\n */\r\n activeItem = model<any>(0);\r\n\r\n /**\r\n * Whether the navigation is disabled.\r\n */\r\n disabled = input(false);\r\n\r\n constructor() {\r\n }\r\n}\r\n","import { Directive, ElementRef, Renderer2, input } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\n\r\n@Directive({\r\n selector: '[ng0NavItem]',\r\n exportAs: 'ng0NavItem',\r\n standalone: true,\r\n})\r\nexport class NavItemDirective {\r\n id = input.required<any>({alias: 'ng0NavItem'});\r\n disabled = input(false);\r\n\r\n constructor(public elementRef: ElementRef) {\r\n }\r\n}\r\n","import { Directive, ElementRef, HostBinding, HostListener, Renderer2, input } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\nimport { NavItemDirective } from './nav-item.directive';\r\n\r\n@Directive({\r\n selector: '[ng0NavLink]',\r\n exportAs: 'ng0NavLink',\r\n standalone: true,\r\n})\r\nexport class NavLinkDirective {\r\n constructor(public elementRef: ElementRef, private _nav: NavDirective, private _navItem: NavItemDirective) {\r\n }\r\n\r\n @HostListener('click')\r\n private _onClick() {\r\n this._nav.activeItem.set(this._navItem.id());\r\n }\r\n\r\n @HostBinding('class.active') \r\n private get _active() {\r\n return this._nav.activeItem() === this._navItem.id();\r\n }\r\n\r\n @HostBinding('class.disabled') \r\n private get _disabled() {\r\n return this._nav.disabled() || this._navItem.disabled();\r\n }\r\n}\r\n","import { Directive, input, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0NavContent]',\r\n exportAs: 'ng0NavContent',\r\n standalone: true,\r\n})\r\nexport class NavContentDirective {\r\n id = input.required<any>({alias: 'ng0NavContent'});\r\n \r\n constructor(public templateRef: TemplateRef<any>) {\r\n }\r\n}\r\n","import { Component, ContentChildren, QueryList, ElementRef, Renderer2, OnInit, input, ChangeDetectionStrategy, computed } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NavContentDirective } from './nav-content.directive';\r\nimport { NavDirective } from './nav.directive';\r\n\r\n@Component({\r\n selector: 'ng0-navcontent-container',\r\n exportAs: 'ng0Navcontent',\r\n templateUrl: './nav-content-container.component.html',\r\n styles: `:host{display: block;}`,\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule]\r\n})\r\nexport class NavContentContainerComponent implements OnInit {\r\n /** \r\n * The navigation directive that this content belongs to.\r\n */\r\n nav = input.required<NavDirective>();\r\n\r\n @ContentChildren(NavContentDirective) protected _contents!: QueryList<NavContentDirective>;\r\n protected _activeItem = computed(() => this.nav().activeItem());\r\n\r\n constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this._renderer.addClass(this._elementRef.nativeElement, 'tab-content');\r\n }\r\n}\r\n","@for (content of _contents; track $index) {\r\n @if(content.id() === _activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"content.templateRef;\"></ng-container>\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\nimport { NavLinkDirective } from './nav-link.directive';\r\nimport { NavContentContainerComponent } from './nav-content-container.component';\r\nimport { NavContentDirective } from './nav-content.directive';\r\nimport { NavItemDirective } from './nav-item.directive';\r\n\r\nconst items = [\r\n NavDirective,\r\n NavItemDirective,\r\n NavLinkDirective,\r\n NavContentContainerComponent,\r\n NavContentDirective\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items\r\n})\r\nexport class NavModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NavDirective","i2.NavItemDirective"],"mappings":";;;;;MAOa,YAAY,CAAA;AACnB;;AAEG;AACH,IAAA,UAAU,GAAG,KAAK,CAAM,CAAC,sDAAC;AAE1B;;AAEG;AACH,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;AAEvB,IAAA,WAAA,GAAA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gBAAgB;IAChB,gBAAgB;IAChB,4BAA4B;IAC5B;CACD;MAMY,SAAS,CAAA;uGAAT,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,YAXpB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,4BAA4B;AAC5B,YAAA,mBAAmB,aAJnB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,4BAA4B;YAC5B,mBAAmB,CAAA,EAAA,CAAA;AAOR,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,YARpB,4BAA4B,CAAA,EAAA,CAAA;;2FAQjB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAJrB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACV,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -4,8 +4,8 @@ import { input, EventEmitter, afterNextRender, effect, untracked, HostListener,
|
|
|
4
4
|
class OffcanvasDirective {
|
|
5
5
|
_el;
|
|
6
6
|
_renderer;
|
|
7
|
-
show = input(false);
|
|
8
|
-
hasBackdrop = input(false);
|
|
7
|
+
show = input(false, ...(ngDevMode ? [{ debugName: "show" }] : []));
|
|
8
|
+
hasBackdrop = input(false, ...(ngDevMode ? [{ debugName: "hasBackdrop" }] : []));
|
|
9
9
|
backdropClick = new EventEmitter;
|
|
10
10
|
_firstShowEffectRun = true;
|
|
11
11
|
_firstBackdropEffectRun = true;
|
|
@@ -100,10 +100,10 @@ class OffcanvasDirective {
|
|
|
100
100
|
ngOnDestroy() {
|
|
101
101
|
this._destroyBackdrop();
|
|
102
102
|
}
|
|
103
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
104
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: OffcanvasDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
104
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: OffcanvasDirective, isStandalone: true, selector: "[ng0Offcanvas]", inputs: { show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { backdropClick: "backdropClick" }, host: { listeners: { "transitionend": "_onTransitionend($event)" } }, exportAs: ["ng0Offcanvas"], ngImport: i0 });
|
|
105
105
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: OffcanvasDirective, decorators: [{
|
|
107
107
|
type: Directive,
|
|
108
108
|
args: [{
|
|
109
109
|
selector: '[ng0Offcanvas]',
|
|
@@ -121,11 +121,11 @@ const items = [
|
|
|
121
121
|
OffcanvasDirective,
|
|
122
122
|
];
|
|
123
123
|
class OffcanvasModule {
|
|
124
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
125
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
126
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: OffcanvasModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
125
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: OffcanvasModule, imports: [OffcanvasDirective], exports: [OffcanvasDirective] });
|
|
126
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: OffcanvasModule });
|
|
127
127
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: OffcanvasModule, decorators: [{
|
|
129
129
|
type: NgModule,
|
|
130
130
|
args: [{
|
|
131
131
|
imports: items,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-offcanvas.mjs","sources":["../../../projects/ng0/components/offcanvas/offcanvas.directive.ts","../../../projects/ng0/components/offcanvas/offcanvas.module.ts","../../../projects/ng0/components/offcanvas/bootkit-ng0-components-offcanvas.ts"],"sourcesContent":["import { OnInit, ElementRef, Renderer2, effect, HostListener, Directive, input, Output, EventEmitter, OnDestroy, afterNextRender, untracked } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Offcanvas]',\r\n exportAs: 'ng0Offcanvas',\r\n standalone: true,\r\n})\r\nexport class OffcanvasDirective implements OnInit, OnDestroy {\r\n public show = input(false);\r\n public hasBackdrop = input(false);\r\n\r\n @Output()\r\n public backdropClick = new EventEmitter<MouseEvent>;\r\n\r\n private _firstShowEffectRun = true;\r\n private _firstBackdropEffectRun = true;\r\n private _backdropElement?: any;\r\n private _backdropClickUnlistenFunc?: any;\r\n private _backdropTransitionendUnlistenFunc?: any;\r\n private addClass = (c: string) => this._renderer.addClass(this._el.nativeElement, c);\r\n\r\n constructor(private _el: ElementRef, private _renderer: Renderer2) {\r\n\r\n afterNextRender(() => {\r\n if (this.show() && this.hasBackdrop()) {\r\n this._createBackdrop();\r\n }\r\n });\r\n\r\n effect(() => {\r\n var show = this.show();\r\n var backdrop = untracked(() => this.hasBackdrop());\r\n\r\n if (this._firstShowEffectRun) {\r\n if (show) {\r\n this.addClass('show');\r\n }\r\n this._firstShowEffectRun = false;\r\n return;\r\n }\r\n\r\n\r\n if (show) {\r\n this.addClass('show');\r\n if (backdrop)\r\n this._createBackdrop();\r\n } else {\r\n this.addClass('hiding');\r\n this._hideBackdrop(); // we first hide backdrop, after hide transition completed, we destroy it.\r\n }\r\n });\r\n\r\n effect(() => {\r\n var backdrop = this.hasBackdrop();\r\n var show = untracked(() => this.show());\r\n\r\n if (this._firstBackdropEffectRun) {\r\n this._firstBackdropEffectRun = false;\r\n return;\r\n }\r\n\r\n if (show) {\r\n if (backdrop)\r\n this._createBackdrop();\r\n else\r\n this._destroyBackdrop();\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n private _createBackdrop() {\r\n if (!this._backdropElement) {\r\n this._backdropElement = this._renderer.createElement('div');\r\n ['offcanvas-backdrop', 'fade', 'show'].forEach(c => this._renderer.addClass(this._backdropElement, c));\r\n\r\n // Append the new element next to the host element\r\n const parent = this._renderer.parentNode(this._el.nativeElement);\r\n const nextSibling = this._renderer.nextSibling(this._el.nativeElement);\r\n this._renderer.insertBefore(parent, this._backdropElement, nextSibling);\r\n\r\n this._backdropClickUnlistenFunc = this._renderer.listen(this._backdropElement, 'click', (e) => {\r\n this.backdropClick.emit(e);\r\n });\r\n\r\n this._backdropTransitionendUnlistenFunc = this._renderer.listen(this._backdropElement, 'transitionend', (e) => {\r\n if (!this.show()) {\r\n this._destroyBackdrop();\r\n }\r\n });\r\n }\r\n }\r\n\r\n private _destroyBackdrop() {\r\n if (this._backdropElement) {\r\n const parent = this._renderer.parentNode(this._el.nativeElement);\r\n this._renderer.removeChild(parent, this._backdropElement, false);\r\n this._backdropClickUnlistenFunc()\r\n\r\n this._backdropClickUnlistenFunc = undefined;\r\n this._backdropElement = undefined\r\n }\r\n }\r\n\r\n private _hideBackdrop() {\r\n if (this._backdropElement) {\r\n this._renderer.removeClass(this._backdropElement, 'show');\r\n }\r\n }\r\n\r\n @HostListener('transitionend', ['$event'])\r\n private _onTransitionend(e: TransitionEvent): void {\r\n if (!this.show() && e.propertyName == 'transform') {\r\n ['show', 'hiding'].forEach(x => this._renderer.removeClass(this._el.nativeElement, x));\r\n // if (this.backdrop())\r\n // this._destroyBackdrop();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._destroyBackdrop()\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { OffcanvasDirective } from './offcanvas.directive';\r\n\r\nconst items = [\r\n OffcanvasDirective,\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items\r\n})\r\nexport class OffcanvasModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAOa,kBAAkB,CAAA;AAcP,IAAA,GAAA;AAAyB,IAAA,SAAA;AAbtC,IAAA,IAAI,GAAG,KAAK,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-offcanvas.mjs","sources":["../../../projects/ng0/components/offcanvas/offcanvas.directive.ts","../../../projects/ng0/components/offcanvas/offcanvas.module.ts","../../../projects/ng0/components/offcanvas/bootkit-ng0-components-offcanvas.ts"],"sourcesContent":["import { OnInit, ElementRef, Renderer2, effect, HostListener, Directive, input, Output, EventEmitter, OnDestroy, afterNextRender, untracked } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Offcanvas]',\r\n exportAs: 'ng0Offcanvas',\r\n standalone: true,\r\n})\r\nexport class OffcanvasDirective implements OnInit, OnDestroy {\r\n public show = input(false);\r\n public hasBackdrop = input(false);\r\n\r\n @Output()\r\n public backdropClick = new EventEmitter<MouseEvent>;\r\n\r\n private _firstShowEffectRun = true;\r\n private _firstBackdropEffectRun = true;\r\n private _backdropElement?: any;\r\n private _backdropClickUnlistenFunc?: any;\r\n private _backdropTransitionendUnlistenFunc?: any;\r\n private addClass = (c: string) => this._renderer.addClass(this._el.nativeElement, c);\r\n\r\n constructor(private _el: ElementRef, private _renderer: Renderer2) {\r\n\r\n afterNextRender(() => {\r\n if (this.show() && this.hasBackdrop()) {\r\n this._createBackdrop();\r\n }\r\n });\r\n\r\n effect(() => {\r\n var show = this.show();\r\n var backdrop = untracked(() => this.hasBackdrop());\r\n\r\n if (this._firstShowEffectRun) {\r\n if (show) {\r\n this.addClass('show');\r\n }\r\n this._firstShowEffectRun = false;\r\n return;\r\n }\r\n\r\n\r\n if (show) {\r\n this.addClass('show');\r\n if (backdrop)\r\n this._createBackdrop();\r\n } else {\r\n this.addClass('hiding');\r\n this._hideBackdrop(); // we first hide backdrop, after hide transition completed, we destroy it.\r\n }\r\n });\r\n\r\n effect(() => {\r\n var backdrop = this.hasBackdrop();\r\n var show = untracked(() => this.show());\r\n\r\n if (this._firstBackdropEffectRun) {\r\n this._firstBackdropEffectRun = false;\r\n return;\r\n }\r\n\r\n if (show) {\r\n if (backdrop)\r\n this._createBackdrop();\r\n else\r\n this._destroyBackdrop();\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n private _createBackdrop() {\r\n if (!this._backdropElement) {\r\n this._backdropElement = this._renderer.createElement('div');\r\n ['offcanvas-backdrop', 'fade', 'show'].forEach(c => this._renderer.addClass(this._backdropElement, c));\r\n\r\n // Append the new element next to the host element\r\n const parent = this._renderer.parentNode(this._el.nativeElement);\r\n const nextSibling = this._renderer.nextSibling(this._el.nativeElement);\r\n this._renderer.insertBefore(parent, this._backdropElement, nextSibling);\r\n\r\n this._backdropClickUnlistenFunc = this._renderer.listen(this._backdropElement, 'click', (e) => {\r\n this.backdropClick.emit(e);\r\n });\r\n\r\n this._backdropTransitionendUnlistenFunc = this._renderer.listen(this._backdropElement, 'transitionend', (e) => {\r\n if (!this.show()) {\r\n this._destroyBackdrop();\r\n }\r\n });\r\n }\r\n }\r\n\r\n private _destroyBackdrop() {\r\n if (this._backdropElement) {\r\n const parent = this._renderer.parentNode(this._el.nativeElement);\r\n this._renderer.removeChild(parent, this._backdropElement, false);\r\n this._backdropClickUnlistenFunc()\r\n\r\n this._backdropClickUnlistenFunc = undefined;\r\n this._backdropElement = undefined\r\n }\r\n }\r\n\r\n private _hideBackdrop() {\r\n if (this._backdropElement) {\r\n this._renderer.removeClass(this._backdropElement, 'show');\r\n }\r\n }\r\n\r\n @HostListener('transitionend', ['$event'])\r\n private _onTransitionend(e: TransitionEvent): void {\r\n if (!this.show() && e.propertyName == 'transform') {\r\n ['show', 'hiding'].forEach(x => this._renderer.removeClass(this._el.nativeElement, x));\r\n // if (this.backdrop())\r\n // this._destroyBackdrop();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._destroyBackdrop()\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { OffcanvasDirective } from './offcanvas.directive';\r\n\r\nconst items = [\r\n OffcanvasDirective,\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items\r\n})\r\nexport class OffcanvasModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAOa,kBAAkB,CAAA;AAcP,IAAA,GAAA;AAAyB,IAAA,SAAA;AAbtC,IAAA,IAAI,GAAG,KAAK,CAAC,KAAK,gDAAC;AACnB,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,uDAAC;IAG1B,aAAa,GAAG,IAAI,YAAwB;IAE3C,mBAAmB,GAAG,IAAI;IAC1B,uBAAuB,GAAG,IAAI;AAC9B,IAAA,gBAAgB;AAChB,IAAA,0BAA0B;AAC1B,IAAA,kCAAkC;IAClC,QAAQ,GAAG,CAAC,CAAS,KAAK,IAA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;AACd,oBAAA,OAAO,EAAE;AACZ,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-overlay.mjs","sources":["../../../projects/ng0/components/overlay/utils.ts","../../../projects/ng0/components/overlay/positions.ts","../../../projects/ng0/components/overlay/bootkit-ng0-components-overlay.ts"],"sourcesContent":["import { ConnectedPosition } from \"@angular/cdk/overlay\";\r\nimport { Alignment, flipPlacement, Placement } from \"@bootkit/ng0/common\";\r\n\r\n/**\r\n * Get the overlay position based on the provided placement and alignment.\r\n * \r\n * @param placement - The placement of the overlay (e.g., 'bottom', 'top', 'start', 'end').\r\n * @param alignment - The alignment of the overlay (e.g., 'start', 'center', 'end').\r\n * @returns The connected position for the overlay.\r\n */\r\nexport function getConnectedPosition(placement: Placement, alignment: Alignment): ConnectedPosition {\r\n let pos = {} as ConnectedPosition;\r\n\r\n switch (placement) {\r\n case 'bottom':\r\n pos.originY = 'bottom';\r\n pos.overlayY = 'top';\r\n pos.originX = alignment;\r\n pos.overlayX = alignment;\r\n break;\r\n case 'top':\r\n pos.originY = 'top';\r\n pos.overlayY = 'bottom';\r\n pos.originX = alignment;\r\n pos.overlayX = alignment;\r\n break;\r\n case 'start':\r\n pos.originX = 'start';\r\n pos.overlayX = 'end';\r\n\r\n if (alignment == 'start') {\r\n pos.originY = 'top';\r\n pos.overlayY = 'top';\r\n } else if (alignment == 'center') {\r\n pos.originY = 'center';\r\n pos.overlayY = 'center';\r\n } else {\r\n pos.originY = 'bottom';\r\n pos.overlayY = 'bottom';\r\n }\r\n break;\r\n case 'end':\r\n pos.originX = 'end';\r\n pos.overlayX = 'start';\r\n\r\n if (alignment == 'start') {\r\n pos.originY = 'top';\r\n pos.overlayY = 'top';\r\n } else if (alignment == 'center') {\r\n pos.originY = 'center';\r\n pos.overlayY = 'center';\r\n } else {\r\n pos.originY = 'bottom';\r\n pos.overlayY = 'bottom';\r\n }\r\n break;\r\n }\r\n\r\n return pos;\r\n}\r\n\r\nexport function getConnectedPositions(placement: Placement, alignment: Alignment, includeFlippedPlacement = true): ConnectedPosition[] {\r\n return [\r\n getConnectedPosition(placement, alignment),\r\n ...(includeFlippedPlacement ? [getConnectedPosition(flipPlacement(placement), alignment)] : []),\r\n ] ;\r\n}\r\n","import { getConnectedPosition, getConnectedPositions } from \"./utils\";\r\n\r\n// Positions\r\nexport const START_START_POS = getConnectedPosition('start', 'start');\r\nexport const START_CENTER_POS = getConnectedPosition('start', 'center');\r\nexport const START_END_POS = getConnectedPosition('start', 'end');\r\n\r\nexport const END_START_POS = getConnectedPosition('end', 'start');\r\nexport const END_CENTER_POS = getConnectedPosition('end', 'center');\r\nexport const END_END_POS = getConnectedPosition('end', 'end');\r\n\r\nexport const TOP_START_POS = getConnectedPosition('top', 'start');\r\nexport const TOP_END_POS = getConnectedPosition('top', 'end');\r\nexport const TOP_CENTER_POS = getConnectedPosition('top', 'center');\r\n\r\nexport const BOTTOM_START_POS = getConnectedPosition('bottom', 'start');\r\nexport const BOTTOM_CENTER_POS = getConnectedPosition('bottom', 'center');\r\nexport const BOTTOM_END_POS = getConnectedPosition('bottom', 'end');\r\n\r\n\r\n// Flipped positions\r\nexport const START_START_FLIPPED_POS = getConnectedPositions('start', 'start');\r\nexport const START_CENTER_FLIPPED_POS = getConnectedPositions('start', 'center');\r\nexport const START_END_FLIPPED_POS = getConnectedPositions('start', 'end');\r\n\r\nexport const END_START_FLIPPED_POS = getConnectedPositions('end', 'start');\r\nexport const END_CENTER_FLIPPED_POS = getConnectedPositions('end', 'center');\r\nexport const END_END_FLIPPED_POS = getConnectedPositions('end', 'end');\r\n\r\nexport const TOP_START_FLIPPED_POS = getConnectedPositions('top', 'start');\r\nexport const TOP_END_FLIPPED_POS = getConnectedPositions('top', 'end');\r\nexport const TOP_CENTER_FLIPPED_POS = getConnectedPositions('top', 'center');\r\n\r\nexport const BOTTOM_START_FLIPPED_POS = getConnectedPositions('bottom', 'start');\r\nexport const BOTTOM_CENTER_FLIPPED_POS = getConnectedPositions('bottom', 'center');\r\nexport const BOTTOM_END_FLIPPED_POS = getConnectedPositions('bottom', 'end');","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAGA;;;;;;AAMG;
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-overlay.mjs","sources":["../../../projects/ng0/components/overlay/utils.ts","../../../projects/ng0/components/overlay/positions.ts","../../../projects/ng0/components/overlay/bootkit-ng0-components-overlay.ts"],"sourcesContent":["import { ConnectedPosition } from \"@angular/cdk/overlay\";\r\nimport { Alignment, flipPlacement, Placement } from \"@bootkit/ng0/common\";\r\n\r\n/**\r\n * Get the overlay position based on the provided placement and alignment.\r\n * \r\n * @param placement - The placement of the overlay (e.g., 'bottom', 'top', 'start', 'end').\r\n * @param alignment - The alignment of the overlay (e.g., 'start', 'center', 'end').\r\n * @returns The connected position for the overlay.\r\n */\r\nexport function getConnectedPosition(placement: Placement, alignment: Alignment): ConnectedPosition {\r\n let pos = {} as ConnectedPosition;\r\n\r\n switch (placement) {\r\n case 'bottom':\r\n pos.originY = 'bottom';\r\n pos.overlayY = 'top';\r\n pos.originX = alignment;\r\n pos.overlayX = alignment;\r\n break;\r\n case 'top':\r\n pos.originY = 'top';\r\n pos.overlayY = 'bottom';\r\n pos.originX = alignment;\r\n pos.overlayX = alignment;\r\n break;\r\n case 'start':\r\n pos.originX = 'start';\r\n pos.overlayX = 'end';\r\n\r\n if (alignment == 'start') {\r\n pos.originY = 'top';\r\n pos.overlayY = 'top';\r\n } else if (alignment == 'center') {\r\n pos.originY = 'center';\r\n pos.overlayY = 'center';\r\n } else {\r\n pos.originY = 'bottom';\r\n pos.overlayY = 'bottom';\r\n }\r\n break;\r\n case 'end':\r\n pos.originX = 'end';\r\n pos.overlayX = 'start';\r\n\r\n if (alignment == 'start') {\r\n pos.originY = 'top';\r\n pos.overlayY = 'top';\r\n } else if (alignment == 'center') {\r\n pos.originY = 'center';\r\n pos.overlayY = 'center';\r\n } else {\r\n pos.originY = 'bottom';\r\n pos.overlayY = 'bottom';\r\n }\r\n break;\r\n }\r\n\r\n return pos;\r\n}\r\n\r\nexport function getConnectedPositions(placement: Placement, alignment: Alignment, includeFlippedPlacement = true): ConnectedPosition[] {\r\n return [\r\n getConnectedPosition(placement, alignment),\r\n ...(includeFlippedPlacement ? [getConnectedPosition(flipPlacement(placement), alignment)] : []),\r\n ] ;\r\n}\r\n","import { getConnectedPosition, getConnectedPositions } from \"./utils\";\r\n\r\n// Positions\r\nexport const START_START_POS = getConnectedPosition('start', 'start');\r\nexport const START_CENTER_POS = getConnectedPosition('start', 'center');\r\nexport const START_END_POS = getConnectedPosition('start', 'end');\r\n\r\nexport const END_START_POS = getConnectedPosition('end', 'start');\r\nexport const END_CENTER_POS = getConnectedPosition('end', 'center');\r\nexport const END_END_POS = getConnectedPosition('end', 'end');\r\n\r\nexport const TOP_START_POS = getConnectedPosition('top', 'start');\r\nexport const TOP_END_POS = getConnectedPosition('top', 'end');\r\nexport const TOP_CENTER_POS = getConnectedPosition('top', 'center');\r\n\r\nexport const BOTTOM_START_POS = getConnectedPosition('bottom', 'start');\r\nexport const BOTTOM_CENTER_POS = getConnectedPosition('bottom', 'center');\r\nexport const BOTTOM_END_POS = getConnectedPosition('bottom', 'end');\r\n\r\n\r\n// Flipped positions\r\nexport const START_START_FLIPPED_POS = getConnectedPositions('start', 'start');\r\nexport const START_CENTER_FLIPPED_POS = getConnectedPositions('start', 'center');\r\nexport const START_END_FLIPPED_POS = getConnectedPositions('start', 'end');\r\n\r\nexport const END_START_FLIPPED_POS = getConnectedPositions('end', 'start');\r\nexport const END_CENTER_FLIPPED_POS = getConnectedPositions('end', 'center');\r\nexport const END_END_FLIPPED_POS = getConnectedPositions('end', 'end');\r\n\r\nexport const TOP_START_FLIPPED_POS = getConnectedPositions('top', 'start');\r\nexport const TOP_END_FLIPPED_POS = getConnectedPositions('top', 'end');\r\nexport const TOP_CENTER_FLIPPED_POS = getConnectedPositions('top', 'center');\r\n\r\nexport const BOTTOM_START_FLIPPED_POS = getConnectedPositions('bottom', 'start');\r\nexport const BOTTOM_CENTER_FLIPPED_POS = getConnectedPositions('bottom', 'center');\r\nexport const BOTTOM_END_FLIPPED_POS = getConnectedPositions('bottom', 'end');","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAGA;;;;;;AAMG;AACG,SAAU,oBAAoB,CAAC,SAAoB,EAAE,SAAoB,EAAA;IACzE,IAAI,GAAG,GAAG,EAAuB;IAEjC,QAAQ,SAAS;AACX,QAAA,KAAK,QAAQ;AACP,YAAA,GAAG,CAAC,OAAO,GAAG,QAAQ;AACtB,YAAA,GAAG,CAAC,QAAQ,GAAG,KAAK;AACpB,YAAA,GAAG,CAAC,OAAO,GAAG,SAAS;AACvB,YAAA,GAAG,CAAC,QAAQ,GAAG,SAAS;YACxB;AACN,QAAA,KAAK,KAAK;AACJ,YAAA,GAAG,CAAC,OAAO,GAAG,KAAK;AACnB,YAAA,GAAG,CAAC,QAAQ,GAAG,QAAQ;AACvB,YAAA,GAAG,CAAC,OAAO,GAAG,SAAS;AACvB,YAAA,GAAG,CAAC,QAAQ,GAAG,SAAS;YACxB;AACN,QAAA,KAAK,OAAO;AACN,YAAA,GAAG,CAAC,OAAO,GAAG,OAAO;AACrB,YAAA,GAAG,CAAC,QAAQ,GAAG,KAAK;AAEpB,YAAA,IAAI,SAAS,IAAI,OAAO,EAAE;AACpB,gBAAA,GAAG,CAAC,OAAO,GAAG,KAAK;AACnB,gBAAA,GAAG,CAAC,QAAQ,GAAG,KAAK;YAC1B;AAAO,iBAAA,IAAI,SAAS,IAAI,QAAQ,EAAE;AAC5B,gBAAA,GAAG,CAAC,OAAO,GAAG,QAAQ;AACtB,gBAAA,GAAG,CAAC,QAAQ,GAAG,QAAQ;YAC7B;iBAAO;AACD,gBAAA,GAAG,CAAC,OAAO,GAAG,QAAQ;AACtB,gBAAA,GAAG,C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K,EAAE,OAAO;AACzD,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,EAAE,KAAK;AACrD,MAAM,cAAc,GAAG,oBAAoB,CAAC,KAAK,EAAE,QAAQ;AAE3D,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,OAAO;AAC/D,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,QAAQ;AACjE,MAAM,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE,KAAK;AAGlE;AACO,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,OAAO,EAAE,OAAO;AACtE,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,OAAO,EAAE,QAAQ;AACxE,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,OAAO,EAAE,KAAK;AAElE,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,KAAK,EAAE,OAAO;AAClE,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,KAAK,EAAE,QAAQ;AACpE,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,KAAK,EAAE,KAAK;AAE9D,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,KAAK,EAAE,OAAO;AAClE,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,KAAK,EAAE,KAAK;AAC9D,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,KAAK,EAAE,QAAQ;AAEpE,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,OAAO;AACxE,MAAM,yBAAyB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,QAAQ;AAC1E,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,KAAK;;ACnC3E;;AAEG;;;;"}
|
|
@@ -1,23 +1,50 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
+
import { input, EventEmitter, computed, Output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
4
|
+
import { TranslatePipe } from '@bootkit/ng0/localization';
|
|
3
5
|
|
|
4
6
|
class PaginationComponent {
|
|
5
|
-
itemClick = new EventEmitter();
|
|
6
|
-
totalRecords = input.required();
|
|
7
|
-
pageSize = input(10);
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* Total number of records.
|
|
9
|
+
*/
|
|
10
|
+
totalRecords = input.required(...(ngDevMode ? [{ debugName: "totalRecords" }] : []));
|
|
11
|
+
/**
|
|
12
|
+
* Page size. Number of items in each page.
|
|
13
|
+
*/
|
|
14
|
+
pageSize = input(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
15
|
+
/**
|
|
16
|
+
* Selected page Index. starts from 1.
|
|
17
|
+
*/
|
|
18
|
+
selectedPage = input(1, ...(ngDevMode ? [{ debugName: "selectedPage" }] : []));
|
|
19
|
+
/**
|
|
20
|
+
* Maximum number of visible pages.
|
|
21
|
+
* Default is 10.
|
|
22
|
+
*/
|
|
23
|
+
maxVisiblePages = input(10, ...(ngDevMode ? [{ debugName: "maxVisiblePages" }] : []));
|
|
24
|
+
/**
|
|
25
|
+
* Show first and last buttons.
|
|
26
|
+
* Default is true.
|
|
27
|
+
*/
|
|
28
|
+
showNextPreviousButtons = input(true, ...(ngDevMode ? [{ debugName: "showNextPreviousButtons" }] : []));
|
|
29
|
+
/**
|
|
30
|
+
* Show first and last buttons.
|
|
31
|
+
* Default is true.
|
|
32
|
+
*/
|
|
33
|
+
showFirstLastButtons = input(true, ...(ngDevMode ? [{ debugName: "showFirstLastButtons" }] : []));
|
|
34
|
+
/**
|
|
35
|
+
* Total number of pages.
|
|
36
|
+
* This is a computed property based on totalRecords and pageSize.
|
|
37
|
+
* It is not an input property.
|
|
10
38
|
*/
|
|
11
|
-
selectedPage = input(1);
|
|
12
|
-
maxVisiblePages = input(10);
|
|
13
|
-
showNextButton = input(true);
|
|
14
|
-
showPreviousButton = input(true);
|
|
15
|
-
showFirstButton = input(true);
|
|
16
|
-
showLastButton = input(true);
|
|
17
39
|
get totalPagesCount() { return this._totalPagesCount; }
|
|
40
|
+
/**
|
|
41
|
+
* Emits the selected page index when a page is clicked.
|
|
42
|
+
* The index starts from 1.
|
|
43
|
+
*/
|
|
44
|
+
itemClick = new EventEmitter();
|
|
18
45
|
_totalPagesCount;
|
|
19
46
|
_visiblePages = computed(() => {
|
|
20
|
-
let selectedPage = this.selectedPage();
|
|
47
|
+
let selectedPage = this.selectedPage() || 0;
|
|
21
48
|
let totalRecords = this.totalRecords();
|
|
22
49
|
let pageSize = this.pageSize();
|
|
23
50
|
if (!Number.isInteger(totalRecords) || totalRecords < 0) {
|
|
@@ -27,8 +54,8 @@ class PaginationComponent {
|
|
|
27
54
|
throw new Error('Page size must be a posotive integer.');
|
|
28
55
|
}
|
|
29
56
|
this._totalPagesCount = Math.ceil(totalRecords / pageSize);
|
|
30
|
-
if (selectedPage <
|
|
31
|
-
throw new Error(`Selected page must be between
|
|
57
|
+
if (selectedPage < 0 || selectedPage > this._totalPagesCount) {
|
|
58
|
+
throw new Error(`Selected page must be between 0 and ${this._totalPagesCount}.`);
|
|
32
59
|
}
|
|
33
60
|
let indices = [];
|
|
34
61
|
let firstVisiblePage = selectedPage;
|
|
@@ -49,23 +76,31 @@ class PaginationComponent {
|
|
|
49
76
|
}
|
|
50
77
|
}
|
|
51
78
|
return indices;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
|
|
79
|
+
}, ...(ngDevMode ? [{ debugName: "_visiblePages" }] : []));
|
|
80
|
+
_onPageChange(pageIndex) {
|
|
81
|
+
debugger;
|
|
82
|
+
console.log('click');
|
|
83
|
+
this.itemClick.emit(pageIndex);
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: PaginationComponent, isStandalone: true, selector: "ng0-pagination", inputs: { totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, selectedPage: { classPropertyName: "selectedPage", publicName: "selectedPage", isSignal: true, isRequired: false, transformFunction: null }, maxVisiblePages: { classPropertyName: "maxVisiblePages", publicName: "maxVisiblePages", isSignal: true, isRequired: false, transformFunction: null }, showNextPreviousButtons: { classPropertyName: "showNextPreviousButtons", publicName: "showNextPreviousButtons", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, exportAs: ["ng0Pagination"], ngImport: i0, template: "@let _selectedPage = selectedPage();\r\n\r\n<nav>\r\n <ul class=\"pagination\">\r\n @if(showFirstLastButtons() || showFirstLastButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage <= 1\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(1)\">\r\n <ng-content select=\"first\">\r\n {{'first' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n\r\n @if(showNextPreviousButtons() || showNextPreviousButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage <= 1\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(_selectedPage! - 1)\">\r\n <ng-content select=\"previous\">\r\n {{'previous' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n\r\n @for (page of _visiblePages(); track page) {\r\n <li class=\"page-item\" [class.active]=\"_selectedPage === page\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(page)\">\r\n {{page}}\r\n </button>\r\n </li>\r\n }\r\n\r\n @if(showNextPreviousButtons() || showNextPreviousButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage >= _totalPagesCount\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(_selectedPage! + 1)\">\r\n <ng-content select=\"next\">\r\n {{'next' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n\r\n @if(showFirstLastButtons() || showFirstLastButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage >= _totalPagesCount\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(_totalPagesCount)\">\r\n <ng-content select=\"last\">\r\n {{'last' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n</nav>\r\n\r\n<style>\r\n .pagination {\r\n margin: 0;\r\n }\r\n</style>", styles: [".pagination{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: TranslatePipe, name: "ng0Translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
55
87
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
57
89
|
type: Component,
|
|
58
|
-
args: [{ selector: 'ng0-pagination', exportAs: 'ng0Pagination', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true,
|
|
90
|
+
args: [{ selector: 'ng0-pagination', exportAs: 'ng0Pagination', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
91
|
+
CommonModule,
|
|
92
|
+
TranslatePipe
|
|
93
|
+
], template: "@let _selectedPage = selectedPage();\r\n\r\n<nav>\r\n <ul class=\"pagination\">\r\n @if(showFirstLastButtons() || showFirstLastButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage <= 1\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(1)\">\r\n <ng-content select=\"first\">\r\n {{'first' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n\r\n @if(showNextPreviousButtons() || showNextPreviousButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage <= 1\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(_selectedPage! - 1)\">\r\n <ng-content select=\"previous\">\r\n {{'previous' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n\r\n @for (page of _visiblePages(); track page) {\r\n <li class=\"page-item\" [class.active]=\"_selectedPage === page\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(page)\">\r\n {{page}}\r\n </button>\r\n </li>\r\n }\r\n\r\n @if(showNextPreviousButtons() || showNextPreviousButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage >= _totalPagesCount\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(_selectedPage! + 1)\">\r\n <ng-content select=\"next\">\r\n {{'next' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n\r\n @if(showFirstLastButtons() || showFirstLastButtons() == undefined) {\r\n <li class=\"page-item\" [class.disabled]=\"_selectedPage == undefined || _selectedPage >= _totalPagesCount\">\r\n <button class=\"page-link\" (click)=\"itemClick.emit(_totalPagesCount)\">\r\n <ng-content select=\"last\">\r\n {{'last' | ng0Translate}}\r\n </ng-content>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n</nav>\r\n\r\n<style>\r\n .pagination {\r\n margin: 0;\r\n }\r\n</style>" }]
|
|
59
94
|
}], propDecorators: { itemClick: [{
|
|
60
95
|
type: Output
|
|
61
96
|
}] } });
|
|
62
97
|
|
|
63
98
|
class PaginationModule {
|
|
64
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
65
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
66
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: PaginationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
100
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: PaginationModule, imports: [PaginationComponent], exports: [PaginationComponent] });
|
|
101
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: PaginationModule, imports: [PaginationComponent] });
|
|
67
102
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: PaginationModule, decorators: [{
|
|
69
104
|
type: NgModule,
|
|
70
105
|
args: [{
|
|
71
106
|
imports: [
|