@sarafapp/iron_core 1.0.64 → 1.0.67
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 +5 -2
- package/index.ts +0 -37
- package/src/BaseModel.ts +0 -127
- package/src/Utils.ts +0 -16
- package/src/accessHandling/AccessControl.ts +0 -33
- package/src/accessHandling/AccessLevel.ts +0 -52
- package/src/accessHandling/Accessible.ts +0 -3
- package/src/accessHandling/EveryDirectiveAccess.ts +0 -7
- package/src/accessHandling/SSO/AuthorizationDirective.ts +0 -65
- package/src/accessHandling/SSO/AuthorizationService.ts +0 -74
- package/src/accessHandling/SSO/EveryLevelAuthorizationDirective.ts +0 -7
- package/src/accessHandling/SSO/SomeLevelsAuthorizationDirective.ts +0 -7
- package/src/accessHandling/SomeDirectiveAccess.ts +0 -7
- package/src/accessHandling/index.ts +0 -9
- package/src/baseDirective/BeforeMountDirective.ts +0 -3
- package/src/baseDirective/BeforeUnMountDirective.ts +0 -3
- package/src/baseDirective/BeforeUpdateDirective.ts +0 -3
- package/src/baseDirective/CreatedDirective.ts +0 -3
- package/src/baseDirective/MountedDirective.ts +0 -3
- package/src/baseDirective/UnMountedDirective.ts +0 -3
- package/src/baseDirective/UpdateDirective.ts +0 -3
- package/src/baseDirective/index.ts +0 -7
- package/src/baseForm/BaseRequestBodyFilter.ts +0 -7
- package/src/baseForm/FormManager.ts +0 -95
- package/src/baseForm/InputControl.ts +0 -182
- package/src/baseForm/InputControlBuilder.ts +0 -59
- package/src/baseForm/InputControlData.ts +0 -16
- package/src/baseForm/RequestBodyFilter.ts +0 -3
- package/src/baseForm/TouchSensitiveForm.ts +0 -47
- package/src/baseForm/UseForm.ts +0 -32
- package/src/baseForm/index.ts +0 -8
- package/src/baseSchedule/Schedule.ts +0 -3
- package/src/baseSchedule/Scheduler.ts +0 -29
- package/src/baseSchedule/index.ts +0 -2
- package/src/baseTable/BaseTable.ts +0 -162
- package/src/baseTable/Constants.ts +0 -26
- package/src/baseTable/OnDestory.ts +0 -3
- package/src/baseTable/RowActionSource.ts +0 -5
- package/src/baseTable/RowClick.ts +0 -3
- package/src/baseTable/RowDoubleClick.ts +0 -3
- package/src/baseTable/RowMetaClick.ts +0 -3
- package/src/baseTable/SelectableTable.ts +0 -86
- package/src/baseTable/TableAction.ts +0 -10
- package/src/baseTable/TableHeaderSchema.ts +0 -44
- package/src/baseTable/TableLoader.ts +0 -3
- package/src/baseTable/TablePaginate.ts +0 -3
- package/src/baseTable/TableService.ts +0 -10
- package/src/baseTable/TableSort.ts +0 -5
- package/src/baseTable/TableSummarySchema.ts +0 -11
- package/src/baseTable/generator/SelectableTableGenerator.ts +0 -65
- package/src/baseTable/generator/TableCellComponentRegistry.ts +0 -15
- package/src/baseTable/generator/TableConfig.ts +0 -18
- package/src/baseTable/generator/TableGenerator.ts +0 -147
- package/src/baseTable/generator/TableSource.ts +0 -34
- package/src/baseTable/index.ts +0 -43
- package/src/baseTable/moduleConnection/Action.ts +0 -12
- package/src/baseTable/moduleConnection/Column.ts +0 -11
- package/src/baseTable/moduleConnection/Table.ts +0 -49
- package/src/baseTable/moduleConnection/TableDestroy.ts +0 -7
- package/src/baseTable/moduleConnection/TableRowClick.ts +0 -7
- package/src/baseTable/moduleConnection/generator/GColumn.ts +0 -10
- package/src/baseTable/moduleConnection/generator/GTable.ts +0 -11
- package/src/composables/UseCrud.ts +0 -53
- package/src/composables/UseData.ts +0 -70
- package/src/composables/UseLoadingStatus.ts +0 -65
- package/src/composables/UseParams.ts +0 -93
- package/src/composables/UseRepository.ts +0 -207
- package/src/composables/UseState.ts +0 -30
- package/src/composables/UseStaticTableService.ts +0 -45
- package/src/composables/index.ts +0 -7
- package/src/constants/Constants.ts +0 -126
- package/src/constants/index.ts +0 -19
- package/src/crudService/CrudService.ts +0 -121
- package/src/crudService/index.ts +0 -1
- package/src/dateHandling/Constants.ts +0 -5
- package/src/dateHandling/Converter.ts +0 -15
- package/src/dateHandling/JalaliDateSetup.ts +0 -42
- package/src/dateHandling/Model.ts +0 -27
- package/src/dateHandling/Utils.ts +0 -49
- package/src/dateHandling/index.ts +0 -5
- package/src/debounce/DebounceAction.ts +0 -4
- package/src/debounce/DebounceService.ts +0 -27
- package/src/debounce/index.ts +0 -2
- package/src/deviceManagement/Constants.ts +0 -4
- package/src/deviceManagement/Visibility.ts +0 -4
- package/src/deviceManagement/VisibilityManager.ts +0 -18
- package/src/deviceManagement/index.ts +0 -3
- package/src/errorHandling/ErrorHandler.ts +0 -3
- package/src/errorHandling/HandleError.ts +0 -20
- package/src/errorHandling/index.ts +0 -2
- package/src/eventSystem/CustomEventDispatcher.ts +0 -13
- package/src/eventSystem/Model.ts +0 -29
- package/src/eventSystem/OnEvent.ts +0 -25
- package/src/eventSystem/index.ts +0 -3
- package/src/feedbackHandling/FailureFeedback.ts +0 -3
- package/src/feedbackHandling/Feedback.ts +0 -34
- package/src/feedbackHandling/HandleFeedback.ts +0 -28
- package/src/feedbackHandling/InfoFeedback.ts +0 -3
- package/src/feedbackHandling/SuccessFeedback.ts +0 -3
- package/src/feedbackHandling/WarningFeedback.ts +0 -3
- package/src/feedbackHandling/index.ts +0 -6
- package/src/httpClient/ApiBuilder.ts +0 -57
- package/src/httpClient/ErrorHandlerRegistry.ts +0 -29
- package/src/httpClient/HttpClient.ts +0 -77
- package/src/httpClient/Interceptor.ts +0 -5
- package/src/httpClient/index.ts +0 -4
- package/src/initializer/ApplicationInitializer.ts +0 -15
- package/src/initializer/Initializer.ts +0 -3
- package/src/initializer/index.ts +0 -2
- package/src/json/JsonMapper.ts +0 -48
- package/src/json/index.ts +0 -1
- package/src/layout/Constants.ts +0 -11
- package/src/layout/DialogService.ts +0 -75
- package/src/layout/DrawerService.ts +0 -25
- package/src/layout/Toast.ts +0 -14
- package/src/layout/index.ts +0 -4
- package/src/lib/Constants.ts +0 -433
- package/src/lib/Formatter.ts +0 -68
- package/src/lib/Util.ts +0 -113
- package/src/lib/index.ts +0 -3
- package/src/observables/AbstractSubject.ts +0 -21
- package/src/observables/BehaviorSubject.ts +0 -58
- package/src/observables/Observer.ts +0 -3
- package/src/observables/Subject.ts +0 -9
- package/src/observables/index.ts +0 -4
- package/src/process/Proccess.ts +0 -21
- package/src/process/ProcessManager.ts +0 -31
- package/src/process/index.ts +0 -2
- package/src/repository/Params.ts +0 -10
- package/src/repository/Repository.ts +0 -44
- package/src/repository/SyncDetail.ts +0 -8
- package/src/repository/index.ts +0 -4
- package/src/repository/model.ts +0 -9
- package/src/routeGuard/RouteGuard.ts +0 -38
- package/src/routeGuard/index.ts +0 -1
- package/src/search/client/ClientArraySearch.ts +0 -25
- package/src/search/client/ClientSearch.ts +0 -3
- package/src/search/index.ts +0 -2
- package/src/sort/SortDetail.ts +0 -11
- package/src/sort/client/Sorter.ts +0 -28
- package/src/sort/index.ts +0 -4
- package/src/sort/strategies/SimpleSort.ts +0 -35
- package/src/sort/strategies/SortStrategy.ts +0 -4
- package/src/types/Global.ts +0 -1
- package/src/types/index.ts +0 -1
- package/src/validators/Validator.ts +0 -5
- package/src/validators/index.ts +0 -1
- package/src/webSocket/Constants.ts +0 -6
- package/src/webSocket/Model.ts +0 -16
- package/src/webSocket/WebSocketService.ts +0 -153
- package/src/webSocket/index.ts +0 -3
- package/vite.config.ts +0 -55
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Axios,
|
|
3
|
-
AxiosHeaders,
|
|
4
|
-
type AxiosResponse,
|
|
5
|
-
type InternalAxiosRequestConfig,
|
|
6
|
-
} from "axios";
|
|
7
|
-
|
|
8
|
-
type axiosConfig = { headers?: AxiosHeaders } & Omit<
|
|
9
|
-
InternalAxiosRequestConfig,
|
|
10
|
-
"headers"
|
|
11
|
-
>;
|
|
12
|
-
|
|
13
|
-
export class HttpClient {
|
|
14
|
-
private axiosInstance: Axios;
|
|
15
|
-
|
|
16
|
-
constructor(instance: Axios) {
|
|
17
|
-
this.axiosInstance = instance;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public async get<T>(
|
|
21
|
-
url: string,
|
|
22
|
-
config?: axiosConfig,
|
|
23
|
-
): Promise<AxiosResponse<T>> {
|
|
24
|
-
return await this.axiosInstance.get(
|
|
25
|
-
url,
|
|
26
|
-
config as InternalAxiosRequestConfig,
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public async post<T>(
|
|
31
|
-
url: string,
|
|
32
|
-
data?: unknown,
|
|
33
|
-
config?: axiosConfig,
|
|
34
|
-
): Promise<AxiosResponse<T>> {
|
|
35
|
-
return await this.axiosInstance.post(
|
|
36
|
-
url,
|
|
37
|
-
data,
|
|
38
|
-
config as InternalAxiosRequestConfig,
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public async patch<T>(
|
|
43
|
-
url: string,
|
|
44
|
-
data?: unknown,
|
|
45
|
-
config?: axiosConfig,
|
|
46
|
-
): Promise<AxiosResponse<T>> {
|
|
47
|
-
return await this.axiosInstance.patch(
|
|
48
|
-
url,
|
|
49
|
-
data,
|
|
50
|
-
config as InternalAxiosRequestConfig,
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public async put<T>(
|
|
55
|
-
url: string,
|
|
56
|
-
data?: unknown,
|
|
57
|
-
config?: axiosConfig,
|
|
58
|
-
): Promise<AxiosResponse<T>> {
|
|
59
|
-
return await this.axiosInstance.put(
|
|
60
|
-
url,
|
|
61
|
-
data,
|
|
62
|
-
config as InternalAxiosRequestConfig,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public async delete<T>(
|
|
67
|
-
url: string,
|
|
68
|
-
config?: axiosConfig,
|
|
69
|
-
): Promise<AxiosResponse<T>> {
|
|
70
|
-
return await this.axiosInstance.delete(
|
|
71
|
-
url,
|
|
72
|
-
config as InternalAxiosRequestConfig,
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export default HttpClient;
|
package/src/httpClient/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Initializer } from "./Initializer";
|
|
2
|
-
|
|
3
|
-
export class ApplicationInitializer {
|
|
4
|
-
private _initializer: Initializer[] = [];
|
|
5
|
-
|
|
6
|
-
public setupInitializers(initializers: Initializer[]) {
|
|
7
|
-
this._initializer.push(...initializers);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
public initialize() {
|
|
11
|
-
for (const initializer of this._initializer) {
|
|
12
|
-
initializer.initialize();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
package/src/initializer/index.ts
DELETED
package/src/json/JsonMapper.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Nullable } from "../types";
|
|
2
|
-
import { JsonConvert } from "json2typescript";
|
|
3
|
-
|
|
4
|
-
export class JsonMapper {
|
|
5
|
-
private static Instance: Nullable<JsonMapper> = null;
|
|
6
|
-
private jsonConverter = new JsonConvert();
|
|
7
|
-
|
|
8
|
-
private constructor() {}
|
|
9
|
-
|
|
10
|
-
public serializeObject<T extends object>(
|
|
11
|
-
object: object,
|
|
12
|
-
model: { new (): T },
|
|
13
|
-
) {
|
|
14
|
-
return this.jsonConverter.serializeObject(object, model) as T;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public deserializeObject<T extends object>(
|
|
18
|
-
object: object,
|
|
19
|
-
model: { new (): T },
|
|
20
|
-
) {
|
|
21
|
-
return this.jsonConverter.deserializeObject(object, model) as T;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public deserializeArray<T extends object>(
|
|
25
|
-
array: Array<T>,
|
|
26
|
-
model: { new (): T[] },
|
|
27
|
-
) {
|
|
28
|
-
return this.jsonConverter.deserializeArray(array, model) as Array<T>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public tryDeserialize(object: object, models: { new (): any }[]) {
|
|
32
|
-
for (const model of models) {
|
|
33
|
-
try {
|
|
34
|
-
return this.deserializeObject(object, model);
|
|
35
|
-
} catch (e) {
|
|
36
|
-
// ignore
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
throw new Error("Unable to deserialize object");
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public static GetInstance() {
|
|
43
|
-
if (!JsonMapper.Instance) {
|
|
44
|
-
JsonMapper.Instance = new JsonMapper();
|
|
45
|
-
}
|
|
46
|
-
return JsonMapper.Instance;
|
|
47
|
-
}
|
|
48
|
-
}
|
package/src/json/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { JsonMapper } from './JsonMapper';
|
package/src/layout/Constants.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { type Component, computed, reactive } from 'vue';
|
|
2
|
-
import { defineStore } from 'pinia';
|
|
3
|
-
import { StoreNames, DialogDimensions } from '../constants';
|
|
4
|
-
import { type Nullable } from '../types';
|
|
5
|
-
|
|
6
|
-
export const useDialogService = defineStore(StoreNames.Dialog, () => {
|
|
7
|
-
const dialogData = reactive<{
|
|
8
|
-
dialogComponent: Nullable<Component>;
|
|
9
|
-
props: Nullable<Record<string, unknown>>;
|
|
10
|
-
header: string;
|
|
11
|
-
width: DialogDimensions;
|
|
12
|
-
height: DialogDimensions;
|
|
13
|
-
}>({
|
|
14
|
-
dialogComponent: null,
|
|
15
|
-
width: DialogDimensions.DefaultWidth,
|
|
16
|
-
height: DialogDimensions.DefaultHeight,
|
|
17
|
-
props: null,
|
|
18
|
-
header: '',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const isDialogExists = computed<boolean>(() => {
|
|
22
|
-
return Boolean(dialogData.dialogComponent);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const hasDefaultHeader = computed<boolean>(() => {
|
|
26
|
-
return Boolean(dialogData.header);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
function openDialog(component: Component) {
|
|
30
|
-
dialogData.dialogComponent = component;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function setDialogHeader(header: string) {
|
|
34
|
-
dialogData.header = header;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function setProps(props: Record<string, unknown>) {
|
|
38
|
-
if (!isDialogExists.value) {
|
|
39
|
-
throw new Error('there is no dialog to set props on');
|
|
40
|
-
}
|
|
41
|
-
dialogData.props = props;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function setSize(size: number, type: DialogDimensions) {
|
|
45
|
-
if (!isDialogExists.value) {
|
|
46
|
-
throw new Error('there is no dialog to set size on');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (size < DialogDimensions.MinimalAvailableSize) {
|
|
50
|
-
throw new Error('negative size not supported');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (type === DialogDimensions.Width) dialogData.width = size;
|
|
54
|
-
else dialogData.height = size;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function clearDialog() {
|
|
58
|
-
dialogData.props = null;
|
|
59
|
-
dialogData.height = DialogDimensions.DefaultHeight;
|
|
60
|
-
dialogData.width = DialogDimensions.DefaultWidth;
|
|
61
|
-
dialogData.header = '';
|
|
62
|
-
dialogData.dialogComponent = null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
dialogData,
|
|
67
|
-
openDialog,
|
|
68
|
-
clearDialog,
|
|
69
|
-
setSize,
|
|
70
|
-
setDialogHeader,
|
|
71
|
-
setProps,
|
|
72
|
-
isDialogExists,
|
|
73
|
-
hasDefaultHeader
|
|
74
|
-
};
|
|
75
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { computed, ref } from 'vue';
|
|
2
|
-
import { defineStore } from 'pinia';
|
|
3
|
-
import { StoreNames, ApplicationDrawerStatus } from '../constants';
|
|
4
|
-
|
|
5
|
-
export const useDrawerService = defineStore(StoreNames.Drawer, () => {
|
|
6
|
-
const drawerStatus = ref<ApplicationDrawerStatus>(ApplicationDrawerStatus.Close);
|
|
7
|
-
|
|
8
|
-
const isDrawerOpen = computed<boolean>(() => {
|
|
9
|
-
return drawerStatus.value === ApplicationDrawerStatus.Open;
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
function closeDrawer() {
|
|
13
|
-
drawerStatus.value = ApplicationDrawerStatus.Close;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function openDrawer() {
|
|
17
|
-
drawerStatus.value = ApplicationDrawerStatus.Open;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
closeDrawer,
|
|
22
|
-
openDrawer,
|
|
23
|
-
isDrawerOpen,
|
|
24
|
-
};
|
|
25
|
-
});
|
package/src/layout/Toast.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ToastLocation, ToastType } from "./Constants";
|
|
2
|
-
|
|
3
|
-
export class ToastMessage {
|
|
4
|
-
public type: ToastType;
|
|
5
|
-
public message: string;
|
|
6
|
-
public description: string;
|
|
7
|
-
public placement: ToastLocation = ToastLocation.BottomLeft;
|
|
8
|
-
|
|
9
|
-
constructor(type: ToastType, message: string, description: string) {
|
|
10
|
-
this.type = type;
|
|
11
|
-
this.message = message;
|
|
12
|
-
this.description = description;
|
|
13
|
-
}
|
|
14
|
-
}
|
package/src/layout/index.ts
DELETED