eservices-core 1.0.467 → 1.0.469
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/classes/ApplicationManager.d.ts +8 -0
- package/dist/classes/new/List.d.ts +11 -4
- package/dist/classes/new/ListConfig.d.ts +7 -6
- package/dist/frontend/core/classes/ApplicationManager.d.ts +61 -0
- package/dist/frontend/core/classes/CoreError.d.ts +42 -0
- package/dist/frontend/core/classes/List.d.ts +101 -0
- package/dist/frontend/core/classes/NotificationSystem.d.ts +39 -0
- package/dist/frontend/core/classes/ProcessWrap.d.ts +8 -0
- package/dist/frontend/core/classes/_List.d.ts +66 -0
- package/dist/frontend/core/classes/new/List.d.ts +119 -0
- package/dist/frontend/core/classes/new/Table.d.ts +27 -0
- package/dist/frontend/core/classes/new/get-table-row.d.ts +8 -0
- package/dist/frontend/core/classes/table/Table.d.ts +70 -0
- package/dist/frontend/core/classes/table/get-table-row.d.ts +8 -0
- package/dist/frontend/core/config.d.ts +14 -0
- package/dist/frontend/core/hooks/use-customer-state.d.ts +24 -0
- package/dist/frontend/core/hooks/use-form-action.d.ts +12 -0
- package/dist/frontend/core/hooks/use-form-label.d.ts +8 -0
- package/dist/frontend/core/hooks/use-form-metadata.d.ts +2 -0
- package/dist/frontend/core/hooks/use-form-request-data.d.ts +13 -0
- package/dist/frontend/core/index.d.ts +185 -0
- package/dist/frontend/core/mixins/index.d.ts +4 -0
- package/dist/frontend/core/new/new-import.d.ts +4 -0
- package/dist/frontend/core/services/FileService.d.ts +7 -0
- package/dist/frontend/core/services/action-service.d.ts +22 -0
- package/dist/{services/AuthService.d.ts → frontend/core/services/auth-service.d.ts} +7 -7
- package/dist/frontend/core/services/client-service.d.ts +16 -0
- package/dist/frontend/core/services/communication-service.d.ts +64 -0
- package/dist/frontend/core/services/data-service.d.ts +54 -0
- package/dist/frontend/core/services/invitation-service.d.ts +5 -0
- package/dist/frontend/core/services/metadata-service.d.ts +5 -0
- package/dist/frontend/core/services/open-service.d.ts +3 -0
- package/dist/frontend/core/services/presentation-service.d.ts +9 -0
- package/dist/frontend/core/services/process-wizard-service.d.ts +30 -0
- package/dist/frontend/core/services/rule-validation-service.d.ts +4 -0
- package/dist/frontend/core/services/view-service.d.ts +19 -0
- package/dist/frontend/core/socket/use-socket.d.ts +4 -0
- package/dist/frontend/core/styles/index.d.ts +2 -0
- package/dist/frontend/core/styles/types.d.ts +164 -0
- package/dist/frontend/core/types/index.d.ts +103 -0
- package/dist/frontend/core/types/metadata-types.d.ts +19 -0
- package/dist/frontend/core/useMethods/index.d.ts +5 -0
- package/dist/frontend/core/useMethods/useInput.d.ts +15 -0
- package/dist/frontend/core/utils/Filter.d.ts +17 -0
- package/dist/frontend/core/utils/GraphQL/index.d.ts +21 -0
- package/dist/frontend/core/utils/Journal.d.ts +34 -0
- package/dist/frontend/core/utils/Request.d.ts +4 -0
- package/dist/frontend/core/utils/clickOutside.d.ts +2 -0
- package/dist/frontend/core/utils/firstChapterToLowerCase.d.ts +5 -0
- package/dist/frontend/core/utils/getPropFromObject.d.ts +15 -0
- package/dist/frontend/core/utils/group-array-by-field.d.ts +29 -0
- package/dist/frontend/core/utils/index.d.ts +21 -0
- package/dist/frontend/core/utils/prettyDate.d.ts +13 -0
- package/dist/frontend/core/utils/requestHandler.d.ts +7 -0
- package/dist/frontend/core/utils/runPromiseQueue.d.ts +1 -0
- package/dist/frontend/core/utils/static-link.d.ts +6 -0
- package/dist/frontend/core/utils/uuid.d.ts +1 -0
- package/dist/frontend/core/utils/values-to-upper-case.d.ts +5 -0
- package/dist/{widgets/interface/interface-navigation-cell.vue.d.ts → frontend/core/widgets/breadcrumbs/widget-breadcrumb-item.vue.d.ts} +7 -7
- package/dist/{widgets/containers/container-input-list.vue.d.ts → frontend/core/widgets/breadcrumbs/widget-breadcrumbs.vue.d.ts} +1 -1
- package/dist/{widgets/communication/communication-head.vue.d.ts → frontend/core/widgets/buttons/WidgetButton.vue.d.ts} +19 -8
- package/dist/frontend/core/widgets/buttons/index.d.ts +5 -0
- package/dist/frontend/core/widgets/buttons/multi-button/WidgetMultiButton.vue.d.ts +22 -0
- package/dist/{widgets/forms/FormSection.vue.d.ts → frontend/core/widgets/cards/widget-card.vue.d.ts} +1 -1
- package/dist/frontend/core/widgets/containers/index.d.ts +6 -0
- package/dist/frontend/core/widgets/errorSystem/default/WidgetError.vue.d.ts +27 -0
- package/dist/frontend/core/widgets/errorSystem/default/WidgetErrorGroup.vue.d.ts +17 -0
- package/dist/frontend/core/widgets/errorSystem/default/WidgetNotificationSystem.vue.d.ts +4 -0
- package/dist/frontend/core/widgets/errorSystem/index.d.ts +4 -0
- package/dist/frontend/core/widgets/forms/index.d.ts +6 -0
- package/dist/frontend/core/widgets/forms/naomi/WidgetForm.vue.d.ts +65 -0
- package/dist/{widgets/interface/user-popup-link.vue.d.ts → frontend/core/widgets/forms/naomi/WidgetFormInfo.vue.d.ts} +12 -14
- package/dist/frontend/core/widgets/icons/index.d.ts +4 -0
- package/dist/{widgets/tables/table-with-form/widget-table-controller-action.vue.d.ts → frontend/core/widgets/image/widget-image.vue.d.ts} +9 -9
- package/dist/frontend/core/widgets/index.d.ts +40 -0
- package/dist/frontend/core/widgets/inputs/default-style/index.d.ts +7 -0
- package/dist/frontend/core/widgets/inputs/index.d.ts +15 -0
- package/dist/frontend/core/widgets/inputs/line-style/index.d.ts +4 -0
- package/dist/frontend/core/widgets/inputs/naomi-style/index.d.ts +4 -0
- package/dist/{widgets/tables/table-with-form/widget-table.vue.d.ts → frontend/core/widgets/inputs/widget-input-check.vue.d.ts} +8 -16
- package/dist/{widgets/interface/interface-header.vue.d.ts → frontend/core/widgets/list/widget-list-head.vue.d.ts} +5 -5
- package/dist/{widgets/tables/table-with-form/widget-table-row.vue.d.ts → frontend/core/widgets/list/widget-list-row.vue.d.ts} +1 -2
- package/dist/{widgets/interface/interface-navigation-row.vue.d.ts → frontend/core/widgets/list/widget-list.vue.d.ts} +21 -13
- package/dist/{widgets/communication/communication-chat-message.vue.d.ts → frontend/core/widgets/modals/modal-validation/modal-validation-item.vue.d.ts} +19 -11
- package/dist/{widgets/interface/interface-navigation.vue.d.ts → frontend/core/widgets/modals/modal-validation/modal-validation.vue.d.ts} +3 -3
- package/dist/frontend/core/widgets/modals/modal-wrap.vue.d.ts +14 -0
- package/dist/frontend/core/widgets/new/widget-table-form.vue.d.ts +36 -0
- package/dist/frontend/core/widgets/new/widget-table-row.vue.d.ts +11 -0
- package/dist/frontend/core/widgets/new/widget-table.vue.d.ts +63 -0
- package/dist/{widgets/wizard/WidgetWizard.vue.d.ts → frontend/core/widgets/section/widget-section.vue.d.ts} +3 -11
- package/dist/{widgets/interface/interface-user-card.vue.d.ts → frontend/core/widgets/shadow-form/WidgetShadowForm.vue.d.ts} +3 -3
- package/dist/frontend/core/widgets/spinner/WidgetSpinner.vue.d.ts +14 -0
- package/dist/frontend/core/widgets/spinner/index.d.ts +4 -0
- package/dist/{widgets/interface/user-popup-organization-item.vue.d.ts → frontend/core/widgets/spinner/widget-loader.vue.d.ts} +9 -9
- package/dist/{widgets/communication/widget-communication.vue.d.ts → frontend/core/widgets/tables/widget-table-form.vue.d.ts} +20 -18
- package/dist/frontend/core/widgets/tables/widget-table-row.vue.d.ts +12 -0
- package/dist/frontend/core/widgets/tables/widget-table.vue.d.ts +52 -0
- package/dist/index.js +44 -7
- package/package.json +1 -1
- package/dist/TEST/index.d.ts +0 -5
- package/dist/classes/Form.d.ts +0 -78
- package/dist/classes/RenderForm.d.ts +0 -37
- package/dist/classes/Table.d.ts +0 -94
- package/dist/classes/ViewForm/ViewForm.d.ts +0 -8
- package/dist/classes/ViewForm/container-form-element-render.d.ts +0 -1
- package/dist/classes/ViewForm/container-form-render.d.ts +0 -1
- package/dist/classes/ViewForm/container-render.d.ts +0 -1
- package/dist/classes/ViewForm/getInputComponent.d.ts +0 -1
- package/dist/classes/ViewForm/render-form-body.d.ts +0 -1
- package/dist/classes/ViewForm/render-form-section.d.ts +0 -1
- package/dist/classes/ViewForm/render-form.d.ts +0 -2
- package/dist/classes/ViewForm/render-input.d.ts +0 -8
- package/dist/classes/ViewForm/render.d.ts +0 -8
- package/dist/classes/index.d.ts +0 -33
- package/dist/services/index.d.ts +0 -11
- package/dist/widgets/communication/communication-chat.vue.d.ts +0 -22
- package/dist/widgets/communication/communication-head-create.vue.d.ts +0 -14
- package/dist/widgets/communication/communication-input.vue.d.ts +0 -14
- package/dist/widgets/interface/interface-container.vue.d.ts +0 -40
- package/dist/widgets/interface/interface-user-popup.vue.d.ts +0 -16
- package/dist/widgets/interface/user-popup-switch-organization.vue.d.ts +0 -24
- package/dist/widgets/interface/user-popup-switch-person.vue.d.ts +0 -22
- package/dist/widgets/tables/WidgetCell.vue.d.ts +0 -18
- package/dist/widgets/tables/WidgetList.vue.d.ts +0 -24
- package/dist/widgets/tables/WidgetListHead.vue.d.ts +0 -15
- package/dist/widgets/tables/getCell.d.ts +0 -4
- package/dist/widgets/tables/index.d.ts +0 -6
- package/dist/widgets/tables/table-with-form/widget-table-controller.vue.d.ts +0 -25
- package/dist/widgets/tables/table-with-form/widget-table-form.vue.d.ts +0 -22
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import EventEmitter from "jenesius-event-emitter";
|
|
2
|
+
import { IListCell } from "./new/List";
|
|
2
3
|
export interface ICustomerContext {
|
|
3
4
|
id: number;
|
|
4
5
|
name: string;
|
|
@@ -62,6 +63,13 @@ declare class ApplicationManager extends EventEmitter {
|
|
|
62
63
|
* @description Method using for validate provided ID, Checking with existing person ID and each organization ID.
|
|
63
64
|
* */
|
|
64
65
|
private validateContextId;
|
|
66
|
+
private getListKeyById;
|
|
67
|
+
getListInformationFromLocalStorage(id: string): {
|
|
68
|
+
config: IListCell[];
|
|
69
|
+
} | null;
|
|
70
|
+
setListInformationToLocalStorage(id: string, info: {
|
|
71
|
+
config: IListCell[];
|
|
72
|
+
}): void;
|
|
65
73
|
}
|
|
66
74
|
declare const Manager: ApplicationManager;
|
|
67
75
|
export { ApplicationManager, Manager };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from "jenesius-event-emitter";
|
|
2
|
-
import { IReadParams
|
|
2
|
+
import { IReadParams } from "../List";
|
|
3
3
|
declare const LIST_ROW_KEY = "_______LIST_______ROW_______INDEX________NAME_______";
|
|
4
4
|
export declare class List<T = {}> extends EventEmitter {
|
|
5
5
|
#private;
|
|
@@ -7,6 +7,7 @@ export declare class List<T = {}> extends EventEmitter {
|
|
|
7
7
|
* @description Event triggers when array was updated, set new or pushed new, or updated, or deleted.
|
|
8
8
|
* */
|
|
9
9
|
static readonly EVENT_DATA = "list-data: update";
|
|
10
|
+
static readonly EVENT_CONFIG_UPDATE = "list-config:update";
|
|
10
11
|
/**
|
|
11
12
|
* @description Используется для идентификации ячейки таблицы. В случае для new/updated используется, как уникальный
|
|
12
13
|
* идентификатор записей.
|
|
@@ -17,6 +18,9 @@ export declare class List<T = {}> extends EventEmitter {
|
|
|
17
18
|
* */
|
|
18
19
|
name?: string;
|
|
19
20
|
private array;
|
|
21
|
+
set config(c: IListCell[]);
|
|
22
|
+
get config(): IListCell[];
|
|
23
|
+
private emitUpdateConfig;
|
|
20
24
|
constructor(params: IListParams);
|
|
21
25
|
set wait(v: boolean);
|
|
22
26
|
/**
|
|
@@ -86,7 +90,7 @@ export declare class List<T = {}> extends EventEmitter {
|
|
|
86
90
|
/**
|
|
87
91
|
* @description Methods using for get name from cell config.
|
|
88
92
|
* */
|
|
89
|
-
static getCellName<T extends Pick<
|
|
93
|
+
static getCellName<T extends Pick<IListCell, 'name'>>(cell: T): string;
|
|
90
94
|
/**
|
|
91
95
|
* @description Получение стандартной информации из ячейки и значений. {name, value}
|
|
92
96
|
* @example
|
|
@@ -94,7 +98,7 @@ export declare class List<T = {}> extends EventEmitter {
|
|
|
94
98
|
* values: {id: 1, title: "GG"}
|
|
95
99
|
* Output: { name: 'title', value: 'GG_GG'}
|
|
96
100
|
*/
|
|
97
|
-
static getCellInfo<T extends Pick<
|
|
101
|
+
static getCellInfo<T extends Pick<IListCell, 'name' | 'value'>>(cell: T, rowValues: any): {
|
|
98
102
|
name: string;
|
|
99
103
|
value: import("../../types").Values;
|
|
100
104
|
};
|
|
@@ -105,6 +109,7 @@ export interface IDefaultListData {
|
|
|
105
109
|
export interface IListParams {
|
|
106
110
|
primaryKeys?: string[];
|
|
107
111
|
name?: string;
|
|
112
|
+
config?: IListCell[];
|
|
108
113
|
}
|
|
109
114
|
/**
|
|
110
115
|
* @description Хук используется для того, чтобы подключить считывание данных с листу.
|
|
@@ -120,14 +125,16 @@ interface IFlexConfig {
|
|
|
120
125
|
config: Readonly<IListCell[]>;
|
|
121
126
|
list: List;
|
|
122
127
|
setConfig: (newConfig: IListCell[]) => void;
|
|
128
|
+
revertConfig: () => void;
|
|
123
129
|
}
|
|
124
130
|
/**
|
|
125
131
|
* Использование гибкого механизма для работы с конфигурацию.
|
|
126
132
|
* */
|
|
127
|
-
export declare function useProvideList(list?: List, defaultConfig?:
|
|
133
|
+
export declare function useProvideList(list?: List, defaultConfig?: IListCell[]): IFlexConfig;
|
|
128
134
|
export declare type ListCellType = 'date' | 'dateWithTime' | 'toggle' | 'select';
|
|
129
135
|
export interface IListCell {
|
|
130
136
|
title: string;
|
|
137
|
+
label: string;
|
|
131
138
|
name: string | string[];
|
|
132
139
|
value: (x: any, obj: IDefaultListData) => string | number;
|
|
133
140
|
link: (obj: IDefaultListData) => any;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import EventEmitter from "jenesius-event-emitter";
|
|
2
|
-
import {
|
|
2
|
+
import { IListCell } from "./List";
|
|
3
3
|
/**
|
|
4
4
|
* @description Используется для работы с конфигурацией списка. При работе делает копию, после чего её можно будет установить
|
|
5
5
|
* как конфигурацию по умолчанию
|
|
6
6
|
* */
|
|
7
7
|
export default class ListConfig extends EventEmitter {
|
|
8
8
|
static readonly EVENT_DATA = "list-config:update";
|
|
9
|
-
array:
|
|
9
|
+
array: IListCell[];
|
|
10
10
|
/**
|
|
11
11
|
* @description Является дефолтной конфигурацией, используется для возвращению
|
|
12
12
|
* */
|
|
13
13
|
private defaultArray;
|
|
14
14
|
private emitUpdate;
|
|
15
|
-
constructor(array?:
|
|
16
|
-
setDefault(array:
|
|
15
|
+
constructor(array?: IListCell[]);
|
|
16
|
+
setDefault(array: IListCell[]): void;
|
|
17
17
|
revert(): void;
|
|
18
|
-
set(array:
|
|
19
|
-
append(data:
|
|
18
|
+
set(array: IListCell[]): void;
|
|
19
|
+
append(data: IListCell): void;
|
|
20
20
|
/**
|
|
21
21
|
* @description Перемещает элемент с позиции I, на позицию J
|
|
22
22
|
* */
|
|
23
23
|
moveTo(i: number, j: number): void;
|
|
24
|
+
remove(i: number): void;
|
|
24
25
|
isOutOfRange(position: number): boolean;
|
|
25
26
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import EventEmitter from "jenesius-event-emitter";
|
|
2
|
+
export interface ICustomerContext {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
photo?: string;
|
|
7
|
+
}
|
|
8
|
+
interface IUserInformation {
|
|
9
|
+
id: number;
|
|
10
|
+
}
|
|
11
|
+
declare class ApplicationManager extends EventEmitter {
|
|
12
|
+
#private;
|
|
13
|
+
static EVENT_CONTEXT_UPDATE: string;
|
|
14
|
+
static EVENT_READY_UPDATE: string;
|
|
15
|
+
static EVENT_DATA_UPDATE: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description Key for localStorage, saving current context ID. using after user login to system
|
|
18
|
+
* */
|
|
19
|
+
static CURRENT_CONTEXT_KEY: string;
|
|
20
|
+
/**
|
|
21
|
+
* @description Current customer id. If Application state is not ready - undefined.
|
|
22
|
+
*/
|
|
23
|
+
contextId?: number;
|
|
24
|
+
/**
|
|
25
|
+
* @description User information. Parent Object.
|
|
26
|
+
*/
|
|
27
|
+
user?: IUserInformation;
|
|
28
|
+
/**
|
|
29
|
+
* @description Person information.
|
|
30
|
+
*/
|
|
31
|
+
person?: ICustomerContext;
|
|
32
|
+
/**
|
|
33
|
+
* @description List of organizations
|
|
34
|
+
*/
|
|
35
|
+
organizations: ICustomerContext[];
|
|
36
|
+
set ready(v: boolean);
|
|
37
|
+
get ready(): boolean;
|
|
38
|
+
onReady(callback: (v: boolean) => any): () => void;
|
|
39
|
+
onupdateContext(callback: (id: number) => any): () => void;
|
|
40
|
+
onupdateData(callback: () => any): () => void;
|
|
41
|
+
/**
|
|
42
|
+
* @description Method for update current context. After success emit event[EVENT_UPDATE_CONTEXT]
|
|
43
|
+
*/
|
|
44
|
+
setCurrentContext(id: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* @description Initialization of ApplicationManager
|
|
47
|
+
*/
|
|
48
|
+
init(): Promise<void>;
|
|
49
|
+
private loadCustomerData;
|
|
50
|
+
/**
|
|
51
|
+
* @description The main method of application. Load the main information about user.
|
|
52
|
+
* @deprecated
|
|
53
|
+
*/
|
|
54
|
+
updateFullClientData(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* @description Method using for validate provided ID, Checking with existing person ID and each organization ID.
|
|
57
|
+
* */
|
|
58
|
+
private validateContextId;
|
|
59
|
+
}
|
|
60
|
+
declare const Manager: ApplicationManager;
|
|
61
|
+
export { ApplicationManager, Manager };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Form } from "jenesius-vue-form";
|
|
2
|
+
import { ListChunker } from "../types";
|
|
3
|
+
export default class CoreError extends Error {
|
|
4
|
+
details: any;
|
|
5
|
+
id: number;
|
|
6
|
+
static ID: number;
|
|
7
|
+
constructor(message: string, details?: any);
|
|
8
|
+
/**
|
|
9
|
+
* @description Не удалось найти родительскую форму. Обычно ошибка используется при вызове Form.getParentForm();
|
|
10
|
+
* */
|
|
11
|
+
static ParentFormNotFound(): CoreError;
|
|
12
|
+
/**
|
|
13
|
+
* ОДИН ИЗ ЭЛЕМЕНТОВ, КОТОРЫЙ ПЫТАЕТСЯ ПОДПИСАТЬСЯ НА ФОРМУ
|
|
14
|
+
* НЕ ИМЕЕТ ПАРАМЕТРА NAME.
|
|
15
|
+
* */
|
|
16
|
+
static UndefinedNameOfCompositeFormController(controller: any): CoreError;
|
|
17
|
+
static EntityWithoutName(entity: any): CoreError;
|
|
18
|
+
static NotResolvedNameEventEmitter(name: string): CoreError;
|
|
19
|
+
static FormIsNotValidated(form: Form): CoreError;
|
|
20
|
+
static ListWorkerIsRunningOrEnd(listChunker: ListChunker): CoreError;
|
|
21
|
+
static ObjectIdNotNumber(id: any): CoreError;
|
|
22
|
+
static UndefinedErrorId(id: number, array: any): CoreError;
|
|
23
|
+
static ApiError(error: any): CoreError;
|
|
24
|
+
static ApiNotAvailable(): CoreError;
|
|
25
|
+
static AuthServiceError(message: string | undefined, errors: string[] | null): CoreError;
|
|
26
|
+
static ApiResponseParseFailed(): CoreError;
|
|
27
|
+
static MissingIdInValuesEntity(values: any): CoreError;
|
|
28
|
+
static ObjectWithIdNotFound(id: number, array: any[]): CoreError;
|
|
29
|
+
/**
|
|
30
|
+
* ОШИБКА ДЛЯ ТАБЛИЦЫ, В ТОМ СЛУЧАЕ, ЕСЛИ ОБЪЕКТ НА ОБНОВЛЕНИЕ НЕ СВЯЗАН
|
|
31
|
+
* С СУЩЕСТВУЮЩИМ ОБЪЕКТОМ ПО _tableId
|
|
32
|
+
* */
|
|
33
|
+
static ObjectWithoutConnectToPresentArray(object: any, array: any): CoreError;
|
|
34
|
+
static EntityWithoutId(object: any): CoreError;
|
|
35
|
+
static NotFoundedTableIndex(tableIndex: number, table: any): CoreError;
|
|
36
|
+
/**
|
|
37
|
+
* Использовать в случае, когда тип ошибки не определён или место её
|
|
38
|
+
* появления не понятно
|
|
39
|
+
* */
|
|
40
|
+
static UndefinedError(str: string, details?: any[]): CoreError;
|
|
41
|
+
static TableArrayAlreadyIncludeProvidedIndexValue(tableIndex: number, array: any, table: any): CoreError;
|
|
42
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { TableRowController, Values, ValuesInterface } from "../types";
|
|
2
|
+
import EventEmitter from "jenesius-event-emitter";
|
|
3
|
+
export interface ListCell {
|
|
4
|
+
title?: string;
|
|
5
|
+
name?: string | string[];
|
|
6
|
+
value?: (x: Values, obj: ValuesInterface) => Values;
|
|
7
|
+
link?: (x: Values, obj: ValuesInterface) => any;
|
|
8
|
+
type?: "date" | "dateWithTime" | 'toggle' | 'select' | 'edit' | 'remove';
|
|
9
|
+
icon?: string;
|
|
10
|
+
class?: string | string[];
|
|
11
|
+
onClick?: (x: Values, obj: TableRowController) => void;
|
|
12
|
+
href?: (x: Values, obj: ValuesInterface) => string;
|
|
13
|
+
}
|
|
14
|
+
export default class List extends EventEmitter {
|
|
15
|
+
#private;
|
|
16
|
+
static EVENT_DATA: string;
|
|
17
|
+
static EVENT_CHANGE_WAIT: string;
|
|
18
|
+
/**
|
|
19
|
+
* Entity Name
|
|
20
|
+
* */
|
|
21
|
+
name: string;
|
|
22
|
+
set wait(v: boolean);
|
|
23
|
+
constructor(config: IListConfig);
|
|
24
|
+
/**
|
|
25
|
+
* @description Hash для значений filter, order
|
|
26
|
+
* */
|
|
27
|
+
hashParams: string;
|
|
28
|
+
offset: number;
|
|
29
|
+
read(ReadParams: IReadParams): Promise<void>;
|
|
30
|
+
set array(data: any[]);
|
|
31
|
+
add(array: any[]): void;
|
|
32
|
+
get array(): any[];
|
|
33
|
+
/**
|
|
34
|
+
* @description Function get all names from Config.
|
|
35
|
+
* */
|
|
36
|
+
static GetFieldNames<T extends {
|
|
37
|
+
name?: string | string[];
|
|
38
|
+
}>(config: T[]): string[];
|
|
39
|
+
/**
|
|
40
|
+
* @description Получение стандартной информации из ячейки и значений. {name, value}
|
|
41
|
+
* @example
|
|
42
|
+
* cell: { name: ['title', 'id'], value: (x) => `${x}_${x}` }
|
|
43
|
+
* values: {id: 1, title: "GG"}
|
|
44
|
+
* Output: { name: 'title', value: 'GG_GG'}
|
|
45
|
+
*/
|
|
46
|
+
static getCellInfo<T extends Pick<ListCell, 'name' | 'value'>>(cell: T, rowValues: any): {
|
|
47
|
+
name: string;
|
|
48
|
+
value: Values;
|
|
49
|
+
};
|
|
50
|
+
static getCellName<T extends Pick<ListCell, 'name'>>(cell: T): string;
|
|
51
|
+
}
|
|
52
|
+
export declare function useListState(list: List): {
|
|
53
|
+
array: any[];
|
|
54
|
+
state: {
|
|
55
|
+
wait: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare function useListOrder(defaultOrder: ISortConfig, onSort: any): {
|
|
59
|
+
order: import("vue").Ref<{
|
|
60
|
+
name: string;
|
|
61
|
+
duration: "desc" | "asc";
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
64
|
+
export declare function useListFilter(defaultFilter: {
|
|
65
|
+
[name: string]: any;
|
|
66
|
+
}, onFilter: any): {
|
|
67
|
+
filters: import("vue").Ref<{
|
|
68
|
+
[name: string]: any;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
export interface IListConfig {
|
|
72
|
+
name: string;
|
|
73
|
+
}
|
|
74
|
+
export declare type ListCellType = "date" | "dateWithTime" | 'toggle' | 'select';
|
|
75
|
+
export interface IListCell {
|
|
76
|
+
title?: string;
|
|
77
|
+
name?: string | string[];
|
|
78
|
+
value?: (x: Values, obj: ValuesInterface) => Values;
|
|
79
|
+
link?: (x: Values, obj: ValuesInterface) => any;
|
|
80
|
+
type?: ListCellType;
|
|
81
|
+
class?: string | string[];
|
|
82
|
+
onClick?: (x: Values, obj: TableRowController) => void;
|
|
83
|
+
href?: (x: Values, obj: ValuesInterface) => string;
|
|
84
|
+
}
|
|
85
|
+
export interface IReadParams {
|
|
86
|
+
fields?: string[];
|
|
87
|
+
order?: ISortConfig;
|
|
88
|
+
filter?: string;
|
|
89
|
+
limit?: number;
|
|
90
|
+
offset?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface ISortConfig {
|
|
93
|
+
name: string;
|
|
94
|
+
duration: 'desc' | 'asc';
|
|
95
|
+
}
|
|
96
|
+
export interface IFilterConfig {
|
|
97
|
+
title: string;
|
|
98
|
+
name: string;
|
|
99
|
+
type: "enum";
|
|
100
|
+
options: any;
|
|
101
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
/**
|
|
3
|
+
* @description Array of current cards.
|
|
4
|
+
*/
|
|
5
|
+
store: {
|
|
6
|
+
id: number;
|
|
7
|
+
type: "error" | "warning";
|
|
8
|
+
msg: string;
|
|
9
|
+
children?: {
|
|
10
|
+
id: number;
|
|
11
|
+
msg: string;
|
|
12
|
+
}[];
|
|
13
|
+
}[];
|
|
14
|
+
/**
|
|
15
|
+
* @description Adding new card to store
|
|
16
|
+
*/
|
|
17
|
+
add(type: INotificationCard["type"], msg: string, { children, timeout }?: {
|
|
18
|
+
children?: string[];
|
|
19
|
+
timeout?: number;
|
|
20
|
+
}): void;
|
|
21
|
+
/**
|
|
22
|
+
* @description Function remove item by id. Return true if card was founded, otherwise false.
|
|
23
|
+
* */
|
|
24
|
+
remove(id: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @description Removing child message, Throwing error if card of children not founded.
|
|
27
|
+
* */
|
|
28
|
+
removeChild(cardId: number, childId: number): void;
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
31
|
+
export interface INotificationCard {
|
|
32
|
+
id: number;
|
|
33
|
+
type: 'error' | 'warning';
|
|
34
|
+
msg: string;
|
|
35
|
+
children?: {
|
|
36
|
+
id: number;
|
|
37
|
+
msg: string;
|
|
38
|
+
}[];
|
|
39
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ComputedRef, VNode } from "vue";
|
|
2
|
+
import { ListRowValues, Values } from "../types";
|
|
3
|
+
import EventEmitter from "jenesius-event-emitter";
|
|
4
|
+
import { ListCell } from "./List";
|
|
5
|
+
export interface ListParams {
|
|
6
|
+
config: ComputedRef<ListCell[]>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated
|
|
10
|
+
* */
|
|
11
|
+
export default class List extends EventEmitter {
|
|
12
|
+
static EVENT_ORDER: string;
|
|
13
|
+
config: ComputedRef<ListCell[]>;
|
|
14
|
+
array: {
|
|
15
|
+
[name: string]: any;
|
|
16
|
+
}[];
|
|
17
|
+
orderField: string;
|
|
18
|
+
orderDirection: string;
|
|
19
|
+
constructor(props: ListParams);
|
|
20
|
+
cleanArray(): void;
|
|
21
|
+
setArray(array: List["array"]): void;
|
|
22
|
+
order(fieldName: string, pos: 'asc' | 'desc'): void;
|
|
23
|
+
/**
|
|
24
|
+
* @description Статик метод для получения VNode для Строки
|
|
25
|
+
*
|
|
26
|
+
* @param {ListCell[]} config - конфигурация списка
|
|
27
|
+
* @param {ListRowValues} rowValues - значения для одной строки
|
|
28
|
+
* */
|
|
29
|
+
static getRow(config: ListCell[], rowValues: ListRowValues): VNode | VNode[];
|
|
30
|
+
/**
|
|
31
|
+
* @return { {name: string, value: any} } CellInfo
|
|
32
|
+
* */
|
|
33
|
+
static getCellInfo(cell: ListCell, rowValues: ListRowValues): {
|
|
34
|
+
name: string;
|
|
35
|
+
value: Values;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @description Статик метод для получения VNode для Ячейки
|
|
39
|
+
*
|
|
40
|
+
* @param {ListCell} cellConfig - конфигурация Ячейки
|
|
41
|
+
* @param {ListRowValues} rowValues - значения Строки
|
|
42
|
+
* @param {string} cellName - имя Ячейки
|
|
43
|
+
* @param {values} cellValue - значение ячейки
|
|
44
|
+
* */
|
|
45
|
+
static getCell(cellConfig: ListCell, rowValues: ListRowValues, cellName: string | null, cellValue: Values, list?: List): VNode[];
|
|
46
|
+
/**
|
|
47
|
+
* @description Принимает конфигурацию списка
|
|
48
|
+
* @return <String>Array Возвращает массив, содержащий все имена полей из ко
|
|
49
|
+
* нфигурации
|
|
50
|
+
* */
|
|
51
|
+
static getNamesFromConfig(config: ListCell[]): string[];
|
|
52
|
+
/**
|
|
53
|
+
* @description Вернёт название ячеки, учитывая все значения поля name
|
|
54
|
+
* Если значением поля name выступает массив, то вернёт первый элемент масси
|
|
55
|
+
* ва
|
|
56
|
+
* */
|
|
57
|
+
static getCellName(cell: ListCell): string | null;
|
|
58
|
+
}
|
|
59
|
+
export declare function useListState(list: List): {
|
|
60
|
+
state: {
|
|
61
|
+
order: {
|
|
62
|
+
field: string;
|
|
63
|
+
direction: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import EventEmitter from "jenesius-event-emitter";
|
|
2
|
+
import { IReadParams, ListCell } from "../List";
|
|
3
|
+
declare const LIST_ROW_KEY = "_______LIST_______ROW_______INDEX________NAME_______";
|
|
4
|
+
export declare class List<T> extends EventEmitter {
|
|
5
|
+
#private;
|
|
6
|
+
/**
|
|
7
|
+
* @description Event triggers when array was updated, set new or pushed new, or updated, or deleted.
|
|
8
|
+
* */
|
|
9
|
+
static readonly EVENT_DATA = "list-data: update";
|
|
10
|
+
/**
|
|
11
|
+
* @description Используется для идентификации ячейки таблицы. В случае для new/updated используется, как уникальный
|
|
12
|
+
* идентификатор записей.
|
|
13
|
+
*/
|
|
14
|
+
private LIST_ROW_KEY;
|
|
15
|
+
/**
|
|
16
|
+
* @description Имя сущности к которой относится List
|
|
17
|
+
* */
|
|
18
|
+
name?: string;
|
|
19
|
+
private array;
|
|
20
|
+
constructor(params: IListParams);
|
|
21
|
+
set wait(v: boolean);
|
|
22
|
+
get wait(): boolean;
|
|
23
|
+
get primaryKeys(): string[];
|
|
24
|
+
/**
|
|
25
|
+
* @description Получение элемента массива по обычно индексу. Не путать с List.LIST_ROW_INDEX_NAME
|
|
26
|
+
* */
|
|
27
|
+
at(index: number): T & IDefaultListData;
|
|
28
|
+
/**
|
|
29
|
+
* @description Получение записи по ROW_KEY.
|
|
30
|
+
* */
|
|
31
|
+
atByKey(rowKey: number): T & IDefaultListData;
|
|
32
|
+
/**
|
|
33
|
+
* @description Возвращает индекс записи по её RowKey, если запись не найдена то -1.
|
|
34
|
+
* */
|
|
35
|
+
indexByKey(rowKey: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* @description Получение значения ключа из объекта
|
|
38
|
+
* */
|
|
39
|
+
static getKey<T extends IDefaultListData>(data: T): number;
|
|
40
|
+
/**
|
|
41
|
+
* @description Добавляет к массиву новые элементы.
|
|
42
|
+
* */
|
|
43
|
+
add(...data: T[]): void;
|
|
44
|
+
/**
|
|
45
|
+
* @description Полностью заменяет содержимое массива, новым
|
|
46
|
+
* */
|
|
47
|
+
set(data: T[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* @description Removing data by rowKey
|
|
50
|
+
* */
|
|
51
|
+
removeByKey(rowKey: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* @description Merging data by RowKey
|
|
54
|
+
* */
|
|
55
|
+
updateByKey(rowKey: number, data: Partial<T>): void;
|
|
56
|
+
/**
|
|
57
|
+
* @description Just alias for array and method wrapItem
|
|
58
|
+
* */
|
|
59
|
+
protected wrapArray(data: T[]): (T & IDefaultListData)[];
|
|
60
|
+
/**
|
|
61
|
+
* @description Wrapping data to IDefaultListData
|
|
62
|
+
* */
|
|
63
|
+
protected wrapItem(data: T): T & IDefaultListData;
|
|
64
|
+
/**
|
|
65
|
+
* @description Return true if provided data is IDefaultListData.
|
|
66
|
+
* */
|
|
67
|
+
private isWrapped;
|
|
68
|
+
set read(fn: () => any);
|
|
69
|
+
get read(): () => any;
|
|
70
|
+
set save(fn: () => any);
|
|
71
|
+
get save(): () => any;
|
|
72
|
+
/**
|
|
73
|
+
* @description Function get all names from Config.
|
|
74
|
+
* */
|
|
75
|
+
static GetFieldNames<T extends {
|
|
76
|
+
name?: string | string[];
|
|
77
|
+
}>(config: T[]): string[];
|
|
78
|
+
static mergeWithKey(data: any, key: number): any;
|
|
79
|
+
static getCellName<T extends Pick<ListCell, 'name'>>(cell: T): string;
|
|
80
|
+
/**
|
|
81
|
+
* @description Получение стандартной информации из ячейки и значений. {name, value}
|
|
82
|
+
* @example
|
|
83
|
+
* cell: { name: ['title', 'id'], value: (x) => `${x}_${x}` }
|
|
84
|
+
* values: {id: 1, title: "GG"}
|
|
85
|
+
* Output: { name: 'title', value: 'GG_GG'}
|
|
86
|
+
*/
|
|
87
|
+
static getCellInfo<T extends Pick<ListCell, 'name' | 'value'>>(cell: T, rowValues: any): {
|
|
88
|
+
name: string;
|
|
89
|
+
value: import("../../types").Values;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface IDefaultListData {
|
|
93
|
+
[LIST_ROW_KEY]: number;
|
|
94
|
+
}
|
|
95
|
+
export interface IListParams {
|
|
96
|
+
primaryKeys?: string[];
|
|
97
|
+
name?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @description Хук используется для того, чтобы подключить считывание данных с листу
|
|
101
|
+
* */
|
|
102
|
+
export declare function useListRead<T extends List<any>>(list: T, readParams: IReadParams): void;
|
|
103
|
+
export declare function useListState(list: List<any>): {
|
|
104
|
+
wait: boolean;
|
|
105
|
+
array: any[];
|
|
106
|
+
};
|
|
107
|
+
export declare type ListCellType = 'date' | 'dateWithTime' | 'toggle' | 'select';
|
|
108
|
+
export interface IListCell {
|
|
109
|
+
title: string;
|
|
110
|
+
name: string | string[];
|
|
111
|
+
value: (x: any, obj: IDefaultListData) => string | number;
|
|
112
|
+
link: (obj: IDefaultListData) => any;
|
|
113
|
+
type: ListCellType;
|
|
114
|
+
class: string | string[];
|
|
115
|
+
onClick: (data: IDefaultListData) => void;
|
|
116
|
+
href: (obj: IDefaultListData) => string;
|
|
117
|
+
icon: string;
|
|
118
|
+
}
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDefaultListData, IListParams, List } from "./List";
|
|
2
|
+
export declare class Table<T> extends List<T> {
|
|
3
|
+
changes: ITableChange<T>[];
|
|
4
|
+
constructor(params: ITableParams);
|
|
5
|
+
get changed(): boolean;
|
|
6
|
+
addChange(type: ITableChange<T>["type"], data?: Partial<T>): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function TableDataController<T>(table: Table<T>, controllerParams: IControllerParams): {
|
|
9
|
+
create(data: Partial<T>): void;
|
|
10
|
+
update(rowKey: number, data: Partial<T>): void;
|
|
11
|
+
delete(rowKey: number): void;
|
|
12
|
+
};
|
|
13
|
+
interface ITableParams extends IListParams {
|
|
14
|
+
}
|
|
15
|
+
interface IControllerParams {
|
|
16
|
+
autosave: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ITableChange<T> {
|
|
19
|
+
type: 'create' | 'remove' | 'update';
|
|
20
|
+
data: (Partial<T> & IDefaultListData);
|
|
21
|
+
status: 'active' | 'inactive';
|
|
22
|
+
}
|
|
23
|
+
export declare function useTableActiveRow(): {
|
|
24
|
+
activeRow: import("vue").Ref<number>;
|
|
25
|
+
activateRow: (v: IDefaultListData | number) => void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IListCell, IDefaultListData } from "./List";
|
|
2
|
+
import { VNode } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* @description Получение ОДНОЙ строки таблицы.
|
|
5
|
+
*/
|
|
6
|
+
export default function getTableRow(config: IListCell[], values: IDefaultListData): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import List, { IListCell, IListConfig } from "../List";
|
|
2
|
+
export declare const SYMBOL_ROW: unique symbol;
|
|
3
|
+
interface ITableChanges {
|
|
4
|
+
edit: {
|
|
5
|
+
[rowIndex: number]: ITableRow;
|
|
6
|
+
};
|
|
7
|
+
new: {
|
|
8
|
+
[rowIndex: number]: ITableRow;
|
|
9
|
+
};
|
|
10
|
+
remove: number[];
|
|
11
|
+
}
|
|
12
|
+
interface ITableConfig extends IListConfig {
|
|
13
|
+
}
|
|
14
|
+
export interface ITableRow {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
[SYMBOL_ROW]: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ITableViewController {
|
|
19
|
+
activate: (rowIndex: number) => void;
|
|
20
|
+
deactivate: () => void;
|
|
21
|
+
removeRow: (a: number | null) => void;
|
|
22
|
+
select: () => void;
|
|
23
|
+
}
|
|
24
|
+
export interface ITableCell extends Omit<IListCell, 'type'> {
|
|
25
|
+
icon?: string;
|
|
26
|
+
type?: IListCell["type"] | ('edit' | 'remove' | 'select-multi');
|
|
27
|
+
}
|
|
28
|
+
export default class Table extends List {
|
|
29
|
+
static PROVIDE_NAME: string;
|
|
30
|
+
/**
|
|
31
|
+
* @description Используется для индексации номера строки. 0 - зарезервирован. Используется для Form:New
|
|
32
|
+
*/
|
|
33
|
+
rowIndex: number;
|
|
34
|
+
changes: ITableChanges;
|
|
35
|
+
get changed(): number;
|
|
36
|
+
save: () => any;
|
|
37
|
+
constructor(params: ITableConfig);
|
|
38
|
+
/**
|
|
39
|
+
* @description Создание новой записи.
|
|
40
|
+
*/
|
|
41
|
+
create(data: any): void;
|
|
42
|
+
cleanChanges(): void;
|
|
43
|
+
/**
|
|
44
|
+
* @description Edit row of table.
|
|
45
|
+
* @param {Number} rowIndex number of uniq row.
|
|
46
|
+
* @param data Values
|
|
47
|
+
*/
|
|
48
|
+
edit(rowIndex: number, data: any): void;
|
|
49
|
+
remove(rowIndex: number): void;
|
|
50
|
+
wrapData(data: any, rawIndex?: number): ITableRow;
|
|
51
|
+
emitChanges(): void;
|
|
52
|
+
/**
|
|
53
|
+
* @override
|
|
54
|
+
* */
|
|
55
|
+
set array(data: any[]);
|
|
56
|
+
get array(): any[];
|
|
57
|
+
log(msg: string): void;
|
|
58
|
+
}
|
|
59
|
+
export declare function useActiveRowGenerator(fn: (a: null | number) => void): (rowIndex: number | null) => {
|
|
60
|
+
activate(): void;
|
|
61
|
+
deactivate(): void;
|
|
62
|
+
};
|
|
63
|
+
export declare function useTableState(table: Table): {
|
|
64
|
+
activeRow: import("vue").Ref<number>;
|
|
65
|
+
array: import("vue").ComputedRef<any[]>;
|
|
66
|
+
};
|
|
67
|
+
export declare function useTableRequest(table: Table, options?: {
|
|
68
|
+
fields: string | string[];
|
|
69
|
+
}): void;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ITableCell, ITableRow, ITableViewController } from "./Table";
|
|
2
|
+
import { VNode } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* @description Получение ОДНОЙ строки таблицы.
|
|
5
|
+
*/
|
|
6
|
+
export default function getTableRow(config: ITableCell[], values: ITableRow, rowController: ITableViewController): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>;
|