@angular-bootstrap/ngbootstrap 0.0.8 → 0.0.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-bootstrap/ngbootstrap",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Angular UI library providing datagrid, drag-and-drop, pagination, stepper, splitter, typeahead and chips components with Bootstrap-friendly styling.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Harmeet Singh"
|
|
@@ -113,6 +113,59 @@ interface NgbDataGridResponsiveOptions {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
type NgbDatagridTrackByFn<T> = (index: number, row: T) => any;
|
|
117
|
+
interface NgbDatagridEditService<T> {
|
|
118
|
+
/**
|
|
119
|
+
* Create a new row in the provided data set.
|
|
120
|
+
* Implementations may mark the row as "new" until `saveChanges` is called.
|
|
121
|
+
*/
|
|
122
|
+
create(data: readonly T[], newRow: T, rowIndex: number, rowId: any): T[];
|
|
123
|
+
/**
|
|
124
|
+
* Update an existing row in the provided data set.
|
|
125
|
+
* Implementations may snapshot the original row to support `cancelChanges` and `hasChanges`.
|
|
126
|
+
*/
|
|
127
|
+
update(data: readonly T[], updatedRow: T, rowIndex: number, rowId: any): T[];
|
|
128
|
+
/**
|
|
129
|
+
* Remove a row from the provided data set.
|
|
130
|
+
*/
|
|
131
|
+
remove(data: readonly T[], rowIndex: number, rowId: any): T[];
|
|
132
|
+
/**
|
|
133
|
+
* Used by the datagrid while editing to compute a new row instance.
|
|
134
|
+
* Default behavior is a shallow merge of the values into the row.
|
|
135
|
+
*/
|
|
136
|
+
assignValues(row: T, values: Partial<T>): T;
|
|
137
|
+
/**
|
|
138
|
+
* Whether this row is considered newly created (not yet saved).
|
|
139
|
+
*/
|
|
140
|
+
isNew(rowId: any): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the row differs from its captured baseline (after `update`/`create` starts tracking).
|
|
143
|
+
*/
|
|
144
|
+
hasChanges(rowId: any, currentRow: T): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Commit current changes (and clear tracking state) for the row.
|
|
147
|
+
*/
|
|
148
|
+
saveChanges(data: readonly T[], rowIndex: number, rowId: any, currentRow: T): T[];
|
|
149
|
+
/**
|
|
150
|
+
* Revert tracked changes for the row (or remove it if it was new).
|
|
151
|
+
*/
|
|
152
|
+
cancelChanges(data: readonly T[], rowIndex: number, rowId: any): T[];
|
|
153
|
+
}
|
|
154
|
+
declare class NgbDatagridDefaultEditService<T> implements NgbDatagridEditService<T> {
|
|
155
|
+
private originals;
|
|
156
|
+
private newRows;
|
|
157
|
+
create(data: readonly T[], newRow: T, _rowIndex: number, rowId: any): T[];
|
|
158
|
+
update(data: readonly T[], updatedRow: T, rowIndex: number, rowId: any): T[];
|
|
159
|
+
remove(data: readonly T[], rowIndex: number, rowId: any): T[];
|
|
160
|
+
assignValues(row: T, values: Partial<T>): T;
|
|
161
|
+
isNew(rowId: any): boolean;
|
|
162
|
+
hasChanges(rowId: any, currentRow: T): boolean;
|
|
163
|
+
saveChanges(data: readonly T[], _rowIndex: number, rowId: any, currentRow: T): T[];
|
|
164
|
+
cancelChanges(data: readonly T[], rowIndex: number, rowId: any): T[];
|
|
165
|
+
private replaceRow;
|
|
166
|
+
private removeRow;
|
|
167
|
+
}
|
|
168
|
+
|
|
116
169
|
interface ExportButtonContext {
|
|
117
170
|
$implicit: (kind: 'pdf' | 'excel') => void;
|
|
118
171
|
}
|
|
@@ -159,6 +212,8 @@ declare class Datagrid<T = any> implements AfterContentInit, OnChanges {
|
|
|
159
212
|
exportOptions: NgbDataGridExportOptions;
|
|
160
213
|
theme: NgbDataGridTheme;
|
|
161
214
|
responsive: NgbDataGridResponsiveOptions | boolean;
|
|
215
|
+
trackBy?: NgbDatagridTrackByFn<T>;
|
|
216
|
+
editService?: NgbDatagridEditService<T>;
|
|
162
217
|
dataProviderAll?: () => Observable<any[]> | Promise<any[]> | any[];
|
|
163
218
|
dataProviderSelection?: () => any[];
|
|
164
219
|
exportButtonDir?: ExportButtonDirective;
|
|
@@ -218,19 +273,18 @@ declare class Datagrid<T = any> implements AfterContentInit, OnChanges {
|
|
|
218
273
|
saveAttemptedEdit: boolean;
|
|
219
274
|
addForm: FormGroup;
|
|
220
275
|
saveAttemptedNew: boolean;
|
|
276
|
+
private addDraftRowId;
|
|
277
|
+
private readonly defaultEditService;
|
|
221
278
|
private norm;
|
|
222
279
|
private keyOf;
|
|
223
|
-
private passesRowFilters;
|
|
224
280
|
private getDefaults;
|
|
225
281
|
private defaultFor;
|
|
226
282
|
private numberValidator;
|
|
227
283
|
private dateValidator;
|
|
228
284
|
private buildFormFromRow;
|
|
229
|
-
private rowIsValidAgainst;
|
|
230
285
|
private strictEmailValidator;
|
|
231
286
|
get exportButtonTpl(): TemplateRef<ExportButtonContext> | null;
|
|
232
287
|
get filtered(): T[];
|
|
233
|
-
private compare;
|
|
234
288
|
get sorted(): T[];
|
|
235
289
|
get paged(): T[];
|
|
236
290
|
get anyFilterable(): boolean;
|
|
@@ -259,6 +313,8 @@ declare class Datagrid<T = any> implements AfterContentInit, OnChanges {
|
|
|
259
313
|
private resolveDataset;
|
|
260
314
|
ngAfterContentInit(): void;
|
|
261
315
|
ngOnChanges(ch: SimpleChanges): void;
|
|
316
|
+
private getRowId;
|
|
317
|
+
private getEditService;
|
|
262
318
|
startAdd(): void;
|
|
263
319
|
saveAdd(): void;
|
|
264
320
|
cancelAdd(): void;
|
|
@@ -268,7 +324,7 @@ declare class Datagrid<T = any> implements AfterContentInit, OnChanges {
|
|
|
268
324
|
onNewDraftChange(col: ColumnDef<T>): void;
|
|
269
325
|
validateInto(col: ColumnDef<T>, targetDraft: Partial<Record<KeyOf<T>, any>> | null, targetErrors: Partial<Record<KeyOf<T>, string>>): void;
|
|
270
326
|
deleteRow(i: number): void;
|
|
271
|
-
trackRow: (
|
|
327
|
+
trackRow: (index: number, row: T) => any;
|
|
272
328
|
toggleSort(field: Extract<keyof T, string>): void;
|
|
273
329
|
onGlobalFilterChange(): void;
|
|
274
330
|
onColumnFilterChange(): void;
|
|
@@ -283,7 +339,7 @@ declare class Datagrid<T = any> implements AfterContentInit, OnChanges {
|
|
|
283
339
|
triggerExport(kind: 'pdf' | 'excel'): void;
|
|
284
340
|
isResponsiveEnabled(): boolean;
|
|
285
341
|
static ɵfac: i0.ɵɵFactoryDeclaration<Datagrid<any>, never>;
|
|
286
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Datagrid<any>, "ngb-datagrid", never, { "columns": { "alias": "columns"; "required": false; }; "data": { "alias": "data"; "required": false; }; "enableSorting": { "alias": "enableSorting"; "required": false; }; "enableFiltering": { "alias": "enableFiltering"; "required": false; }; "enableGlobalFilter": { "alias": "enableGlobalFilter"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "enableEdit": { "alias": "enableEdit"; "required": false; }; "enableDelete": { "alias": "enableDelete"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "enableAdd": { "alias": "enableAdd"; "required": false; }; "addButtonAriaLabel": { "alias": "addButtonAriaLabel"; "required": false; }; "addButtonText": { "alias": "addButtonText"; "required": false; }; "globalFilterAriaLabel": { "alias": "globalFilterAriaLabel"; "required": false; }; "expandRowAriaLabel": { "alias": "expandRowAriaLabel"; "required": false; }; "collapseRowAriaLabel": { "alias": "collapseRowAriaLabel"; "required": false; }; "exportPdfAriaLabel": { "alias": "exportPdfAriaLabel"; "required": false; }; "exportExcelAriaLabel": { "alias": "exportExcelAriaLabel"; "required": false; }; "newRowDefaults": { "alias": "newRowDefaults"; "required": false; }; "strictEmail": { "alias": "strictEmail"; "required": false; }; "editOnRowClick": { "alias": "editOnRowClick"; "required": false; }; "singleExpand": { "alias": "singleExpand"; "required": false; }; "exportOptions": { "alias": "exportOptions"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "dataProviderAll": { "alias": "dataProviderAll"; "required": false; }; "dataProviderSelection": { "alias": "dataProviderSelection"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; }, { "rowAdd": "rowAdd"; "rowEdit": "rowEdit"; "rowSave": "rowSave"; "rowCancel": "rowCancel"; "rowDelete": "rowDelete"; "sortChange": "sortChange"; "filtersChange": "filtersChange"; "pageChange": "pageChange"; }, ["exportButtonDir", "rowDetailTpl", "cellTplQ", "editTplQ", "filterTplQ", "globalTplQ"], never, true, never>;
|
|
342
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Datagrid<any>, "ngb-datagrid", never, { "columns": { "alias": "columns"; "required": false; }; "data": { "alias": "data"; "required": false; }; "enableSorting": { "alias": "enableSorting"; "required": false; }; "enableFiltering": { "alias": "enableFiltering"; "required": false; }; "enableGlobalFilter": { "alias": "enableGlobalFilter"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "enableEdit": { "alias": "enableEdit"; "required": false; }; "enableDelete": { "alias": "enableDelete"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "enableAdd": { "alias": "enableAdd"; "required": false; }; "addButtonAriaLabel": { "alias": "addButtonAriaLabel"; "required": false; }; "addButtonText": { "alias": "addButtonText"; "required": false; }; "globalFilterAriaLabel": { "alias": "globalFilterAriaLabel"; "required": false; }; "expandRowAriaLabel": { "alias": "expandRowAriaLabel"; "required": false; }; "collapseRowAriaLabel": { "alias": "collapseRowAriaLabel"; "required": false; }; "exportPdfAriaLabel": { "alias": "exportPdfAriaLabel"; "required": false; }; "exportExcelAriaLabel": { "alias": "exportExcelAriaLabel"; "required": false; }; "newRowDefaults": { "alias": "newRowDefaults"; "required": false; }; "strictEmail": { "alias": "strictEmail"; "required": false; }; "editOnRowClick": { "alias": "editOnRowClick"; "required": false; }; "singleExpand": { "alias": "singleExpand"; "required": false; }; "exportOptions": { "alias": "exportOptions"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; "editService": { "alias": "editService"; "required": false; }; "dataProviderAll": { "alias": "dataProviderAll"; "required": false; }; "dataProviderSelection": { "alias": "dataProviderSelection"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; }, { "rowAdd": "rowAdd"; "rowEdit": "rowEdit"; "rowSave": "rowSave"; "rowCancel": "rowCancel"; "rowDelete": "rowDelete"; "sortChange": "sortChange"; "filtersChange": "filtersChange"; "pageChange": "pageChange"; }, ["exportButtonDir", "rowDetailTpl", "cellTplQ", "editTplQ", "filterTplQ", "globalTplQ"], never, true, never>;
|
|
287
343
|
}
|
|
288
344
|
|
|
289
345
|
interface PdfExportPayload {
|
|
@@ -670,6 +726,8 @@ declare class NgbTypeaheadComponent implements AfterViewInit, OnChanges, OnDestr
|
|
|
670
726
|
updateOnTab: boolean;
|
|
671
727
|
separator: string | string[];
|
|
672
728
|
chips: boolean;
|
|
729
|
+
vScroll: boolean;
|
|
730
|
+
vItemSize: number;
|
|
673
731
|
itemTemplate?: any;
|
|
674
732
|
i18n?: NgbTypeaheadI18n;
|
|
675
733
|
projectedItemTemplate?: any;
|
|
@@ -711,6 +769,7 @@ declare class NgbTypeaheadComponent implements AfterViewInit, OnChanges, OnDestr
|
|
|
711
769
|
itemHeight: number;
|
|
712
770
|
beforePadding: number;
|
|
713
771
|
afterPadding: number;
|
|
772
|
+
private viewportStartIndex;
|
|
714
773
|
private debounceId?;
|
|
715
774
|
private onControlChange;
|
|
716
775
|
private onControlTouched;
|
|
@@ -751,6 +810,8 @@ declare class NgbTypeaheadComponent implements AfterViewInit, OnChanges, OnDestr
|
|
|
751
810
|
private updateViewport;
|
|
752
811
|
private activatePreferredOption;
|
|
753
812
|
private moveActive;
|
|
813
|
+
private activeGlobalIndex;
|
|
814
|
+
private setActiveGlobalIndex;
|
|
754
815
|
private validateItem;
|
|
755
816
|
private showOverlay;
|
|
756
817
|
private hideOverlay;
|
|
@@ -760,7 +821,7 @@ declare class NgbTypeaheadComponent implements AfterViewInit, OnChanges, OnDestr
|
|
|
760
821
|
private propagateControlValue;
|
|
761
822
|
private coerceToItem;
|
|
762
823
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgbTypeaheadComponent, never>;
|
|
763
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgbTypeaheadComponent, "ngb-typeahead", never, { "data": { "alias": "data"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; "characterTyped": { "alias": "characterTyped"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "selectExact": { "alias": "selectExact"; "required": false; }; "multiSelect": { "alias": "multiSelect"; "required": false; }; "matchSelection": { "alias": "matchSelection"; "required": false; }; "showDropdownButton": { "alias": "showDropdownButton"; "required": false; }; "showClearButton": { "alias": "showClearButton"; "required": false; }; "updateOnBlur": { "alias": "updateOnBlur"; "required": false; }; "updateOnTab": { "alias": "updateOnTab"; "required": false; }; "separator": { "alias": "separator"; "required": false; }; "chips": { "alias": "chips"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; }, { "completeMethod": "completeMethod"; "onSelect": "onSelect"; "onUnselect": "onUnselect"; "onAdd": "onAdd"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onDropdownClick": "onDropdownClick"; "onClear": "onClear"; "onInputKeydown": "onInputKeydown"; "onKeyUp": "onKeyUp"; "onShow": "onShow"; "onHide": "onHide"; "onLazyLoad": "onLazyLoad"; "selectedItems": "selectedItems"; "selectionChange": "selectionChange"; "onChange": "onChange"; "onScrollEvent": "onScrollEvent"; }, ["projectedItemTemplate"], never, true, never>;
|
|
824
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgbTypeaheadComponent, "ngb-typeahead", never, { "data": { "alias": "data"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; "characterTyped": { "alias": "characterTyped"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "selectExact": { "alias": "selectExact"; "required": false; }; "multiSelect": { "alias": "multiSelect"; "required": false; }; "matchSelection": { "alias": "matchSelection"; "required": false; }; "showDropdownButton": { "alias": "showDropdownButton"; "required": false; }; "showClearButton": { "alias": "showClearButton"; "required": false; }; "updateOnBlur": { "alias": "updateOnBlur"; "required": false; }; "updateOnTab": { "alias": "updateOnTab"; "required": false; }; "separator": { "alias": "separator"; "required": false; }; "chips": { "alias": "chips"; "required": false; }; "vScroll": { "alias": "vScroll"; "required": false; }; "vItemSize": { "alias": "vItemSize"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; }, { "completeMethod": "completeMethod"; "onSelect": "onSelect"; "onUnselect": "onUnselect"; "onAdd": "onAdd"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onDropdownClick": "onDropdownClick"; "onClear": "onClear"; "onInputKeydown": "onInputKeydown"; "onKeyUp": "onKeyUp"; "onShow": "onShow"; "onHide": "onHide"; "onLazyLoad": "onLazyLoad"; "selectedItems": "selectedItems"; "selectionChange": "selectionChange"; "onChange": "onChange"; "onScrollEvent": "onScrollEvent"; }, ["projectedItemTemplate"], never, true, never>;
|
|
764
825
|
}
|
|
765
826
|
|
|
766
827
|
type NgbTreeType = 'text' | 'json';
|
|
@@ -826,5 +887,5 @@ declare class NgbChipsComponent {
|
|
|
826
887
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgbChipsComponent, "ngb-chips", never, { "items": { "alias": "items"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "removeLabel": { "alias": "removeLabel"; "required": false; }; }, { "remove": "remove"; }, never, never, true, never>;
|
|
827
888
|
}
|
|
828
889
|
|
|
829
|
-
export { DATAGRID_TEMPLATE_DIRECTIVES, DND_I18N, DND_LIVE_ANNOUNCE, Datagrid, ExcelExportAdapter, ExportButtonDirective, JsPdfAdapter, NgbCellTemplate, NgbChipsComponent, NgbDndItemDirective, NgbDndListDirective, NgbDndState, NgbEditorTemplate, NgbExportService, NgbFilterTemplate, NgbGlobalFilterTemplate, NgbLiveAnnouncer, NgbPaginationComponent, NgbRowDetailTemplate, NgbSplitterComponent, NgbSplitterPaneComponent, NgbStepLabelDirective, NgbStepperComponent, NgbTreeComponent, NgbTypeaheadComponent, PdfExportAdapter, XlsxAdapter, defaultDndI18n };
|
|
830
|
-
export type { CellCtx, ColumnDef, ColumnType, DndCanDropFn, DndCanDropPayload, DndI18n, DndSession, EditCtx, ExcelExportPayload, ExportButtonContext, FilterCtx, GlobalFilterCtx, NgbChip, NgbDataGridExportOptions, NgbDataGridExportPages, NgbDataGridExportType, NgbDataGridResponsiveOptions, NgbDataGridTheme, NgbDndDropEvent, NgbSplitterOrientation, NgbSplitterPaneSize, NgbStepperContentPosition, NgbStepperLabelPosition, NgbStepperOrientation, NgbStepperSelectionChangeEvent, NgbStepperState, NgbStepperStep, NgbStepperTheme, NgbTreeI18n, NgbTreeNode, NgbTreeType, NgbTypeaheadI18n, NgbTypeaheadItem, PdfExportPayload };
|
|
890
|
+
export { DATAGRID_TEMPLATE_DIRECTIVES, DND_I18N, DND_LIVE_ANNOUNCE, Datagrid, ExcelExportAdapter, ExportButtonDirective, JsPdfAdapter, NgbCellTemplate, NgbChipsComponent, NgbDatagridDefaultEditService, NgbDndItemDirective, NgbDndListDirective, NgbDndState, NgbEditorTemplate, NgbExportService, NgbFilterTemplate, NgbGlobalFilterTemplate, NgbLiveAnnouncer, NgbPaginationComponent, NgbRowDetailTemplate, NgbSplitterComponent, NgbSplitterPaneComponent, NgbStepLabelDirective, NgbStepperComponent, NgbTreeComponent, NgbTypeaheadComponent, PdfExportAdapter, XlsxAdapter, defaultDndI18n };
|
|
891
|
+
export type { CellCtx, ColumnDef, ColumnType, DndCanDropFn, DndCanDropPayload, DndI18n, DndSession, EditCtx, ExcelExportPayload, ExportButtonContext, FilterCtx, GlobalFilterCtx, NgbChip, NgbDataGridExportOptions, NgbDataGridExportPages, NgbDataGridExportType, NgbDataGridResponsiveOptions, NgbDataGridTheme, NgbDatagridEditService, NgbDatagridTrackByFn, NgbDndDropEvent, NgbSplitterOrientation, NgbSplitterPaneSize, NgbStepperContentPosition, NgbStepperLabelPosition, NgbStepperOrientation, NgbStepperSelectionChangeEvent, NgbStepperState, NgbStepperStep, NgbStepperTheme, NgbTreeI18n, NgbTreeNode, NgbTreeType, NgbTypeaheadI18n, NgbTypeaheadItem, PdfExportPayload };
|