@sarafapp/iron_core 1.0.17
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/dist/IronCore.js +2469 -0
- package/dist/IronCore.umd.cjs +2 -0
- package/dist/index.d.ts +29 -0
- package/dist/src/BaseModel.d.ts +45 -0
- package/dist/src/Utils.d.ts +4 -0
- package/dist/src/accessHandling/AccessControl.d.ts +10 -0
- package/dist/src/accessHandling/AccessLevel.d.ts +13 -0
- package/dist/src/accessHandling/Accessible.d.ts +3 -0
- package/dist/src/accessHandling/EveryDirectiveAccess.d.ts +4 -0
- package/dist/src/accessHandling/SSO/AuthorizationDirective.d.ts +17 -0
- package/dist/src/accessHandling/SSO/AuthorizationService.d.ts +17 -0
- package/dist/src/accessHandling/SSO/EveryLevelAuthorizationDirective.d.ts +4 -0
- package/dist/src/accessHandling/SSO/SomeLevelsAuthorizationDirective.d.ts +4 -0
- package/dist/src/accessHandling/SomeDirectiveAccess.d.ts +4 -0
- package/dist/src/accessHandling/index.d.ts +9 -0
- package/dist/src/baseDirective/BeforeMountDirective.d.ts +3 -0
- package/dist/src/baseDirective/BeforeUnMountDirective.d.ts +3 -0
- package/dist/src/baseDirective/BeforeUpdateDirective.d.ts +3 -0
- package/dist/src/baseDirective/CreatedDirective.d.ts +3 -0
- package/dist/src/baseDirective/MountedDirective.d.ts +3 -0
- package/dist/src/baseDirective/UnMountedDirective.d.ts +3 -0
- package/dist/src/baseDirective/UpdateDirective.d.ts +3 -0
- package/dist/src/baseDirective/index.d.ts +7 -0
- package/dist/src/baseForm/FormManager.d.ts +17 -0
- package/dist/src/baseForm/InputControl.d.ts +36 -0
- package/dist/src/baseForm/InputControlBuilder.d.ts +14 -0
- package/dist/src/baseForm/InputControlData.d.ts +13 -0
- package/dist/src/baseForm/TouchSensitiveForm.d.ts +9 -0
- package/dist/src/baseForm/UseForm.d.ts +5 -0
- package/dist/src/baseForm/index.d.ts +6 -0
- package/dist/src/baseSchedule/Schedule.d.ts +3 -0
- package/dist/src/baseSchedule/Scheduler.d.ts +8 -0
- package/dist/src/baseSchedule/index.d.ts +2 -0
- package/dist/src/baseTable/BaseTable.d.ts +46 -0
- package/dist/src/baseTable/Constants.d.ts +12 -0
- package/dist/src/baseTable/OnDestory.d.ts +3 -0
- package/dist/src/baseTable/RowActionSource.d.ts +4 -0
- package/dist/src/baseTable/RowClick.d.ts +3 -0
- package/dist/src/baseTable/RowDoubleClick.d.ts +3 -0
- package/dist/src/baseTable/RowMetaClick.d.ts +3 -0
- package/dist/src/baseTable/SelectableTable.d.ts +19 -0
- package/dist/src/baseTable/TableAction.d.ts +8 -0
- package/dist/src/baseTable/TableHeaderSchema.d.ts +27 -0
- package/dist/src/baseTable/TableLoader.d.ts +3 -0
- package/dist/src/baseTable/TablePaginate.d.ts +3 -0
- package/dist/src/baseTable/TableService.d.ts +9 -0
- package/dist/src/baseTable/TableSort.d.ts +4 -0
- package/dist/src/baseTable/TableSummarySchema.d.ts +9 -0
- package/dist/src/baseTable/index.d.ts +15 -0
- package/dist/src/baseTable/moduleConnection/Action.d.ts +3 -0
- package/dist/src/baseTable/moduleConnection/Column.d.ts +3 -0
- package/dist/src/baseTable/moduleConnection/Table.d.ts +4 -0
- package/dist/src/baseTable/moduleConnection/TableDestroy.d.ts +2 -0
- package/dist/src/baseTable/moduleConnection/TableRowClick.d.ts +2 -0
- package/dist/src/composables/UseCrud.d.ts +10 -0
- package/dist/src/composables/UseData.d.ts +14 -0
- package/dist/src/composables/UseLoadingStatus.d.ts +15 -0
- package/dist/src/composables/UseParams.d.ts +15 -0
- package/dist/src/composables/UseRepository.d.ts +63 -0
- package/dist/src/composables/UseStaticTableService.d.ts +4 -0
- package/dist/src/composables/index.d.ts +6 -0
- package/dist/src/constants/Constants.d.ts +108 -0
- package/dist/src/constants/index.d.ts +1 -0
- package/dist/src/crudService/CrudService.d.ts +22 -0
- package/dist/src/crudService/index.d.ts +1 -0
- package/dist/src/dateHandling/Constants.d.ts +5 -0
- package/dist/src/dateHandling/Converter.d.ts +5 -0
- package/dist/src/dateHandling/JalaliDateSetup.d.ts +1 -0
- package/dist/src/dateHandling/Model.d.ts +12 -0
- package/dist/src/dateHandling/Utils.d.ts +8 -0
- package/dist/src/dateHandling/index.d.ts +5 -0
- package/dist/src/debounce/DebounceAction.d.ts +4 -0
- package/dist/src/debounce/DebounceService.d.ts +9 -0
- package/dist/src/debounce/index.d.ts +2 -0
- package/dist/src/deviceManagement/Constants.d.ts +4 -0
- package/dist/src/deviceManagement/Visibility.d.ts +4 -0
- package/dist/src/deviceManagement/VisibilityManager.d.ts +6 -0
- package/dist/src/deviceManagement/index.d.ts +3 -0
- package/dist/src/errorHandling/ErrorHandler.d.ts +3 -0
- package/dist/src/errorHandling/HandleError.d.ts +2 -0
- package/dist/src/errorHandling/index.d.ts +2 -0
- package/dist/src/feedbackHandling/FailureFeedback.d.ts +3 -0
- package/dist/src/feedbackHandling/Feedback.d.ts +11 -0
- package/dist/src/feedbackHandling/HandleFeedback.d.ts +2 -0
- package/dist/src/feedbackHandling/InfoFeedback.d.ts +3 -0
- package/dist/src/feedbackHandling/SuccessFeedback.d.ts +3 -0
- package/dist/src/feedbackHandling/WarningFeedback.d.ts +3 -0
- package/dist/src/feedbackHandling/index.d.ts +6 -0
- package/dist/src/httpClient/ApiBuilder.d.ts +14 -0
- package/dist/src/httpClient/ErrorHandlerRegistry.d.ts +10 -0
- package/dist/src/httpClient/HttpClient.d.ts +14 -0
- package/dist/src/httpClient/Interceptor.d.ts +4 -0
- package/dist/src/httpClient/index.d.ts +4 -0
- package/dist/src/initializer/ApplicationInitializer.d.ts +6 -0
- package/dist/src/initializer/Initializer.d.ts +3 -0
- package/dist/src/initializer/index.d.ts +2 -0
- package/dist/src/json/JsonMapper.d.ts +18 -0
- package/dist/src/json/index.d.ts +1 -0
- package/dist/src/layout/Constants.d.ts +10 -0
- package/dist/src/layout/DialogService.d.ts +1 -0
- package/dist/src/layout/DrawerService.d.ts +1 -0
- package/dist/src/layout/Toast.d.ts +8 -0
- package/dist/src/layout/index.d.ts +4 -0
- package/dist/src/lib/Constants.d.ts +20 -0
- package/dist/src/lib/Formatter.d.ts +10 -0
- package/dist/src/lib/Util.d.ts +11 -0
- package/dist/src/lib/index.d.ts +3 -0
- package/dist/src/observables/AbstractSubject.d.ts +7 -0
- package/dist/src/observables/BehaviorSubject.d.ts +15 -0
- package/dist/src/observables/Observer.d.ts +3 -0
- package/dist/src/observables/Subject.d.ts +6 -0
- package/dist/src/observables/index.d.ts +4 -0
- package/dist/src/process/Proccess.d.ts +9 -0
- package/dist/src/process/ProcessManager.d.ts +10 -0
- package/dist/src/process/index.d.ts +2 -0
- package/dist/src/repository/Params.d.ts +11 -0
- package/dist/src/repository/Repository.d.ts +38 -0
- package/dist/src/repository/SyncDetail.d.ts +5 -0
- package/dist/src/repository/index.d.ts +4 -0
- package/dist/src/repository/model.d.ts +5 -0
- package/dist/src/routeGuard/RouteGuard.d.ts +6 -0
- package/dist/src/routeGuard/index.d.ts +1 -0
- package/dist/src/search/client/ClientArraySearch.d.ts +4 -0
- package/dist/src/search/client/ClientSearch.d.ts +3 -0
- package/dist/src/search/index.d.ts +2 -0
- package/dist/src/sort/SortDetail.d.ts +6 -0
- package/dist/src/sort/client/Sorter.d.ts +6 -0
- package/dist/src/sort/index.d.ts +4 -0
- package/dist/src/sort/strategies/SimpleSort.d.ts +5 -0
- package/dist/src/sort/strategies/SortStrategy.d.ts +4 -0
- package/dist/src/types/Global.d.ts +1 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/validators/Validator.d.ts +4 -0
- package/dist/src/validators/index.d.ts +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +38 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CellType, HeaderType, LoadingStatus, SortOrder, TableHeaderAlign } from '../constants';
|
|
2
|
+
import { Accessible } from '../accessHandling';
|
|
3
|
+
export interface TableHeaderSchema<Model> extends Accessible {
|
|
4
|
+
path?: keyof Model;
|
|
5
|
+
title: string;
|
|
6
|
+
getProps?: (row: Model) => Record<string, unknown>;
|
|
7
|
+
key: keyof Model;
|
|
8
|
+
cellType?: CellType;
|
|
9
|
+
align?: TableHeaderAlign;
|
|
10
|
+
headerType?: HeaderType;
|
|
11
|
+
colspan?: number;
|
|
12
|
+
width?: string | number;
|
|
13
|
+
ellipsis?: boolean;
|
|
14
|
+
maxWidth?: number;
|
|
15
|
+
minWidth?: number;
|
|
16
|
+
resizable?: boolean;
|
|
17
|
+
sortOrder?: SortOrder;
|
|
18
|
+
sorter?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface TableRenderingData<Model> {
|
|
21
|
+
totalItems: number;
|
|
22
|
+
currentPage: number;
|
|
23
|
+
rows: Model[];
|
|
24
|
+
loadingStatus: Set<LoadingStatus>;
|
|
25
|
+
currentPageItems: Model[];
|
|
26
|
+
}
|
|
27
|
+
export declare function generateHeader<Model>(header: TableHeaderSchema<Model>): TableHeaderSchema<Model>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SortDetail } from '../sort';
|
|
2
|
+
import { FetchListResponse } from '../repository/model';
|
|
3
|
+
import { TableRenderingData } from './TableHeaderSchema';
|
|
4
|
+
export interface TableService<Model> {
|
|
5
|
+
fetchRows(): Promise<FetchListResponse<Model>>;
|
|
6
|
+
paginate(nextPage: number, pageSize: number): Promise<FetchListResponse<Model>>;
|
|
7
|
+
sort(sortDetail: SortDetail<Model>): Promise<FetchListResponse<Model>>;
|
|
8
|
+
getData(): TableRenderingData<Model>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { TableAction } from './TableAction';
|
|
2
|
+
export type { TableService } from './TableService';
|
|
3
|
+
export type { Destroy } from './OnDestory';
|
|
4
|
+
export type { RowActionSource } from './RowActionSource';
|
|
5
|
+
export type { TableLoader } from './TableLoader';
|
|
6
|
+
export type { TablePaginate } from './TablePaginate';
|
|
7
|
+
export { TABLE_ACTION_COLUMN, TABLE_COLUMN_DEFAULT_VALUES, TABLE_COLUMN_DEFAULT_COLSPAN, TABLE_COLUMN_DEFAULT_WIDTH, } from './Constants';
|
|
8
|
+
export { BaseTable } from './BaseTable';
|
|
9
|
+
export { SelectableTable } from './SelectableTable';
|
|
10
|
+
export { type TableHeaderSchema, type TableRenderingData, generateHeader, } from './TableHeaderSchema';
|
|
11
|
+
export { Column } from './moduleConnection/Column';
|
|
12
|
+
export { Table } from './moduleConnection/Table';
|
|
13
|
+
export { Action } from './moduleConnection/Action';
|
|
14
|
+
export { TableDestroy } from './moduleConnection/TableDestroy';
|
|
15
|
+
export { TableRowClick } from './moduleConnection/TableRowClick';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ActionDecorator } from '../TableAction';
|
|
2
|
+
import { BaseModel } from '../../BaseModel';
|
|
3
|
+
export declare function Action<Model extends BaseModel>(actionDetail: Omit<ActionDecorator<Model>, 'handler'>): (target: BaseModel, _propertyKey: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BaseTable } from '../../baseTable';
|
|
2
|
+
import { BaseModel } from '../../BaseModel';
|
|
3
|
+
import { SelectableTable } from '../SelectableTable';
|
|
4
|
+
export declare function Table<Model extends BaseModel>(table: typeof BaseTable<Model> | typeof SelectableTable<Model>): (constructor: Function) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseModel } from '../BaseModel';
|
|
2
|
+
export declare function useCrud<Entity extends BaseModel>(): {
|
|
3
|
+
entityItemsAsArray: any;
|
|
4
|
+
addOrReplaceItems: (items: Entity[]) => void;
|
|
5
|
+
removeById: (id: string | number) => any;
|
|
6
|
+
getItemById: (id: number | string) => any;
|
|
7
|
+
clearItems: () => void;
|
|
8
|
+
setTotalCount: (count: number) => void;
|
|
9
|
+
getTotalCount: any;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseModel } from '../BaseModel';
|
|
2
|
+
import { Nullable } from '../types';
|
|
3
|
+
export declare function useData<Model extends BaseModel>(): {
|
|
4
|
+
itemsAsArray: any;
|
|
5
|
+
totalCount: any;
|
|
6
|
+
currentItem: any;
|
|
7
|
+
setTotalCount: (totalItems: number) => void;
|
|
8
|
+
addOrReplaceItems: (itemsToAdd: Model[]) => void;
|
|
9
|
+
getById: (id: number) => Nullable<Model>;
|
|
10
|
+
removeById: (id: number) => boolean;
|
|
11
|
+
clearItems: () => void;
|
|
12
|
+
setCurrentItem: (item: Nullable<Model>) => void;
|
|
13
|
+
clearCurrentItem: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LoadingStatus } from '../constants';
|
|
2
|
+
export declare function useLoadingStatus(): {
|
|
3
|
+
loadingStatus: any;
|
|
4
|
+
isFetchingList: any;
|
|
5
|
+
isFetchingItem: any;
|
|
6
|
+
isFetchingLastItems: any;
|
|
7
|
+
isFetchingPreviousItems: any;
|
|
8
|
+
isCreating: any;
|
|
9
|
+
isUpdating: any;
|
|
10
|
+
isDeleting: any;
|
|
11
|
+
isSearching: any;
|
|
12
|
+
isSorting: any;
|
|
13
|
+
setStatus: (status: LoadingStatus) => void;
|
|
14
|
+
removeStatus: (status: LoadingStatus) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SortDetail } from '../sort';
|
|
2
|
+
import { BaseModel } from '../BaseModel';
|
|
3
|
+
export declare function useParams(): {
|
|
4
|
+
params: Ref<Params>;
|
|
5
|
+
setNextPage: () => void;
|
|
6
|
+
setPreventPage: () => void;
|
|
7
|
+
setPageNumber: (pageNumber: number) => void;
|
|
8
|
+
setItemCount: (itemCount: number) => void;
|
|
9
|
+
setSortDetail: (sortDetail: SortDetail<BaseModel>) => void;
|
|
10
|
+
setFilter: (key: string, value: unknown) => void;
|
|
11
|
+
removeFilter: (key: string) => void;
|
|
12
|
+
getRequestParams: () => Record<string, unknown>;
|
|
13
|
+
clearParam: () => void;
|
|
14
|
+
setFiltersBaseOnRequestBody: (filters: Record<string, unknown>) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { Repository } from '../repository';
|
|
3
|
+
import { LoadingStatus } from '../constants';
|
|
4
|
+
import { SortDetail } from '../sort';
|
|
5
|
+
import { BaseModel } from '../BaseModel';
|
|
6
|
+
export declare function useRepository<Model extends BaseModel>(repository: Repository<Model>): {
|
|
7
|
+
loadingStatusManager: {
|
|
8
|
+
loadingStatus: any;
|
|
9
|
+
isFetchingList: any;
|
|
10
|
+
isFetchingItem: any;
|
|
11
|
+
isFetchingLastItems: any;
|
|
12
|
+
isFetchingPreviousItems: any;
|
|
13
|
+
isCreating: any;
|
|
14
|
+
isUpdating: any;
|
|
15
|
+
isDeleting: any;
|
|
16
|
+
isSearching: any;
|
|
17
|
+
isSorting: any;
|
|
18
|
+
setStatus: (status: LoadingStatus) => void;
|
|
19
|
+
removeStatus: (status: LoadingStatus) => void;
|
|
20
|
+
};
|
|
21
|
+
dataManger: {
|
|
22
|
+
itemsAsArray: any;
|
|
23
|
+
totalCount: any;
|
|
24
|
+
currentItem: any;
|
|
25
|
+
setTotalCount: (totalItems: number) => void;
|
|
26
|
+
addOrReplaceItems: (itemsToAdd: BaseModel[]) => void;
|
|
27
|
+
getById: (id: number) => computed<BaseModel>;
|
|
28
|
+
removeById: (id: number) => boolean;
|
|
29
|
+
clearItems: () => void;
|
|
30
|
+
setCurrentItem: (item: computed<BaseModel>) => void;
|
|
31
|
+
clearCurrentItem: () => void;
|
|
32
|
+
};
|
|
33
|
+
paramsManager: {
|
|
34
|
+
params: Ref<Params>;
|
|
35
|
+
setNextPage: () => void;
|
|
36
|
+
setPreventPage: () => void;
|
|
37
|
+
setPageNumber: (pageNumber: number) => void;
|
|
38
|
+
setItemCount: (itemCount: number) => void;
|
|
39
|
+
setSortDetail: (sortDetail: SortDetail<BaseModel>) => void;
|
|
40
|
+
setFilter: (key: string, value: unknown) => void;
|
|
41
|
+
removeFilter: (key: string) => void;
|
|
42
|
+
getRequestParams: () => Record<string, unknown>;
|
|
43
|
+
clearParam: () => void;
|
|
44
|
+
setFiltersBaseOnRequestBody: (filters: Record<string, unknown>) => void;
|
|
45
|
+
};
|
|
46
|
+
tableRenderingData: any;
|
|
47
|
+
fetchList: (loadingStatus?: LoadingStatus) => Promise<any>;
|
|
48
|
+
fetchWithAutoRefresh: () => Promise<void>;
|
|
49
|
+
setupAutoRefresh: () => void;
|
|
50
|
+
stopAutoRefresh: () => void;
|
|
51
|
+
fetchItemById: (id: number, shouldRemoveItem?: boolean) => Promise<any>;
|
|
52
|
+
createItem: <Body>(body: Body) => Promise<any>;
|
|
53
|
+
updateItem: <Body>(id: number, body: Body) => Promise<any>;
|
|
54
|
+
deleteItem: (id: number) => Promise<boolean>;
|
|
55
|
+
fetchLastItems: () => Promise<any>;
|
|
56
|
+
fetchPreviousItems: () => Promise<any>;
|
|
57
|
+
fetchItemsByPageNumber: (pageNumber: number) => Promise<any>;
|
|
58
|
+
search: (searchedValue: string) => Promise<any>;
|
|
59
|
+
sort: (sortDetail: SortDetail<Model>) => Promise<any>;
|
|
60
|
+
clearFilters: () => Promise<any>;
|
|
61
|
+
tableService: any;
|
|
62
|
+
currentPageItems: any;
|
|
63
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useRepository } from './UseRepository';
|
|
2
|
+
export { useData } from './UseData';
|
|
3
|
+
export { useParams } from './UseParams';
|
|
4
|
+
export { useLoadingStatus } from './UseLoadingStatus';
|
|
5
|
+
export { useStaticTableService } from './UseStaticTableService';
|
|
6
|
+
export * from './UseCrud';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export declare const enum LoadingStatus {
|
|
2
|
+
FetchList = "fetchList",
|
|
3
|
+
AutoRefresh = "autoRefresh",
|
|
4
|
+
FetchItem = "fetchItem",
|
|
5
|
+
FetchLastItems = "fetchLastItems",
|
|
6
|
+
FetchPreviousItems = "fetchPreviousItems",
|
|
7
|
+
Create = "CREATE",
|
|
8
|
+
Update = "UPDATE",
|
|
9
|
+
Delete = "DELETE",
|
|
10
|
+
Search = "SEARCH",
|
|
11
|
+
Sort = "SORT",
|
|
12
|
+
Success = "SUCCESS",
|
|
13
|
+
Error = "ERROR",
|
|
14
|
+
Idle = "IDLE"
|
|
15
|
+
}
|
|
16
|
+
export declare const enum DialogDimensions {
|
|
17
|
+
Width = "width",
|
|
18
|
+
Height = "height",
|
|
19
|
+
DefaultWidth = 500,
|
|
20
|
+
DefaultHeight = 350,
|
|
21
|
+
MinimalAvailableSize = 0
|
|
22
|
+
}
|
|
23
|
+
export declare const enum SortOrder {
|
|
24
|
+
ASC = "ASC",
|
|
25
|
+
DESC = "DESC"
|
|
26
|
+
}
|
|
27
|
+
export declare const enum SortOrderTableHeader {
|
|
28
|
+
ASC = "ascend",
|
|
29
|
+
DESC = "descend"
|
|
30
|
+
}
|
|
31
|
+
export declare const enum TableHeaderAlign {
|
|
32
|
+
Left = "left",
|
|
33
|
+
Right = "right",
|
|
34
|
+
Center = "center"
|
|
35
|
+
}
|
|
36
|
+
export declare const enum HeaderType {
|
|
37
|
+
Text = "text"
|
|
38
|
+
}
|
|
39
|
+
export declare const enum CellType {
|
|
40
|
+
Text = "text",
|
|
41
|
+
ACTION = "action",
|
|
42
|
+
Tag = "tag",
|
|
43
|
+
Iban = "iban",
|
|
44
|
+
BankCard = "bankCard",
|
|
45
|
+
Symbol = "symbol",
|
|
46
|
+
TradeDetail = "tradeDetail",
|
|
47
|
+
SymbolPrice = "symbolPrice",
|
|
48
|
+
TradeSymbol = "tradeSymbol",
|
|
49
|
+
Price = "price",
|
|
50
|
+
DynamicCurrencyPrice = "dynamicCurrencyPrice",
|
|
51
|
+
TradeDate = "tradeDate",
|
|
52
|
+
RequestResponseIdentity = "requestResponseIdentity",
|
|
53
|
+
Image = "image"
|
|
54
|
+
}
|
|
55
|
+
export declare const enum TableConstants {
|
|
56
|
+
MINIMAL_LOADABLE_HEADER_COUNT = 0,
|
|
57
|
+
DEFAULT_ITEM_COUNT_PER_PAGE = 20,
|
|
58
|
+
PAGINATION_POSITION = "bottomCenter"
|
|
59
|
+
}
|
|
60
|
+
export declare const enum ApplicationTheme {
|
|
61
|
+
FontFamily = "IRANSansX"
|
|
62
|
+
}
|
|
63
|
+
export declare const enum ApplicationDrawerStatus {
|
|
64
|
+
Open = "open",
|
|
65
|
+
Close = "close"
|
|
66
|
+
}
|
|
67
|
+
export declare const enum ToastType {
|
|
68
|
+
Success = "success",
|
|
69
|
+
Failure = "error",
|
|
70
|
+
Info = "info",
|
|
71
|
+
Warning = "warning"
|
|
72
|
+
}
|
|
73
|
+
export declare const enum ToastLocation {
|
|
74
|
+
BottomLeft = "bottomLeft"
|
|
75
|
+
}
|
|
76
|
+
export declare const enum StatusCode {
|
|
77
|
+
NotFound = 404,
|
|
78
|
+
Unauthorized = 401,
|
|
79
|
+
ServerError = 500
|
|
80
|
+
}
|
|
81
|
+
export declare const enum FormValidationStatus {
|
|
82
|
+
Invalid = 0,
|
|
83
|
+
Valid = 1
|
|
84
|
+
}
|
|
85
|
+
export declare const enum StorageKeys {
|
|
86
|
+
Theme = "theme",
|
|
87
|
+
AccessList = "accessList",
|
|
88
|
+
Token = "token",
|
|
89
|
+
SSO_ACCESS_LIST = "ssoAccessList"
|
|
90
|
+
}
|
|
91
|
+
export declare const enum ApplicationTheme {
|
|
92
|
+
Light = "light",
|
|
93
|
+
Dark = "dark"
|
|
94
|
+
}
|
|
95
|
+
export declare const enum ComponentSize {
|
|
96
|
+
Small = "small",
|
|
97
|
+
Medium = "medium",
|
|
98
|
+
Large = "large"
|
|
99
|
+
}
|
|
100
|
+
export declare const enum StoreNames {
|
|
101
|
+
Dialog = "dialog",
|
|
102
|
+
Drawer = "drawer",
|
|
103
|
+
Module = "module",
|
|
104
|
+
Toast = "toast"
|
|
105
|
+
}
|
|
106
|
+
export declare const enum Symbols {
|
|
107
|
+
USDT = "USDT"
|
|
108
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LoadingStatus, DialogDimensions, SortOrder, SortOrderTableHeader, TableHeaderAlign, HeaderType, CellType, TableConstants, ApplicationDrawerStatus, ToastType, ToastLocation, StatusCode, FormValidationStatus, StorageKeys, ApplicationTheme, StoreNames } from './Constants';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SyncDetail, useParams, useCrud, Repository } from '../../index';
|
|
2
|
+
import { BaseModel } from '../BaseModel';
|
|
3
|
+
export declare class CrudService<Entity extends BaseModel> {
|
|
4
|
+
protected repository: Repository<Entity>;
|
|
5
|
+
protected crudDataManagement: ReturnType<typeof useCrud>;
|
|
6
|
+
protected scheduler: any;
|
|
7
|
+
protected syncDetail: SyncDetail;
|
|
8
|
+
paramManager: any;
|
|
9
|
+
constructor(repository: Repository<Entity>, crudDataManagement: ReturnType<typeof useCrud>, paramManager: ReturnType<typeof useParams>);
|
|
10
|
+
fetchList(): Promise<any>;
|
|
11
|
+
fetchItemById(id: number): Promise<any>;
|
|
12
|
+
createItem<Body>(body: Body): Promise<any>;
|
|
13
|
+
protected shouldRefreshListAfterCreate(): boolean;
|
|
14
|
+
deleteItem(id: number): Promise<any>;
|
|
15
|
+
updateItem<Body>(id: number, body: Body): Promise<any>;
|
|
16
|
+
protected shouldRefreshListAfterUpdate(): boolean;
|
|
17
|
+
removeItem(id: number): Promise<any>;
|
|
18
|
+
protected shouldRefreshListAfterDelete(): boolean;
|
|
19
|
+
private syncListWithApi;
|
|
20
|
+
onDestroy(): void;
|
|
21
|
+
clearInterval(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CrudService';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupJalaliDate(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullable } from '../types';
|
|
2
|
+
export declare class RangeValue {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
constructor(start: number, end: number);
|
|
6
|
+
}
|
|
7
|
+
export declare class DateDisabledOptions {
|
|
8
|
+
maxDate: Nullable<number>;
|
|
9
|
+
minDate: Nullable<number>;
|
|
10
|
+
disabledDates: number[];
|
|
11
|
+
constructor(max: Nullable<number>, min: Nullable<number>, disabledDates: number[]);
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DateDisabledOptions } from './Model';
|
|
2
|
+
import { default as dayjs } from 'dayjs';
|
|
3
|
+
export declare class DateTools {
|
|
4
|
+
static isDateDisabled(options: DateDisabledOptions, date: dayjs.Dayjs): boolean;
|
|
5
|
+
static areUnixesInSameDate(firstDate: number, secondDate: number): boolean;
|
|
6
|
+
static isDateGraterOrSame(originDate: number, dateToCheck: number): boolean;
|
|
7
|
+
static isDateLowerOrSame(originDate: number, dateToCheck: number): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DebounceAction } from './DebounceAction';
|
|
2
|
+
export declare class DebounceService {
|
|
3
|
+
private readonly debounceTimeout;
|
|
4
|
+
private action;
|
|
5
|
+
private timerId;
|
|
6
|
+
constructor(action: DebounceAction, debounceTimeout?: number);
|
|
7
|
+
runAction(): void;
|
|
8
|
+
cancelDebounce(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare abstract class Feedback<Model, ErrorModel extends Error = Error> {
|
|
2
|
+
protected successMessageResolver: (model: Model) => string;
|
|
3
|
+
protected failureMessageResolver: (error: ErrorModel) => string;
|
|
4
|
+
shouldResolveSuccess: (model: Model) => boolean;
|
|
5
|
+
shouldResolveFailure: (error: ErrorModel) => boolean;
|
|
6
|
+
constructor(successMessageResolver: (model: Model) => string, failureMessageResolver: (error: ErrorModel) => string, shouldResolveSuccess?: (model: Model) => boolean, shouldResolveFailure?: (error: ErrorModel) => boolean);
|
|
7
|
+
handleSuccess(entity: Model): Promise<void>;
|
|
8
|
+
handleFailure(error: ErrorModel): Promise<void>;
|
|
9
|
+
handleInfo(): Promise<void>;
|
|
10
|
+
handleWarning(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { HandleFeedback } from './HandleFeedback';
|
|
2
|
+
export { Feedback } from './Feedback';
|
|
3
|
+
export type { FailureFeedback } from './FailureFeedback';
|
|
4
|
+
export type { InfoFeedback } from './InfoFeedback';
|
|
5
|
+
export type { SuccessFeedback } from './SuccessFeedback';
|
|
6
|
+
export type { WarningFeedback } from './WarningFeedback';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Axios } from 'axios';
|
|
2
|
+
import { Interceptor } from './Interceptor';
|
|
3
|
+
import { APIErrorHandlerRegistry } from './ErrorHandlerRegistry';
|
|
4
|
+
export declare class ApiBuilder {
|
|
5
|
+
private axiosInstance;
|
|
6
|
+
constructor(axiosInstance: Axios);
|
|
7
|
+
setBaseURL(baseURL: string): this;
|
|
8
|
+
setTimeout(timeInMilliSeconds: number): this;
|
|
9
|
+
setHeaders(headers: Record<string, string | string[]>): this;
|
|
10
|
+
attachRequestInterceptors(interceptors: Interceptor[]): this;
|
|
11
|
+
attachResponseInterceptors(apiErrorRegistry: APIErrorHandlerRegistry): this;
|
|
12
|
+
build(): Axios;
|
|
13
|
+
}
|
|
14
|
+
export default ApiBuilder;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
import { ErrorHandler } from '../errorHandling';
|
|
3
|
+
export declare class APIErrorHandlerRegistry {
|
|
4
|
+
private static handlers;
|
|
5
|
+
private static instance;
|
|
6
|
+
private constructor();
|
|
7
|
+
static GetInstance(): Nullable<APIErrorHandlerRegistry>;
|
|
8
|
+
static registerHandler(statusCode: number, handler: ErrorHandler): void;
|
|
9
|
+
handle(error: AxiosError): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Axios, AxiosHeaders, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
type axiosConfig = {
|
|
3
|
+
headers?: AxiosHeaders;
|
|
4
|
+
} & Omit<InternalAxiosRequestConfig, "headers">;
|
|
5
|
+
export declare class HttpClient {
|
|
6
|
+
private axiosInstance;
|
|
7
|
+
constructor(instance: Axios);
|
|
8
|
+
get<T>(url: string, config?: axiosConfig): Promise<AxiosResponse<T>>;
|
|
9
|
+
post<T>(url: string, data?: unknown, config?: axiosConfig): Promise<AxiosResponse<T>>;
|
|
10
|
+
patch<T>(url: string, data?: unknown, config?: axiosConfig): Promise<AxiosResponse<T>>;
|
|
11
|
+
put<T>(url: string, data?: unknown, config?: axiosConfig): Promise<AxiosResponse<T>>;
|
|
12
|
+
delete<T>(url: string, config?: axiosConfig): Promise<AxiosResponse<T>>;
|
|
13
|
+
}
|
|
14
|
+
export default HttpClient;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class JsonMapper {
|
|
2
|
+
private static Instance;
|
|
3
|
+
private jsonConverter;
|
|
4
|
+
private constructor();
|
|
5
|
+
serializeObject<T extends object>(object: object, model: {
|
|
6
|
+
new (): T;
|
|
7
|
+
}): any;
|
|
8
|
+
deserializeObject<T extends object>(object: object, model: {
|
|
9
|
+
new (): T;
|
|
10
|
+
}): any;
|
|
11
|
+
deserializeArray<T extends object>(array: Array<T>, model: {
|
|
12
|
+
new (): T[];
|
|
13
|
+
}): any;
|
|
14
|
+
tryDeserialize(object: object, models: {
|
|
15
|
+
new (): any;
|
|
16
|
+
}[]): any;
|
|
17
|
+
static GetInstance(): Nullable<JsonMapper>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JsonMapper } from './JsonMapper';
|