oolib 2.64.9 → 2.64.10
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.
|
@@ -9,37 +9,39 @@ var parseMetaBlockConfig = function (_a) {
|
|
|
9
9
|
if (!config)
|
|
10
10
|
return [];
|
|
11
11
|
//else
|
|
12
|
-
return config
|
|
12
|
+
return config
|
|
13
|
+
.map(function (d) {
|
|
13
14
|
var key = d.key, valuePath = d.valuePath, prefix = d.prefix, icon = d.icon, linkConfig = d.linkConfig;
|
|
14
|
-
var
|
|
15
|
+
var display;
|
|
15
16
|
switch (key) {
|
|
16
17
|
case "name":
|
|
17
|
-
|
|
18
|
-
if (
|
|
18
|
+
display = (0, getVal_1.getVal)(data, valuePath);
|
|
19
|
+
if (display) {
|
|
19
20
|
//reduce surname down to initials
|
|
20
|
-
var split =
|
|
21
|
+
var split = display.split(" ");
|
|
21
22
|
var name_1 = split[0];
|
|
22
23
|
var surname = split[1];
|
|
23
|
-
|
|
24
|
+
display = "".concat(name_1).concat(surname ? " ".concat(surname[0], ".") : "");
|
|
24
25
|
}
|
|
25
26
|
break;
|
|
26
27
|
case "date":
|
|
27
|
-
|
|
28
|
+
display = (0, createFormattedDate_1.createFormattedDate)((0, getVal_1.getVal)(data, valuePath));
|
|
28
29
|
break;
|
|
29
30
|
case "text":
|
|
30
31
|
default:
|
|
31
|
-
|
|
32
|
+
display = (0, getVal_1.getVal)(data, valuePath);
|
|
32
33
|
}
|
|
33
34
|
if (prefix) {
|
|
34
|
-
|
|
35
|
+
display = "".concat(localize(prefix)).concat(display);
|
|
35
36
|
}
|
|
36
|
-
var toReturn =
|
|
37
|
+
var toReturn = { display: display };
|
|
37
38
|
//now to incorporate things like icons, imgs, links
|
|
38
39
|
if (icon)
|
|
39
40
|
toReturn.icon = icon;
|
|
40
41
|
if (linkConfig)
|
|
41
42
|
toReturn.to = (0, stitchLink_1.stitchLink)({ data: data, config: linkConfig });
|
|
42
43
|
return toReturn;
|
|
43
|
-
})
|
|
44
|
+
})
|
|
45
|
+
.filter(function (d) { return d.display !== undefined; });
|
|
44
46
|
};
|
|
45
47
|
exports.parseMetaBlockConfig = parseMetaBlockConfig;
|