aloha-vue 1.2.18 → 1.2.20

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 CHANGED
@@ -14,7 +14,7 @@
14
14
  "Vue.js"
15
15
  ],
16
16
  "homepage": "https://github.com/ilia-brykin/aloha/#README.md",
17
- "version": "1.2.18",
17
+ "version": "1.2.20",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -280,6 +280,11 @@ export default {
280
280
  required: false,
281
281
  default: true,
282
282
  },
283
+ rowClass: {
284
+ type: [String, Object, Function],
285
+ required: false,
286
+ default: undefined,
287
+ },
283
288
  rowsCountRenderPerTick: {
284
289
  type: Number,
285
290
  required: false,
@@ -748,6 +753,7 @@ export default {
748
753
  disabledPreview: this.disabledPreview,
749
754
  disabledRowActions: this.disabledRowActions,
750
755
  row,
756
+ rowClass: this.rowClass,
751
757
  rowIndex,
752
758
  isPreviewDownOpen: this.previewDownRowIndexes[rowIndex],
753
759
  isRowActionsStickyLocal: this.isRowActionsStickyLocal,
@@ -780,6 +786,7 @@ export default {
780
786
  disabledPreview: this.disabledPreview,
781
787
  disabledRowActions: this.disabledRowActions,
782
788
  row,
789
+ rowClass: this.rowClass,
783
790
  rowIndex,
784
791
  isRowActionsStickyLocal: this.isRowActionsStickyLocal,
785
792
  rowActionsClass: this.rowActionsClass,
@@ -262,6 +262,10 @@ export default {
262
262
  h("span", "aloha"),
263
263
  ],
264
264
  }),
265
+ this.$slots.tableActionsAppend && this.$slots.tableActionsAppend({
266
+ isMultipleActionsActive: this.isMultipleActionsActive,
267
+ modelView: this.modelView,
268
+ }),
265
269
  ]),
266
270
  ]),
267
271
  this.isMultipleActionsActive && h("div", {
@@ -298,10 +302,6 @@ export default {
298
302
  }),
299
303
  ]),
300
304
  ]),
301
- this.$slots.tableActionsAppend && this.$slots.tableActionsAppend({
302
- isMultipleActionsActive: this.isMultipleActionsActive,
303
- modelView: this.modelView,
304
- }),
305
305
  h("div", {
306
306
  class: "a_table__multiple_panel__actions",
307
307
  }, [
@@ -59,6 +59,11 @@ export default {
59
59
  required: false,
60
60
  default: undefined,
61
61
  },
62
+ rowClass: {
63
+ type: [String, Object, Function],
64
+ required: false,
65
+ default: undefined,
66
+ },
62
67
  rowIndex: {
63
68
  type: Number,
64
69
  required: true,
@@ -3,8 +3,11 @@ import {
3
3
  inject,
4
4
  toRef,
5
5
  } from "vue";
6
+ import { isFunction } from "lodash-es";
6
7
 
7
8
  export default function AttributesAPI(props) {
9
+ const row = toRef(props, "row");
10
+ const rowClass = toRef(props, "rowClass");
8
11
  const rowIndex = toRef(props, "rowIndex");
9
12
 
10
13
  const hasPreview = inject("hasPreview");
@@ -26,11 +29,25 @@ export default function AttributesAPI(props) {
26
29
  rowIndex.value === previewRightRowIndexLast.value;
27
30
  });
28
31
 
29
- const rowClass = computed(() => {
30
- return ["a_table__row a_table__row_hover", {
31
- a_table__row_focus: isPreviewRightForCurrentRowOpen.value,
32
- a_table__row_focus_was: isPreviewRightForCurrentRowWasOpen.value,
33
- }];
32
+ const rowClassLocal = computed(() => {
33
+ if (isFunction(rowClass.value)) {
34
+ return rowClass.value({
35
+ row: row.value,
36
+ rowindex: rowIndex.value,
37
+ });
38
+ }
39
+ return rowClass.value;
40
+ });
41
+
42
+ const rowClassComputed = computed(() => {
43
+ return [
44
+ "a_table__row a_table__row_hover",
45
+ {
46
+ a_table__row_focus: isPreviewRightForCurrentRowOpen.value,
47
+ a_table__row_focus_was: isPreviewRightForCurrentRowWasOpen.value,
48
+ },
49
+ rowClassLocal.value
50
+ ];
34
51
  });
35
52
 
36
53
  const roleLocal = computed(() => {
@@ -40,7 +57,7 @@ export default function AttributesAPI(props) {
40
57
  const rowAttributes = computed(() => {
41
58
  const ATTRIBUTES = {
42
59
  id: rowId.value,
43
- class: rowClass.value,
60
+ class: rowClassComputed.value,
44
61
  role: roleLocal.value,
45
62
  };
46
63
  if (hasPreview.value) {