aloha-vue 1.2.243 → 1.2.245

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.243",
17
+ "version": "1.2.245",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -359,8 +359,12 @@ export default {
359
359
  round: [],
360
360
  };
361
361
 
362
- if (props.type in validSubTypes) {
363
- return isNil(value) || validSubTypes[props.type].indexOf(value) !== -1;
362
+ if (props) {
363
+ if (props.type in validSubTypes) {
364
+ return isNil(value) || validSubTypes[props.type].indexOf(value) !== -1;
365
+ }
366
+ } else {
367
+ return ["square", "circle", "square-bordered", "circle-bordered"].indexOf(value) !== -1;
364
368
  }
365
369
 
366
370
  return false;
@@ -243,6 +243,15 @@ export default {
243
243
  type: Boolean,
244
244
  required: false,
245
245
  },
246
+ isTreeCollapsible: {
247
+ type: Boolean,
248
+ required: false,
249
+ default: true,
250
+ },
251
+ isTreeOpened: {
252
+ type: Boolean,
253
+ required: false,
254
+ },
246
255
  keyCountAllRowsInData: {
247
256
  type: String,
248
257
  required: false,
@@ -971,6 +980,8 @@ export default {
971
980
  isPreviewDownOpen: this.previewDownRowIds[ROW_ID],
972
981
  isRowActionsStickyLocal: this.isRowActionsStickyLocal,
973
982
  isTree: this.isTree,
983
+ isTreeCollapsible: this.isTreeCollapsible,
984
+ isTreeOpened: this.isTreeOpened,
974
985
  keyChildren: this.keyChildren,
975
986
  keyId: this.keyId,
976
987
  level: 1,
@@ -1019,6 +1030,8 @@ export default {
1019
1030
  isFooter: true,
1020
1031
  isRowActionsStickyLocal: this.isRowActionsStickyLocal,
1021
1032
  isTree: this.isTree,
1033
+ isTreeCollapsible: this.isTreeCollapsible,
1034
+ isTreeOpened: this.isTreeOpened,
1022
1035
  keyChildren: this.keyChildren,
1023
1036
  keyId: this.keyId,
1024
1037
  level: 1,
@@ -77,6 +77,15 @@ export default {
77
77
  type: Boolean,
78
78
  required: false,
79
79
  },
80
+ isTreeCollapsible: {
81
+ type: Boolean,
82
+ required: false,
83
+ default: true,
84
+ },
85
+ isTreeOpened: {
86
+ type: Boolean,
87
+ required: false,
88
+ },
80
89
  keyChildren: {
81
90
  type: String,
82
91
  required: false,
@@ -132,6 +141,7 @@ export default {
132
141
 
133
142
  const {
134
143
  ariaExpanded,
144
+ initIsChildrenOpen,
135
145
  isOneOfParentsCloseForChildren,
136
146
  rowClassChildren,
137
147
  toggleChildren,
@@ -177,6 +187,8 @@ export default {
177
187
  toggleCheckbox,
178
188
  } = CheckboxAPI(props, context);
179
189
 
190
+ initIsChildrenOpen();
191
+
180
192
  return {
181
193
  ariaExpanded,
182
194
  ariaTreeAttributes,
@@ -239,7 +251,7 @@ export default {
239
251
  row: this.row,
240
252
  rowIndex: this.rowIndex,
241
253
  isFooter: this.isFooter,
242
- showIconChildren: !!(this.hasChildren && columnIndex === 0),
254
+ showIconChildren: !!(this.isTreeCollapsible && this.hasChildren && columnIndex === 0),
243
255
  }, this.$slots);
244
256
  });
245
257
  }
@@ -267,13 +279,15 @@ export default {
267
279
  isFooter: this.isFooter,
268
280
  }) :
269
281
  "",
270
- this.hasChildren && h(AElement, {
271
- "aria-hidden": true,
272
- class: "a_table__row_level__icon",
273
- classDefault: "",
274
- iconLeft: "CaretRightFill",
275
- type: "text",
276
- }),
282
+ (this.isTreeCollapsible && this.hasChildren) ?
283
+ h(AElement, {
284
+ "aria-hidden": true,
285
+ class: "a_table__row_level__icon",
286
+ classDefault: "",
287
+ iconLeft: "CaretRightFill",
288
+ type: "text",
289
+ }) :
290
+ "",
277
291
  h("dl", {
278
292
  class: "a_table_mobile__dl",
279
293
  }, tds),
@@ -351,6 +365,8 @@ export default {
351
365
  isPreviewDownOpen: false,
352
366
  isRowActionsStickyLocal: this.isRowActionsStickyLocal,
353
367
  isTree: this.isTree,
368
+ isTreeCollapsible: this.isTreeCollapsible,
369
+ isTreeOpened: this.isTreeOpened,
354
370
  keyChildren: this.keyChildren,
355
371
  keyId: this.keyId,
356
372
  level: this.levelForChildren,
@@ -23,6 +23,7 @@ export default function AttributesAPI(props, {
23
23
  const disabledPreview = toRef(props, "disabledPreview");
24
24
  const disabledPreviewRowCallback = toRef(props, "disabledPreviewRowCallback");
25
25
  const isFooter = toRef(props, "isFooter");
26
+ const isTreeCollapsible = toRef(props, "isTreeCollapsible");
26
27
  const row = toRef(props, "row");
27
28
  const rowClass = toRef(props, "rowClass");
28
29
  const rowIndex = toRef(props, "rowIndex");
@@ -97,7 +98,9 @@ export default function AttributesAPI(props, {
97
98
  };
98
99
 
99
100
  const eventsLocal = computed(() => {
100
- if ((hasChildren.value || hasPreviewLocal.value) && !disabledPreviewRow.value) {
101
+ if (((isTreeCollapsible.value && hasChildren.value)
102
+ || hasPreviewLocal.value) &&
103
+ !disabledPreviewRow.value) {
101
104
  return {
102
105
  tabindex: 0,
103
106
  onClick: onClickRow,
@@ -7,6 +7,8 @@ export default function ChildrenToggleAPI(props, {
7
7
  hasChildren = computed(() => false),
8
8
  }) {
9
9
  const isOneOfParentsClose = toRef(props, "isOneOfParentsClose");
10
+ const isTreeCollapsible = toRef(props, "isTreeCollapsible");
11
+ const isTreeOpened = toRef(props, "isTreeOpened");
10
12
 
11
13
  const isChildrenOpen = ref(false);
12
14
 
@@ -34,9 +36,16 @@ export default function ChildrenToggleAPI(props, {
34
36
  isChildrenOpen.value = !isChildrenOpen.value;
35
37
  };
36
38
 
39
+ const initIsChildrenOpen = () => {
40
+ if (!isTreeCollapsible.value || isTreeOpened.value) {
41
+ isChildrenOpen.value = true;
42
+ }
43
+ };
44
+
37
45
 
38
46
  return {
39
47
  ariaExpanded,
48
+ initIsChildrenOpen,
40
49
  isOneOfParentsCloseForChildren,
41
50
  rowClassChildren,
42
51
  toggleChildren,
@@ -243,8 +243,12 @@ export default {
243
243
  round: [],
244
244
  };
245
245
 
246
- if (props.type in validSubTypes) {
247
- return isNil(value) || validSubTypes[props.type].indexOf(value) !== -1;
246
+ if (props) {
247
+ if (props.type in validSubTypes) {
248
+ return isNil(value) || validSubTypes[props.type].indexOf(value) !== -1;
249
+ }
250
+ } else {
251
+ return ["square", "circle", "square-bordered", "circle-bordered"].indexOf(value) !== -1;
248
252
  }
249
253
 
250
254
  return false;
@@ -27,3 +27,8 @@
27
27
  padding-bottom: var(--a_modal_padding);
28
28
  }
29
29
  }
30
+ .a_modal_footer_actions {
31
+ display: flex;
32
+ flex-direction: row;
33
+ align-items: center;
34
+ }