aloha-vue 1.0.79 → 1.0.81
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
package/src/ATable/ATable.js
CHANGED
|
@@ -58,8 +58,8 @@ export default function AFiltersAPI() {
|
|
|
58
58
|
return Link(value, { param, target });
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const filterList = (value, { isHtml = true, listClass = "
|
|
62
|
-
return list(value, { isHtml, listClass });
|
|
61
|
+
const filterList = (value, { isHtml = true, listClass = "a_list_without_styles", keyLabel = "" } = {}) => {
|
|
62
|
+
return list(value, { isHtml, listClass, keyLabel });
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
const filterPropertyByValue = (value, { mapping = {}, defaultValue = "" } = {}) => {
|
package/src/filters/list.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isArray,
|
|
3
3
|
forEach,
|
|
4
|
+
get,
|
|
4
5
|
} from "lodash-es";
|
|
5
6
|
|
|
6
|
-
export default function(value, { isHtml = true, listClass = "
|
|
7
|
+
export default function(value, { isHtml = true, listClass = "a_list_without_styles", keyLabel = "" } = {}) {
|
|
7
8
|
if (!isArray(value)) {
|
|
8
9
|
return value;
|
|
9
10
|
}
|
|
@@ -13,12 +14,14 @@ export default function(value, { isHtml = true, listClass = "list-unstyled" } =
|
|
|
13
14
|
let result = "";
|
|
14
15
|
if (isHtml === false || isHtml === "false") {
|
|
15
16
|
forEach(value, (item, index) => {
|
|
16
|
-
|
|
17
|
+
const ITEM_TEXT = keyLabel ? get(item, keyLabel) : item;
|
|
18
|
+
result += `${ index !== 0 ? ", " : "" }${ ITEM_TEXT }`;
|
|
17
19
|
});
|
|
18
20
|
return result;
|
|
19
21
|
}
|
|
20
22
|
forEach(value, item => {
|
|
21
|
-
|
|
23
|
+
const ITEM_TEXT = keyLabel ? get(item, keyLabel) : item;
|
|
24
|
+
result += `<li>${ ITEM_TEXT }</li>`;
|
|
22
25
|
});
|
|
23
26
|
return `<ul${ listClass ? ` class="${ listClass }"` : "" }>${ result }</ul>`;
|
|
24
27
|
}
|