oolib 2.64.9 → 2.64.11
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.
|
@@ -47,8 +47,10 @@ var STYLED_SANS_2 = (0, styled_components_1.default)(Typo_1.SANS_2)(templateObje
|
|
|
47
47
|
return disabled ? themes_1.colors.greyColor40 : themes_1.colors.greyColor100;
|
|
48
48
|
});
|
|
49
49
|
var StyledSeparator = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 0.3rem;\n height: 0.3rem;\n border-radius: 50%;\n background-color: ", ";\n"], ["\n width: 0.3rem;\n height: 0.3rem;\n border-radius: 50%;\n background-color: ", ";\n"])), function (_a) {
|
|
50
|
-
var disabled = _a.disabled;
|
|
51
|
-
return disabled
|
|
50
|
+
var disabled = _a.disabled, invert = _a.invert;
|
|
51
|
+
return disabled
|
|
52
|
+
? themes_1.colors.greyColor40
|
|
53
|
+
: invert ? themes_1.colors.white : themes_1.colors.greyColor100;
|
|
52
54
|
});
|
|
53
55
|
var MetaBlock = function (_a) {
|
|
54
56
|
var data = _a.data, config = _a.config, disabled = _a.disabled, _b = _a.align, align = _b === void 0 ? "left" : _b, invert = _a.invert;
|
|
@@ -59,8 +61,8 @@ var MetaBlock = function (_a) {
|
|
|
59
61
|
var genText = function (_a) {
|
|
60
62
|
var icon = _a.icon, display = _a.display;
|
|
61
63
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
62
|
-
icon && react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: icon, size: 15, color: invert ? themes_1.colors.white : themes_1.colors.greyColor100 }),
|
|
63
|
-
react_1.default.createElement(STYLED_SANS_2, { disabled: disabled, capitalize: true }, display)));
|
|
64
|
+
icon && react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: icon, size: 15, color: invert ? themes_1.colors.white : themes_1.colors.greyColor100, weight: "regular" }),
|
|
65
|
+
react_1.default.createElement(STYLED_SANS_2, { invert: invert, disabled: disabled, capitalize: true }, display)));
|
|
64
66
|
};
|
|
65
67
|
var genLink = function (_a) {
|
|
66
68
|
var icon = _a.icon, display = _a.display, to = _a.to;
|
|
@@ -72,7 +74,7 @@ var MetaBlock = function (_a) {
|
|
|
72
74
|
react_1.default.createElement(StyledMetaWrapper, { style: { maxWidth: 100 / value.length + "%" } }, v.to
|
|
73
75
|
? genLink({ display: v.display, to: v.to, icon: v.icon })
|
|
74
76
|
: genText({ icon: v.icon, display: v.display })),
|
|
75
|
-
i + 1 === value.length ? null : (react_1.default.createElement(StyledSeparator, { disabled: disabled })))); })));
|
|
77
|
+
i + 1 === value.length ? null : (react_1.default.createElement(StyledSeparator, { invert: invert, disabled: disabled })))); })));
|
|
76
78
|
};
|
|
77
79
|
exports.default = MetaBlock;
|
|
78
80
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -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;
|