eservices-core 1.0.401 → 1.0.402
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 -3
- package/dist/index.js +18 -12
- package/package.json +1 -1
package/dist/classes/_List.d.ts
CHANGED
|
@@ -7,13 +7,11 @@ export interface ListCell {
|
|
|
7
7
|
name?: string | string[];
|
|
8
8
|
value?: (x: Values, obj: ValuesInterface) => Values;
|
|
9
9
|
link?: (x: Values, obj: ValuesInterface) => any;
|
|
10
|
-
type?: "date" | "dateWithTime" | 'toggle' | 'select';
|
|
10
|
+
type?: "date" | "dateWithTime" | 'toggle' | 'select' | 'edit' | 'remove';
|
|
11
11
|
icon?: string;
|
|
12
12
|
class?: string | string[];
|
|
13
13
|
onClick?: (x: Values, obj: TableRowController) => void;
|
|
14
14
|
href?: (x: Values, obj: ValuesInterface) => string;
|
|
15
|
-
edit?: boolean;
|
|
16
|
-
delete?: boolean;
|
|
17
15
|
}
|
|
18
16
|
export interface ListParams extends FormParams {
|
|
19
17
|
config: ComputedRef<ListCell[]>;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.402
|
|
3
3
|
* (c) 2022 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -3619,7 +3619,9 @@ class Table extends List$1 {
|
|
|
3619
3619
|
return this.changes.update.length || this.changes.new.length || this.changes.delete.length;
|
|
3620
3620
|
}
|
|
3621
3621
|
static getCell(cellConfig, rowValues, cellName, cellValue, table) {
|
|
3622
|
-
const handlers = {
|
|
3622
|
+
const handlers = {
|
|
3623
|
+
onClick: []
|
|
3624
|
+
};
|
|
3623
3625
|
const outputNodes = [];
|
|
3624
3626
|
const cellNodeChildren = [];
|
|
3625
3627
|
const cellClasses = ['widget-table__cell'];
|
|
@@ -3627,15 +3629,25 @@ class Table extends List$1 {
|
|
|
3627
3629
|
switch (cell.type) {
|
|
3628
3630
|
case "toggle": {
|
|
3629
3631
|
cell.icon = "angle-small-right";
|
|
3630
|
-
handlers.onClick
|
|
3631
|
-
console.log('+');
|
|
3632
|
+
handlers.onClick.push(() => {
|
|
3632
3633
|
table.toggleForm(rowValues[Table.INDEX_FIELD_NAME]);
|
|
3633
|
-
};
|
|
3634
|
+
});
|
|
3635
|
+
break;
|
|
3636
|
+
}
|
|
3637
|
+
case "edit": {
|
|
3638
|
+
handlers.onClick.push(() => table.activateForm(rowValues[Table.INDEX_FIELD_NAME]));
|
|
3639
|
+
cell.icon = 'edit';
|
|
3640
|
+
break;
|
|
3641
|
+
}
|
|
3642
|
+
case "remove": {
|
|
3643
|
+
handlers.onClick.push(() => table.tableController.delete(rowValues[Table.INDEX_FIELD_NAME]));
|
|
3644
|
+
cell.icon = 'remove';
|
|
3634
3645
|
break;
|
|
3635
3646
|
}
|
|
3636
3647
|
}
|
|
3637
3648
|
if (cell.onClick) {
|
|
3638
|
-
|
|
3649
|
+
// @ts-ignore
|
|
3650
|
+
handlers.onClick.push(() => cell.onClick(rowValues));
|
|
3639
3651
|
}
|
|
3640
3652
|
if (cell.link) {
|
|
3641
3653
|
cellNodeChildren.push(vue.h(vueRouter.RouterLink, {
|
|
@@ -3773,12 +3785,6 @@ class Table extends List$1 {
|
|
|
3773
3785
|
* БЫЛИ ДОБАВЛЕНЫ ДВА СВОЙСТВА: edit: boolean, remove: boolean
|
|
3774
3786
|
* ПРИ УСТАНОВКЕ ЛЮБОГО ИЗ НИХ, НА ВЫБРАННУЮ ЯЧЕЙКУ ВЕШАЕТСЯ ЭВЕНТ
|
|
3775
3787
|
* */
|
|
3776
|
-
if (elem.edit) {
|
|
3777
|
-
props.onClick = () => this.activateForm(values[Table.INDEX_FIELD_NAME]);
|
|
3778
|
-
}
|
|
3779
|
-
if (elem.delete) {
|
|
3780
|
-
props.onClick = () => this.tableController.delete(values[Table.INDEX_FIELD_NAME]);
|
|
3781
|
-
}
|
|
3782
3788
|
let elemNode = vue.h("td", Object.assign({ class: [
|
|
3783
3789
|
{
|
|
3784
3790
|
'cursor_pointer': elem.onClick
|