eservices-core 1.0.450 → 1.0.452
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/List.d.ts +1 -1
- package/dist/classes/new/List.d.ts +4 -2
- package/dist/index.js +13 -5
- package/package.json +1 -1
package/dist/classes/List.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ListCell {
|
|
|
4
4
|
title?: string;
|
|
5
5
|
name?: string | string[];
|
|
6
6
|
value?: (x: Values, obj: ValuesInterface) => Values;
|
|
7
|
-
link?: (
|
|
7
|
+
link?: (obj: ValuesInterface) => any;
|
|
8
8
|
type?: "date" | "dateWithTime" | 'toggle' | 'select' | 'edit' | 'remove';
|
|
9
9
|
icon?: string;
|
|
10
10
|
class?: string | string[];
|
|
@@ -107,9 +107,11 @@ export interface IListParams {
|
|
|
107
107
|
name?: string;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* @description Хук используется для того, чтобы подключить считывание данных с
|
|
110
|
+
* @description Хук используется для того, чтобы подключить считывание данных с листу.
|
|
111
|
+
* Т.к. Filter или order могут меняться readParams может выступать не только как объект, но и фнкция, которая будет возв
|
|
112
|
+
* ращать IReadParams
|
|
111
113
|
* */
|
|
112
|
-
export declare function useListRead<T extends List<any>>(list: T,
|
|
114
|
+
export declare function useListRead<T extends List<any>>(list: T, params: IReadParams | (() => IReadParams)): void;
|
|
113
115
|
export declare function useListState(list: List<any>): {
|
|
114
116
|
wait: boolean;
|
|
115
117
|
array: any[];
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.452
|
|
3
3
|
* (c) 2022 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -2925,9 +2925,11 @@ _primaryKeys = new WeakMap(), _wait = new WeakMap(), _readData = new WeakMap(),
|
|
|
2925
2925
|
* */
|
|
2926
2926
|
List$1.EVENT_DATA = 'list-data: update';
|
|
2927
2927
|
/**
|
|
2928
|
-
* @description Хук используется для того, чтобы подключить считывание данных с
|
|
2928
|
+
* @description Хук используется для того, чтобы подключить считывание данных с листу.
|
|
2929
|
+
* Т.к. Filter или order могут меняться readParams может выступать не только как объект, но и фнкция, которая будет возв
|
|
2930
|
+
* ращать IReadParams
|
|
2929
2931
|
* */
|
|
2930
|
-
function useListRead(list,
|
|
2932
|
+
function useListRead(list, params) {
|
|
2931
2933
|
/**
|
|
2932
2934
|
* @description Hash полученные по входным параметрам. На данный момент обычные JSON.stringify
|
|
2933
2935
|
* */
|
|
@@ -2935,6 +2937,12 @@ function useListRead(list, readParams) {
|
|
|
2935
2937
|
let offset = 0;
|
|
2936
2938
|
list.read = () => {
|
|
2937
2939
|
var _a, _b;
|
|
2940
|
+
/**
|
|
2941
|
+
* Получение нужных данных, если передана функция
|
|
2942
|
+
* */
|
|
2943
|
+
let readParams = params;
|
|
2944
|
+
if (typeof readParams === 'function')
|
|
2945
|
+
readParams = readParams();
|
|
2938
2946
|
const options = {};
|
|
2939
2947
|
if (!list.name)
|
|
2940
2948
|
throw new Error('Reading list`s data without name is not available.');
|
|
@@ -3466,10 +3474,10 @@ class List extends EventEmitter {
|
|
|
3466
3474
|
* Добавляем ссылку в ячейку
|
|
3467
3475
|
* */
|
|
3468
3476
|
if (cell.link) {
|
|
3469
|
-
const to = cell.link(
|
|
3477
|
+
const to = cell.link(rowValues);
|
|
3470
3478
|
if (to) {
|
|
3471
3479
|
cellNodeChildren.push(vue.h(vueRouter.RouterLink, {
|
|
3472
|
-
to: cell.link(
|
|
3480
|
+
to: cell.link(rowValues),
|
|
3473
3481
|
}));
|
|
3474
3482
|
cellClasses.push('list-cell-link');
|
|
3475
3483
|
}
|