aloha-vue 1.0.124 → 1.0.126

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.124",
4
+ "version": "1.0.126",
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"
@@ -482,7 +482,10 @@ export default {
482
482
  if (this.modelColumnsOrdering.length) {
483
483
  this.modelColumnsOrderingLocal = cloneDeep(this.modelColumnsOrdering);
484
484
  } else {
485
- this.changeColumnsOrdering({ modelColumnsOrderingLocal: getModelColumnsOrderingDefault(this.columns) });
485
+ this.changeColumnsOrdering({
486
+ modelColumnsOrderingLocal: getModelColumnsOrderingDefault(this.columns),
487
+ isFirst: true,
488
+ });
486
489
  }
487
490
  },
488
491
 
@@ -501,7 +504,7 @@ export default {
501
504
  this.closePreviewAll();
502
505
  },
503
506
 
504
- changeColumnsOrdering({ modelColumnsOrderingLocal, columnIndexDraggable, columnIndexOver }) {
507
+ changeColumnsOrdering({ modelColumnsOrderingLocal, columnIndexDraggable, columnIndexOver, isFirst }) {
505
508
  if (columnIndexDraggable === columnIndexOver && !modelColumnsOrderingLocal) {
506
509
  return;
507
510
  }
@@ -516,6 +519,7 @@ export default {
516
519
  columnIndexDraggable,
517
520
  columnIndexOver,
518
521
  modelColumnsOrdering: cloneDeep(this.modelColumnsOrderingLocal),
522
+ isFirst,
519
523
  });
520
524
  this.checkVisibleColumns();
521
525
  },
@@ -142,9 +142,18 @@ export default {
142
142
  const TO = cloneDeep(this.column.to);
143
143
  const PARAMS = TO.params || {};
144
144
  if (this.column.to.paramsDynamic) {
145
+ let hasParamsDynamicError = false;
145
146
  forEach(this.column.to.paramsDynamic, (value, key) => {
146
- PARAMS[key] = get(this.row, value);
147
+ const PARAMS_VALUE = get(this.row, value);
148
+ if (isUndefined(PARAMS_VALUE)) {
149
+ hasParamsDynamicError = true;
150
+ return false;
151
+ }
152
+ PARAMS[key] = PARAMS_VALUE;
147
153
  });
154
+ if (hasParamsDynamicError) {
155
+ return undefined;
156
+ }
148
157
  }
149
158
  TO.params = PARAMS;
150
159
  return TO;
@@ -177,7 +186,7 @@ export default {
177
186
  row: this.row,
178
187
  rowIndex: this.rowIndex,
179
188
  rows: this.rowsLocal,
180
- }) : this.isLink ? [
189
+ }) : (this.isLink && this.toLocal) ? [
181
190
  h(resolveComponent("RouterLink"), {
182
191
  class: [this.column.class, this.classForLink],
183
192
  to: this.toLocal,
@@ -7,7 +7,7 @@ import AIcon from "../../AIcon/AIcon";
7
7
  import {
8
8
  cloneDeep,
9
9
  forEach, get,
10
- isFunction, isPlainObject, isString,
10
+ isFunction, isPlainObject, isString, isUndefined,
11
11
  } from "lodash-es";
12
12
 
13
13
  export default {
@@ -99,9 +99,18 @@ export default {
99
99
  const TO = cloneDeep(this.rowAction.to);
100
100
  const PARAMS = TO.params || {};
101
101
  if (this.rowAction.to.paramsDynamic) {
102
+ let hasParamsDynamicError = false;
102
103
  forEach(this.rowAction.to.paramsDynamic, (value, key) => {
103
- PARAMS[key] = get(this.row, value);
104
+ const PARAMS_VALUE = get(this.row, value);
105
+ if (isUndefined(PARAMS_VALUE)) {
106
+ hasParamsDynamicError = true;
107
+ return false;
108
+ }
109
+ PARAMS[key] = PARAMS_VALUE;
104
110
  });
111
+ if (hasParamsDynamicError) {
112
+ return undefined;
113
+ }
105
114
  }
106
115
  TO.params = PARAMS;
107
116
  return TO;
@@ -181,12 +190,14 @@ export default {
181
190
  if (this.rowAction.type === "link") {
182
191
  return h("li", null, [
183
192
  this.rowAction.to ?
184
- h(resolveComponent("RouterLink"), {
185
- id: this.idLocal,
186
- class: ["a_dropdown__item a_table__row_action", this.classLocal],
187
- to: this.toLocal,
188
- ...this.targetObject,
189
- }, () => CONTENT) :
193
+ this.toLocal ?
194
+ h(resolveComponent("RouterLink"), {
195
+ id: this.idLocal,
196
+ class: ["a_dropdown__item a_table__row_action", this.classLocal],
197
+ to: this.toLocal,
198
+ ...this.targetObject,
199
+ }, () => CONTENT) :
200
+ "" :
190
201
  h("a", {
191
202
  id: this.idLocal,
192
203
  class: ["a_dropdown__item a_table__row_action", this.classLocal],