angular-dumb-lib 0.0.30 → 0.0.32
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/fesm2022/angular-dumb-lib.mjs +351 -93
- package/fesm2022/angular-dumb-lib.mjs.map +1 -1
- package/lib/components/atoms/file-selection/file-selection.component.d.ts +11 -7
- package/lib/components/atoms/selection/selection.component.d.ts +8 -15
- package/lib/components/molecules/actions/actions.component.d.ts +15 -0
- package/lib/components/molecules/paginator/paginator.component.d.ts +1 -1
- package/lib/components/pages/admin/admin.component.d.ts +47 -0
- package/lib/shared/enums/enum.d.ts +4 -5
- package/lib/shared/facades/event-abstract.facade.d.ts +8 -0
- package/lib/shared/facades/pages.facade.d.ts +31 -0
- package/lib/shared/interfaces/interface.d.ts +2 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, ElementRef } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
3
|
import { IButtonConfig } from '../../../shared/interfaces/interface';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -7,19 +7,23 @@ export declare class FileSelectionComponent implements OnInit, ControlValueAcces
|
|
|
7
7
|
chooseFileLabel: string;
|
|
8
8
|
imageUrl: string | ArrayBuffer | null;
|
|
9
9
|
fileName: string | null;
|
|
10
|
+
valueChange: EventEmitter<File | null>;
|
|
11
|
+
fileInputRef: ElementRef<HTMLInputElement>;
|
|
10
12
|
config: IButtonConfig;
|
|
13
|
+
private _value;
|
|
14
|
+
isDisabled: boolean;
|
|
11
15
|
onChange: any;
|
|
12
16
|
onTouched: any;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
set value(value: any);
|
|
17
|
+
get value(): File | string | null;
|
|
18
|
+
set value(val: File | null);
|
|
16
19
|
ngOnInit(): void;
|
|
17
20
|
onFileSelected(event: Event): void;
|
|
21
|
+
previewImage(file: File): void;
|
|
18
22
|
triggerFileInput(): void;
|
|
19
|
-
writeValue(value:
|
|
23
|
+
writeValue(value: string | File | null): void;
|
|
20
24
|
registerOnChange(fn: any): void;
|
|
21
25
|
registerOnTouched(fn: any): void;
|
|
22
|
-
setDisabledState
|
|
26
|
+
setDisabledState(isDisabled: boolean): void;
|
|
23
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileSelectionComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileSelectionComponent, "app-file-selection", never, { "label": { "alias": "label"; "required": false; }; "chooseFileLabel": { "alias": "chooseFileLabel"; "required": false; }; "imageUrl": { "alias": "imageUrl"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; }, {}, never, never, true, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileSelectionComponent, "app-file-selection", never, { "label": { "alias": "label"; "required": false; }; "chooseFileLabel": { "alias": "chooseFileLabel"; "required": false; }; "imageUrl": { "alias": "imageUrl"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
25
29
|
}
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import { EventEmitter
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
import { SelectionType } from '../../../shared/enums/enum';
|
|
4
3
|
import { IDropdownOption } from '../../../shared/interfaces/interface';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class SelectionComponent implements
|
|
5
|
+
export declare class SelectionComponent implements ControlValueAccessor {
|
|
7
6
|
label: string;
|
|
8
7
|
options: IDropdownOption[] | undefined;
|
|
9
|
-
selectedValue: any;
|
|
10
|
-
selectedValues: any[];
|
|
11
8
|
isMultiSelect: boolean;
|
|
12
|
-
displayType: SelectionType;
|
|
13
9
|
selectedChange: EventEmitter<any>;
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
private _value;
|
|
11
|
+
onChange: (value: any) => void;
|
|
12
|
+
onTouched: () => void;
|
|
16
13
|
get value(): any;
|
|
17
|
-
set value(
|
|
18
|
-
|
|
19
|
-
onSelectChange(event: Event): void;
|
|
20
|
-
onMultiSelectChange(event: Event): void;
|
|
21
|
-
isSelected(value: any): boolean;
|
|
14
|
+
set value(val: any);
|
|
15
|
+
onDropdownChange(value: any): void;
|
|
22
16
|
writeValue(value: any): void;
|
|
23
17
|
registerOnChange(fn: any): void;
|
|
24
18
|
registerOnTouched(fn: any): void;
|
|
25
|
-
setDisabledState?(isDisabled: boolean): void;
|
|
26
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionComponent, never>;
|
|
27
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionComponent, "app-selection", never, { "label": { "alias": "label"; "required": false; }; "options": { "alias": "options"; "required": false; }; "
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionComponent, "app-selection", never, { "label": { "alias": "label"; "required": false; }; "options": { "alias": "options"; "required": false; }; "isMultiSelect": { "alias": "isMultiSelect"; "required": false; }; }, { "selectedChange": "selectedChange"; }, never, never, true, never>;
|
|
28
21
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { CRUDType } from '../../../shared/enums/enum';
|
|
3
|
+
import { IButtonConfig } from '../../../shared/interfaces/interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ActionsComponent implements OnInit {
|
|
6
|
+
actionButtons: IButtonConfig[];
|
|
7
|
+
crudActions: CRUDType[];
|
|
8
|
+
selectedAction: EventEmitter<string>;
|
|
9
|
+
crudButtons: IButtonConfig[];
|
|
10
|
+
constructor();
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
clickButton(action: string | undefined): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActionsComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ActionsComponent, "app-actions", never, { "actionButtons": { "alias": "actionButtons"; "required": false; }; "crudActions": { "alias": "crudActions"; "required": false; }; }, { "selectedAction": "selectedAction"; }, never, never, true, never>;
|
|
15
|
+
}
|
|
@@ -19,7 +19,7 @@ export declare class PaginatorComponent implements OnInit {
|
|
|
19
19
|
ngOnInit(): void;
|
|
20
20
|
ngOnChanges(): void;
|
|
21
21
|
selectPage(i: number): void;
|
|
22
|
-
onChangeNumberOfPage(
|
|
22
|
+
onChangeNumberOfPage(itemsPerPage: any): void;
|
|
23
23
|
private emitPaging;
|
|
24
24
|
private calculateNumberOfPage;
|
|
25
25
|
private updateButtonConfigs;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { IButtonConfig, IDataColumnConfig, IInputConfig, IModalEvent, IPaginator } from '../../../shared/interfaces/interface';
|
|
4
|
+
import { TableColumnType } from '../../../shared/enums/enum';
|
|
5
|
+
import { PagesFacade } from '../../../shared/facades/pages.facade';
|
|
6
|
+
import { FormGroup } from '@angular/forms';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class AdminComponent<T> implements OnInit {
|
|
9
|
+
private pageFacade;
|
|
10
|
+
itemFormTpl: TemplateRef<unknown>;
|
|
11
|
+
warningDialogTpl: TemplateRef<unknown>;
|
|
12
|
+
modalEvent: IModalEvent;
|
|
13
|
+
formGroup: FormGroup;
|
|
14
|
+
selectedItems: any[];
|
|
15
|
+
TableColumnType: typeof TableColumnType;
|
|
16
|
+
tableContents: T[];
|
|
17
|
+
columns: IDataColumnConfig[];
|
|
18
|
+
formFields: IInputConfig[];
|
|
19
|
+
tableName: string;
|
|
20
|
+
totalRecords: number;
|
|
21
|
+
loadingState: Observable<boolean>;
|
|
22
|
+
actionButtons: IButtonConfig[];
|
|
23
|
+
validationMessages: {
|
|
24
|
+
[fieldName: string]: {
|
|
25
|
+
[errorKey: string]: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
paginator: EventEmitter<IPaginator>;
|
|
29
|
+
itemAction: EventEmitter<{
|
|
30
|
+
action: string;
|
|
31
|
+
item: T[];
|
|
32
|
+
}>;
|
|
33
|
+
formSubmit: EventEmitter<any>;
|
|
34
|
+
constructor(pageFacade: PagesFacade);
|
|
35
|
+
ngOnInit(): void;
|
|
36
|
+
changePaginator(paginator: IPaginator): void;
|
|
37
|
+
toggleSelection(item: T, event: Event): void;
|
|
38
|
+
isSelected(item: T): boolean;
|
|
39
|
+
private _initPageEventHandler;
|
|
40
|
+
private _subscribeToPageReady;
|
|
41
|
+
private _initializeForm;
|
|
42
|
+
openDialog(detailAction: string, items?: T[]): void;
|
|
43
|
+
selectedItem(action: string): void;
|
|
44
|
+
saveForm(formGroup: any): void;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AdminComponent<any>, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AdminComponent<any>, "app-admin", never, { "tableContents": { "alias": "tableContents"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "formFields": { "alias": "formFields"; "required": false; }; "tableName": { "alias": "tableName"; "required": false; }; "totalRecords": { "alias": "totalRecords"; "required": false; }; "loadingState": { "alias": "loadingState"; "required": false; }; "actionButtons": { "alias": "actionButtons"; "required": false; }; "validationMessages": { "alias": "validationMessages"; "required": false; }; }, { "paginator": "paginator"; "itemAction": "itemAction"; "formSubmit": "formSubmit"; }, never, never, true, never>;
|
|
47
|
+
}
|
|
@@ -35,17 +35,16 @@ export declare enum InputType {
|
|
|
35
35
|
select = "select",
|
|
36
36
|
file = "file"
|
|
37
37
|
}
|
|
38
|
+
export declare enum TableColumnType {
|
|
39
|
+
text = "text",
|
|
40
|
+
image = "image"
|
|
41
|
+
}
|
|
38
42
|
export declare enum ContentDirection {
|
|
39
43
|
left = "left",
|
|
40
44
|
right = "right",
|
|
41
45
|
up = "up",
|
|
42
46
|
down = "down"
|
|
43
47
|
}
|
|
44
|
-
export declare enum SelectionType {
|
|
45
|
-
dropdown = "dropdown",
|
|
46
|
-
radio = "radio",
|
|
47
|
-
checkbox = "checkbox"
|
|
48
|
-
}
|
|
49
48
|
export declare enum Size {
|
|
50
49
|
Xbig = "xbig",
|
|
51
50
|
Big = "big",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare abstract class EventAbstractFacade<T> {
|
|
3
|
+
private readonly _eventsDictionary;
|
|
4
|
+
addEventListener(name: string, handler: (...argument: T[] | unknown[]) => void): void;
|
|
5
|
+
dispatch(name: string, ...args: T[] | unknown[]): void;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EventAbstractFacade<any>, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EventAbstractFacade<any>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { EventAbstractFacade } from "./event-abstract.facade";
|
|
3
|
+
import { IModalEvent } from "../interfaces/interface";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare enum PageEvent {
|
|
6
|
+
Modal = "Modal",
|
|
7
|
+
Loading = "Loading"
|
|
8
|
+
}
|
|
9
|
+
export interface ILoadingEvent {
|
|
10
|
+
text: string;
|
|
11
|
+
position?: 'top' | 'bottom';
|
|
12
|
+
}
|
|
13
|
+
export type PageEventDetails = IModalEvent | ILoadingEvent | unknown;
|
|
14
|
+
export interface IPageEvent {
|
|
15
|
+
type?: 'start' | 'end' | unknown;
|
|
16
|
+
details?: PageEventDetails;
|
|
17
|
+
}
|
|
18
|
+
export declare class PagesFacade extends EventAbstractFacade<IPageEvent> {
|
|
19
|
+
private readonly _isPageReady;
|
|
20
|
+
private _params;
|
|
21
|
+
private _validated;
|
|
22
|
+
get isPageReady(): Observable<boolean>;
|
|
23
|
+
get params(): Record<string | number | symbol, unknown>;
|
|
24
|
+
get validated(): boolean;
|
|
25
|
+
setParams(value: Record<string | number | symbol, unknown>): void;
|
|
26
|
+
markAsReady(): void;
|
|
27
|
+
markAsLoading(): void;
|
|
28
|
+
validate(status: boolean): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PagesFacade, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PagesFacade>;
|
|
31
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateRef } from "@angular/core";
|
|
2
|
-
import { ButtonType, ContentDirection, DesignType, InputDirection, InputType, WidgetPosition } from "../enums/enum";
|
|
2
|
+
import { ButtonType, ContentDirection, DesignType, InputDirection, InputType, TableColumnType, WidgetPosition } from "../enums/enum";
|
|
3
3
|
import { ValidatorFn } from "@angular/forms";
|
|
4
4
|
export interface IButtonConfig {
|
|
5
5
|
isDisabled?: boolean;
|
|
@@ -71,6 +71,7 @@ export interface IPaginator {
|
|
|
71
71
|
export interface IDataColumnConfig {
|
|
72
72
|
name: string;
|
|
73
73
|
label: string;
|
|
74
|
+
type: TableColumnType;
|
|
74
75
|
}
|
|
75
76
|
export interface IItemList<T> {
|
|
76
77
|
totalRecords: number;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export * from './lib/components/pages/login/login.component';
|
|
|
22
22
|
export * from './lib/components/pages/menu/menu.component';
|
|
23
23
|
export * from './lib/components/pages/version/version.component';
|
|
24
24
|
export * from './lib/components/pages/detail/detail.component';
|
|
25
|
+
export * from './lib/components/pages/admin/admin.component';
|
|
25
26
|
export * from './lib/shared/interfaces/interface';
|
|
26
27
|
export * from './lib/shared/enums/enum';
|