aloha-vue 1.0.110 → 1.0.112

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.
@@ -56,6 +56,12 @@ export default {
56
56
  hide: true,
57
57
  footerPath: "hola",
58
58
  },
59
+ {
60
+ label: "Slot",
61
+ id: "slot",
62
+ slot: "slot1",
63
+ // hide: true,
64
+ },
59
65
  {
60
66
  label: "Obj",
61
67
  id: "obj",
@@ -98,12 +104,7 @@ export default {
98
104
  path: "geld",
99
105
  footerPath: "geld",
100
106
  },
101
- {
102
- label: "Slot",
103
- id: "slot",
104
- slot: "slot1",
105
- // hide: true,
106
- },
107
+
107
108
  {
108
109
  label: "Slot2",
109
110
  id: "slot2",
@@ -24,7 +24,9 @@ div
24
24
  template(
25
25
  v-slot:slot1="vm"
26
26
  )
27
- pre {{ vm.column }}
27
+ router-link(
28
+ :to="{ name: 'PageTabs' }"
29
+ ) Tabs
28
30
 
29
31
  template(
30
32
  v-slot:tableDetailsLabel="vm"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.110",
4
+ "version": "1.0.112",
5
5
  "author": "Ilia Brykin",
6
6
  "scripts": {
7
7
  "build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
@@ -17,6 +17,7 @@ export default {
17
17
  provide() {
18
18
  return {
19
19
  classBody: computed(() => this.classBody),
20
+ classHeader: computed(() => this.classHeader),
20
21
  classButton: computed(() => this.classButton),
21
22
  disabled: computed(() => this.disabled),
22
23
  id: computed(() => this.id),
@@ -26,6 +27,7 @@ export default {
26
27
  keyLabel: computed(() => this.keyLabel),
27
28
  keyContent: computed(() => this.keyContent),
28
29
  keyClassBody: computed(() => this.keyClassBody),
30
+ keyClassHeader: computed(() => this.keyClassHeader),
29
31
  keyIsRender: computed(() => this.keyIsRender),
30
32
  readonly: computed(() => this.readonly),
31
33
  withGap: computed(() => this.withGap),
@@ -73,6 +75,11 @@ export default {
73
75
  required: false,
74
76
  default: undefined,
75
77
  },
78
+ keyClassHeader: {
79
+ type: String,
80
+ required: false,
81
+ default: undefined,
82
+ },
76
83
  keyIsRender: {
77
84
  type: String,
78
85
  required: false,
@@ -101,6 +108,11 @@ export default {
101
108
  required: false,
102
109
  default: "",
103
110
  },
111
+ classHeader: {
112
+ type: [String, Object],
113
+ required: false,
114
+ default: "",
115
+ },
104
116
  withGap: {
105
117
  type: Boolean,
106
118
  required: false,
@@ -35,6 +35,7 @@ export default {
35
35
  emits: ["toggle"],
36
36
  inject: [
37
37
  "classBody",
38
+ "classHeader",
38
39
  "classButton",
39
40
  "disabled",
40
41
  "id",
@@ -53,6 +54,7 @@ export default {
53
54
  const parentIndexes = toRef(props, "parentIndexes");
54
55
 
55
56
  const keyClassBody = inject("keyClassBody");
57
+ const keyClassHeader = inject("keyClassHeader");
56
58
  const keyIsRender = inject("keyIsRender");
57
59
 
58
60
  const classBodyLocal = computed(() => {
@@ -62,6 +64,13 @@ export default {
62
64
  return undefined;
63
65
  });
64
66
 
67
+ const classHeaderLocal = computed(() => {
68
+ if (keyClassHeader.value) {
69
+ return get(item.value, keyClassHeader.value);
70
+ }
71
+ return undefined;
72
+ });
73
+
65
74
  const indexesForOpen = inject("indexesForOpen");
66
75
  const parentIndexesString = computed(() => {
67
76
  return parentIndexes.value.join(".");
@@ -90,6 +99,7 @@ export default {
90
99
 
91
100
  return {
92
101
  classBodyLocal,
102
+ classHeaderLocal,
93
103
  currentIndex,
94
104
  isOpen,
95
105
  isRender,
@@ -173,7 +183,7 @@ export default {
173
183
  class: "a_accordion__item",
174
184
  }, [
175
185
  h("div", {
176
- class: "a_accordion__header",
186
+ class: ["a_accordion__header", this.classHeader, this.classHeaderLocal],
177
187
  }, [
178
188
  h(this.buttonTag, this.buttonAttributes, [
179
189
  this.$slots.accordionButton && this.$slots.accordionButton({
@@ -5,12 +5,16 @@ import {
5
5
 
6
6
  import ColumnStylesAPI from "../compositionAPI/ColumnStylesAPI";
7
7
 
8
+ import {
9
+ isClickOnLinkOrButton
10
+ } from "../utils/utils";
8
11
  import {
9
12
  cloneDeep,
10
13
  forEach,
11
14
  get,
12
15
  isPlainObject,
13
- isString, isUndefined,
16
+ isString,
17
+ isUndefined,
14
18
  } from "lodash-es";
15
19
 
16
20
 
@@ -114,10 +118,15 @@ export default {
114
118
  style: this.columnsStyles,
115
119
  };
116
120
  if (this.hasPreview && !this.isFooter) {
117
- ATTRIBUTES.onClick = () => this.onTogglePreview({
118
- row: this.row,
119
- rowIndex: this.rowIndex,
120
- });
121
+ ATTRIBUTES.onClick = $event => {
122
+ if (isClickOnLinkOrButton($event)) {
123
+ return;
124
+ }
125
+ this.onTogglePreview({
126
+ row: this.row,
127
+ rowIndex: this.rowIndex,
128
+ });
129
+ };
121
130
  }
122
131
  return ATTRIBUTES;
123
132
  },
@@ -1,3 +1,7 @@
1
+ import {
2
+ forEach,
3
+ } from "lodash-es";
4
+
1
5
  export function getModelColumnsVisibleDefault(columns) {
2
6
  const MODEL_COLUMNS_VISIBLE = [];
3
7
  columns.forEach(column => {
@@ -11,3 +15,19 @@ export function getModelColumnsVisibleDefault(columns) {
11
15
  export function getModelColumnsOrderingDefault(columns) {
12
16
  return columns.map(column => column.id);
13
17
  }
18
+
19
+ export function isClickOnLinkOrButton($event) {
20
+ if ($event && $event.path) {
21
+ let isLink = false;
22
+ forEach($event.path, item => {
23
+ if (item.tagName === "A" || item.tagName === "BUTTON") {
24
+ isLink = true;
25
+ return false;
26
+ } else if (item.tagName === "TD") {
27
+ return false;
28
+ }
29
+ });
30
+
31
+ return isLink;
32
+ }
33
+ }