oolib 2.61.0 → 2.61.1
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/dist/components/Dropdowns/comps/OptionsSingle/styled.js +1 -1
- package/dist/components/VideoInput/comps/EmbedLinkModal.d.ts +9 -0
- package/dist/components/VideoInput/comps/EmbedLinkModal.js +35 -0
- package/dist/components/VideoInput/index.d.ts +16 -0
- package/dist/components/VideoInput/index.js +207 -0
- package/dist/components/VideoInput/styled.index.d.ts +6 -0
- package/dist/components/VideoInput/styled.index.js +27 -0
- package/dist/components/cards/CardContent/index.d.ts +10 -0
- package/dist/components/cards/CardContent/index.js +97 -0
- package/dist/components/cards/CardContent/styled.d.ts +5 -0
- package/dist/components/cards/CardContent/styled.js +41 -0
- package/dist/components/cards/ListContent/index.d.ts +12 -0
- package/dist/components/cards/ListContent/index.js +75 -0
- package/dist/components/cards/ListContent/styled.d.ts +10 -0
- package/dist/components/cards/ListContent/styled.js +67 -0
- package/dist/components/cards/comps/CardMetaBlock/index.d.ts +5 -0
- package/dist/components/cards/comps/CardMetaBlock/index.js +49 -0
- package/dist/components/cards/comps/LineClampWrapper/index.d.ts +7 -0
- package/dist/components/cards/comps/LineClampWrapper/index.js +26 -0
- package/dist/components/cards/utils/decideLinkCompAndTarget.d.ts +8 -0
- package/dist/components/cards/utils/decideLinkCompAndTarget.js +22 -0
- package/dist/components/cards/utils/dontRenderIfBothOnClickAndTo.d.ts +5 -0
- package/dist/components/cards/utils/dontRenderIfBothOnClickAndTo.js +18 -0
- package/dist/components/cards/utils/isExternalUrl.d.ts +1 -0
- package/dist/components/cards/utils/isExternalUrl.js +5 -0
- package/dist/components/cards/utils/parseCardConfig.d.ts +15 -0
- package/dist/components/cards/utils/parseCardConfig.js +56 -0
- package/dist/globalStyles/normalize.d.ts +1 -1
- package/dist/globalStyles/normalize.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -1
- package/dist/utils/momentjs/createFormattedDate.d.ts +1 -0
- package/dist/utils/momentjs/createFormattedDate.js +30 -0
- package/dist/utilsOolib/renderImagePlaceholderForOolibPreview.js +1 -1
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ exports.StyledOptionsWrapper = styled_components_1.default.ul(templateObject_1 |
|
|
|
54
54
|
return '24rem';
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
exports.StyledOption = styled_components_1.default.li(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n
|
|
57
|
+
exports.StyledOption = styled_components_1.default.li(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 1rem 2rem;\n ", "\n ", ";\n\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:first-of-type {\n margin-top: 1rem;\n }\n\n &:last-of-type {\n margin-bottom: 1rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n padding: 1rem 2rem;\n ", "\n ", ";\n\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:first-of-type {\n margin-top: 1rem;\n }\n\n &:last-of-type {\n margin-bottom: 1rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"])), function (_a) {
|
|
58
58
|
var S = _a.S;
|
|
59
59
|
return !S
|
|
60
60
|
? (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n \n min-height: 4rem;\n "], ["\n \n min-height: 4rem;\n "]))) : (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 3rem;\n "], ["\n height: 3rem;\n "])));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function EmbedLinkModal({ id, setShowEmbedLinkModal, value, createVideoPreview, canPlay, onChange, invert }: {
|
|
2
|
+
id: any;
|
|
3
|
+
setShowEmbedLinkModal: any;
|
|
4
|
+
value: any;
|
|
5
|
+
createVideoPreview: any;
|
|
6
|
+
canPlay: any;
|
|
7
|
+
onChange: any;
|
|
8
|
+
invert: any;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmbedLinkModal = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var ModalSmall_1 = require("../../Modals/ModalSmall");
|
|
6
|
+
var TextInputs_1 = require("../../TextInputs");
|
|
7
|
+
var Paddings_1 = require("../../Paddings");
|
|
8
|
+
var Buttons_1 = require("../../Buttons");
|
|
9
|
+
var styled_index_1 = require("../styled.index");
|
|
10
|
+
var EmbedLinkModal = function (_a) {
|
|
11
|
+
var _b;
|
|
12
|
+
var id = _a.id, setShowEmbedLinkModal = _a.setShowEmbedLinkModal, value = _a.value, createVideoPreview = _a.createVideoPreview, canPlay = _a.canPlay, onChange = _a.onChange, invert = _a.invert;
|
|
13
|
+
var _c = (0, react_1.useState)(value), localValue = _c[0], setLocalValue = _c[1];
|
|
14
|
+
return (React.createElement(ModalSmall_1.ModalSmall, { title: "Add URL Embed", subTitle: "Paste the link of the video you want to share. ",
|
|
15
|
+
// invert={invert}
|
|
16
|
+
onClose: function () {
|
|
17
|
+
setShowEmbedLinkModal(false);
|
|
18
|
+
} },
|
|
19
|
+
React.createElement(TextInputs_1.TextInput, { icon: "LinkSimple", onChange: function (k, v) { return setLocalValue(v ? [{ publicUrl: v }] : undefined); }, value: localValue && ((_b = localValue[0]) === null || _b === void 0 ? void 0 : _b.publicUrl), placeholder: "Paste a url here", clearBtn: { icon: 'X' } }),
|
|
20
|
+
localValue && React.createElement(Paddings_1.PaddingBottom20, null),
|
|
21
|
+
createVideoPreview({ value: localValue }),
|
|
22
|
+
React.createElement(styled_index_1.StyledModalActionButtons, null,
|
|
23
|
+
React.createElement(Buttons_1.ButtonPrimary, { value: "Embed", disabled: !canPlay(localValue) || !localValue,
|
|
24
|
+
// invert={invert}
|
|
25
|
+
onClick: function () {
|
|
26
|
+
onChange(id, localValue);
|
|
27
|
+
setShowEmbedLinkModal(false);
|
|
28
|
+
} }),
|
|
29
|
+
React.createElement(Buttons_1.ButtonGhost, { value: "Cancel",
|
|
30
|
+
// invert={invert}
|
|
31
|
+
onClick: function () {
|
|
32
|
+
setShowEmbedLinkModal(false);
|
|
33
|
+
} }))));
|
|
34
|
+
};
|
|
35
|
+
exports.EmbedLinkModal = EmbedLinkModal;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default VideoInput;
|
|
2
|
+
declare function VideoInput({ id, label, sublabel, isRequired, value: _value, onChange, readOnly, light: lightPlayer, enableVideoUpload, isInRTE, invert, files, }: {
|
|
3
|
+
id: any;
|
|
4
|
+
label: any;
|
|
5
|
+
sublabel: any;
|
|
6
|
+
isRequired: any;
|
|
7
|
+
value: any;
|
|
8
|
+
onChange: any;
|
|
9
|
+
readOnly: any;
|
|
10
|
+
light: any;
|
|
11
|
+
enableVideoUpload?: boolean;
|
|
12
|
+
isInRTE: any;
|
|
13
|
+
invert: any;
|
|
14
|
+
files: any;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
import React from "react";
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var react_1 = __importStar(require("react"));
|
|
41
|
+
var styled_components_1 = require("styled-components");
|
|
42
|
+
var react_player_1 = __importDefault(require("react-player"));
|
|
43
|
+
var BlockLabel_1 = require("../BlockLabel");
|
|
44
|
+
var styled_index_1 = require("./styled.index");
|
|
45
|
+
var LoadersAndProgress_1 = require("../LoadersAndProgress");
|
|
46
|
+
var Buttons_1 = require("../Buttons");
|
|
47
|
+
var Typo_1 = require("../Typo");
|
|
48
|
+
var EmbedLinkModal_1 = require("./comps/EmbedLinkModal");
|
|
49
|
+
var ActionMenu_1 = require("../ActionMenu");
|
|
50
|
+
var themes_1 = require("../../themes");
|
|
51
|
+
var VideoInput = function (_a) {
|
|
52
|
+
var id = _a.id, label = _a.label, sublabel = _a.sublabel, isRequired = _a.isRequired, _value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, lightPlayer = _a.light, _b = _a.enableVideoUpload, enableVideoUpload = _b === void 0 ? false : _b, isInRTE = _a.isInRTE, invert = _a.invert, files = _a.files;
|
|
53
|
+
//backwards compatibility
|
|
54
|
+
var value = typeof _value === 'string'
|
|
55
|
+
? [{ publicUrl: _value }]
|
|
56
|
+
: _value;
|
|
57
|
+
var _c = (0, react_1.useState)(false), showEmbedLinkModal = _c[0], setShowEmbedLinkModal = _c[1];
|
|
58
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
59
|
+
var canPlay = function (value) { var _a; return react_player_1.default.canPlay(value && ((_a = value[0]) === null || _a === void 0 ? void 0 : _a.publicUrl)); };
|
|
60
|
+
var SET_ALERT_BANNER;
|
|
61
|
+
if (theme && theme.useBannerContext) {
|
|
62
|
+
var bannerContext = theme.useBannerContext();
|
|
63
|
+
SET_ALERT_BANNER = bannerContext.SET_ALERT_BANNER;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
SET_ALERT_BANNER = 'Incorrect video format' /* fallback value / function */;
|
|
67
|
+
}
|
|
68
|
+
var _d = (0, react_1.useState)(undefined), uploadProgress = _d[0], setUploadProgress = _d[1];
|
|
69
|
+
var inputRef = (0, react_1.useRef)();
|
|
70
|
+
var handleUploadProgess = function (progress) { return setUploadProgress(progress); };
|
|
71
|
+
var isUploadedVideo = function (value) { return value && Object.keys(value === null || value === void 0 ? void 0 : value[0]).length > 1; };
|
|
72
|
+
var upload;
|
|
73
|
+
var isLoading;
|
|
74
|
+
if (theme && theme.useUploadMedia) {
|
|
75
|
+
var uploadMediaContext = theme.useUploadMedia({
|
|
76
|
+
mediaConfigs: {
|
|
77
|
+
type: "files",
|
|
78
|
+
folderName: "videos",
|
|
79
|
+
mediaType: "video",
|
|
80
|
+
},
|
|
81
|
+
handleUploadProgess: handleUploadProgess,
|
|
82
|
+
});
|
|
83
|
+
if (uploadMediaContext) {
|
|
84
|
+
upload = uploadMediaContext.mutate;
|
|
85
|
+
isLoading = uploadMediaContext.isLoading;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
upload = uploadVideoToLocalStorage;
|
|
90
|
+
isLoading = "uploading";
|
|
91
|
+
}
|
|
92
|
+
var handleUpload = function (files) {
|
|
93
|
+
// onChange(id, undefined) //so that the prev video is cleared and loader shows up
|
|
94
|
+
if (!files)
|
|
95
|
+
return;
|
|
96
|
+
if (!upload)
|
|
97
|
+
return;
|
|
98
|
+
upload(files, {
|
|
99
|
+
onSuccess: function (data) {
|
|
100
|
+
onChange(id, [data[0].fileData]);
|
|
101
|
+
},
|
|
102
|
+
onError: function (err) {
|
|
103
|
+
var _a;
|
|
104
|
+
SET_ALERT_BANNER(((_a = err.response) === null || _a === void 0 ? void 0 : _a.data.errors[0].msg) || err.message, "red", 3500);
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
(0, react_1.useEffect)(function () {
|
|
109
|
+
if (files) {
|
|
110
|
+
handleUpload(files);
|
|
111
|
+
}
|
|
112
|
+
}, []);
|
|
113
|
+
var genVideoActionMenu = function () { return (react_1.default.createElement(styled_index_1.StyledActionButtonWrapper, null,
|
|
114
|
+
react_1.default.createElement("div", { style: __assign({}, (isInRTE ? { display: "none" } : {})) },
|
|
115
|
+
react_1.default.createElement(ActionMenu_1.ActionMenu, { popOutOfOverflowHiddenParent: true, ButtonComp: "ButtonPrimary", iconSize: "M", invert: invert, actions: [
|
|
116
|
+
isUploadedVideo(value) // Only allow user to replace URL when embed method is URL
|
|
117
|
+
? {
|
|
118
|
+
id: "uploadNewVideo",
|
|
119
|
+
display: "Upload New Video",
|
|
120
|
+
onClick: function () {
|
|
121
|
+
inputRef.current.click(); // Trigger file explorer popup
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
: {
|
|
125
|
+
id: "replaceUrl",
|
|
126
|
+
display: "Replace URL",
|
|
127
|
+
onClick: function (e) {
|
|
128
|
+
setShowEmbedLinkModal(true);
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
display: "Delete",
|
|
133
|
+
onClick: function () { return onChange(undefined); },
|
|
134
|
+
},
|
|
135
|
+
] })))); };
|
|
136
|
+
var createVideoPreview = function (_a) {
|
|
137
|
+
var _b;
|
|
138
|
+
var value = _a.value, _c = _a.actionMenuButton, actionMenuButton = _c === void 0 ? false : _c;
|
|
139
|
+
var url = value && ((_b = value[0]) === null || _b === void 0 ? void 0 : _b.publicUrl);
|
|
140
|
+
switch (true) {
|
|
141
|
+
case !url:
|
|
142
|
+
return null;
|
|
143
|
+
case !canPlay(value):
|
|
144
|
+
return (react_1.default.createElement(Typo_1.SANS_3_4, { color: themes_1.colors.red }, "Error displaying video. Make sure you've added the right link or you have permission to share publicly."));
|
|
145
|
+
default:
|
|
146
|
+
if (url.indexOf("&list=") !== -1) {
|
|
147
|
+
var regex = /(?:\?|)v=([a-zA-Z0-9_-]{11})/; //Regular expression to match the video ID in a YouTube link
|
|
148
|
+
// 1- Extract the video URL from the playlist link - value.split('&list=')[0]
|
|
149
|
+
// 2- Use the regular expression to extract the video ID from the video URL - match(regex)[1]
|
|
150
|
+
// 3- Construct the final video URL using the extracted video ID - value = 'https://www.youtube.com/watch?v=' + value.split('&list=')[0].match(regex)[1];
|
|
151
|
+
url =
|
|
152
|
+
"https://www.youtube.com/watch?v=" +
|
|
153
|
+
url.split("&list=")[0].match(regex)[1];
|
|
154
|
+
}
|
|
155
|
+
return (react_1.default.createElement(styled_index_1.StyledVideoEmbedPreviewSection, null,
|
|
156
|
+
actionMenuButton && genVideoActionMenu(),
|
|
157
|
+
react_1.default.createElement(react_player_1.default, { id: "outVideo", url: url, controls: true, width: "100%", light: lightPlayer, style: { overflow: "hidden" } })));
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
|
161
|
+
react_1.default.createElement(BlockLabel_1.BlockLabel, { label: label, sublabel: sublabel, isRequired: isRequired, readOnly: readOnly, invert: invert }),
|
|
162
|
+
readOnly ? (createVideoPreview({ value: value })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
163
|
+
false ? (react_1.default.createElement(styled_index_1.StyledUploadEmbedBlock, { invert: invert },
|
|
164
|
+
react_1.default.createElement(styled_index_1.StyledInnerWrapper, null,
|
|
165
|
+
react_1.default.createElement(LoadersAndProgress_1.ProgressBar, { progress: uploadProgress, text: uploadProgress && uploadProgress !== 100
|
|
166
|
+
? uploadProgress + "%"
|
|
167
|
+
: "Almost Done..." })))) : value ? (createVideoPreview({ value: value, actionMenuButton: true })) : (react_1.default.createElement(styled_index_1.StyledUploadEmbedBlock, { invert: invert },
|
|
168
|
+
react_1.default.createElement(styled_index_1.StyledInnerWrapper, null,
|
|
169
|
+
react_1.default.createElement(Buttons_1.ButtonSecondary, { value: "Add Video link", icon: "Plus", onClick: function () { return setShowEmbedLinkModal(true); }, invert: invert }),
|
|
170
|
+
enableVideoUpload && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
171
|
+
react_1.default.createElement(Typo_1.SANS_2, { semibold: true, color: invert ? themes_1.colors.white_opacity60 : themes_1.colors.greyColor80 }, "OR"),
|
|
172
|
+
react_1.default.createElement(Buttons_1.ButtonSecondary, { onClick: function () { return inputRef.current.click(); }, value: "Upload A Video", icon: "UploadSimple", invert: invert, id: "videoField" })))))),
|
|
173
|
+
showEmbedLinkModal && (react_1.default.createElement(EmbedLinkModal_1.EmbedLinkModal, __assign({}, {
|
|
174
|
+
setShowEmbedLinkModal: setShowEmbedLinkModal,
|
|
175
|
+
value: value,
|
|
176
|
+
createVideoPreview: createVideoPreview,
|
|
177
|
+
canPlay: canPlay,
|
|
178
|
+
onChange: onChange,
|
|
179
|
+
id: id,
|
|
180
|
+
invert: invert
|
|
181
|
+
}))))),
|
|
182
|
+
react_1.default.createElement("input", { type: "file" // When user clicks on upload new video from action menu inputRef.current.click() this does not work for upload button. this approch deals with that issue.
|
|
183
|
+
, accept: "video/*", ref: inputRef, style: { display: "none" }, id: "videoField", onChange: function (v) { return handleUpload(v.target.files); } })));
|
|
184
|
+
};
|
|
185
|
+
exports.default = VideoInput;
|
|
186
|
+
function uploadVideoToLocalStorage(videoFile) {
|
|
187
|
+
console.log({ videoFile: videoFile });
|
|
188
|
+
// if (!videoFile) return
|
|
189
|
+
// // Check if the selected file is a Blob
|
|
190
|
+
// if (!(videoFile[0] instanceof Blob)) {
|
|
191
|
+
// console.error('Invalid file type. Please select a video file.');
|
|
192
|
+
// return;
|
|
193
|
+
// }
|
|
194
|
+
// // Create a new FileReader instance
|
|
195
|
+
// const reader = new FileReader();
|
|
196
|
+
// // When the FileReader finishes loading the video file
|
|
197
|
+
// reader.onloadend = () => {
|
|
198
|
+
// // Retrieve the base64-encoded video data
|
|
199
|
+
// const base64Data = reader.result;
|
|
200
|
+
// // Save the video data to local storage
|
|
201
|
+
// localStorage.setItem('uploadedVideo', base64Data);
|
|
202
|
+
// // Display a success message or perform any desired actions
|
|
203
|
+
// console.log('Video uploaded to local storage successfully.');
|
|
204
|
+
// };
|
|
205
|
+
// // Read the video file as a data URL
|
|
206
|
+
// reader.readAsDataURL(videoFile);
|
|
207
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const StyledUploadEmbedBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export const StyledInnerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const StyledModalActionButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const StyledVideoEmbedPreviewSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export const StyledActionButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export const StyledGhostButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StyledGhostButton = exports.StyledActionButtonWrapper = exports.StyledVideoEmbedPreviewSection = exports.StyledModalActionButtons = exports.StyledInnerWrapper = exports.StyledUploadEmbedBlock = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var themes_1 = require("../../themes");
|
|
13
|
+
var mixins_1 = require("../../themes/mixins");
|
|
14
|
+
var primaryColor10 = themes_1.colors.primaryColor10, greyColor100 = themes_1.colors.greyColor100;
|
|
15
|
+
exports.StyledUploadEmbedBlock = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 18rem;\n background-color: ", ";\n padding: ", ";\n"], ["\n height: 18rem;\n background-color: ", ";\n padding: ", ";\n"])), function (_a) {
|
|
16
|
+
var invert = _a.invert;
|
|
17
|
+
return invert ? greyColor100 : primaryColor10;
|
|
18
|
+
}, function (_a) {
|
|
19
|
+
var smallPlaceholderUI = _a.smallPlaceholderUI;
|
|
20
|
+
return !smallPlaceholderUI && '1.2rem';
|
|
21
|
+
});
|
|
22
|
+
exports.StyledInnerWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 1rem;\n border: 0.2rem dashed ", ";\n ", "{\n flex-direction: row;\n }\n"], ["\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 1rem;\n border: 0.2rem dashed ", ";\n ", "{\n flex-direction: row;\n }\n"])), themes_1.colors.greyColor40, (0, mixins_1.mediaQuery)('sm'));
|
|
23
|
+
exports.StyledModalActionButtons = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n padding-top: 2rem;\n justify-content: flex-start;\n gap: 2rem;\n"], ["\n display: flex;\n padding-top: 2rem;\n justify-content: flex-start;\n gap: 2rem;\n"])));
|
|
24
|
+
exports.StyledVideoEmbedPreviewSection = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
25
|
+
exports.StyledActionButtonWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1000;\n margin: 0.5rem;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1000;\n margin: 0.5rem;\n"])));
|
|
26
|
+
exports.StyledGhostButton = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
27
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.CardContent = void 0;
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
31
|
+
var react_router_dom_1 = require("react-router-dom");
|
|
32
|
+
var VideoInput_1 = __importDefault(require("../../VideoInput"));
|
|
33
|
+
var styled_1 = require("./styled");
|
|
34
|
+
var styled_components_1 = require("styled-components");
|
|
35
|
+
var isExternalUrl_1 = require("../utils/isExternalUrl");
|
|
36
|
+
var parseCardConfig_1 = require("../utils/parseCardConfig");
|
|
37
|
+
var LineClampWrapper_1 = require("../comps/LineClampWrapper");
|
|
38
|
+
var CardMetaBlock_1 = __importDefault(require("../comps/CardMetaBlock"));
|
|
39
|
+
var Typo_1 = require("../../Typo");
|
|
40
|
+
var injectHttps_1 = require("../../../utils/injectHttps");
|
|
41
|
+
var ActionMenu_1 = require("../../ActionMenu");
|
|
42
|
+
var icons_1 = require("../../../icons");
|
|
43
|
+
var utilsOolib_1 = require("../../../utilsOolib");
|
|
44
|
+
var renderImagePlaceholderForOolibPreview_1 = require("../../../utilsOolib/renderImagePlaceholderForOolibPreview");
|
|
45
|
+
var decideLinkCompAndTarget_1 = require("../utils/decideLinkCompAndTarget");
|
|
46
|
+
var dontRenderIfBothOnClickAndTo_1 = require("../utils/dontRenderIfBothOnClickAndTo");
|
|
47
|
+
var ArrowLineUpRight = icons_1.icons.ArrowLineUpRight;
|
|
48
|
+
var CardContent = function (_a) {
|
|
49
|
+
var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions;
|
|
50
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
51
|
+
var localize = (0, utilsOolib_1.useLocale)();
|
|
52
|
+
var _b = theme || {}, ImageInput = _b.ImageInput, parseSpecialSyntax = _b.parseSpecialSyntax;
|
|
53
|
+
var showEmbedSection = !!((config === null || config === void 0 ? void 0 : config.image) || (config === null || config === void 0 ? void 0 : config.video));
|
|
54
|
+
var _c = (0, parseCardConfig_1.parseCardConfig)({
|
|
55
|
+
config: config,
|
|
56
|
+
data: data,
|
|
57
|
+
parseSpecialSyntax: parseSpecialSyntax,
|
|
58
|
+
localize: localize,
|
|
59
|
+
}), cardLabel = _c.cardLabel, title = _c.title, titleOptional = _c.titleOptional, video = _c.video, image = _c.image, metaBlockData = _c.metaBlockData;
|
|
60
|
+
var dontRenderRes = (0, dontRenderIfBothOnClickAndTo_1.dontRenderIfBothOnClickAndTo)({ onClick: onClick, to: to });
|
|
61
|
+
if (dontRenderRes)
|
|
62
|
+
return dontRenderRes;
|
|
63
|
+
var _d = (0, decideLinkCompAndTarget_1.decideLinkCompAndTarget)({ to: to, openInNewTab: openInNewTab }), LinkComp = _d.LinkComp, target = _d.target, externalUrl = _d.externalUrl;
|
|
64
|
+
return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
|
|
65
|
+
react_1.default.createElement(styled_1.StyledCardWrapper, { id: id, onClick: onClick },
|
|
66
|
+
react_1.default.createElement(styled_1.StyledUpperSection, null,
|
|
67
|
+
react_1.default.createElement(styled_1.StyledContainer1, null,
|
|
68
|
+
cardLabel ? (react_1.default.createElement("div", { title: cardLabel, style: {
|
|
69
|
+
display: "flex",
|
|
70
|
+
gap: "2rem",
|
|
71
|
+
justifyContent: "space-between",
|
|
72
|
+
} },
|
|
73
|
+
react_1.default.createElement(Typo_1.LABEL, { style: {
|
|
74
|
+
textOverflow: "ellipsis",
|
|
75
|
+
overflow: "hidden",
|
|
76
|
+
whiteSpace: "nowrap",
|
|
77
|
+
}, color: (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors) }, cardLabel),
|
|
78
|
+
react_1.default.createElement("div", { style: { marginTop: "-1rem", marginRight: "-1rem" } }, actions && react_1.default.createElement(ActionMenu_1.ActionMenu, { actions: actions })))) : null,
|
|
79
|
+
titleOptional ? (react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, title: titleOptional },
|
|
80
|
+
react_1.default.createElement(Typo_1.SANS_4_5, { semibold: true, style: { wordBreak: "break-word" }, capitalize: true }, titleOptional))) : null,
|
|
81
|
+
title ? (react_1.default.createElement("div", { style: { display: "flex", alignItems: "end", gap: ".5rem" } },
|
|
82
|
+
" ",
|
|
83
|
+
react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, title: titleOptional },
|
|
84
|
+
react_1.default.createElement(Typo_1.SERIF_5_6, { style: { wordBreak: "break-word" }, capitalize: true }, title)))) : null),
|
|
85
|
+
metaBlockData ? (react_1.default.createElement(CardMetaBlock_1.default, { value: metaBlockData.slice(0, 2) }) //show only two meta for cardContent
|
|
86
|
+
) : null),
|
|
87
|
+
showEmbedSection ? (react_1.default.createElement(styled_1.StyledEmbedSection, null,
|
|
88
|
+
(video === null || video === void 0 ? void 0 : video.length) > 0 ? (react_1.default.createElement("div", { style: { width: "100%" } },
|
|
89
|
+
react_1.default.createElement(VideoInput_1.default, { value: video, readOnly: true, light: true }))) : null,
|
|
90
|
+
(image === null || image === void 0 ? void 0 : image.length) > 0 && !video ? (react_1.default.createElement("div", { style: { width: "100%" } }, !ImageInput ? ((0, renderImagePlaceholderForOolibPreview_1.renderImagePlaceholderForOolibPreview)({
|
|
91
|
+
tooltipPos: "right",
|
|
92
|
+
width: "100%",
|
|
93
|
+
height: "100px",
|
|
94
|
+
borderRadius: 0,
|
|
95
|
+
})) : (react_1.default.createElement(ImageInput, { value: image, aspectRatio: image.aspectRatio || "5/3", containerShape: image.containerShape, readOnly: true, defaultImageSpread: "cover", enableCaptions: false, disableImageBorder: true })))) : null)) : null)));
|
|
96
|
+
};
|
|
97
|
+
exports.CardContent = CardContent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const StyledContainer1: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export const StyledMetaBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const StyledEmbedSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const StyledCardWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export const StyledUpperSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledUpperSection = exports.StyledCardWrapper = exports.StyledEmbedSection = exports.StyledMetaBlock = exports.StyledContainer1 = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var colors_1 = require("../../../themes/colors");
|
|
33
|
+
var transitions_1 = require("../../../themes/mixins/transitions");
|
|
34
|
+
var greyColor5 = colors_1.colors.greyColor5, white = colors_1.colors.white;
|
|
35
|
+
var flexColumn = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
36
|
+
exports.StyledContainer1 = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n gap: 1rem;\n"], ["\n ", "\n gap: 1rem;\n"])), flexColumn);
|
|
37
|
+
exports.StyledMetaBlock = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n gap: 0.5em;\n"], ["\n display: flex;\n gap: 0.5em;\n"])));
|
|
38
|
+
exports.StyledEmbedSection = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100px;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n"], ["\n height: 100px;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n"])));
|
|
39
|
+
exports.StyledCardWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 100%;\n border: 2px solid ", ";\n background-color: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n ", "\n\n cursor: pointer;\n :hover {\n background-color: ", ";\n }\n"], ["\n height: 100%;\n border: 2px solid ", ";\n background-color: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n ", "\n\n cursor: pointer;\n :hover {\n background-color: ", ";\n }\n"])), greyColor5, greyColor5, (0, transitions_1.transition)("background-color"), white);
|
|
40
|
+
exports.StyledUpperSection = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n /* height: 100%; */\n flex-grow: 1;\n justify-content: space-between;\n\n padding: 2rem;\n ", "\n gap: 3rem;\n"], ["\n /* height: 100%; */\n flex-grow: 1;\n justify-content: space-between;\n\n padding: 2rem;\n ", "\n gap: 3rem;\n"])), flexColumn);
|
|
41
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function ListContent({ id, data, config, to, onClick, openInNewTab, actions, disabled, statusTag, }: {
|
|
2
|
+
id: any;
|
|
3
|
+
data: any;
|
|
4
|
+
config: any;
|
|
5
|
+
to: any;
|
|
6
|
+
onClick: any;
|
|
7
|
+
openInNewTab: any;
|
|
8
|
+
actions: any;
|
|
9
|
+
disabled: any;
|
|
10
|
+
statusTag: any;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
import React from "react";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ListContent = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var parseCardConfig_1 = require("../utils/parseCardConfig");
|
|
9
|
+
var styled_js_1 = require("./styled.js");
|
|
10
|
+
var styled_components_1 = require("styled-components");
|
|
11
|
+
var decideLinkCompAndTarget_1 = require("../utils/decideLinkCompAndTarget");
|
|
12
|
+
var dontRenderIfBothOnClickAndTo_1 = require("../utils/dontRenderIfBothOnClickAndTo");
|
|
13
|
+
var ActionMenu_1 = require("../../ActionMenu");
|
|
14
|
+
var Typo_1 = require("../../Typo");
|
|
15
|
+
var Tags_1 = require("../../Tags");
|
|
16
|
+
var LineClampWrapper_1 = require("../comps/LineClampWrapper");
|
|
17
|
+
var VideoInput_1 = __importDefault(require("../../VideoInput"));
|
|
18
|
+
var CardMetaBlock_1 = __importDefault(require("../comps/CardMetaBlock"));
|
|
19
|
+
var injectHttps_1 = require("../../../utils/injectHttps");
|
|
20
|
+
var utilsOolib_1 = require("../../../utilsOolib");
|
|
21
|
+
var themes_1 = require("../../../themes");
|
|
22
|
+
var icons_1 = require("../../../icons");
|
|
23
|
+
var renderImagePlaceholderForOolibPreview_1 = require("../../../utilsOolib/renderImagePlaceholderForOolibPreview");
|
|
24
|
+
var greyColor100 = themes_1.colors.greyColor100, greyColor40 = themes_1.colors.greyColor40, greyColor15 = themes_1.colors.greyColor15;
|
|
25
|
+
var ArrowLineUpRight = icons_1.icons.ArrowLineUpRight;
|
|
26
|
+
var ListContent = function (_a) {
|
|
27
|
+
var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions, disabled = _a.disabled, statusTag = _a.statusTag;
|
|
28
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
29
|
+
var localize = (0, utilsOolib_1.useLocale)();
|
|
30
|
+
var _b = theme || {}, ImageInput = _b.ImageInput, parseSpecialSyntax = _b.parseSpecialSyntax;
|
|
31
|
+
var _c = (0, parseCardConfig_1.parseCardConfig)({ config: config, data: data, parseSpecialSyntax: parseSpecialSyntax, localize: localize }), cardLabel = _c.cardLabel, title = _c.title, titleOptional = _c.titleOptional, video = _c.video, image = _c.image, metaBlockData = _c.metaBlockData;
|
|
32
|
+
var dontRenderRes = (0, dontRenderIfBothOnClickAndTo_1.dontRenderIfBothOnClickAndTo)({ onClick: onClick, to: to });
|
|
33
|
+
if (dontRenderRes)
|
|
34
|
+
return dontRenderRes;
|
|
35
|
+
var _d = (0, decideLinkCompAndTarget_1.decideLinkCompAndTarget)({
|
|
36
|
+
to: to,
|
|
37
|
+
openInNewTab: openInNewTab,
|
|
38
|
+
}), LinkComp = _d.LinkComp, target = _d.target, externalUrl = _d.externalUrl;
|
|
39
|
+
return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
|
|
40
|
+
react_1.default.createElement(styled_js_1.StyledListElemContainer, { id: id, onClick: onClick, disableHover: disabled ? true : false },
|
|
41
|
+
react_1.default.createElement(styled_js_1.StyledListWrapper, null,
|
|
42
|
+
react_1.default.createElement(styled_js_1.StyledHeader, null,
|
|
43
|
+
react_1.default.createElement(styled_js_1.StyledStatusTagCardLabelWrapper, null,
|
|
44
|
+
cardLabel && (react_1.default.createElement("div", { title: cardLabel },
|
|
45
|
+
react_1.default.createElement(styled_js_1.StyledLabel, { color: (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors) }, cardLabel))),
|
|
46
|
+
statusTag && (react_1.default.createElement(Tags_1.TagDisplay, { variant: "secondary", XS: true, display: statusTag }))),
|
|
47
|
+
titleOptional && (react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, noOfLines_D: 3, title: titleOptional },
|
|
48
|
+
" ",
|
|
49
|
+
react_1.default.createElement(Typo_1.SANS_5_6, { color: greyColor100 }, titleOptional))),
|
|
50
|
+
title ? (react_1.default.createElement("div", { style: {
|
|
51
|
+
paddingBottom: "1rem",
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "end",
|
|
54
|
+
} },
|
|
55
|
+
react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, noOfLines_D: 3, title: title },
|
|
56
|
+
react_1.default.createElement(styled_js_1.StyledTitle, { capitalize: true, className: "StyledTitle" },
|
|
57
|
+
react_1.default.createElement(styled_js_1.StyledTitleSpan, { className: "StyledTitleSpan" }, title))))) : null,
|
|
58
|
+
react_1.default.createElement(styled_js_1.StyledMeta, null, metaBlockData && (react_1.default.createElement(CardMetaBlock_1.default, { value: metaBlockData.slice(0, 3) }) // show only three metas for listContent
|
|
59
|
+
))),
|
|
60
|
+
react_1.default.createElement(styled_js_1.StyledContentModule2, null,
|
|
61
|
+
(video === null || video === void 0 ? void 0 : video.length) > 0 && (react_1.default.createElement(styled_js_1.StyledMediaWrapper, null,
|
|
62
|
+
react_1.default.createElement("div", { style: { width: "14rem", border: "1px solid ".concat(greyColor15) } },
|
|
63
|
+
react_1.default.createElement(VideoInput_1.default, { value: video, readOnly: true, light: true })))),
|
|
64
|
+
(image === null || image === void 0 ? void 0 : image.length) > 0 && !video && (react_1.default.createElement(styled_js_1.StyledMediaWrapper, null, !ImageInput ? ((0, renderImagePlaceholderForOolibPreview_1.renderImagePlaceholderForOolibPreview)({
|
|
65
|
+
width: "100%",
|
|
66
|
+
height: "100%",
|
|
67
|
+
borderRadius: 0,
|
|
68
|
+
})) : (react_1.default.createElement("div", { style: {
|
|
69
|
+
width: "14rem",
|
|
70
|
+
border: "1px solid ".concat(greyColor15),
|
|
71
|
+
} },
|
|
72
|
+
react_1.default.createElement(ImageInput, { value: image, aspectRatio: image.aspectRatio || "5/3", containerShape: image.containerShape, readOnly: true, enableCaptions: false, disableImageBorder: true, defaultImageSpread: "cover" }))))),
|
|
73
|
+
actions && react_1.default.createElement(ActionMenu_1.ActionMenu, { actions: actions, align: "right" }))))));
|
|
74
|
+
};
|
|
75
|
+
exports.ListContent = ListContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const StyledListElemContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export const StyledStatusTagCardLabelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const StyledHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const StyledLabel: import("styled-components").StyledComponent<(props: any) => import("react").JSX.Element, any, {}, never>;
|
|
5
|
+
export const StyledTitle: import("styled-components").StyledComponent<(props: any) => import("react").JSX.Element, any, {}, never>;
|
|
6
|
+
export const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export const StyledTitleSpan: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
8
|
+
export const StyledContentModule2: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export const StyledMediaWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export const StyledMeta: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledMeta = exports.StyledMediaWrapper = exports.StyledContentModule2 = exports.StyledTitleSpan = exports.StyledListWrapper = exports.StyledTitle = exports.StyledLabel = exports.StyledHeader = exports.StyledStatusTagCardLabelWrapper = exports.StyledListElemContainer = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var utilsOolib_1 = require("../../../utilsOolib");
|
|
33
|
+
var themes_1 = require("../../../themes");
|
|
34
|
+
var Typo_1 = require("../../Typo");
|
|
35
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
36
|
+
exports.StyledListElemContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-bottom: 1px solid ", ";\n margin-bottom: 2rem;\n padding-bottom: 2rem;\n cursor: ", ";\n ", "\n"], ["\n border-bottom: 1px solid ", ";\n margin-bottom: 2rem;\n padding-bottom: 2rem;\n cursor: ", ";\n ", "\n"])), themes_1.colors.greyColor15, function (_a) {
|
|
37
|
+
var disableHover = _a.disableHover;
|
|
38
|
+
return !disableHover ? 'pointer' : '';
|
|
39
|
+
}, function (_a) {
|
|
40
|
+
var disableHover = _a.disableHover;
|
|
41
|
+
return !disableHover && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n .StyledTitle {\n color: ", ";\n }\n\n .StyledTitleSpan {\n //animate the underline created by the mixin : underlineForAnimation\n ", "\n }\n }\n "], ["\n &:hover {\n .StyledTitle {\n color: ", ";\n }\n\n .StyledTitleSpan {\n //animate the underline created by the mixin : underlineForAnimation\n ", "\n }\n }\n "])), function (_a) {
|
|
42
|
+
var theme = _a.theme;
|
|
43
|
+
return (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors);
|
|
44
|
+
}, function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return (0, mixins_1.multilineUnderline)({
|
|
47
|
+
color: (0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors),
|
|
48
|
+
thickness: '2px',
|
|
49
|
+
}).hovered;
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
exports.StyledStatusTagCardLabelWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n gap: 1rem;\n align-items: center;\n flex-wrap: wrap;\n"], ["\n display: flex;\n gap: 1rem;\n align-items: center;\n flex-wrap: wrap;\n"])));
|
|
53
|
+
exports.StyledHeader = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: .7rem;\n"], ["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: .7rem;\n"])));
|
|
54
|
+
exports.StyledLabel = (0, styled_components_1.default)(Typo_1.LABEL)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n max-width: 23rem;\n ", "{\n max-width: 40rem;\n }\n"], ["\n ", ";\n max-width: 23rem;\n ", "{\n max-width: 40rem;\n }\n"])), mixins_1.ellipsis, (0, mixins_1.mediaQuery)("sm"));
|
|
55
|
+
exports.StyledTitle = (0, styled_components_1.default)(Typo_1.SERIF_4_5)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n /* position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 23rem;\n gap: 1rem;\n ", "{\n width: 40rem;\n } */\n ", "\n"], ["\n /* position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 23rem;\n gap: 1rem;\n ", "{\n width: 40rem;\n } */\n ", "\n"])), (0, mixins_1.mediaQuery)("sm"), (0, mixins_1.transition)("color"));
|
|
56
|
+
exports.StyledListWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: auto;\n display: flex;\n align-items: center;\n justify-content: space-between;\n"], ["\n width: auto;\n display: flex;\n align-items: center;\n justify-content: space-between;\n"])));
|
|
57
|
+
exports.StyledTitleSpan = styled_components_1.default.span(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin: 2em 0;\n margin-right: .5rem;\n background-repeat: no-repeat;\n ", "\n ", "\n"], ["\n margin: 2em 0;\n margin-right: .5rem;\n background-repeat: no-repeat;\n ", "\n ", "\n"])), function (_a) {
|
|
58
|
+
var theme = _a.theme;
|
|
59
|
+
return (0, mixins_1.multilineUnderline)({
|
|
60
|
+
color: (0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors),
|
|
61
|
+
thickness: '2px',
|
|
62
|
+
}).init;
|
|
63
|
+
}, (0, mixins_1.transition)("background-size 0.5s"));
|
|
64
|
+
exports.StyledContentModule2 = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n justify-content: center;\n display: flex;\n align-items: flex-end;\n position: relative;\n padding: 0 2rem;\n row-gap: 1rem;\n column-gap: 0;\n flex-direction: column-reverse;\n ", " {\n flex-direction: row;\n align-items: center;\n row-gap: 0;\n column-gap: 1rem;\n }\n"], ["\n justify-content: center;\n display: flex;\n align-items: flex-end;\n position: relative;\n padding: 0 2rem;\n row-gap: 1rem;\n column-gap: 0;\n flex-direction: column-reverse;\n ", " {\n flex-direction: row;\n align-items: center;\n row-gap: 0;\n column-gap: 1rem;\n }\n"])), (0, mixins_1.mediaQuery)("sm"));
|
|
65
|
+
exports.StyledMediaWrapper = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n width: 70px;\n height: 84px;\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n flex-wrap: wrap;\n ", " {\n width: 6rem;\n height: 6rem;\n }\n"], ["\n width: 70px;\n height: 84px;\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n flex-wrap: wrap;\n ", " {\n width: 6rem;\n height: 6rem;\n }\n"])), (0, mixins_1.mediaQuery)("sm"));
|
|
66
|
+
exports.StyledMeta = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), mixins_1.ellipsis);
|
|
67
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
var react_1 = __importStar(require("react"));
|
|
34
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
35
|
+
var themes_1 = require("../../../../themes");
|
|
36
|
+
var Typo_1 = require("../../../Typo");
|
|
37
|
+
var greyColor100 = themes_1.colors.greyColor100;
|
|
38
|
+
var StyledContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n"], ["\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n"])));
|
|
39
|
+
var StyledMetaWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex; \n align-items: center;\n"], ["\n display: flex; \n align-items: center;\n"])));
|
|
40
|
+
var StyledSeparator = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __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"])), greyColor100);
|
|
41
|
+
var CardMetaBlock = function (_a) {
|
|
42
|
+
var value = _a.value;
|
|
43
|
+
return (react_1.default.createElement(StyledContainer, null, value.map(function (v, i) { return (react_1.default.createElement(react_1.Fragment, null,
|
|
44
|
+
react_1.default.createElement(StyledMetaWrapper, { key: i },
|
|
45
|
+
react_1.default.createElement(Typo_1.SANS_2, { capitalize: true }, v)),
|
|
46
|
+
i + 1 === value.length ? null : react_1.default.createElement(StyledSeparator, null))); })));
|
|
47
|
+
};
|
|
48
|
+
exports.default = CardMetaBlock;
|
|
49
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.LineClampWrapper = void 0;
|
|
11
|
+
var react_1 = __importDefault(require("react"));
|
|
12
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
14
|
+
var LineClampWrapperStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n\n ", " {\n ", "\n }\n"], ["\n ", "\n\n ", " {\n ", "\n }\n"])), function (_a) {
|
|
15
|
+
var noOfLines_D = _a.noOfLines_D, noOfLines_M = _a.noOfLines_M;
|
|
16
|
+
return (noOfLines_M && (0, mixins_1.clampText)(noOfLines_M)) || (noOfLines_D && (0, mixins_1.clampText)(noOfLines_D));
|
|
17
|
+
}, (0, mixins_1.mediaQuery)("sm"), function (_a) {
|
|
18
|
+
var noOfLines_D = _a.noOfLines_D, noOfLines_M = _a.noOfLines_M;
|
|
19
|
+
return (noOfLines_D && (0, mixins_1.clampText)(noOfLines_D)) || (noOfLines_M && (0, mixins_1.clampText)(noOfLines_M));
|
|
20
|
+
});
|
|
21
|
+
var LineClampWrapper = function (_a) {
|
|
22
|
+
var title = _a.title, children = _a.children, noOfLines_D = _a.noOfLines_D, noOfLines_M = _a.noOfLines_M;
|
|
23
|
+
return (react_1.default.createElement(LineClampWrapperStyled, { title: title, noOfLines_D: noOfLines_D, noOfLines_M: noOfLines_M }, children));
|
|
24
|
+
};
|
|
25
|
+
exports.LineClampWrapper = LineClampWrapper;
|
|
26
|
+
var templateObject_1;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decideLinkCompAndTarget = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var isExternalUrl_1 = require("./isExternalUrl");
|
|
6
|
+
var react_router_dom_1 = require("react-router-dom");
|
|
7
|
+
var decideLinkCompAndTarget = function (_a) {
|
|
8
|
+
var to = _a.to, openInNewTab = _a.openInNewTab;
|
|
9
|
+
var externalUrl = (0, isExternalUrl_1.isExternalUrl)(to);
|
|
10
|
+
var LinkComp = externalUrl === null ? react_1.Fragment : externalUrl ? "a" : react_router_dom_1.Link;
|
|
11
|
+
/* openInNewTab is explicitly defined, then listen to whatever it says else
|
|
12
|
+
by default externalUrl will open in new tab, internalUrl will not.*/
|
|
13
|
+
var target = openInNewTab === true
|
|
14
|
+
? "_blank"
|
|
15
|
+
: openInNewTab === false
|
|
16
|
+
? "_self"
|
|
17
|
+
: externalUrl
|
|
18
|
+
? "_blank"
|
|
19
|
+
: "_self";
|
|
20
|
+
return { LinkComp: LinkComp, target: target, externalUrl: externalUrl };
|
|
21
|
+
};
|
|
22
|
+
exports.decideLinkCompAndTarget = decideLinkCompAndTarget;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.dontRenderIfBothOnClickAndTo = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var Typo_1 = require("../../Typo");
|
|
9
|
+
var dontRenderIfBothOnClickAndTo = function (_a) {
|
|
10
|
+
var onClick = _a.onClick, to = _a.to;
|
|
11
|
+
if (onClick && to) {
|
|
12
|
+
return (react_1.default.createElement(Typo_1.SANS_4_5, { color: "red" }, "Only one prop is allowed for this component - \"to\" or \"onClick\" ."));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.dontRenderIfBothOnClickAndTo = dontRenderIfBothOnClickAndTo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isExternalUrl(to: any): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function parseCardConfig({ config, data, localize, parseSpecialSyntax, }: {
|
|
2
|
+
config: any;
|
|
3
|
+
data: any;
|
|
4
|
+
localize: any;
|
|
5
|
+
parseSpecialSyntax?: () => any;
|
|
6
|
+
}): {
|
|
7
|
+
title: string;
|
|
8
|
+
titleOptional: string;
|
|
9
|
+
desc: string;
|
|
10
|
+
cardLabel: any;
|
|
11
|
+
video: any;
|
|
12
|
+
image: any;
|
|
13
|
+
metaBlockData: any;
|
|
14
|
+
tagDisplay: any;
|
|
15
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCardConfig = void 0;
|
|
4
|
+
var getText_1 = require("../../../utils/getText");
|
|
5
|
+
var getVal_1 = require("../../../utils/getterSetterDeleter/getVal");
|
|
6
|
+
var createFormattedDate_1 = require("../../../utils/momentjs/createFormattedDate");
|
|
7
|
+
var parseCardConfig = function (_a) {
|
|
8
|
+
var _b;
|
|
9
|
+
var config = _a.config, data = _a.data, localize = _a.localize, _c = _a.parseSpecialSyntax, parseSpecialSyntax = _c === void 0 ? function () { return undefined; } : _c;
|
|
10
|
+
var title = config.title && (0, getText_1.getText)((0, getVal_1.getVal)(data, config.title)); //getText converts richtext into plain. and leaves plain text unchanged
|
|
11
|
+
var titleOptional = config.titleOptional && (0, getText_1.getText)((0, getVal_1.getVal)(data, config.titleOptional));
|
|
12
|
+
var desc = config.desc && (0, getText_1.getText)((0, getVal_1.getVal)(data, config.desc));
|
|
13
|
+
var cardLabel = config.cardLabel &&
|
|
14
|
+
(parseSpecialSyntax({ string: config.cardLabel, content: data }) ||
|
|
15
|
+
(0, getVal_1.getVal)(data, config.cardLabel));
|
|
16
|
+
var video = config.video && (0, getVal_1.getVal)(data, config.video);
|
|
17
|
+
var tagDisplay = config.tagDisplay && (0, getVal_1.getVal)(data, config.tagDisplay);
|
|
18
|
+
var image = config.image && (0, getVal_1.getVal)(data, config.image);
|
|
19
|
+
var metaBlockData = (_b = config.metaBlock) === null || _b === void 0 ? void 0 : _b.map(function (d) {
|
|
20
|
+
var key = d.key;
|
|
21
|
+
var valuePath = d.valuePath;
|
|
22
|
+
var prefix = d.prefix;
|
|
23
|
+
var returnValue;
|
|
24
|
+
switch (key) {
|
|
25
|
+
case "name":
|
|
26
|
+
returnValue = (0, getVal_1.getVal)(data, valuePath);
|
|
27
|
+
//reduce surname down to initials
|
|
28
|
+
var split = returnValue.split(" ");
|
|
29
|
+
var name_1 = split[0];
|
|
30
|
+
var surname = split[1];
|
|
31
|
+
returnValue = "".concat(name_1).concat(surname ? " ".concat(surname[0], ".") : "");
|
|
32
|
+
break;
|
|
33
|
+
case "date":
|
|
34
|
+
returnValue = (0, createFormattedDate_1.createFormattedDate)((0, getVal_1.getVal)(data, valuePath));
|
|
35
|
+
break;
|
|
36
|
+
case "text":
|
|
37
|
+
default:
|
|
38
|
+
returnValue = (0, getVal_1.getVal)(data, valuePath);
|
|
39
|
+
}
|
|
40
|
+
if (prefix) {
|
|
41
|
+
return "".concat(localize(prefix), " : ").concat(returnValue);
|
|
42
|
+
}
|
|
43
|
+
return returnValue;
|
|
44
|
+
}).filter(function (d) { return d !== undefined; });
|
|
45
|
+
return {
|
|
46
|
+
title: title,
|
|
47
|
+
titleOptional: titleOptional,
|
|
48
|
+
desc: desc,
|
|
49
|
+
cardLabel: cardLabel,
|
|
50
|
+
video: video,
|
|
51
|
+
image: image,
|
|
52
|
+
metaBlockData: metaBlockData,
|
|
53
|
+
tagDisplay: tagDisplay,
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
exports.parseCardConfig = parseCardConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const normalize: "\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the 'main' element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on 'h1' elements within 'section' and\n * 'article' contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent 'sub' and 'sup' elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\n// button:-moz-focusring,\n// [type=\"button\"]:-moz-focusring,\n// [type=\"reset\"]:-moz-focusring,\n// [type=\"submit\"]:-moz-focusring {\n// outline: 1px dotted ButtonText;\n// }\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from 'fieldset' elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * 'fieldset' elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to 'inherit' in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\n\n";
|
|
1
|
+
export const normalize: "\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\n* This ensures that when an element's width is set, it includes the padding and the border. Very important to make dev lives easier.\n*/\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the 'main' element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on 'h1' elements within 'section' and\n * 'article' contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent 'sub' and 'sup' elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\n// button:-moz-focusring,\n// [type=\"button\"]:-moz-focusring,\n// [type=\"reset\"]:-moz-focusring,\n// [type=\"submit\"]:-moz-focusring {\n// outline: 1px dotted ButtonText;\n// }\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from 'fieldset' elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * 'fieldset' elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to 'inherit' in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\n\n";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalize = void 0;
|
|
4
|
-
exports.normalize = "\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the 'main' element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on 'h1' elements within 'section' and\n * 'article' contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent 'sub' and 'sup' elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\n// button:-moz-focusring,\n// [type=\"button\"]:-moz-focusring,\n// [type=\"reset\"]:-moz-focusring,\n// [type=\"submit\"]:-moz-focusring {\n// outline: 1px dotted ButtonText;\n// }\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from 'fieldset' elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * 'fieldset' elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to 'inherit' in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\n\n";
|
|
4
|
+
exports.normalize = "\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\n* This ensures that when an element's width is set, it includes the padding and the border. Very important to make dev lives easier.\n*/\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the 'main' element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on 'h1' elements within 'section' and\n * 'article' contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd 'em' font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent 'sub' and 'sup' elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\n// button:-moz-focusring,\n// [type=\"button\"]:-moz-focusring,\n// [type=\"reset\"]:-moz-focusring,\n// [type=\"submit\"]:-moz-focusring {\n// outline: 1px dotted ButtonText;\n// }\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from 'fieldset' elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * 'fieldset' elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to 'inherit' in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\n\n";
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export { default as DatePicker } from "./components/DatePicker";
|
|
|
37
37
|
export { default as DateRangePicker } from "./components/DateRangePicker";
|
|
38
38
|
export { BarChart } from "./components/dataViz/comps/BarChart";
|
|
39
39
|
export { TextLoader } from "./components/LoadersAndProgress/TextLoader";
|
|
40
|
+
export { CardContent } from "./components/cards/CardContent";
|
|
41
|
+
export { ListContent } from "./components/cards/ListContent";
|
|
40
42
|
export { DropdownSingle } from "./components/Dropdowns/DropdownSingle";
|
|
41
43
|
export { DropdownMulti } from "./components/Dropdowns/DropdownMulti";
|
|
42
44
|
export { OptionsSingle } from "./components/Dropdowns/comps/OptionsSingle";
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.HintsProvider = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.TextLoader = exports.BarChart = exports.DateRangePicker = exports.DatePicker = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.ModalLarge = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
20
|
+
exports.HintsProvider = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.ListContent = exports.CardContent = exports.TextLoader = exports.BarChart = exports.DateRangePicker = exports.DatePicker = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.ModalLarge = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
21
21
|
//css and styling related ( styled-components )
|
|
22
22
|
var globalStyles_1 = require("./globalStyles");
|
|
23
23
|
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
|
|
@@ -87,6 +87,11 @@ var BarChart_1 = require("./components/dataViz/comps/BarChart");
|
|
|
87
87
|
Object.defineProperty(exports, "BarChart", { enumerable: true, get: function () { return BarChart_1.BarChart; } });
|
|
88
88
|
var TextLoader_1 = require("./components/LoadersAndProgress/TextLoader");
|
|
89
89
|
Object.defineProperty(exports, "TextLoader", { enumerable: true, get: function () { return TextLoader_1.TextLoader; } });
|
|
90
|
+
//cards
|
|
91
|
+
var CardContent_1 = require("./components/cards/CardContent");
|
|
92
|
+
Object.defineProperty(exports, "CardContent", { enumerable: true, get: function () { return CardContent_1.CardContent; } });
|
|
93
|
+
var ListContent_1 = require("./components/cards/ListContent");
|
|
94
|
+
Object.defineProperty(exports, "ListContent", { enumerable: true, get: function () { return ListContent_1.ListContent; } });
|
|
90
95
|
//dropdowns & options
|
|
91
96
|
var DropdownSingle_1 = require("./components/Dropdowns/DropdownSingle");
|
|
92
97
|
Object.defineProperty(exports, "DropdownSingle", { enumerable: true, get: function () { return DropdownSingle_1.DropdownSingle; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createFormattedDate(inputDate: any, altDate?: any, prefix?: any, options?: {}): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createFormattedDate = void 0;
|
|
7
|
+
var moment_1 = __importDefault(require("moment"));
|
|
8
|
+
var getDaysDiff_1 = require("./getDaysDiff");
|
|
9
|
+
var createFormattedDate = function (inputDate, altDate, prefix, options) {
|
|
10
|
+
if (altDate === void 0) { altDate = null; }
|
|
11
|
+
if (prefix === void 0) { prefix = null; }
|
|
12
|
+
if (options === void 0) { options = {}; }
|
|
13
|
+
//alt date is only to deal with the blunder of not saving published date sometime back
|
|
14
|
+
var _a = options.switchDisplayFormatAfter, switchDisplayFormatAfter = _a === void 0 ? 7 : _a, _b = options.format, format = _b === void 0 ? "DD MMM YYYY" : _b;
|
|
15
|
+
if (!inputDate && !altDate)
|
|
16
|
+
return null;
|
|
17
|
+
var inputMoment = inputDate ? (0, moment_1.default)(inputDate) : (0, moment_1.default)(altDate);
|
|
18
|
+
var daysDiff = inputDate
|
|
19
|
+
? (0, getDaysDiff_1.getDaysDiff)(inputDate).count
|
|
20
|
+
: (0, getDaysDiff_1.getDaysDiff)(altDate).count;
|
|
21
|
+
var toReturn;
|
|
22
|
+
if (Math.abs(daysDiff) > switchDisplayFormatAfter) {
|
|
23
|
+
toReturn = "".concat(prefix ? prefix : "", " ").concat(inputMoment.format(format));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
toReturn = inputMoment.fromNow();
|
|
27
|
+
}
|
|
28
|
+
return toReturn;
|
|
29
|
+
};
|
|
30
|
+
exports.createFormattedDate = createFormattedDate;
|
|
@@ -21,6 +21,6 @@ var renderImagePlaceholderForOolibPreview = function (options) {
|
|
|
21
21
|
alignItems: "center",
|
|
22
22
|
flex: "0 0 auto",
|
|
23
23
|
} },
|
|
24
|
-
react_1.default.createElement(Tooltip_1.Tooltip, { position: tooltipPos, text: "ProfileImageDisplay component needs to be provided via theme provider in order to render profile image", presetTarget: "infoIcon" })));
|
|
24
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { popOutOfOverflowHiddenParent: true, position: tooltipPos, text: "ProfileImageDisplay component needs to be provided via theme provider in order to render profile image", presetTarget: "infoIcon" })));
|
|
25
25
|
};
|
|
26
26
|
exports.renderImagePlaceholderForOolibPreview = renderImagePlaceholderForOolibPreview;
|