eservices-core 1.0.501 → 1.0.503
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/new/get-table-row.d.ts +1 -1
- package/dist/index.js +71 -219
- package/dist/services/process-wizard-service.d.ts +1 -0
- package/dist/widgets/list/widget-list-row.vue.d.ts +1 -3
- package/package.json +4 -9
- package/dist/frontend/core/classes/ApplicationManager.d.ts +0 -61
- package/dist/frontend/core/classes/CoreError.d.ts +0 -42
- package/dist/frontend/core/classes/List.d.ts +0 -101
- package/dist/frontend/core/classes/NotificationSystem.d.ts +0 -39
- package/dist/frontend/core/classes/ProcessWrap.d.ts +0 -8
- package/dist/frontend/core/classes/_List.d.ts +0 -66
- package/dist/frontend/core/classes/new/List.d.ts +0 -119
- package/dist/frontend/core/classes/new/Table.d.ts +0 -27
- package/dist/frontend/core/classes/new/get-table-row.d.ts +0 -8
- package/dist/frontend/core/classes/table/Table.d.ts +0 -70
- package/dist/frontend/core/classes/table/get-table-row.d.ts +0 -8
- package/dist/frontend/core/config.d.ts +0 -14
- package/dist/frontend/core/hooks/use-customer-state.d.ts +0 -24
- package/dist/frontend/core/hooks/use-form-action.d.ts +0 -12
- package/dist/frontend/core/hooks/use-form-label.d.ts +0 -8
- package/dist/frontend/core/hooks/use-form-metadata.d.ts +0 -2
- package/dist/frontend/core/hooks/use-form-request-data.d.ts +0 -13
- package/dist/frontend/core/index.d.ts +0 -185
- package/dist/frontend/core/mixins/index.d.ts +0 -4
- package/dist/frontend/core/new/new-import.d.ts +0 -4
- package/dist/frontend/core/services/FileService.d.ts +0 -7
- package/dist/frontend/core/services/action-service.d.ts +0 -22
- package/dist/frontend/core/services/auth-service.d.ts +0 -76
- package/dist/frontend/core/services/client-service.d.ts +0 -16
- package/dist/frontend/core/services/communication-service.d.ts +0 -64
- package/dist/frontend/core/services/data-service.d.ts +0 -54
- package/dist/frontend/core/services/invitation-service.d.ts +0 -5
- package/dist/frontend/core/services/metadata-service.d.ts +0 -5
- package/dist/frontend/core/services/open-service.d.ts +0 -3
- package/dist/frontend/core/services/presentation-service.d.ts +0 -9
- package/dist/frontend/core/services/process-wizard-service.d.ts +0 -30
- package/dist/frontend/core/services/rule-validation-service.d.ts +0 -4
- package/dist/frontend/core/services/view-service.d.ts +0 -19
- package/dist/frontend/core/socket/use-socket.d.ts +0 -4
- package/dist/frontend/core/styles/index.d.ts +0 -2
- package/dist/frontend/core/styles/types.d.ts +0 -164
- package/dist/frontend/core/types/index.d.ts +0 -103
- package/dist/frontend/core/types/metadata-types.d.ts +0 -19
- package/dist/frontend/core/useMethods/index.d.ts +0 -5
- package/dist/frontend/core/useMethods/useInput.d.ts +0 -15
- package/dist/frontend/core/utils/Filter.d.ts +0 -17
- package/dist/frontend/core/utils/GraphQL/index.d.ts +0 -21
- package/dist/frontend/core/utils/Journal.d.ts +0 -34
- package/dist/frontend/core/utils/Request.d.ts +0 -4
- package/dist/frontend/core/utils/clickOutside.d.ts +0 -2
- package/dist/frontend/core/utils/firstChapterToLowerCase.d.ts +0 -5
- package/dist/frontend/core/utils/getPropFromObject.d.ts +0 -15
- package/dist/frontend/core/utils/group-array-by-field.d.ts +0 -29
- package/dist/frontend/core/utils/index.d.ts +0 -21
- package/dist/frontend/core/utils/prettyDate.d.ts +0 -13
- package/dist/frontend/core/utils/requestHandler.d.ts +0 -7
- package/dist/frontend/core/utils/runPromiseQueue.d.ts +0 -1
- package/dist/frontend/core/utils/static-link.d.ts +0 -6
- package/dist/frontend/core/utils/uuid.d.ts +0 -1
- package/dist/frontend/core/utils/values-to-upper-case.d.ts +0 -5
- package/dist/frontend/core/widgets/breadcrumbs/widget-breadcrumb-item.vue.d.ts +0 -30
- package/dist/frontend/core/widgets/breadcrumbs/widget-breadcrumbs.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/buttons/WidgetButton.vue.d.ts +0 -41
- package/dist/frontend/core/widgets/buttons/index.d.ts +0 -5
- package/dist/frontend/core/widgets/buttons/multi-button/WidgetMultiButton.vue.d.ts +0 -22
- package/dist/frontend/core/widgets/cards/widget-card.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/containers/index.d.ts +0 -6
- package/dist/frontend/core/widgets/errorSystem/default/WidgetError.vue.d.ts +0 -27
- package/dist/frontend/core/widgets/errorSystem/default/WidgetErrorGroup.vue.d.ts +0 -17
- package/dist/frontend/core/widgets/errorSystem/default/WidgetNotificationSystem.vue.d.ts +0 -4
- package/dist/frontend/core/widgets/errorSystem/index.d.ts +0 -4
- package/dist/frontend/core/widgets/forms/index.d.ts +0 -6
- package/dist/frontend/core/widgets/forms/naomi/WidgetForm.vue.d.ts +0 -65
- package/dist/frontend/core/widgets/forms/naomi/WidgetFormInfo.vue.d.ts +0 -30
- package/dist/frontend/core/widgets/icons/index.d.ts +0 -4
- package/dist/frontend/core/widgets/image/widget-image.vue.d.ts +0 -30
- package/dist/frontend/core/widgets/index.d.ts +0 -40
- package/dist/frontend/core/widgets/inputs/default-style/index.d.ts +0 -7
- package/dist/frontend/core/widgets/inputs/index.d.ts +0 -15
- package/dist/frontend/core/widgets/inputs/line-style/index.d.ts +0 -4
- package/dist/frontend/core/widgets/inputs/naomi-style/index.d.ts +0 -4
- package/dist/frontend/core/widgets/inputs/widget-input-check.vue.d.ts +0 -16
- package/dist/frontend/core/widgets/list/widget-list-head.vue.d.ts +0 -22
- package/dist/frontend/core/widgets/list/widget-list-row.vue.d.ts +0 -12
- package/dist/frontend/core/widgets/list/widget-list.vue.d.ts +0 -42
- package/dist/frontend/core/widgets/modals/modal-validation/modal-validation-item.vue.d.ts +0 -46
- package/dist/frontend/core/widgets/modals/modal-validation/modal-validation.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/modals/modal-wrap.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/new/widget-table-form.vue.d.ts +0 -36
- package/dist/frontend/core/widgets/new/widget-table-row.vue.d.ts +0 -11
- package/dist/frontend/core/widgets/new/widget-table.vue.d.ts +0 -63
- package/dist/frontend/core/widgets/section/widget-section.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/shadow-form/WidgetShadowForm.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/spinner/WidgetSpinner.vue.d.ts +0 -14
- package/dist/frontend/core/widgets/spinner/index.d.ts +0 -4
- package/dist/frontend/core/widgets/spinner/widget-loader.vue.d.ts +0 -22
- package/dist/frontend/core/widgets/tables/widget-table-form.vue.d.ts +0 -40
- package/dist/frontend/core/widgets/tables/widget-table-row.vue.d.ts +0 -12
- package/dist/frontend/core/widgets/tables/widget-table.vue.d.ts +0 -52
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IListCell, IDefaultListData } from "./List";
|
|
2
2
|
import { VNode } from "vue";
|
|
3
3
|
/**
|
|
4
|
-
* @description Получение ОДНОЙ строки
|
|
4
|
+
* @description Получение ОДНОЙ строки таблицы или списка.
|
|
5
5
|
*/
|
|
6
6
|
export default function getTableRow(config: IListCell[], values: IDefaultListData): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
7
|
[key: string]: any;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.503
|
|
3
3
|
* (c) 2023 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -2458,7 +2458,7 @@ class dataService {
|
|
|
2458
2458
|
}
|
|
2459
2459
|
|
|
2460
2460
|
var _array, _wait$1;
|
|
2461
|
-
class List$
|
|
2461
|
+
class List$1 extends EventEmitter {
|
|
2462
2462
|
constructor(config) {
|
|
2463
2463
|
super();
|
|
2464
2464
|
_array.set(this, []
|
|
@@ -2479,7 +2479,7 @@ class List$2 extends EventEmitter {
|
|
|
2479
2479
|
}
|
|
2480
2480
|
set wait(v) {
|
|
2481
2481
|
__classPrivateFieldSet(this, _wait$1, v);
|
|
2482
|
-
this.emit(List$
|
|
2482
|
+
this.emit(List$1.EVENT_CHANGE_WAIT, v);
|
|
2483
2483
|
}
|
|
2484
2484
|
get wait() {
|
|
2485
2485
|
return __classPrivateFieldGet(this, _wait$1);
|
|
@@ -2515,18 +2515,18 @@ class List$2 extends EventEmitter {
|
|
|
2515
2515
|
.then(v => {
|
|
2516
2516
|
this.array.push(...v);
|
|
2517
2517
|
})
|
|
2518
|
-
.then(() => this.emit(List$
|
|
2518
|
+
.then(() => this.emit(List$1.EVENT_DATA, this.array))
|
|
2519
2519
|
.finally(() => {
|
|
2520
2520
|
this.wait = false;
|
|
2521
2521
|
});
|
|
2522
2522
|
}
|
|
2523
2523
|
set array(data) {
|
|
2524
2524
|
__classPrivateFieldSet(this, _array, data);
|
|
2525
|
-
this.emit(List$
|
|
2525
|
+
this.emit(List$1.EVENT_DATA, this.array);
|
|
2526
2526
|
}
|
|
2527
2527
|
add(array) {
|
|
2528
2528
|
__classPrivateFieldGet(this, _array).push(...array);
|
|
2529
|
-
this.emit(List$
|
|
2529
|
+
this.emit(List$1.EVENT_DATA, this.array);
|
|
2530
2530
|
}
|
|
2531
2531
|
get array() {
|
|
2532
2532
|
return __classPrivateFieldGet(this, _array);
|
|
@@ -2553,7 +2553,7 @@ class List$2 extends EventEmitter {
|
|
|
2553
2553
|
* Output: { name: 'title', value: 'GG_GG'}
|
|
2554
2554
|
*/
|
|
2555
2555
|
static getCellInfo(cell, rowValues) {
|
|
2556
|
-
const cellName = List$
|
|
2556
|
+
const cellName = List$1.getCellName(cell);
|
|
2557
2557
|
const cellValue = (() => {
|
|
2558
2558
|
let _v = cellName ? getPropFromObject(rowValues, cellName) : null;
|
|
2559
2559
|
if (_v === undefined)
|
|
@@ -2576,15 +2576,15 @@ class List$2 extends EventEmitter {
|
|
|
2576
2576
|
}
|
|
2577
2577
|
}
|
|
2578
2578
|
_array = new WeakMap(), _wait$1 = new WeakMap();
|
|
2579
|
-
List$
|
|
2580
|
-
List$
|
|
2579
|
+
List$1.EVENT_DATA = 'LIST:DATA';
|
|
2580
|
+
List$1.EVENT_CHANGE_WAIT = 'LIST:UPDATE-WAIT';
|
|
2581
2581
|
function useListState$1(list) {
|
|
2582
2582
|
const array = vue.reactive(list.array);
|
|
2583
|
-
list.on(List$
|
|
2583
|
+
list.on(List$1.EVENT_DATA, () => array.splice(0, array.length, ...list.array));
|
|
2584
2584
|
const state = vue.reactive({
|
|
2585
2585
|
wait: list.wait
|
|
2586
2586
|
});
|
|
2587
|
-
list.on(List$
|
|
2587
|
+
list.on(List$1.EVENT_CHANGE_WAIT, (v) => state.wait = v);
|
|
2588
2588
|
return {
|
|
2589
2589
|
array,
|
|
2590
2590
|
state
|
|
@@ -2592,7 +2592,7 @@ function useListState$1(list) {
|
|
|
2592
2592
|
}
|
|
2593
2593
|
|
|
2594
2594
|
const SYMBOL_ROW = Symbol("__ROW_INDEX__");
|
|
2595
|
-
class Table$1 extends List$
|
|
2595
|
+
class Table$1 extends List$1 {
|
|
2596
2596
|
constructor(params) {
|
|
2597
2597
|
super(params);
|
|
2598
2598
|
/**
|
|
@@ -2691,7 +2691,7 @@ function useTableState(table) {
|
|
|
2691
2691
|
const array = vue.reactive(table.array);
|
|
2692
2692
|
vue.provide(Table$1.PROVIDE_NAME, table);
|
|
2693
2693
|
const changes = vue.reactive(table.changes);
|
|
2694
|
-
table.on(List$
|
|
2694
|
+
table.on(List$1.EVENT_DATA, (v) => array.splice(0, array.length, ...v));
|
|
2695
2695
|
table.on(jenesiusVueForm.Form.EVENT_CHANGED, () => {
|
|
2696
2696
|
changes.new = Object.keys(table.changes.new).reduce((acc, key) => {
|
|
2697
2697
|
const _key = Number(key);
|
|
@@ -2751,7 +2751,7 @@ styleInject(css_248z$j);
|
|
|
2751
2751
|
|
|
2752
2752
|
var _primaryKeys, _config, _order, _filters, _wait, _readData, _saveData;
|
|
2753
2753
|
const LIST_ROW_KEY = '_______LIST_______ROW_______INDEX________NAME_______';
|
|
2754
|
-
class List
|
|
2754
|
+
class List extends EventEmitter {
|
|
2755
2755
|
constructor(params) {
|
|
2756
2756
|
super();
|
|
2757
2757
|
/**
|
|
@@ -2773,12 +2773,12 @@ class List$1 extends EventEmitter {
|
|
|
2773
2773
|
_filters.set(this, new Proxy({}, {
|
|
2774
2774
|
set: (target, p, value, receiver) => {
|
|
2775
2775
|
target[p] = value;
|
|
2776
|
-
this.emit(List
|
|
2776
|
+
this.emit(List.EVENT_FILTERS_UPDATE, target);
|
|
2777
2777
|
return true;
|
|
2778
2778
|
},
|
|
2779
2779
|
deleteProperty: (target, p) => {
|
|
2780
2780
|
delete target[p];
|
|
2781
|
-
this.emit(List
|
|
2781
|
+
this.emit(List.EVENT_FILTERS_UPDATE, target);
|
|
2782
2782
|
return true;
|
|
2783
2783
|
}
|
|
2784
2784
|
}));
|
|
@@ -2798,14 +2798,14 @@ class List$1 extends EventEmitter {
|
|
|
2798
2798
|
return __classPrivateFieldGet(this, _config);
|
|
2799
2799
|
}
|
|
2800
2800
|
emitUpdateConfig() {
|
|
2801
|
-
this.emit(List
|
|
2801
|
+
this.emit(List.EVENT_CONFIG_UPDATE, this.config);
|
|
2802
2802
|
}
|
|
2803
2803
|
get order() {
|
|
2804
2804
|
return __classPrivateFieldGet(this, _order);
|
|
2805
2805
|
}
|
|
2806
2806
|
set order(newOrder) {
|
|
2807
2807
|
__classPrivateFieldSet(this, _order, newOrder);
|
|
2808
|
-
this.emit(List
|
|
2808
|
+
this.emit(List.EVENT_ORDER_UPDATE, this.order);
|
|
2809
2809
|
}
|
|
2810
2810
|
get filters() {
|
|
2811
2811
|
return __classPrivateFieldGet(this, _filters);
|
|
@@ -2862,7 +2862,7 @@ class List$1 extends EventEmitter {
|
|
|
2862
2862
|
const wrappedData = this.wrapArray(data);
|
|
2863
2863
|
// @ts-ignore
|
|
2864
2864
|
this.array.push(...wrappedData);
|
|
2865
|
-
this.emit(List
|
|
2865
|
+
this.emit(List.EVENT_DATA, this.array);
|
|
2866
2866
|
}
|
|
2867
2867
|
/**
|
|
2868
2868
|
* @description Полностью заменяет содержимое массива, новым
|
|
@@ -2879,7 +2879,7 @@ class List$1 extends EventEmitter {
|
|
|
2879
2879
|
if (index === -1)
|
|
2880
2880
|
return;
|
|
2881
2881
|
this.array.splice(index, 1);
|
|
2882
|
-
this.emit(List
|
|
2882
|
+
this.emit(List.EVENT_DATA, this.array);
|
|
2883
2883
|
}
|
|
2884
2884
|
/**
|
|
2885
2885
|
* @description Merging data by RowKey
|
|
@@ -2889,7 +2889,7 @@ class List$1 extends EventEmitter {
|
|
|
2889
2889
|
if (!obj)
|
|
2890
2890
|
return;
|
|
2891
2891
|
Object.assign(obj, data);
|
|
2892
|
-
this.emit(List
|
|
2892
|
+
this.emit(List.EVENT_DATA, this.array);
|
|
2893
2893
|
}
|
|
2894
2894
|
/**
|
|
2895
2895
|
* @description Just alias for array and method wrapItem
|
|
@@ -2970,7 +2970,7 @@ class List$1 extends EventEmitter {
|
|
|
2970
2970
|
* Output: { name: 'title', value: 'GG_GG'}
|
|
2971
2971
|
*/
|
|
2972
2972
|
static getCellInfo(cell, rowValues) {
|
|
2973
|
-
const cellName = List
|
|
2973
|
+
const cellName = List.getCellName(cell);
|
|
2974
2974
|
const cellValue = (() => {
|
|
2975
2975
|
let _v = cellName ? getPropFromObject(rowValues, cellName) : null;
|
|
2976
2976
|
if (_v === undefined)
|
|
@@ -2989,10 +2989,10 @@ _primaryKeys = new WeakMap(), _config = new WeakMap(), _order = new WeakMap(), _
|
|
|
2989
2989
|
/**
|
|
2990
2990
|
* @description Event triggers when array was updated, set new or pushed new, or updated, or deleted.
|
|
2991
2991
|
* */
|
|
2992
|
-
List
|
|
2993
|
-
List
|
|
2994
|
-
List
|
|
2995
|
-
List
|
|
2992
|
+
List.EVENT_DATA = 'list-data: update';
|
|
2993
|
+
List.EVENT_CONFIG_UPDATE = 'list-config:update';
|
|
2994
|
+
List.EVENT_ORDER_UPDATE = 'list-order:update';
|
|
2995
|
+
List.EVENT_FILTERS_UPDATE = 'list-filters:update';
|
|
2996
2996
|
/**
|
|
2997
2997
|
* @description Хук используется для того, чтобы подключить считывание данных с листу.
|
|
2998
2998
|
* Т.к. Filter или order могут меняться readParams может выступать не только как объект, но и фнкция, которая будет возв
|
|
@@ -3058,7 +3058,7 @@ function useListState(list) {
|
|
|
3058
3058
|
array: []
|
|
3059
3059
|
});
|
|
3060
3060
|
// const array = reactive<IData[]>([]);
|
|
3061
|
-
list.on(List
|
|
3061
|
+
list.on(List.EVENT_DATA, (data) => {
|
|
3062
3062
|
state.array.splice(0, state.array.length, ...data);
|
|
3063
3063
|
});
|
|
3064
3064
|
list.on(jenesiusVueForm.Form.EVENT_WAIT, () => {
|
|
@@ -3078,7 +3078,7 @@ function useProvideList(list, defaultConfig) {
|
|
|
3078
3078
|
throw new Error(`Hook useProvideList has two required params: list and defaultConfig`);
|
|
3079
3079
|
const config = useListConfig(list);
|
|
3080
3080
|
const order = useListOrder(list);
|
|
3081
|
-
list.on(List
|
|
3081
|
+
list.on(List.EVENT_CONFIG_UPDATE, () => {
|
|
3082
3082
|
list.read();
|
|
3083
3083
|
});
|
|
3084
3084
|
function revertConfig() {
|
|
@@ -3103,7 +3103,7 @@ function useProvideList(list, defaultConfig) {
|
|
|
3103
3103
|
* */
|
|
3104
3104
|
function useListConfig(list) {
|
|
3105
3105
|
const config = vue.reactive([...list.config]);
|
|
3106
|
-
list.on(List
|
|
3106
|
+
list.on(List.EVENT_CONFIG_UPDATE, v => {
|
|
3107
3107
|
config.splice(0, config.length, ...v);
|
|
3108
3108
|
});
|
|
3109
3109
|
return config;
|
|
@@ -3114,7 +3114,7 @@ function useListConfig(list) {
|
|
|
3114
3114
|
function useListOrder(list) {
|
|
3115
3115
|
const defaultValue = list.order || [];
|
|
3116
3116
|
const order = vue.reactive(defaultValue);
|
|
3117
|
-
list.on(List
|
|
3117
|
+
list.on(List.EVENT_ORDER_UPDATE, v => {
|
|
3118
3118
|
order.splice(0, order.length, ...v);
|
|
3119
3119
|
list.read();
|
|
3120
3120
|
});
|
|
@@ -3125,14 +3125,14 @@ function useListOrder(list) {
|
|
|
3125
3125
|
* */
|
|
3126
3126
|
function useListFilter(list) {
|
|
3127
3127
|
const filters = vue.reactive(list.filters);
|
|
3128
|
-
list.on(List
|
|
3128
|
+
list.on(List.EVENT_FILTERS_UPDATE, arr => {
|
|
3129
3129
|
jenesiusVueForm.utils.softReplaceObject(list.filters, arr);
|
|
3130
3130
|
list.read();
|
|
3131
3131
|
});
|
|
3132
3132
|
return filters;
|
|
3133
3133
|
}
|
|
3134
3134
|
|
|
3135
|
-
class Table extends List
|
|
3135
|
+
class Table extends List {
|
|
3136
3136
|
constructor(params) {
|
|
3137
3137
|
super(params);
|
|
3138
3138
|
this.changes = [];
|
|
@@ -3162,7 +3162,7 @@ function defaultTableSave() {
|
|
|
3162
3162
|
function useTableActiveRow() {
|
|
3163
3163
|
const activeRow = vue.ref(null);
|
|
3164
3164
|
function activateRow(v) {
|
|
3165
|
-
activeRow.value = typeof v === 'number' ? v : List
|
|
3165
|
+
activeRow.value = typeof v === 'number' ? v : List.getKey(v);
|
|
3166
3166
|
}
|
|
3167
3167
|
return {
|
|
3168
3168
|
activeRow, activateRow
|
|
@@ -3200,7 +3200,7 @@ script$o.__scopeId = "data-v-99f36e92";
|
|
|
3200
3200
|
script$o.__file = "core/widgets/new/widget-table-head.vue";
|
|
3201
3201
|
|
|
3202
3202
|
/**
|
|
3203
|
-
* @description Получение ОДНОЙ строки
|
|
3203
|
+
* @description Получение ОДНОЙ строки таблицы или списка.
|
|
3204
3204
|
*/
|
|
3205
3205
|
function getTableRow$1(config, values) {
|
|
3206
3206
|
const arrayCells = config.map(cell => getTableCell$1(cell, values));
|
|
@@ -3208,7 +3208,7 @@ function getTableRow$1(config, values) {
|
|
|
3208
3208
|
}
|
|
3209
3209
|
function getTableCell$1(cell, rowValue) {
|
|
3210
3210
|
//@ts-ignore
|
|
3211
|
-
let { name, value } = List
|
|
3211
|
+
let { name, value } = List.getCellInfo(cell, rowValue);
|
|
3212
3212
|
const attributes = {
|
|
3213
3213
|
onClick: [],
|
|
3214
3214
|
class: ['widget-table__cell widget-table-cell']
|
|
@@ -3309,12 +3309,12 @@ var script$m = /*#__PURE__*/ vue.defineComponent({
|
|
|
3309
3309
|
/**
|
|
3310
3310
|
* @description Если в новых данных отсутвует RowKey
|
|
3311
3311
|
* */
|
|
3312
|
-
const isNew = vue.computed(() => !props.values && !List
|
|
3312
|
+
const isNew = vue.computed(() => !props.values && !List.hasKey(props.values));
|
|
3313
3313
|
vue.onMounted(() => {
|
|
3314
3314
|
setTimeout(() => {
|
|
3315
3315
|
if (refTableForm.value)
|
|
3316
3316
|
refTableForm.value.scrollIntoView({ block: "nearest", inline: "nearest", behavior: 'smooth' });
|
|
3317
|
-
},
|
|
3317
|
+
}, 250);
|
|
3318
3318
|
});
|
|
3319
3319
|
return (_ctx, _cache) => {
|
|
3320
3320
|
return (vue.openBlock(), vue.createElementBlock("tr", {
|
|
@@ -3416,11 +3416,11 @@ var script$k = /*#__PURE__*/ vue.defineComponent({
|
|
|
3416
3416
|
vue.createVNode(script$n, {
|
|
3417
3417
|
config: __props.config,
|
|
3418
3418
|
values: values,
|
|
3419
|
-
selected: (_a = __props.selectRows) === null || _a === void 0 ? void 0 : _a.includes(vue.unref(List
|
|
3420
|
-
onSelect: ($event) => (onSelect(vue.unref(List
|
|
3419
|
+
selected: (_a = __props.selectRows) === null || _a === void 0 ? void 0 : _a.includes(vue.unref(List).getKey(values)),
|
|
3420
|
+
onSelect: ($event) => (onSelect(vue.unref(List).getKey(values), $event)),
|
|
3421
3421
|
class: vue.normalizeClass(!!__props.classCallback ? __props.classCallback(values) : '')
|
|
3422
3422
|
}, null, 8 /* PROPS */, ["config", "values", "selected", "onSelect", "class"]),
|
|
3423
|
-
(vue.unref(tableForm) && (__props.activeRow === vue.unref(List
|
|
3423
|
+
(vue.unref(tableForm) && (__props.activeRow === vue.unref(List).getKey(values)))
|
|
3424
3424
|
? (vue.openBlock(), vue.createBlock(script$m, {
|
|
3425
3425
|
key: 0,
|
|
3426
3426
|
component: vue.unref(tableForm),
|
|
@@ -3458,7 +3458,7 @@ script$k.__file = "core/widgets/new/widget-table.vue";
|
|
|
3458
3458
|
var newImport = /*#__PURE__*/Object.freeze({
|
|
3459
3459
|
__proto__: null,
|
|
3460
3460
|
WidgetTable: script$k,
|
|
3461
|
-
List: List
|
|
3461
|
+
List: List,
|
|
3462
3462
|
useListState: useListState,
|
|
3463
3463
|
useListRead: useListRead,
|
|
3464
3464
|
Table: Table,
|
|
@@ -3541,188 +3541,13 @@ styleInject(css_248z$e);
|
|
|
3541
3541
|
script$i.__scopeId = "data-v-ee0481d0";
|
|
3542
3542
|
script$i.__file = "core/widgets/breadcrumbs/widget-breadcrumbs.vue";
|
|
3543
3543
|
|
|
3544
|
-
/**
|
|
3545
|
-
* @param {String} str
|
|
3546
|
-
*
|
|
3547
|
-
* @return {String} prettyDate
|
|
3548
|
-
* */
|
|
3549
|
-
function prettyDateWithTime(str) {
|
|
3550
|
-
return prettyDate(str, 'YYYY/MM/DD HH:mm:ss');
|
|
3551
|
-
}
|
|
3552
|
-
/**
|
|
3553
|
-
* @param {String} str
|
|
3554
|
-
* @param {String} format
|
|
3555
|
-
*
|
|
3556
|
-
* @return {String} prettyDate
|
|
3557
|
-
* */
|
|
3558
|
-
function prettyDate(str, format = 'YYYY/MM/DD') {
|
|
3559
|
-
if (!str)
|
|
3560
|
-
return "";
|
|
3561
|
-
try {
|
|
3562
|
-
const date = new Date(str);
|
|
3563
|
-
return dateAndTime__default["default"].format(date, format);
|
|
3564
|
-
}
|
|
3565
|
-
catch (e) {
|
|
3566
|
-
console.log(e);
|
|
3567
|
-
return 'Invalid date';
|
|
3568
|
-
}
|
|
3569
|
-
}
|
|
3570
|
-
|
|
3571
|
-
/**
|
|
3572
|
-
* @deprecated
|
|
3573
|
-
* */
|
|
3574
|
-
class List extends EventEmitter {
|
|
3575
|
-
constructor(props) {
|
|
3576
|
-
super();
|
|
3577
|
-
this.array = vue.reactive([]);
|
|
3578
|
-
this.orderField = '';
|
|
3579
|
-
this.orderDirection = '';
|
|
3580
|
-
this.config = props.config;
|
|
3581
|
-
}
|
|
3582
|
-
cleanArray() {
|
|
3583
|
-
this.array.splice(0, this.array.length);
|
|
3584
|
-
}
|
|
3585
|
-
setArray(array) {
|
|
3586
|
-
this.cleanArray();
|
|
3587
|
-
this.array.push(...array);
|
|
3588
|
-
}
|
|
3589
|
-
order(fieldName, pos) {
|
|
3590
|
-
this.orderField = fieldName;
|
|
3591
|
-
this.orderDirection = pos;
|
|
3592
|
-
// @ts-ignore
|
|
3593
|
-
this.emit(List.EVENT_ORDER, {
|
|
3594
|
-
field: fieldName,
|
|
3595
|
-
direction: pos
|
|
3596
|
-
});
|
|
3597
|
-
}
|
|
3598
|
-
/**
|
|
3599
|
-
* @description Статик метод для получения VNode для Строки
|
|
3600
|
-
*
|
|
3601
|
-
* @param {ListCell[]} config - конфигурация списка
|
|
3602
|
-
* @param {ListRowValues} rowValues - значения для одной строки
|
|
3603
|
-
* */
|
|
3604
|
-
static getRow(config, rowValues) {
|
|
3605
|
-
const arrayCells = config.map(cell => {
|
|
3606
|
-
const { name, value } = List.getCellInfo(cell, rowValues);
|
|
3607
|
-
return List.getCell(cell, rowValues, name, value);
|
|
3608
|
-
});
|
|
3609
|
-
return vue.h("tr", {}, arrayCells);
|
|
3610
|
-
}
|
|
3611
|
-
/**
|
|
3612
|
-
* @return { {name: string, value: any} } CellInfo
|
|
3613
|
-
* */
|
|
3614
|
-
static getCellInfo(cell, rowValues) {
|
|
3615
|
-
const cellName = List.getCellName(cell);
|
|
3616
|
-
const cellValue = (() => {
|
|
3617
|
-
let _v = cellName ? getPropFromObject(rowValues, cellName) : null;
|
|
3618
|
-
if (_v === undefined)
|
|
3619
|
-
_v = null;
|
|
3620
|
-
if (cell.value)
|
|
3621
|
-
return cell.value(_v, rowValues);
|
|
3622
|
-
return _v;
|
|
3623
|
-
})();
|
|
3624
|
-
return {
|
|
3625
|
-
name: cellName,
|
|
3626
|
-
value: cellValue
|
|
3627
|
-
};
|
|
3628
|
-
}
|
|
3629
|
-
/**
|
|
3630
|
-
* @description Статик метод для получения VNode для Ячейки
|
|
3631
|
-
*
|
|
3632
|
-
* @param {ListCell} cellConfig - конфигурация Ячейки
|
|
3633
|
-
* @param {ListRowValues} rowValues - значения Строки
|
|
3634
|
-
* @param {string} cellName - имя Ячейки
|
|
3635
|
-
* @param {values} cellValue - значение ячейки
|
|
3636
|
-
* */
|
|
3637
|
-
static getCell(cellConfig, rowValues, cellName, cellValue, list) {
|
|
3638
|
-
const cellNodeChildren = [];
|
|
3639
|
-
const cellClasses = [];
|
|
3640
|
-
const cell = cellConfig; // Для удобно использования
|
|
3641
|
-
/**
|
|
3642
|
-
* Добавляем ссылку в ячейку
|
|
3643
|
-
* */
|
|
3644
|
-
if (cell.link) {
|
|
3645
|
-
const to = cell.link(rowValues);
|
|
3646
|
-
if (to) {
|
|
3647
|
-
cellNodeChildren.push(vue.h(vueRouter.RouterLink, {
|
|
3648
|
-
to: cell.link(rowValues),
|
|
3649
|
-
}));
|
|
3650
|
-
cellClasses.push('list-cell-link');
|
|
3651
|
-
}
|
|
3652
|
-
}
|
|
3653
|
-
/**
|
|
3654
|
-
* Для удобной работы с ячейкой используется cell.type для преднастройки
|
|
3655
|
-
*/
|
|
3656
|
-
if (cell.type)
|
|
3657
|
-
switch (cell.type) {
|
|
3658
|
-
case "date": {
|
|
3659
|
-
cellValue = prettyDate(typeof cellValue === "string" ? cellValue : null);
|
|
3660
|
-
break;
|
|
3661
|
-
}
|
|
3662
|
-
case "dateWithTime": {
|
|
3663
|
-
cellValue = prettyDateWithTime(typeof cellValue === "string" ? cellValue : null);
|
|
3664
|
-
break;
|
|
3665
|
-
}
|
|
3666
|
-
}
|
|
3667
|
-
/**
|
|
3668
|
-
* Установка обычного значения
|
|
3669
|
-
* */
|
|
3670
|
-
if (cellValue)
|
|
3671
|
-
cellNodeChildren.push(vue.h("p", {}, cellValue));
|
|
3672
|
-
/**
|
|
3673
|
-
* Добавляем иконку к полю
|
|
3674
|
-
* */
|
|
3675
|
-
if (cell.icon) { // @ts-ignore
|
|
3676
|
-
cellNodeChildren.push(vue.h(script$L, { name: cell.icon }));
|
|
3677
|
-
}
|
|
3678
|
-
if (cell.class)
|
|
3679
|
-
cellClasses.push(...(Array.isArray(cell.class) ? cell.class : [cell.class]));
|
|
3680
|
-
const attr = {};
|
|
3681
|
-
if (cell.onClick) {
|
|
3682
|
-
attr.onClick = cell.onClick.bind(null, rowValues);
|
|
3683
|
-
}
|
|
3684
|
-
return [vue.h("td", Object.assign({ class: cellClasses }, attr), cellNodeChildren)];
|
|
3685
|
-
}
|
|
3686
|
-
/**
|
|
3687
|
-
* @description Принимает конфигурацию списка
|
|
3688
|
-
* @return <String>Array Возвращает массив, содержащий все имена полей из ко
|
|
3689
|
-
* нфигурации
|
|
3690
|
-
* */
|
|
3691
|
-
static getNamesFromConfig(config) {
|
|
3692
|
-
return config.reduce((acc, row) => {
|
|
3693
|
-
if (row.name) {
|
|
3694
|
-
if (typeof row.name === 'string')
|
|
3695
|
-
acc.push(row.name);
|
|
3696
|
-
else
|
|
3697
|
-
acc.push(...row.name);
|
|
3698
|
-
}
|
|
3699
|
-
return acc;
|
|
3700
|
-
}, []);
|
|
3701
|
-
}
|
|
3702
|
-
/**
|
|
3703
|
-
* @description Вернёт название ячеки, учитывая все значения поля name
|
|
3704
|
-
* Если значением поля name выступает массив, то вернёт первый элемент масси
|
|
3705
|
-
* ва
|
|
3706
|
-
* */
|
|
3707
|
-
static getCellName(cell) {
|
|
3708
|
-
if (!cell.name)
|
|
3709
|
-
return null;
|
|
3710
|
-
if (typeof cell.name === "string")
|
|
3711
|
-
return cell.name;
|
|
3712
|
-
if (Array.isArray(cell.name))
|
|
3713
|
-
return cell.name[0];
|
|
3714
|
-
return null;
|
|
3715
|
-
}
|
|
3716
|
-
}
|
|
3717
|
-
List.EVENT_ORDER = 'order';
|
|
3718
|
-
|
|
3719
3544
|
var script$h = {
|
|
3720
3545
|
props: {
|
|
3721
3546
|
config: Array,
|
|
3722
3547
|
values: Object
|
|
3723
3548
|
},
|
|
3724
3549
|
setup(props) {
|
|
3725
|
-
return () =>
|
|
3550
|
+
return () => getTableRow$1(props.config, props.values);
|
|
3726
3551
|
}
|
|
3727
3552
|
};
|
|
3728
3553
|
|
|
@@ -3964,7 +3789,7 @@ function getTableRow(config, values, rowController) {
|
|
|
3964
3789
|
return vue.h("tr", { class: 'widget-table__row widget-table-row' }, arrayCells);
|
|
3965
3790
|
}
|
|
3966
3791
|
function getTableCell(cell, rowValue, controller) {
|
|
3967
|
-
const { name, value } = List$
|
|
3792
|
+
const { name, value } = List$1.getCellInfo(cell, rowValue);
|
|
3968
3793
|
const attributes = {
|
|
3969
3794
|
onClick: [],
|
|
3970
3795
|
class: ['widget-table__cell widget-table-cell']
|
|
@@ -5175,6 +5000,33 @@ function useCommunication(communication) {
|
|
|
5175
5000
|
};
|
|
5176
5001
|
}
|
|
5177
5002
|
|
|
5003
|
+
/**
|
|
5004
|
+
* @param {String} str
|
|
5005
|
+
*
|
|
5006
|
+
* @return {String} prettyDate
|
|
5007
|
+
* */
|
|
5008
|
+
function prettyDateWithTime(str) {
|
|
5009
|
+
return prettyDate(str, 'YYYY/MM/DD HH:mm:ss');
|
|
5010
|
+
}
|
|
5011
|
+
/**
|
|
5012
|
+
* @param {String} str
|
|
5013
|
+
* @param {String} format
|
|
5014
|
+
*
|
|
5015
|
+
* @return {String} prettyDate
|
|
5016
|
+
* */
|
|
5017
|
+
function prettyDate(str, format = 'YYYY/MM/DD') {
|
|
5018
|
+
if (!str)
|
|
5019
|
+
return "";
|
|
5020
|
+
try {
|
|
5021
|
+
const date = new Date(str);
|
|
5022
|
+
return dateAndTime__default["default"].format(date, format);
|
|
5023
|
+
}
|
|
5024
|
+
catch (e) {
|
|
5025
|
+
console.log(e);
|
|
5026
|
+
return 'Invalid date';
|
|
5027
|
+
}
|
|
5028
|
+
}
|
|
5029
|
+
|
|
5178
5030
|
/**
|
|
5179
5031
|
* @description Function check provided value for data filter format.
|
|
5180
5032
|
* @example {start: '2022-10-10'}
|
|
@@ -5656,7 +5508,7 @@ var index = {
|
|
|
5656
5508
|
exports.ApplicationManager = ApplicationManager;
|
|
5657
5509
|
exports.Communication = Communication;
|
|
5658
5510
|
exports.CoreError = CoreError;
|
|
5659
|
-
exports.List = List$
|
|
5511
|
+
exports.List = List$1;
|
|
5660
5512
|
exports.ListConfig = ListConfig;
|
|
5661
5513
|
exports.Manager = Manager;
|
|
5662
5514
|
exports.ModalValidation = script$5;
|
|
@@ -5,8 +5,6 @@ declare const _default: {
|
|
|
5
5
|
};
|
|
6
6
|
setup(props: any): () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
7
|
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}>[];
|
|
8
|
+
}>;
|
|
11
9
|
};
|
|
12
10
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eservices-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.503",
|
|
4
4
|
"description": "Core library",
|
|
5
5
|
"author": "",
|
|
6
6
|
"scripts": {
|
|
@@ -24,24 +24,19 @@
|
|
|
24
24
|
"@babel/preset-typescript": "^7.16.5",
|
|
25
25
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
26
26
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
27
|
-
"@rollup/plugin-typescript": "10.0.1",
|
|
28
27
|
"@types/bencode": "^2.0.1",
|
|
29
28
|
"@types/date-and-time": "^0.13.0",
|
|
30
29
|
"@types/jest": "^24.9.1",
|
|
31
30
|
"@types/object-hash": "^2.2.1",
|
|
32
|
-
"@vue/cli-plugin-typescript": "
|
|
33
|
-
"@vue/cli-plugin-unit-jest": "
|
|
34
|
-
"@vue/cli-service": "
|
|
31
|
+
"@vue/cli-plugin-typescript": "^5.0.8",
|
|
32
|
+
"@vue/cli-plugin-unit-jest": "^5.0.8",
|
|
33
|
+
"@vue/cli-service": "^5.0.8",
|
|
35
34
|
"@vue/compiler-sfc": "^3.0.0",
|
|
36
35
|
"@vue/test-utils": "^2.0.0-rc.18",
|
|
37
36
|
"babel-jest": "26.6.3",
|
|
38
|
-
"object-hash": "^3.0.0",
|
|
39
37
|
"postcss-import": "^14.0.2",
|
|
40
|
-
"rollup-plugin-filesize": "^9.1.2",
|
|
41
|
-
"rollup-plugin-import-css": "^3.0.2",
|
|
42
38
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
43
39
|
"rollup-plugin-postcss": "^4.0.2",
|
|
44
|
-
"rollup-plugin-styles": "^4.0.0",
|
|
45
40
|
"rollup-plugin-typescript2": "0.34.1",
|
|
46
41
|
"rollup-plugin-vue": "6.0.0",
|
|
47
42
|
"tslib": "^2.3.1",
|
|
@@ -1,61 +0,0 @@
|
|
|
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 };
|