oolib 2.56.0 → 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/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 +1 -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
|
@@ -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; } });
|
|
@@ -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;
|