@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.
Files changed (136) hide show
  1. package/dist/IronCore.js +2469 -0
  2. package/dist/IronCore.umd.cjs +2 -0
  3. package/dist/index.d.ts +29 -0
  4. package/dist/src/BaseModel.d.ts +45 -0
  5. package/dist/src/Utils.d.ts +4 -0
  6. package/dist/src/accessHandling/AccessControl.d.ts +10 -0
  7. package/dist/src/accessHandling/AccessLevel.d.ts +13 -0
  8. package/dist/src/accessHandling/Accessible.d.ts +3 -0
  9. package/dist/src/accessHandling/EveryDirectiveAccess.d.ts +4 -0
  10. package/dist/src/accessHandling/SSO/AuthorizationDirective.d.ts +17 -0
  11. package/dist/src/accessHandling/SSO/AuthorizationService.d.ts +17 -0
  12. package/dist/src/accessHandling/SSO/EveryLevelAuthorizationDirective.d.ts +4 -0
  13. package/dist/src/accessHandling/SSO/SomeLevelsAuthorizationDirective.d.ts +4 -0
  14. package/dist/src/accessHandling/SomeDirectiveAccess.d.ts +4 -0
  15. package/dist/src/accessHandling/index.d.ts +9 -0
  16. package/dist/src/baseDirective/BeforeMountDirective.d.ts +3 -0
  17. package/dist/src/baseDirective/BeforeUnMountDirective.d.ts +3 -0
  18. package/dist/src/baseDirective/BeforeUpdateDirective.d.ts +3 -0
  19. package/dist/src/baseDirective/CreatedDirective.d.ts +3 -0
  20. package/dist/src/baseDirective/MountedDirective.d.ts +3 -0
  21. package/dist/src/baseDirective/UnMountedDirective.d.ts +3 -0
  22. package/dist/src/baseDirective/UpdateDirective.d.ts +3 -0
  23. package/dist/src/baseDirective/index.d.ts +7 -0
  24. package/dist/src/baseForm/FormManager.d.ts +17 -0
  25. package/dist/src/baseForm/InputControl.d.ts +36 -0
  26. package/dist/src/baseForm/InputControlBuilder.d.ts +14 -0
  27. package/dist/src/baseForm/InputControlData.d.ts +13 -0
  28. package/dist/src/baseForm/TouchSensitiveForm.d.ts +9 -0
  29. package/dist/src/baseForm/UseForm.d.ts +5 -0
  30. package/dist/src/baseForm/index.d.ts +6 -0
  31. package/dist/src/baseSchedule/Schedule.d.ts +3 -0
  32. package/dist/src/baseSchedule/Scheduler.d.ts +8 -0
  33. package/dist/src/baseSchedule/index.d.ts +2 -0
  34. package/dist/src/baseTable/BaseTable.d.ts +46 -0
  35. package/dist/src/baseTable/Constants.d.ts +12 -0
  36. package/dist/src/baseTable/OnDestory.d.ts +3 -0
  37. package/dist/src/baseTable/RowActionSource.d.ts +4 -0
  38. package/dist/src/baseTable/RowClick.d.ts +3 -0
  39. package/dist/src/baseTable/RowDoubleClick.d.ts +3 -0
  40. package/dist/src/baseTable/RowMetaClick.d.ts +3 -0
  41. package/dist/src/baseTable/SelectableTable.d.ts +19 -0
  42. package/dist/src/baseTable/TableAction.d.ts +8 -0
  43. package/dist/src/baseTable/TableHeaderSchema.d.ts +27 -0
  44. package/dist/src/baseTable/TableLoader.d.ts +3 -0
  45. package/dist/src/baseTable/TablePaginate.d.ts +3 -0
  46. package/dist/src/baseTable/TableService.d.ts +9 -0
  47. package/dist/src/baseTable/TableSort.d.ts +4 -0
  48. package/dist/src/baseTable/TableSummarySchema.d.ts +9 -0
  49. package/dist/src/baseTable/index.d.ts +15 -0
  50. package/dist/src/baseTable/moduleConnection/Action.d.ts +3 -0
  51. package/dist/src/baseTable/moduleConnection/Column.d.ts +3 -0
  52. package/dist/src/baseTable/moduleConnection/Table.d.ts +4 -0
  53. package/dist/src/baseTable/moduleConnection/TableDestroy.d.ts +2 -0
  54. package/dist/src/baseTable/moduleConnection/TableRowClick.d.ts +2 -0
  55. package/dist/src/composables/UseCrud.d.ts +10 -0
  56. package/dist/src/composables/UseData.d.ts +14 -0
  57. package/dist/src/composables/UseLoadingStatus.d.ts +15 -0
  58. package/dist/src/composables/UseParams.d.ts +15 -0
  59. package/dist/src/composables/UseRepository.d.ts +63 -0
  60. package/dist/src/composables/UseStaticTableService.d.ts +4 -0
  61. package/dist/src/composables/index.d.ts +6 -0
  62. package/dist/src/constants/Constants.d.ts +108 -0
  63. package/dist/src/constants/index.d.ts +1 -0
  64. package/dist/src/crudService/CrudService.d.ts +22 -0
  65. package/dist/src/crudService/index.d.ts +1 -0
  66. package/dist/src/dateHandling/Constants.d.ts +5 -0
  67. package/dist/src/dateHandling/Converter.d.ts +5 -0
  68. package/dist/src/dateHandling/JalaliDateSetup.d.ts +1 -0
  69. package/dist/src/dateHandling/Model.d.ts +12 -0
  70. package/dist/src/dateHandling/Utils.d.ts +8 -0
  71. package/dist/src/dateHandling/index.d.ts +5 -0
  72. package/dist/src/debounce/DebounceAction.d.ts +4 -0
  73. package/dist/src/debounce/DebounceService.d.ts +9 -0
  74. package/dist/src/debounce/index.d.ts +2 -0
  75. package/dist/src/deviceManagement/Constants.d.ts +4 -0
  76. package/dist/src/deviceManagement/Visibility.d.ts +4 -0
  77. package/dist/src/deviceManagement/VisibilityManager.d.ts +6 -0
  78. package/dist/src/deviceManagement/index.d.ts +3 -0
  79. package/dist/src/errorHandling/ErrorHandler.d.ts +3 -0
  80. package/dist/src/errorHandling/HandleError.d.ts +2 -0
  81. package/dist/src/errorHandling/index.d.ts +2 -0
  82. package/dist/src/feedbackHandling/FailureFeedback.d.ts +3 -0
  83. package/dist/src/feedbackHandling/Feedback.d.ts +11 -0
  84. package/dist/src/feedbackHandling/HandleFeedback.d.ts +2 -0
  85. package/dist/src/feedbackHandling/InfoFeedback.d.ts +3 -0
  86. package/dist/src/feedbackHandling/SuccessFeedback.d.ts +3 -0
  87. package/dist/src/feedbackHandling/WarningFeedback.d.ts +3 -0
  88. package/dist/src/feedbackHandling/index.d.ts +6 -0
  89. package/dist/src/httpClient/ApiBuilder.d.ts +14 -0
  90. package/dist/src/httpClient/ErrorHandlerRegistry.d.ts +10 -0
  91. package/dist/src/httpClient/HttpClient.d.ts +14 -0
  92. package/dist/src/httpClient/Interceptor.d.ts +4 -0
  93. package/dist/src/httpClient/index.d.ts +4 -0
  94. package/dist/src/initializer/ApplicationInitializer.d.ts +6 -0
  95. package/dist/src/initializer/Initializer.d.ts +3 -0
  96. package/dist/src/initializer/index.d.ts +2 -0
  97. package/dist/src/json/JsonMapper.d.ts +18 -0
  98. package/dist/src/json/index.d.ts +1 -0
  99. package/dist/src/layout/Constants.d.ts +10 -0
  100. package/dist/src/layout/DialogService.d.ts +1 -0
  101. package/dist/src/layout/DrawerService.d.ts +1 -0
  102. package/dist/src/layout/Toast.d.ts +8 -0
  103. package/dist/src/layout/index.d.ts +4 -0
  104. package/dist/src/lib/Constants.d.ts +20 -0
  105. package/dist/src/lib/Formatter.d.ts +10 -0
  106. package/dist/src/lib/Util.d.ts +11 -0
  107. package/dist/src/lib/index.d.ts +3 -0
  108. package/dist/src/observables/AbstractSubject.d.ts +7 -0
  109. package/dist/src/observables/BehaviorSubject.d.ts +15 -0
  110. package/dist/src/observables/Observer.d.ts +3 -0
  111. package/dist/src/observables/Subject.d.ts +6 -0
  112. package/dist/src/observables/index.d.ts +4 -0
  113. package/dist/src/process/Proccess.d.ts +9 -0
  114. package/dist/src/process/ProcessManager.d.ts +10 -0
  115. package/dist/src/process/index.d.ts +2 -0
  116. package/dist/src/repository/Params.d.ts +11 -0
  117. package/dist/src/repository/Repository.d.ts +38 -0
  118. package/dist/src/repository/SyncDetail.d.ts +5 -0
  119. package/dist/src/repository/index.d.ts +4 -0
  120. package/dist/src/repository/model.d.ts +5 -0
  121. package/dist/src/routeGuard/RouteGuard.d.ts +6 -0
  122. package/dist/src/routeGuard/index.d.ts +1 -0
  123. package/dist/src/search/client/ClientArraySearch.d.ts +4 -0
  124. package/dist/src/search/client/ClientSearch.d.ts +3 -0
  125. package/dist/src/search/index.d.ts +2 -0
  126. package/dist/src/sort/SortDetail.d.ts +6 -0
  127. package/dist/src/sort/client/Sorter.d.ts +6 -0
  128. package/dist/src/sort/index.d.ts +4 -0
  129. package/dist/src/sort/strategies/SimpleSort.d.ts +5 -0
  130. package/dist/src/sort/strategies/SortStrategy.d.ts +4 -0
  131. package/dist/src/types/Global.d.ts +1 -0
  132. package/dist/src/types/index.d.ts +1 -0
  133. package/dist/src/validators/Validator.d.ts +4 -0
  134. package/dist/src/validators/index.d.ts +1 -0
  135. package/dist/vite.config.d.ts +2 -0
  136. 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,3 @@
1
+ export interface TableLoader<Model> {
2
+ loadRows(): Promise<Model>;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface TablePaginate {
2
+ handlePagination(nextPage: number, pageSize: number): Promise<void>;
3
+ }
@@ -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,4 @@
1
+ import { SortDetail } from '../sort';
2
+ export interface TableSort<Model> {
3
+ handleSort(sortDetail: SortDetail<Model>): Promise<void>;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { TableHeaderAlign } from '../constants';
2
+ export interface TableSummaryItem {
3
+ data: string | number;
4
+ align: TableHeaderAlign;
5
+ }
6
+ export interface TableSummarySchema {
7
+ summaryTitle: string;
8
+ summaryItems: TableSummaryItem[];
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,3 @@
1
+ import { TableHeaderSchema } from '../TableHeaderSchema';
2
+ import { BaseModel } from '../../BaseModel';
3
+ export declare function Column<Model extends BaseModel>(header: TableHeaderSchema<Model>): (target: BaseModel, propertyKey: string) => 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,2 @@
1
+ import { BaseModel } from '../../BaseModel';
2
+ export declare function TableDestroy(): (target: BaseModel, _propertyKey: string, descriptor: PropertyDescriptor) => void;
@@ -0,0 +1,2 @@
1
+ import { BaseModel } from '../../BaseModel';
2
+ export declare function TableRowClick(): (target: BaseModel, _propertyKey: string, descriptor: PropertyDescriptor) => 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,4 @@
1
+ export declare function useStaticTableService<Model>(initialRows: Model[]): {
2
+ tableRows: any;
3
+ staticTableService: any;
4
+ };
@@ -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,5 @@
1
+ export declare const enum DateFormats {
2
+ Normal = "YYYY-MM-DD",
3
+ ContainsHour = "YYYY-MM-DD HH:mm",
4
+ OnlyHour = "HH:mm"
5
+ }
@@ -0,0 +1,5 @@
1
+ export declare class DateConverter {
2
+ static standardToUnix(dateToConvert: string): number;
3
+ static unixToStandard(dateToConvert: number): string;
4
+ static getUnixEndOfDayInUnix(unix: number): any;
5
+ }
@@ -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,5 @@
1
+ export { DateFormats } from './Constants';
2
+ export { setupJalaliDate } from './JalaliDateSetup';
3
+ export { RangeValue, DateDisabledOptions } from './Model';
4
+ export { DateTools } from './Utils';
5
+ export { DateConverter } from './Converter';
@@ -0,0 +1,4 @@
1
+ export interface DebounceAction {
2
+ runDebounce: () => void;
3
+ runImmediate: () => void;
4
+ }
@@ -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,2 @@
1
+ export { type DebounceAction } from './DebounceAction';
2
+ export { DebounceService } from './DebounceService';
@@ -0,0 +1,4 @@
1
+ export declare const enum VisibilityState {
2
+ Hidden = "hidden",
3
+ Visible = "visible"
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface Visibility {
2
+ screenVisible(event: Event): Promise<void>;
3
+ screenInvisible(event: Event): Promise<void>;
4
+ }
@@ -0,0 +1,6 @@
1
+ import { Visibility } from './Visibility';
2
+ export declare class VisibilityManager {
3
+ private _visibilityControl;
4
+ constructor(_visibilityControl: Visibility);
5
+ private mangeVisibilityEvent;
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Constants';
2
+ export * from './VisibilityManager';
3
+ export * from './Visibility';
@@ -0,0 +1,3 @@
1
+ export interface ErrorHandler {
2
+ handleError(error: Error): Promise<void>;
3
+ }
@@ -0,0 +1,2 @@
1
+ import { ErrorHandler } from './ErrorHandler';
2
+ export declare function HandleError(handlers: ErrorHandler[]): (_name: unknown, _target: unknown, descriptor: PropertyDescriptor) => void;
@@ -0,0 +1,2 @@
1
+ export type { ErrorHandler } from './ErrorHandler';
2
+ export { HandleError } from './HandleError';
@@ -0,0 +1,3 @@
1
+ export interface FailureFeedback<ErrorModel> {
2
+ handleFailure(error: ErrorModel): Promise<void>;
3
+ }
@@ -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,2 @@
1
+ import { Feedback } from './Feedback';
2
+ export declare function HandleFeedback<Model>(feedbacks: Feedback<Model>[]): (_name: unknown, _target: unknown, descriptor: PropertyDescriptor) => void;
@@ -0,0 +1,3 @@
1
+ export interface InfoFeedback {
2
+ handleInfo(): Promise<void>;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface SuccessFeedback<Model> {
2
+ handleSuccess(model: Model): Promise<void>;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface WarningFeedback {
2
+ handleWarning(): Promise<void>;
3
+ }
@@ -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,4 @@
1
+ import { InternalAxiosRequestConfig } from 'axios';
2
+ export interface Interceptor {
3
+ intercept(config: InternalAxiosRequestConfig): InternalAxiosRequestConfig;
4
+ }
@@ -0,0 +1,4 @@
1
+ export { APIErrorHandlerRegistry } from './ErrorHandlerRegistry';
2
+ export { ApiBuilder } from './ApiBuilder';
3
+ export { HttpClient } from './HttpClient';
4
+ export { type Interceptor } from './Interceptor';
@@ -0,0 +1,6 @@
1
+ import { Initializer } from './Initializer';
2
+ export declare class ApplicationInitializer {
3
+ private _initializer;
4
+ setupInitializers(initializers: Initializer[]): void;
5
+ initialize(): void;
6
+ }
@@ -0,0 +1,3 @@
1
+ export interface Initializer {
2
+ initialize(): void;
3
+ }
@@ -0,0 +1,2 @@
1
+ export { ApplicationInitializer } from './ApplicationInitializer';
2
+ export { type Initializer } from './Initializer';
@@ -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';