@bootkit/ng0 0.0.0-alpha.7 → 0.0.0-alpha.9
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/components/nav/index.d.ts +23 -19
- package/components/pagination/index.d.ts +38 -3
- package/components/table/index.d.ts +35 -14
- package/data/index.d.ts +17 -5
- 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 +3 -3
- package/fesm2022/bootkit-ng0-components-backdrop.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-button.mjs +11 -11
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-card.mjs +11 -11
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-code.mjs +9 -9
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -1
- 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 +13 -13
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-form-field.mjs +13 -13
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-modal.mjs +12 -12
- 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 +61 -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-sidenav.mjs +18 -18
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-stepper.mjs +12 -12
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-table.mjs +87 -90
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-toast.mjs +6 -6
- 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 +24 -24
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-data.mjs +25 -6
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-form.mjs +30 -52
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-http.mjs +38 -3
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization.mjs +202 -91
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -1
- 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 +3 -3
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-security.mjs +15 -15
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/form/index.d.ts +5 -9
- package/http/index.d.ts +35 -0
- package/localization/index.d.ts +88 -28
- package/package.json +27 -23
- package/platform/browser/index.d.ts +22 -0
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ElementRef,
|
|
2
|
+
import { ElementRef, TemplateRef, OnInit, QueryList, Renderer2 } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
declare class NavDirective {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The active item.
|
|
7
|
+
*/
|
|
7
8
|
activeItem: i0.ModelSignal<any>;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the navigation is disabled.
|
|
11
|
+
*/
|
|
8
12
|
disabled: i0.InputSignal<boolean>;
|
|
9
|
-
constructor(
|
|
13
|
+
constructor();
|
|
10
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<NavDirective, never>;
|
|
11
15
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NavDirective, "[ng0Nav]", ["ng0Nav"], { "activeItem": { "alias": "activeItem"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "activeItem": "activeItemChange"; }, never, never, true, never>;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
declare class NavItemDirective {
|
|
15
19
|
elementRef: ElementRef;
|
|
16
|
-
private _renderer;
|
|
17
|
-
private _nav;
|
|
18
20
|
id: i0.InputSignal<any>;
|
|
19
21
|
disabled: i0.InputSignal<boolean>;
|
|
20
|
-
constructor(elementRef: ElementRef
|
|
22
|
+
constructor(elementRef: ElementRef);
|
|
21
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<NavItemDirective, never>;
|
|
22
24
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NavItemDirective, "[ng0NavItem]", ["ng0NavItem"], { "id": { "alias": "ng0NavItem"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
declare class NavLinkDirective {
|
|
26
28
|
elementRef: ElementRef;
|
|
27
|
-
private _renderer;
|
|
28
29
|
private _nav;
|
|
29
30
|
private _navItem;
|
|
30
|
-
constructor(elementRef: ElementRef,
|
|
31
|
+
constructor(elementRef: ElementRef, _nav: NavDirective, _navItem: NavItemDirective);
|
|
31
32
|
private _onClick;
|
|
32
33
|
private get _active();
|
|
33
34
|
private get _disabled();
|
|
@@ -35,30 +36,33 @@ declare class NavLinkDirective {
|
|
|
35
36
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NavLinkDirective, "[ng0NavLink]", ["ng0NavLink"], {}, {}, never, never, true, never>;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
declare class
|
|
39
|
+
declare class NavContentDirective {
|
|
39
40
|
templateRef: TemplateRef<any>;
|
|
40
41
|
id: i0.InputSignal<any>;
|
|
41
42
|
constructor(templateRef: TemplateRef<any>);
|
|
42
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
43
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavContentDirective, never>;
|
|
44
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NavContentDirective, "[ng0NavContent]", ["ng0NavContent"], { "id": { "alias": "ng0NavContent"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
declare class
|
|
47
|
+
declare class NavContentContainerComponent implements OnInit {
|
|
47
48
|
private _elementRef;
|
|
48
49
|
private _renderer;
|
|
50
|
+
/**
|
|
51
|
+
* The navigation directive that this content belongs to.
|
|
52
|
+
*/
|
|
49
53
|
nav: i0.InputSignal<NavDirective>;
|
|
50
|
-
protected
|
|
51
|
-
|
|
54
|
+
protected _contents: QueryList<NavContentDirective>;
|
|
55
|
+
protected _activeItem: i0.Signal<any>;
|
|
52
56
|
constructor(_elementRef: ElementRef, _renderer: Renderer2);
|
|
53
57
|
ngOnInit(): void;
|
|
54
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
55
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavContentContainerComponent, never>;
|
|
59
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavContentContainerComponent, "ng0-navcontent-container", ["ng0Navcontent"], { "nav": { "alias": "nav"; "required": true; "isSignal": true; }; }, {}, ["_contents"], never, true, never>;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
declare class NavModule {
|
|
59
63
|
static ɵfac: i0.ɵɵFactoryDeclaration<NavModule, never>;
|
|
60
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NavModule, never, [typeof NavDirective, typeof NavItemDirective, typeof NavLinkDirective, typeof
|
|
64
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NavModule, never, [typeof NavDirective, typeof NavItemDirective, typeof NavLinkDirective, typeof NavContentContainerComponent, typeof NavContentDirective], [typeof NavDirective, typeof NavItemDirective, typeof NavLinkDirective, typeof NavContentContainerComponent, typeof NavContentDirective]>;
|
|
61
65
|
static ɵinj: i0.ɵɵInjectorDeclaration<NavModule>;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
export { NavDirective, NavItemDirective, NavLinkDirective, NavModule
|
|
68
|
+
export { NavContentContainerComponent, NavContentDirective, NavDirective, NavItemDirective, NavLinkDirective, NavModule };
|
|
@@ -2,19 +2,54 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { EventEmitter } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
declare class PaginationComponent {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Total number of records.
|
|
7
|
+
*/
|
|
6
8
|
totalRecords: _angular_core.InputSignal<number>;
|
|
9
|
+
/**
|
|
10
|
+
* Page size. Number of items in each page.
|
|
11
|
+
*/
|
|
7
12
|
pageSize: _angular_core.InputSignal<number>;
|
|
8
13
|
/**
|
|
9
|
-
* Selected page. starts from 1.
|
|
14
|
+
* Selected page Index. starts from 1.
|
|
15
|
+
*/
|
|
16
|
+
selectedPage: _angular_core.InputSignal<number | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum number of visible pages.
|
|
19
|
+
* Default is 10.
|
|
10
20
|
*/
|
|
11
|
-
selectedPage: _angular_core.InputSignal<number>;
|
|
12
21
|
maxVisiblePages: _angular_core.InputSignal<number>;
|
|
22
|
+
/**
|
|
23
|
+
* Show first button.
|
|
24
|
+
* Default is true.
|
|
25
|
+
*/
|
|
13
26
|
showNextButton: _angular_core.InputSignal<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* Show previous button.
|
|
29
|
+
* Default is true.
|
|
30
|
+
*/
|
|
14
31
|
showPreviousButton: _angular_core.InputSignal<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Show first button.
|
|
34
|
+
* Default is true.
|
|
35
|
+
*/
|
|
15
36
|
showFirstButton: _angular_core.InputSignal<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Show last button.
|
|
39
|
+
* Default is true.
|
|
40
|
+
*/
|
|
16
41
|
showLastButton: _angular_core.InputSignal<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Total number of pages.
|
|
44
|
+
* This is a computed property based on totalRecords and pageSize.
|
|
45
|
+
* It is not an input property.
|
|
46
|
+
*/
|
|
17
47
|
get totalPagesCount(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Emits the selected page index when a page is clicked.
|
|
50
|
+
* The index starts from 0.
|
|
51
|
+
*/
|
|
52
|
+
itemClick: EventEmitter<number>;
|
|
18
53
|
protected _totalPagesCount: number;
|
|
19
54
|
protected _visiblePages: _angular_core.Signal<number[]>;
|
|
20
55
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PaginationComponent, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { TemplateRef, OnInit, AfterContentInit, OnDestroy, QueryList, DestroyRef } from '@angular/core';
|
|
3
3
|
import { formatString } from '@bootkit/ng0/common';
|
|
4
|
-
import { DataLoader, DataSource } from '@bootkit/ng0/data';
|
|
4
|
+
import { DataLoader, DataSource, DataResult, DataRequest } from '@bootkit/ng0/data';
|
|
5
5
|
|
|
6
6
|
type DataTableColumnBadgeValueType = string | number | boolean;
|
|
7
7
|
declare class TableColumnDirective {
|
|
@@ -70,9 +70,14 @@ declare class TableComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
70
70
|
* If true, the table will support pagination.
|
|
71
71
|
* If false, the table will load all records at once.
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
paging: _angular_core.InputSignal<boolean>;
|
|
74
74
|
/**
|
|
75
|
-
* If true, the table will
|
|
75
|
+
* If true, the table will support sorting.
|
|
76
|
+
* This will add a sort icon to each column header.
|
|
77
|
+
*/
|
|
78
|
+
sortable: _angular_core.InputSignal<boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* If true, the table will show pagination controls at the bottom.
|
|
76
81
|
*/
|
|
77
82
|
showPagination: _angular_core.InputSignal<boolean>;
|
|
78
83
|
/**
|
|
@@ -81,11 +86,17 @@ declare class TableComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
81
86
|
*/
|
|
82
87
|
pageSize: _angular_core.InputSignal<number>;
|
|
83
88
|
/**
|
|
84
|
-
* The
|
|
89
|
+
* The initial page index to load when the table is initialized.
|
|
85
90
|
* This is only used if pagable is true.
|
|
86
|
-
* The
|
|
91
|
+
* The index starts from 1.
|
|
92
|
+
* Default is 1.
|
|
87
93
|
*/
|
|
88
|
-
|
|
94
|
+
initialPageIndex: _angular_core.InputSignal<number>;
|
|
95
|
+
/**
|
|
96
|
+
* Maximum number of visible pages.
|
|
97
|
+
* Default is 10.
|
|
98
|
+
*/
|
|
99
|
+
maxVisiblePages: _angular_core.InputSignal<number>;
|
|
89
100
|
/**
|
|
90
101
|
* The CSS class to apply to the table element.
|
|
91
102
|
* This can be used to apply custom styles to the table.
|
|
@@ -99,6 +110,10 @@ declare class TableComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
99
110
|
* The caption of the table.
|
|
100
111
|
*/
|
|
101
112
|
caption: _angular_core.InputSignal<string | undefined>;
|
|
113
|
+
/**
|
|
114
|
+
* The height of the table in pixels.
|
|
115
|
+
* This can be used to set a fixed height for the table.
|
|
116
|
+
*/
|
|
102
117
|
height: _angular_core.InputSignal<number | undefined>;
|
|
103
118
|
/**
|
|
104
119
|
* If true, the table will support filtering.
|
|
@@ -107,9 +122,9 @@ declare class TableComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
107
122
|
filterable: _angular_core.InputSignal<boolean>;
|
|
108
123
|
protected _columns: QueryList<TableColumnDirective>;
|
|
109
124
|
protected _detailRow?: TableDetailRowDirective;
|
|
110
|
-
protected
|
|
111
|
-
protected
|
|
112
|
-
protected
|
|
125
|
+
protected _dataResult?: DataResult;
|
|
126
|
+
protected _lastRequest?: DataRequest;
|
|
127
|
+
protected _loadingRequest?: DataRequest;
|
|
113
128
|
protected _rowStates: Map<any, {
|
|
114
129
|
expanded: boolean;
|
|
115
130
|
}>;
|
|
@@ -119,16 +134,22 @@ declare class TableComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
119
134
|
constructor(_destroyRef: DestroyRef);
|
|
120
135
|
ngOnInit(): void;
|
|
121
136
|
ngAfterContentInit(): void;
|
|
122
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Load data for the specified page index (optional).
|
|
139
|
+
* @param pageIndex The page index to load.
|
|
140
|
+
*/
|
|
141
|
+
load(pageIndex?: number): void;
|
|
142
|
+
/**
|
|
143
|
+
* Determines if the table is currently loading data.
|
|
144
|
+
*/
|
|
123
145
|
get loading(): boolean;
|
|
124
146
|
protected _getCellValue(row: any, col: TableColumnDirective): any;
|
|
125
|
-
protected
|
|
126
|
-
protected
|
|
127
|
-
protected onToggleRowDetailClick(row: any): void;
|
|
147
|
+
protected _onPageChange(pageIndex: number): void;
|
|
148
|
+
protected _onToggleRowDetailClick(row: any): void;
|
|
128
149
|
protected isRowExpanded(row: any): boolean;
|
|
129
150
|
ngOnDestroy(): void;
|
|
130
151
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
131
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "ng0-table", ["ng0Table"], { "source": { "alias": "source"; "required": true; "isSignal": true; }; "autoLoad": { "alias": "autoLoad"; "required": false; "isSignal": true; }; "showRowNumbers": { "alias": "showRowNumbers"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "
|
|
152
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "ng0-table", ["ng0Table"], { "source": { "alias": "source"; "required": true; "isSignal": true; }; "autoLoad": { "alias": "autoLoad"; "required": false; "isSignal": true; }; "showRowNumbers": { "alias": "showRowNumbers"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "paging": { "alias": "paging"; "required": false; "isSignal": true; }; "sortable": { "alias": "sortable"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "initialPageIndex": { "alias": "initialPageIndex"; "required": false; "isSignal": true; }; "maxVisiblePages": { "alias": "maxVisiblePages"; "required": false; "isSignal": true; }; "tableClass": { "alias": "tableClass"; "required": false; "isSignal": true; }; "headerClass": { "alias": "headerClass"; "required": false; "isSignal": true; }; "caption": { "alias": "caption"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "filterable": { "alias": "filterable"; "required": false; "isSignal": true; }; }, {}, ["_detailRow", "_columns"], ["paging-first", "paging-last", "paging-next", "paging-previous", "paging-info"], true, never>;
|
|
132
153
|
}
|
|
133
154
|
|
|
134
155
|
declare class TableModule {
|
package/data/index.d.ts
CHANGED
|
@@ -14,8 +14,7 @@ declare class DataRequest {
|
|
|
14
14
|
select?: string[];
|
|
15
15
|
computeTotal?: boolean;
|
|
16
16
|
constructor(options?: {
|
|
17
|
-
|
|
18
|
-
pageSize?: number;
|
|
17
|
+
page?: DataRequestPage;
|
|
19
18
|
filters?: DataRequestFilter[];
|
|
20
19
|
sort?: DataRequestSort;
|
|
21
20
|
select?: string[];
|
|
@@ -23,13 +22,22 @@ declare class DataRequest {
|
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
|
-
* Represents a
|
|
27
|
-
* @property index The index of the page (0-based).
|
|
28
|
-
* @property size The size of the page (number of items per page).
|
|
25
|
+
* Represents a data request page.
|
|
29
26
|
*/
|
|
30
27
|
interface DataRequestPage {
|
|
28
|
+
/**
|
|
29
|
+
* Index of the page.
|
|
30
|
+
* If zeroBased is true, the index starts from 0.
|
|
31
|
+
*/
|
|
31
32
|
index: number;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the page, i.e., number of items in each page.
|
|
35
|
+
*/
|
|
32
36
|
size: number;
|
|
37
|
+
/**
|
|
38
|
+
* Indicates if the index is zero-based.
|
|
39
|
+
*/
|
|
40
|
+
zeroBased: boolean;
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
* Represents a sorting option in a DataRequest.
|
|
@@ -81,6 +89,10 @@ declare class AsyncDataSource extends DataSource {
|
|
|
81
89
|
load(request: DataRequest): Observable<DataResult<any>>;
|
|
82
90
|
}
|
|
83
91
|
|
|
92
|
+
/**
|
|
93
|
+
* An implementation of DataSource that uses an array as the data source.
|
|
94
|
+
* This is useful for static data or when you want to manage the data manually.
|
|
95
|
+
*/
|
|
84
96
|
declare class ArrayDataSource extends DataSource {
|
|
85
97
|
private items;
|
|
86
98
|
private _insertSubject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-common.mjs","sources":["../../../projects/ng0/common/types.ts","../../../projects/ng0/common/utils.ts","../../../projects/ng0/common/format-string.ts","../../../projects/ng0/common/bootkit-ng0-common.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\n\r\nexport type Placement = 'start' | 'end' | 'top' | 'bottom';\r\nexport type Alignment = 'start' | 'center' | 'end';\r\nexport const RTL = new InjectionToken<boolean>('RTL Direction');","import { Placement } from \"./types\";\r\n\r\nexport function numberRange(start: number, end: number) {\r\n return Array.from({ length: end - start + 1 }, (_, i) => i + start)\r\n}\r\n\r\nexport function fillArray(start: number, end: number): number[] {\r\n const result: number[] = [];\r\n for (let i = start; i <= end; i++) {\r\n result.push(i);\r\n }\r\n return result;\r\n}\r\n\r\nexport function flipPlacement(placement: Placement) {\r\n switch (placement) {\r\n case 'bottom':\r\n return 'top'\r\n case 'top':\r\n return 'bottom'\r\n case 'start':\r\n return 'end'\r\n case 'end':\r\n return 'start'\r\n }\r\n}\r\n","export function formatString(str: string, ...args: any[]) {\r\n return str.replace(/\\{(\\d+)\\}/g, function (match, index) {\r\n return args[index];\r\n });\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAIa,GAAG,GAAG,IAAI,cAAc,CAAU,eAAe;;
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-common.mjs","sources":["../../../projects/ng0/common/types.ts","../../../projects/ng0/common/utils.ts","../../../projects/ng0/common/format-string.ts","../../../projects/ng0/common/bootkit-ng0-common.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\n\r\nexport type Placement = 'start' | 'end' | 'top' | 'bottom';\r\nexport type Alignment = 'start' | 'center' | 'end';\r\nexport const RTL = new InjectionToken<boolean>('RTL Direction');","import { Placement } from \"./types\";\r\n\r\nexport function numberRange(start: number, end: number) {\r\n return Array.from({ length: end - start + 1 }, (_, i) => i + start)\r\n}\r\n\r\nexport function fillArray(start: number, end: number): number[] {\r\n const result: number[] = [];\r\n for (let i = start; i <= end; i++) {\r\n result.push(i);\r\n }\r\n return result;\r\n}\r\n\r\nexport function flipPlacement(placement: Placement) {\r\n switch (placement) {\r\n case 'bottom':\r\n return 'top'\r\n case 'top':\r\n return 'bottom'\r\n case 'start':\r\n return 'end'\r\n case 'end':\r\n return 'start'\r\n }\r\n}\r\n","export function formatString(str: string, ...args: any[]) {\r\n return str.replace(/\\{(\\d+)\\}/g, function (match, index) {\r\n return args[index];\r\n });\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAIa,GAAG,GAAG,IAAI,cAAc,CAAU,eAAe;;ACFxD,SAAU,WAAW,CAAC,KAAa,EAAE,GAAW,EAAA;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AACvE;AAEM,SAAU,SAAS,CAAC,KAAa,EAAE,GAAW,EAAA;IAChD,MAAM,MAAM,GAAa,EAAE;AAC3B,IAAA,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;AAC/B,QAAA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;AAElB,IAAA,OAAO,MAAM;AACjB;AAEM,SAAU,aAAa,CAAC,SAAoB,EAAA;IAC9C,QAAQ,SAAS;AACb,QAAA,KAAK,QAAQ;AACT,YAAA,OAAO,KAAK;AAChB,QAAA,KAAK,KAAK;AACN,YAAA,OAAO,QAAQ;AACnB,QAAA,KAAK,OAAO;AACR,YAAA,OAAO,KAAK;AAChB,QAAA,KAAK,KAAK;AACN,YAAA,OAAO,OAAO;;AAE1B;;SCzBgB,YAAY,CAAC,GAAW,EAAE,GAAG,IAAW,EAAA;IACpD,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,KAAK,EAAA;AACnD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC;AACtB,KAAC,CAAC;AACN;;ACJA;;AAEG;;;;"}
|
|
@@ -6,8 +6,8 @@ class AccordionItemComponent {
|
|
|
6
6
|
_element;
|
|
7
7
|
_renderer;
|
|
8
8
|
_accordion;
|
|
9
|
-
header = input();
|
|
10
|
-
collapsed = model(true);
|
|
9
|
+
header = input(...(ngDevMode ? [undefined, { debugName: "header" }] : []));
|
|
10
|
+
collapsed = model(true, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
11
11
|
constructor(_element, _renderer, _accordion) {
|
|
12
12
|
this._element = _element;
|
|
13
13
|
this._renderer = _renderer;
|
|
@@ -22,10 +22,10 @@ class AccordionItemComponent {
|
|
|
22
22
|
}
|
|
23
23
|
}, { allowSignalWrites: true });
|
|
24
24
|
}
|
|
25
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
26
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: AccordionComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.3", type: AccordionItemComponent, isStandalone: true, selector: "ng0-accordion-item", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange" }, exportAs: ["ng0AccordionItem"], ngImport: i0, template: "<h6 class=\"accordion-header\">\r\n <button class=\"accordion-button\" type=\"button\" [class.collapsed]=\"collapsed()\" (click)=\"collapsed.set(!collapsed())\">\r\n {{header()}}\r\n </button>\r\n</h6>\r\n\r\n<ng0-collapse [collapsed]=\"collapsed()\">\r\n <div class=\"accordion-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n</ng0-collapse>", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: CollapseComponent, selector: "ng0-collapse", inputs: ["collapsed", "timings"], outputs: ["collapsedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
27
27
|
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionItemComponent, decorators: [{
|
|
29
29
|
type: Component,
|
|
30
30
|
args: [{ selector: 'ng0-accordion-item', exportAs: 'ng0AccordionItem', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
31
31
|
CollapseComponent
|
|
@@ -36,17 +36,17 @@ class AccordionComponent {
|
|
|
36
36
|
_element;
|
|
37
37
|
_renderer;
|
|
38
38
|
/** Items open mode */
|
|
39
|
-
mode = input('single');
|
|
39
|
+
mode = input('single', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
40
40
|
items;
|
|
41
41
|
constructor(_element, _renderer) {
|
|
42
42
|
this._element = _element;
|
|
43
43
|
this._renderer = _renderer;
|
|
44
44
|
this._renderer.addClass(this._element.nativeElement, 'accordion');
|
|
45
45
|
}
|
|
46
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
47
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.3", type: AccordionComponent, isStandalone: true, selector: "ng0-accordion", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "items", predicate: AccordionItemComponent }], exportAs: ["ng0Accordion"], ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
48
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
50
50
|
type: Component,
|
|
51
51
|
args: [{ selector: 'ng0-accordion', exportAs: 'ng0Accordion', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", styles: [":host{display:block}\n"] }]
|
|
52
52
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { items: [{
|
|
@@ -55,13 +55,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
55
55
|
}] } });
|
|
56
56
|
|
|
57
57
|
class AccordionModule {
|
|
58
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
59
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
59
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AccordionModule, imports: [AccordionComponent,
|
|
60
60
|
AccordionItemComponent], exports: [AccordionComponent,
|
|
61
61
|
AccordionItemComponent] });
|
|
62
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
62
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionModule, imports: [AccordionItemComponent] });
|
|
63
63
|
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AccordionModule, decorators: [{
|
|
65
65
|
type: NgModule,
|
|
66
66
|
args: [{
|
|
67
67
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-accordion.mjs","sources":["../../../projects/ng0/components/accordion/accordion-item.component.ts","../../../projects/ng0/components/accordion/accordion-item.component.html","../../../projects/ng0/components/accordion/accordion.component.ts","../../../projects/ng0/components/accordion/accordion.component.html","../../../projects/ng0/components/accordion/accordion.module.ts","../../../projects/ng0/components/accordion/bootkit-ng0-components-accordion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, ElementRef, input, model, Renderer2 } from '@angular/core';\r\nimport { CollapseComponent } from '@bootkit/ng0/components/collapse';\r\nimport { AccordionComponent } from './accordion.component';\r\n\r\n@Component({\r\n selector: 'ng0-accordion-item',\r\n exportAs: 'ng0AccordionItem',\r\n templateUrl: './accordion-item.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n styles: `:host {display: block;}`,\r\n imports: [\r\n CollapseComponent\r\n ]\r\n})\r\nexport class AccordionItemComponent {\r\n public header = input<string>();\r\n public collapsed = model(true);\r\n\r\n constructor(private _element: ElementRef, private _renderer: Renderer2, private _accordion: AccordionComponent) {\r\n this._renderer.addClass(this._element.nativeElement, 'accordion-item');\r\n\r\n effect(() => {\r\n var collapsed = this.collapsed();\r\n \r\n if(_accordion.mode() == 'single') {\r\n if(!collapsed) {\r\n this._accordion.items.filter(x => x !== this).forEach(x => x.collapsed.update(x => true));\r\n }\r\n }\r\n }, {allowSignalWrites: true})\r\n }\r\n}\r\n","<h6 class=\"accordion-header\">\r\n <button class=\"accordion-button\" type=\"button\" [class.collapsed]=\"collapsed()\" (click)=\"collapsed.set(!collapsed())\">\r\n {{header()}}\r\n </button>\r\n</h6>\r\n\r\n<ng0-collapse [collapsed]=\"collapsed()\">\r\n <div class=\"accordion-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n</ng0-collapse>","import { ChangeDetectionStrategy, Component, ContentChildren, ElementRef, input, QueryList, Renderer2 } from '@angular/core';\r\nimport { AccordionItemComponent } from './accordion-item.component';\r\n\r\n@Component({\r\n selector: 'ng0-accordion',\r\n exportAs: 'ng0Accordion',\r\n templateUrl: './accordion.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n styles: `:host {display: block;}`\r\n})\r\nexport class AccordionComponent {\r\n /** Items open mode */\r\n public mode = input<'single' | 'multiple'>('single');\r\n\r\n @ContentChildren(AccordionItemComponent)\r\n public readonly items!: QueryList<AccordionItemComponent>;\r\n\r\n constructor(private _element: ElementRef, private _renderer: Renderer2) {\r\n this._renderer.addClass(this._element.nativeElement, 'accordion');\r\n }\r\n}\r\n","<ng-content></ng-content>","import { NgModule } from '@angular/core';\r\nimport { AccordionComponent } from './accordion.component';\r\nimport { AccordionItemComponent } from './accordion-item.component';\r\n\r\n@NgModule({\r\n imports: [\r\n AccordionComponent,\r\n AccordionItemComponent,\r\n ],\r\n exports: [\r\n AccordionComponent,\r\n AccordionItemComponent,\r\n ]\r\n})\r\nexport class AccordionModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AccordionComponent"],"mappings":";;;;MAea,sBAAsB,CAAA;AAIX,IAAA,QAAA;AAA8B,IAAA,SAAA;AAA8B,IAAA,UAAA;IAHzE,MAAM,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-accordion.mjs","sources":["../../../projects/ng0/components/accordion/accordion-item.component.ts","../../../projects/ng0/components/accordion/accordion-item.component.html","../../../projects/ng0/components/accordion/accordion.component.ts","../../../projects/ng0/components/accordion/accordion.component.html","../../../projects/ng0/components/accordion/accordion.module.ts","../../../projects/ng0/components/accordion/bootkit-ng0-components-accordion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, ElementRef, input, model, Renderer2 } from '@angular/core';\r\nimport { CollapseComponent } from '@bootkit/ng0/components/collapse';\r\nimport { AccordionComponent } from './accordion.component';\r\n\r\n@Component({\r\n selector: 'ng0-accordion-item',\r\n exportAs: 'ng0AccordionItem',\r\n templateUrl: './accordion-item.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n styles: `:host {display: block;}`,\r\n imports: [\r\n CollapseComponent\r\n ]\r\n})\r\nexport class AccordionItemComponent {\r\n public header = input<string>();\r\n public collapsed = model(true);\r\n\r\n constructor(private _element: ElementRef, private _renderer: Renderer2, private _accordion: AccordionComponent) {\r\n this._renderer.addClass(this._element.nativeElement, 'accordion-item');\r\n\r\n effect(() => {\r\n var collapsed = this.collapsed();\r\n \r\n if(_accordion.mode() == 'single') {\r\n if(!collapsed) {\r\n this._accordion.items.filter(x => x !== this).forEach(x => x.collapsed.update(x => true));\r\n }\r\n }\r\n }, {allowSignalWrites: true})\r\n }\r\n}\r\n","<h6 class=\"accordion-header\">\r\n <button class=\"accordion-button\" type=\"button\" [class.collapsed]=\"collapsed()\" (click)=\"collapsed.set(!collapsed())\">\r\n {{header()}}\r\n </button>\r\n</h6>\r\n\r\n<ng0-collapse [collapsed]=\"collapsed()\">\r\n <div class=\"accordion-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n</ng0-collapse>","import { ChangeDetectionStrategy, Component, ContentChildren, ElementRef, input, QueryList, Renderer2 } from '@angular/core';\r\nimport { AccordionItemComponent } from './accordion-item.component';\r\n\r\n@Component({\r\n selector: 'ng0-accordion',\r\n exportAs: 'ng0Accordion',\r\n templateUrl: './accordion.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n styles: `:host {display: block;}`\r\n})\r\nexport class AccordionComponent {\r\n /** Items open mode */\r\n public mode = input<'single' | 'multiple'>('single');\r\n\r\n @ContentChildren(AccordionItemComponent)\r\n public readonly items!: QueryList<AccordionItemComponent>;\r\n\r\n constructor(private _element: ElementRef, private _renderer: Renderer2) {\r\n this._renderer.addClass(this._element.nativeElement, 'accordion');\r\n }\r\n}\r\n","<ng-content></ng-content>","import { NgModule } from '@angular/core';\r\nimport { AccordionComponent } from './accordion.component';\r\nimport { AccordionItemComponent } from './accordion-item.component';\r\n\r\n@NgModule({\r\n imports: [\r\n AccordionComponent,\r\n AccordionItemComponent,\r\n ],\r\n exports: [\r\n AccordionComponent,\r\n AccordionItemComponent,\r\n ]\r\n})\r\nexport class AccordionModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AccordionComponent"],"mappings":";;;;MAea,sBAAsB,CAAA;AAIX,IAAA,QAAA;AAA8B,IAAA,SAAA;AAA8B,IAAA,UAAA;IAHzE,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AACxB,IAAA,SAAS,GAAG,KAAK,CAAC,IAAI,qDAAC;AAE9B,IAAA,WAAA,CAAoB,QAAoB,EAAU,SAAoB,EAAU,UAA8B,EAAA;QAA1F,IAAA,CAAA,QAAQ,GAAR,QAAQ;QAAsB,IAAA,CAAA,SAAS,GAAT,SAAS;QAAqB,IAAA,CAAA,UAAU,GAAV,UAAU;AACtF,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;QAEtE,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;AAEhC,YAAA,IAAG,UAAU,CAAC,IAAI,EAAE,IAAI,QAAQ,EAAE;gBAC9B,IAAG,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AACzB;AACJ,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -3,8 +3,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
|
3
3
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
4
4
|
|
|
5
5
|
class BackdropComponent {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: BackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: BackdropComponent, isStandalone: true, selector: "ng0-backdrop", host: { properties: { "@fade": "" } }, ngImport: i0, template: '', isInline: true, styles: [":host{position:absolute;inset:0;background-color:#00000080}\n"], animations: [
|
|
8
8
|
trigger('fade', [
|
|
9
9
|
transition(':enter', [
|
|
10
10
|
style({ opacity: 0 }),
|
|
@@ -16,7 +16,7 @@ class BackdropComponent {
|
|
|
16
16
|
]),
|
|
17
17
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: BackdropComponent, decorators: [{
|
|
20
20
|
type: Component,
|
|
21
21
|
args: [{ selector: 'ng0-backdrop', template: '', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, animations: [
|
|
22
22
|
trigger('fade', [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-backdrop.mjs","sources":["../../../projects/ng0/components/backdrop/backdrop.component.ts","../../../projects/ng0/components/backdrop/bootkit-ng0-components-backdrop.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\r\nimport {\r\n trigger,\r\n transition,\r\n style,\r\n animate,\r\n} from '@angular/animations';\r\n\r\n@Component({\r\n selector: 'ng0-backdrop',\r\n template: '',\r\n styleUrl: 'backdrop.component.css',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [\r\n trigger('fade', [\r\n transition(':enter', [\r\n style({ opacity: 0 }),\r\n animate('150ms ease', style({ opacity: 1 })),\r\n ]),\r\n transition(':leave', [\r\n animate('150ms ease', style({ opacity: 0 })),\r\n ]),\r\n ]),\r\n ],\r\n host: {\r\n '[@fade]': '', // Binds the animation trigger to the host\r\n }\r\n})\r\nexport class BackdropComponent {}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MA6Ba,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAnBlB,EAAE,
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-backdrop.mjs","sources":["../../../projects/ng0/components/backdrop/backdrop.component.ts","../../../projects/ng0/components/backdrop/bootkit-ng0-components-backdrop.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\r\nimport {\r\n trigger,\r\n transition,\r\n style,\r\n animate,\r\n} from '@angular/animations';\r\n\r\n@Component({\r\n selector: 'ng0-backdrop',\r\n template: '',\r\n styleUrl: 'backdrop.component.css',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [\r\n trigger('fade', [\r\n transition(':enter', [\r\n style({ opacity: 0 }),\r\n animate('150ms ease', style({ opacity: 1 })),\r\n ]),\r\n transition(':leave', [\r\n animate('150ms ease', style({ opacity: 0 })),\r\n ]),\r\n ]),\r\n ],\r\n host: {\r\n '[@fade]': '', // Binds the animation trigger to the host\r\n }\r\n})\r\nexport class BackdropComponent {}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MA6Ba,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAnBlB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+DAAA,CAAA,EAAA,UAAA,EAIA;YACV,OAAO,CAAC,MAAM,EAAE;gBACd,UAAU,CAAC,QAAQ,EAAE;AACnB,oBAAA,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;oBACrB,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;iBAC7C,CAAC;gBACF,UAAU,CAAC,QAAQ,EAAE;oBACnB,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;iBAC7C,CAAC;aACH,CAAC;AACH,SAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKU,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBArB7B,SAAS;+BACE,cAAc,EAAA,QAAA,EACd,EAAE,EAAA,UAAA,EAEA,IAAI,mBACC,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC;wBACV,OAAO,CAAC,MAAM,EAAE;4BACd,UAAU,CAAC,QAAQ,EAAE;AACnB,gCAAA,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;gCACrB,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;6BAC7C,CAAC;4BACF,UAAU,CAAC,QAAQ,EAAE;gCACnB,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;6BAC7C,CAAC;yBACH,CAAC;qBACH,EAAA,IAAA,EACK;wBACJ,SAAS,EAAE,EAAE;AACd,qBAAA,EAAA,MAAA,EAAA,CAAA,+DAAA,CAAA,EAAA;;;AC3BH;;AAEG;;;;"}
|
|
@@ -13,24 +13,24 @@ class ButtonDirective {
|
|
|
13
13
|
* The IDs of the HTTP requests that this button listens to.
|
|
14
14
|
* If one of these requests is in progress, it will show a loading indicator or will be disabled based on 'showLoading' and 'disableOnLoading' properties.
|
|
15
15
|
*/
|
|
16
|
-
request = input(undefined);
|
|
16
|
+
request = input(undefined, ...(ngDevMode ? [{ debugName: "request" }] : []));
|
|
17
17
|
/**
|
|
18
18
|
* Whether the button is disabled or not.
|
|
19
19
|
*/
|
|
20
|
-
disabled = model(false);
|
|
20
|
+
disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
21
21
|
/**
|
|
22
22
|
* Whether to wait for the HTTP response before enabling the button again.
|
|
23
23
|
* If true, the button will remain disabled until the HTTP request completes.
|
|
24
24
|
* This is useful for preventing multiple clicks while waiting for a response.
|
|
25
25
|
* Default is true.
|
|
26
26
|
*/
|
|
27
|
-
disableDuringRequest = input(true, { transform: booleanAttribute });
|
|
27
|
+
disableDuringRequest = input(true, ...(ngDevMode ? [{ debugName: "disableDuringRequest", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
28
28
|
/**
|
|
29
29
|
* Whether to show a loading indicator when the HTTP request is in progress.
|
|
30
30
|
* If true, a loading spinner will be displayed on the button while the request is being processed.
|
|
31
31
|
* Default is true.
|
|
32
32
|
*/
|
|
33
|
-
loadingIndicator = input(false, { transform: booleanAttribute });
|
|
33
|
+
loadingIndicator = input(false, ...(ngDevMode ? [{ debugName: "loadingIndicator", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
34
34
|
constructor(_element, _renderer, _http, _destroyRef) {
|
|
35
35
|
this._element = _element;
|
|
36
36
|
this._renderer = _renderer;
|
|
@@ -76,10 +76,10 @@ class ButtonDirective {
|
|
|
76
76
|
}
|
|
77
77
|
ngOnDestroy() {
|
|
78
78
|
}
|
|
79
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
80
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
79
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.HttpService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
80
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.3", type: ButtonDirective, isStandalone: true, selector: "button[ng0Button], a[ng0Button], input[type=button][ng0Button], input[type=submit][ng0Button], input[type=reset][ng0Button]", inputs: { request: { classPropertyName: "request", publicName: "request", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disableDuringRequest: { classPropertyName: "disableDuringRequest", publicName: "disableDuringRequest", isSignal: true, isRequired: false, transformFunction: null }, loadingIndicator: { classPropertyName: "loadingIndicator", publicName: "loadingIndicator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { properties: { "class.disabled": "disabled()", "prop.disabled": "disabled()", "attr.aria-disabled": "disabled()", "attr.tabindex": "disabled() ? \"-1\" : \"\" " } }, exportAs: ["ng0Button"], ngImport: i0 });
|
|
81
81
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
83
83
|
type: Directive,
|
|
84
84
|
args: [{
|
|
85
85
|
selector: 'button[ng0Button], a[ng0Button], input[type=button][ng0Button], input[type=submit][ng0Button], input[type=reset][ng0Button]',
|
|
@@ -95,11 +95,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
95
95
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.HttpService }, { type: i0.DestroyRef }] });
|
|
96
96
|
|
|
97
97
|
class ButtonModule {
|
|
98
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
99
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
100
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
99
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: ButtonModule, imports: [ButtonDirective], exports: [ButtonDirective] });
|
|
100
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonModule });
|
|
101
101
|
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonModule, decorators: [{
|
|
103
103
|
type: NgModule,
|
|
104
104
|
args: [{
|
|
105
105
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-button.mjs","sources":["../../../projects/ng0/components/button/button.directive.ts","../../../projects/ng0/components/button/button.module.ts","../../../projects/ng0/components/button/bootkit-ng0-components-button.ts"],"sourcesContent":["import { Directive, Renderer2, ElementRef, OnInit, OnDestroy, input, DestroyRef, model, booleanAttribute } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { HttpService } from '@bootkit/ng0/http';\r\n\r\n@Directive({\r\n selector: 'button[ng0Button], a[ng0Button], input[type=button][ng0Button], input[type=submit][ng0Button], input[type=reset][ng0Button]',\r\n exportAs: 'ng0Button',\r\n standalone: true,\r\n host: {\r\n '[class.disabled]': 'disabled()',\r\n '[prop.disabled]': 'disabled()',\r\n '[attr.aria-disabled]': 'disabled()',\r\n '[attr.tabindex]': 'disabled() ? \"-1\" : \"\" ',\r\n }\r\n})\r\nexport class ButtonDirective implements OnInit, OnDestroy {\r\n private _loadingElement: any;\r\n\r\n /**\r\n * The IDs of the HTTP requests that this button listens to.\r\n * If one of these requests is in progress, it will show a loading indicator or will be disabled based on 'showLoading' and 'disableOnLoading' properties.\r\n */\r\n public request = input<string | string[] | undefined>(undefined);\r\n\r\n /** \r\n * Whether the button is disabled or not.\r\n */\r\n public disabled = model<boolean>(false);\r\n\r\n /**\r\n * Whether to wait for the HTTP response before enabling the button again.\r\n * If true, the button will remain disabled until the HTTP request completes.\r\n * This is useful for preventing multiple clicks while waiting for a response.\r\n * Default is true.\r\n */\r\n public disableDuringRequest = input(true, {transform: booleanAttribute});\r\n\r\n /**\r\n * Whether to show a loading indicator when the HTTP request is in progress.\r\n * If true, a loading spinner will be displayed on the button while the request is being processed.\r\n * Default is true.\r\n */\r\n public loadingIndicator = input(false, {transform: booleanAttribute});\r\n\r\n constructor(\r\n private _element: ElementRef,\r\n private _renderer: Renderer2,\r\n private _http: HttpService,\r\n private _destroyRef: DestroyRef) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this._renderer.setStyle(this._element.nativeElement, \"position\", \"relative\");\r\n\r\n if (this.request()) {\r\n this._http.events.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(e => {\r\n var ids = (Array.isArray(this.request()) ? this.request() : [this.request()]) as string[];\r\n\r\n if (ids.includes(e?.options?.id)) {\r\n let requestInProgress = e.type === 'Send' || e.type === 'Progress';\r\n\r\n if (this.disableDuringRequest()) {\r\n this.disabled.set(requestInProgress);\r\n }\r\n\r\n if (this.loadingIndicator()) {\r\n if (requestInProgress) {\r\n this._showLoading();\r\n } else {\r\n this._hideLoading();\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n // @HostListener('click', ['$event']) private _onClick(e: MouseEvent): void {\r\n // if (!this._disabled) {\r\n // }\r\n // }\r\n\r\n private _showLoading() {\r\n this._loadingElement = this._renderer.createElement(\"div\");\r\n [\"spinner-grow\", \"spinner-grow-sm\", \"text-warning\"].forEach(s => this._renderer.addClass(this._loadingElement, s));\r\n this._renderer.setStyle(this._loadingElement, \"position\", \"absolute\");\r\n this._renderer.setStyle(this._loadingElement, \"top\", \"-25%\");\r\n this._renderer.setStyle(this._loadingElement, \"left\", \"-5px\");\r\n this._renderer.appendChild(this._element.nativeElement, this._loadingElement);\r\n }\r\n\r\n private _hideLoading() {\r\n this._renderer.removeChild(this._element.nativeElement, this._loadingElement);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { ButtonDirective } from './button.directive';\r\n\r\n@NgModule({\r\n imports: [\r\n ButtonDirective,\r\n ],\r\n exports: [\r\n ButtonDirective,\r\n ]\r\n})\r\nexport class ButtonModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAea,eAAe,CAAA;AA8BhB,IAAA,QAAA;AACA,IAAA,SAAA;AACA,IAAA,KAAA;AACA,IAAA,WAAA;AAhCF,IAAA,eAAe;AAEvB;;;AAGG;AACI,IAAA,OAAO,GAAG,KAAK,CAAgC,SAAS,
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-button.mjs","sources":["../../../projects/ng0/components/button/button.directive.ts","../../../projects/ng0/components/button/button.module.ts","../../../projects/ng0/components/button/bootkit-ng0-components-button.ts"],"sourcesContent":["import { Directive, Renderer2, ElementRef, OnInit, OnDestroy, input, DestroyRef, model, booleanAttribute } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { HttpService } from '@bootkit/ng0/http';\r\n\r\n@Directive({\r\n selector: 'button[ng0Button], a[ng0Button], input[type=button][ng0Button], input[type=submit][ng0Button], input[type=reset][ng0Button]',\r\n exportAs: 'ng0Button',\r\n standalone: true,\r\n host: {\r\n '[class.disabled]': 'disabled()',\r\n '[prop.disabled]': 'disabled()',\r\n '[attr.aria-disabled]': 'disabled()',\r\n '[attr.tabindex]': 'disabled() ? \"-1\" : \"\" ',\r\n }\r\n})\r\nexport class ButtonDirective implements OnInit, OnDestroy {\r\n private _loadingElement: any;\r\n\r\n /**\r\n * The IDs of the HTTP requests that this button listens to.\r\n * If one of these requests is in progress, it will show a loading indicator or will be disabled based on 'showLoading' and 'disableOnLoading' properties.\r\n */\r\n public request = input<string | string[] | undefined>(undefined);\r\n\r\n /** \r\n * Whether the button is disabled or not.\r\n */\r\n public disabled = model<boolean>(false);\r\n\r\n /**\r\n * Whether to wait for the HTTP response before enabling the button again.\r\n * If true, the button will remain disabled until the HTTP request completes.\r\n * This is useful for preventing multiple clicks while waiting for a response.\r\n * Default is true.\r\n */\r\n public disableDuringRequest = input(true, {transform: booleanAttribute});\r\n\r\n /**\r\n * Whether to show a loading indicator when the HTTP request is in progress.\r\n * If true, a loading spinner will be displayed on the button while the request is being processed.\r\n * Default is true.\r\n */\r\n public loadingIndicator = input(false, {transform: booleanAttribute});\r\n\r\n constructor(\r\n private _element: ElementRef,\r\n private _renderer: Renderer2,\r\n private _http: HttpService,\r\n private _destroyRef: DestroyRef) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this._renderer.setStyle(this._element.nativeElement, \"position\", \"relative\");\r\n\r\n if (this.request()) {\r\n this._http.events.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(e => {\r\n var ids = (Array.isArray(this.request()) ? this.request() : [this.request()]) as string[];\r\n\r\n if (ids.includes(e?.options?.id)) {\r\n let requestInProgress = e.type === 'Send' || e.type === 'Progress';\r\n\r\n if (this.disableDuringRequest()) {\r\n this.disabled.set(requestInProgress);\r\n }\r\n\r\n if (this.loadingIndicator()) {\r\n if (requestInProgress) {\r\n this._showLoading();\r\n } else {\r\n this._hideLoading();\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n // @HostListener('click', ['$event']) private _onClick(e: MouseEvent): void {\r\n // if (!this._disabled) {\r\n // }\r\n // }\r\n\r\n private _showLoading() {\r\n this._loadingElement = this._renderer.createElement(\"div\");\r\n [\"spinner-grow\", \"spinner-grow-sm\", \"text-warning\"].forEach(s => this._renderer.addClass(this._loadingElement, s));\r\n this._renderer.setStyle(this._loadingElement, \"position\", \"absolute\");\r\n this._renderer.setStyle(this._loadingElement, \"top\", \"-25%\");\r\n this._renderer.setStyle(this._loadingElement, \"left\", \"-5px\");\r\n this._renderer.appendChild(this._element.nativeElement, this._loadingElement);\r\n }\r\n\r\n private _hideLoading() {\r\n this._renderer.removeChild(this._element.nativeElement, this._loadingElement);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { ButtonDirective } from './button.directive';\r\n\r\n@NgModule({\r\n imports: [\r\n ButtonDirective,\r\n ],\r\n exports: [\r\n ButtonDirective,\r\n ]\r\n})\r\nexport class ButtonModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],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