oolib 2.55.8 → 2.57.0
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/BlockLabel/index.js +2 -2
- package/dist/components/Hints/index.d.ts +3 -2
- package/dist/components/Hints/index.js +5 -5
- package/dist/components/HomeCover/index.js +7 -4
- package/dist/components/OKELink/index.js +3 -5
- package/dist/utils/_EXPORTS/index.d.ts +3 -0
- package/dist/utils/_EXPORTS/index.js +8 -1
- package/dist/utils/getBlockLabelProps.js +4 -1
- package/dist/utils/getKeyCode.d.ts +1 -0
- package/dist/utils/getKeyCode.js +17 -0
- package/dist/utils/getText.d.ts +1 -0
- package/dist/utils/getText.js +43 -0
- package/dist/utils/isStringMatch.d.ts +6 -0
- package/dist/utils/isStringMatch.js +27 -0
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ var Tooltip_1 = require("../Tooltip");
|
|
|
38
38
|
var phosphor_react_1 = require("phosphor-react");
|
|
39
39
|
var greyColor40 = colors_1.colors.greyColor40, greyColor80 = colors_1.colors.greyColor80;
|
|
40
40
|
var BlockLabel = function (props) {
|
|
41
|
-
var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, errorMsgs = props.errorMsgs, hints = props.hints, id = props.id,
|
|
41
|
+
var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, errorMsgs = props.errorMsgs, hints = props.hints, id = props.id, hintsTitle = props.hintsTitle, hintsBtnLabel = props.hintsBtnLabel, hintsSubtitle = props.hintsSubtitle, hideOptionalLabel = props.hideOptionalLabel, infoTooltip = props.infoTooltip;
|
|
42
42
|
var shouldCompRender = label ||
|
|
43
43
|
(!readOnly &&
|
|
44
44
|
(sublabel ||
|
|
@@ -55,7 +55,7 @@ var BlockLabel = function (props) {
|
|
|
55
55
|
return (shouldCompRender && (react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className },
|
|
56
56
|
react_1.default.createElement("div", { style: { display: "flex", gap: "1rem" } },
|
|
57
57
|
(label || inputOnlyLabel) && (react_1.default.createElement(Typo_1.SANS_3, { invert: invert, semibold: true, capitalize: true }, label || inputOnlyLabel)),
|
|
58
|
-
!readOnly && hints ? (react_1.default.createElement(Hints_1.default, { id: id, title: hintsTitle, subtitle: hintsSubtitle, hints: hints })) : null,
|
|
58
|
+
!readOnly && hints ? (react_1.default.createElement(Hints_1.default, { id: id, title: hintsTitle, btnlabel: hintsBtnLabel, subtitle: hintsSubtitle, hints: hints })) : null,
|
|
59
59
|
optional && !hideOptionalLabel && (react_1.default.createElement(Typo_1.SANS_3, { color: invert ? greyColor40 : greyColor80 }, "(optional)")),
|
|
60
60
|
!readOnly && (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0 ? (react_1.default.createElement(InlineAlert_1.InlineAlert, { text: errText, type: errType, link: errLink, invert: invert })) : null,
|
|
61
61
|
infoTooltip && (react_1.default.createElement(Tooltip_1.Tooltip, { text: infoTooltip.text || infoTooltip, position: infoTooltip.position || "right", invert: invert, debug: infoTooltip.debug, popOutOfOverflowHiddenParent: infoTooltip.popOutOfOverflowHiddenParent, presetTarget: "infoIcon" }))),
|
|
@@ -67,12 +67,12 @@ var BulletIcon = function () { return (
|
|
|
67
67
|
react_1.default.createElement("div", { style: { fontSize: 0, marginTop: "6.5px" } },
|
|
68
68
|
react_1.default.createElement(comps_1.DisplayIcon, { color: greyColor100, weight: "fill", icon: "Circle", size: 8 }))); };
|
|
69
69
|
var Hints = function (_a) {
|
|
70
|
-
var id = _a.id, hints = _a.hints,
|
|
70
|
+
var id = _a.id, hints = _a.hints, _b = _a.title, title = _b === void 0 ? "Hints" : _b, _c = _a.btnlabel, btnlabel = _c === void 0 ? "Hints" : _c, subtitle = _a.subtitle;
|
|
71
71
|
//get the context state
|
|
72
|
-
var
|
|
72
|
+
var _d = (0, contextApi_1.useHintsContext)(), active = _d.active, setActive = _d.setActive;
|
|
73
73
|
var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
|
|
74
74
|
var lightBoxRef = (0, react_1.useRef)();
|
|
75
|
-
var
|
|
75
|
+
var _e = (0, react_1.useState)(getPositionStyles("left")), styles = _e[0], setStyles = _e[1];
|
|
76
76
|
//isStorybook is temporary hack to get correct with on storybook, since a story is getting renderend within an iframe, screen.width gives the incorrect width
|
|
77
77
|
var isDesktop = screenWidth > (0, mixins_1.getBreakPoint)("md");
|
|
78
78
|
(0, react_1.useEffect)(function () {
|
|
@@ -93,7 +93,7 @@ var Hints = function (_a) {
|
|
|
93
93
|
" ",
|
|
94
94
|
react_1.default.createElement(styled_1.StyledHints, { onClick: function () { return setActive(id); } },
|
|
95
95
|
react_1.default.createElement(Typo_1.SANS_3, { semibold: true },
|
|
96
|
-
react_1.default.createElement(OKELink_1.OKELink, { icon: "LightbulbFilament", linkType: "action", onClick: function () { return setActive(id); }, iconSize: 16, invertUnderline: true },
|
|
96
|
+
react_1.default.createElement(OKELink_1.OKELink, { icon: "LightbulbFilament", linkType: "action", onClick: function () { return setActive(id); }, iconSize: 16, invertUnderline: true }, btnlabel))),
|
|
97
97
|
active === id ? (isDesktop ? (react_1.default.createElement("div", null,
|
|
98
98
|
react_1.default.createElement(styled_1.StyledTriangle, { style: styles.arrow, id: id }),
|
|
99
99
|
react_1.default.createElement(styled_1.StyledLightbox, { style: styles.lightBox, ref: lightBoxRef, id: id },
|
|
@@ -101,7 +101,7 @@ var Hints = function (_a) {
|
|
|
101
101
|
react_1.default.createElement("div", { style: { position: "absolute", top: "-2.5rem", fontSize: 0 } },
|
|
102
102
|
react_1.default.createElement(comps_1.DisplayIcon, { icon: "ModalBulbIcon" })),
|
|
103
103
|
react_1.default.createElement(styled_2.StyledModalHeaderStyle2Title, null,
|
|
104
|
-
react_1.default.createElement(Typo_1.SANS_3, { semibold: true, capitalize: true }, title
|
|
104
|
+
react_1.default.createElement(Typo_1.SANS_3, { semibold: true, capitalize: true }, title),
|
|
105
105
|
subtitle ? (react_1.default.createElement(Typo_1.SANS_3_4, { capitalize: true, semibold: true, style: { flexGrow: "1" }, color: greyColor80 }, subtitle)) : null,
|
|
106
106
|
react_1.default.createElement(Buttons_1.ButtonGhost, { onClick: function () { return setActive(""); }, icon: "X" }))),
|
|
107
107
|
react_1.default.createElement(styled_1.StyledLightBoxContent, null,
|
|
@@ -89,8 +89,10 @@ var HomeCover = function (_a) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
var interval, timeout;
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
var intervalFlag = isDesktop ? 4 : 2;
|
|
93
|
+
if (_CoverImages.length >= intervalFlag) {
|
|
94
|
+
interval = setInterval(function () {
|
|
95
|
+
// if(_CoverImages.length>=intervalFlag) {
|
|
94
96
|
setCoverImageIdx(function (prev) {
|
|
95
97
|
return __assign(__assign({}, prev), { currLayer: prev.currLayer === "layer1" ? "layer2" : "layer1" });
|
|
96
98
|
});
|
|
@@ -118,8 +120,9 @@ var HomeCover = function (_a) {
|
|
|
118
120
|
[(prev[layerToSwitch][0] + 2) % _CoverImages.length], _a));
|
|
119
121
|
});
|
|
120
122
|
}, 300); // the interval here shoudl be the same as the css transition interval
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
// }
|
|
124
|
+
}, 3000);
|
|
125
|
+
}
|
|
123
126
|
//resize title container if text is bleeding out due to long word
|
|
124
127
|
return function () {
|
|
125
128
|
clearTimeout(timeout);
|
|
@@ -37,14 +37,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
exports.OKELink = void 0;
|
|
38
38
|
var react_1 = __importStar(require("react"));
|
|
39
39
|
var react_router_dom_1 = require("react-router-dom");
|
|
40
|
-
var icons_1 = require("../../icons");
|
|
41
40
|
// import { ProfileImageDisplay } from '../../inputs/ImageInput/derivedComps/ProfileImageDisplay'
|
|
42
|
-
var styled_1 = require("./styled");
|
|
43
|
-
var utilsOolib_1 = require("../../utilsOolib");
|
|
44
41
|
var styled_components_1 = require("styled-components");
|
|
45
|
-
var themes_1 = require("../../themes");
|
|
46
|
-
var injectHttps_1 = require("../../utils/injectHttps");
|
|
47
42
|
var comps_1 = require("../../utils/comps");
|
|
43
|
+
var injectHttps_1 = require("../../utils/injectHttps");
|
|
44
|
+
var utilsOolib_1 = require("../../utilsOolib");
|
|
45
|
+
var styled_1 = require("./styled");
|
|
48
46
|
var OKELink = function (_a) {
|
|
49
47
|
var _to = _a.to, link = _a.link, //link is deprecated. use to instead
|
|
50
48
|
onClick = _a.onClick, icon = _a.icon, iconAfter = _a.iconAfter, text = _a.text, children = _a.children, invertUnderline = _a.invertUnderline, color = _a.color, invert = _a.invert, disabled = _a.disabled, className = _a.className, style = _a.style, avatar = _a.avatar, // imageData // [ {...} ] OR {...}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
export { getVal } from "../getterSetterDeleter/getVal";
|
|
2
2
|
export { setVal } from "../getterSetterDeleter/setVal";
|
|
3
3
|
export { deleteVal } from "../getterSetterDeleter/deleteVal";
|
|
4
|
+
export { getText } from "../getText";
|
|
5
|
+
export { getKeyCode } from "../getKeyCode";
|
|
4
6
|
export { getBlockLabelProps } from "../getBlockLabelProps";
|
|
5
7
|
export { injectHttps } from "../injectHttps";
|
|
6
8
|
export { formatTextToCamelCase } from "../formatTextToCamelCase";
|
|
7
9
|
export { formatCamelCaseToSentenceCase } from "../formatCamelCaseToSentenceCase";
|
|
8
10
|
export { toArray } from "../toArray";
|
|
9
11
|
export { sortData } from "../sortData";
|
|
12
|
+
export { isStringMatch } from "../isStringMatch";
|
|
10
13
|
export { useScroll } from "../customHooks/useScroll";
|
|
11
14
|
export { usePopOutOfOverflowHiddenParent } from "../usePopOutOfOverflowHiddenParent";
|
|
12
15
|
export { useHandleClickOutside } from "../customHooks/useHandleClickOutside";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDaysDiff = exports.useScreenWidth = exports.testJSON = exports.useHandleClickOutside = exports.usePopOutOfOverflowHiddenParent = exports.useScroll = exports.sortData = exports.toArray = exports.formatCamelCaseToSentenceCase = exports.formatTextToCamelCase = exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
|
|
3
|
+
exports.getDaysDiff = exports.useScreenWidth = exports.testJSON = exports.useHandleClickOutside = exports.usePopOutOfOverflowHiddenParent = exports.useScroll = exports.isStringMatch = exports.sortData = exports.toArray = exports.formatCamelCaseToSentenceCase = exports.formatTextToCamelCase = exports.injectHttps = exports.getBlockLabelProps = exports.getKeyCode = exports.getText = exports.deleteVal = exports.setVal = exports.getVal = void 0;
|
|
4
4
|
//the holy setter, getter & deleter
|
|
5
5
|
var getVal_1 = require("../getterSetterDeleter/getVal");
|
|
6
6
|
Object.defineProperty(exports, "getVal", { enumerable: true, get: function () { return getVal_1.getVal; } });
|
|
@@ -8,6 +8,11 @@ var setVal_1 = require("../getterSetterDeleter/setVal");
|
|
|
8
8
|
Object.defineProperty(exports, "setVal", { enumerable: true, get: function () { return setVal_1.setVal; } });
|
|
9
9
|
var deleteVal_1 = require("../getterSetterDeleter/deleteVal");
|
|
10
10
|
Object.defineProperty(exports, "deleteVal", { enumerable: true, get: function () { return deleteVal_1.deleteVal; } });
|
|
11
|
+
//other getters
|
|
12
|
+
var getText_1 = require("../getText");
|
|
13
|
+
Object.defineProperty(exports, "getText", { enumerable: true, get: function () { return getText_1.getText; } });
|
|
14
|
+
var getKeyCode_1 = require("../getKeyCode");
|
|
15
|
+
Object.defineProperty(exports, "getKeyCode", { enumerable: true, get: function () { return getKeyCode_1.getKeyCode; } });
|
|
11
16
|
//the others
|
|
12
17
|
var getBlockLabelProps_1 = require("../getBlockLabelProps");
|
|
13
18
|
Object.defineProperty(exports, "getBlockLabelProps", { enumerable: true, get: function () { return getBlockLabelProps_1.getBlockLabelProps; } });
|
|
@@ -21,6 +26,8 @@ var toArray_1 = require("../toArray");
|
|
|
21
26
|
Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return toArray_1.toArray; } });
|
|
22
27
|
var sortData_1 = require("../sortData");
|
|
23
28
|
Object.defineProperty(exports, "sortData", { enumerable: true, get: function () { return sortData_1.sortData; } });
|
|
29
|
+
var isStringMatch_1 = require("../isStringMatch");
|
|
30
|
+
Object.defineProperty(exports, "isStringMatch", { enumerable: true, get: function () { return isStringMatch_1.isStringMatch; } });
|
|
24
31
|
//custom hooks
|
|
25
32
|
var useScroll_1 = require("../customHooks/useScroll");
|
|
26
33
|
Object.defineProperty(exports, "useScroll", { enumerable: true, get: function () { return useScroll_1.useScroll; } });
|
|
@@ -14,9 +14,12 @@ var getBlockLabelProps = function (props) {
|
|
|
14
14
|
'isRequired',
|
|
15
15
|
'invert',
|
|
16
16
|
'hints',
|
|
17
|
+
"hintsBtnLabel",
|
|
18
|
+
"hintsTitle",
|
|
19
|
+
"hintsSubtitle",
|
|
17
20
|
'hideOptionalLabel',
|
|
18
21
|
'infoTooltip',
|
|
19
|
-
'popOutOfOverflowHiddenParent'
|
|
22
|
+
'popOutOfOverflowHiddenParent',
|
|
20
23
|
];
|
|
21
24
|
var labelProps = {};
|
|
22
25
|
Object.keys(props).map(function (key) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getKeyCode(event: any): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKeyCode = void 0;
|
|
4
|
+
var getKeyCode = function (event) {
|
|
5
|
+
var code;
|
|
6
|
+
if (event.key !== undefined) {
|
|
7
|
+
code = event.key;
|
|
8
|
+
}
|
|
9
|
+
else if (event.keyIdentifier !== undefined) {
|
|
10
|
+
code = event.keyIdentifier;
|
|
11
|
+
}
|
|
12
|
+
else if (event.keyCode !== undefined) {
|
|
13
|
+
code = event.keyCode;
|
|
14
|
+
}
|
|
15
|
+
return code;
|
|
16
|
+
};
|
|
17
|
+
exports.getKeyCode = getKeyCode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getText(value: any, options?: any): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {*} value
|
|
5
|
+
* @param {*} options
|
|
6
|
+
* @description we can pass multiple values as array, giving this function the option
|
|
7
|
+
* to pick any one that has a readable value in order of preference from first to last.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getText = void 0;
|
|
11
|
+
var getText = function (value, options) {
|
|
12
|
+
if (options === void 0) { options = {}; }
|
|
13
|
+
if (!value)
|
|
14
|
+
return "";
|
|
15
|
+
var toReturn = Array.isArray(value)
|
|
16
|
+
? extractFirstTruthyValue(value)
|
|
17
|
+
: extractorFn(value);
|
|
18
|
+
return "".concat(toReturn).concat(options.suffix || "");
|
|
19
|
+
};
|
|
20
|
+
exports.getText = getText;
|
|
21
|
+
var extractFirstTruthyValue = function (valueArray) {
|
|
22
|
+
var value;
|
|
23
|
+
for (var i = 0; i < valueArray.length; i++) {
|
|
24
|
+
value = extractorFn(valueArray[i]);
|
|
25
|
+
if (value)
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
var extractorFn = function (value) {
|
|
31
|
+
if (!value)
|
|
32
|
+
return "";
|
|
33
|
+
//check to see if its draftjs format.
|
|
34
|
+
//if not, simply return the value as is without modification
|
|
35
|
+
if (!Array.isArray(value.blocks))
|
|
36
|
+
return value;
|
|
37
|
+
//else
|
|
38
|
+
return value.blocks
|
|
39
|
+
.filter(function (d) { return !!d.text === true; })
|
|
40
|
+
.map(function (d) { return d.text; })
|
|
41
|
+
.join(" ")
|
|
42
|
+
.trim();
|
|
43
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStringMatch = void 0;
|
|
4
|
+
var getVal_1 = require("./getterSetterDeleter/getVal");
|
|
5
|
+
var toArray_1 = require("./toArray");
|
|
6
|
+
var isStringMatch = function (_a) {
|
|
7
|
+
var data = _a.data, toMatchPath = _a.toMatchPath, // can be array or string
|
|
8
|
+
subString = _a.subString,
|
|
9
|
+
// string, subString, strValPathObj = null
|
|
10
|
+
_b = _a.matchType // alt startsWith
|
|
11
|
+
,
|
|
12
|
+
// string, subString, strValPathObj = null
|
|
13
|
+
matchType = _b === void 0 ? 'includes' : _b // alt startsWith
|
|
14
|
+
;
|
|
15
|
+
var isMatch = false;
|
|
16
|
+
var pathsAry = (0, toArray_1.toArray)(toMatchPath);
|
|
17
|
+
for (var i = 0; i < pathsAry.length; i++) {
|
|
18
|
+
var path = pathsAry[i];
|
|
19
|
+
var stringToMatch = (0, getVal_1.getVal)(data, path);
|
|
20
|
+
if (stringToMatch === null || stringToMatch === void 0 ? void 0 : stringToMatch.toLowerCase()[matchType](subString === null || subString === void 0 ? void 0 : subString.toLowerCase())) {
|
|
21
|
+
isMatch = true;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return isMatch;
|
|
26
|
+
};
|
|
27
|
+
exports.isStringMatch = isStringMatch;
|