oolib 2.112.1 → 2.113.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/Divider/index.d.ts +6 -4
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +2 -1
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +2 -2
- package/dist/components/Dropdowns/comps/OptionsShell/index.js +6 -13
- package/dist/components/Section/index.d.ts +21 -2
- package/dist/components/Section/index.js +16 -10
- package/dist/components/Section/styled.d.ts +1 -0
- package/dist/components/Section/{index.styled.js → styled.js} +2 -3
- package/dist/components/Wrappers/WrapperCardGrid.d.ts +5 -7
- package/dist/components/Wrappers/index.d.ts +17 -10
- package/dist/components/Wrappers/index.js +15 -14
- package/dist/components/Wrappers/styled.d.ts +2 -0
- package/dist/components/Wrappers/{index.styled.js → styled.js} +2 -2
- package/dist/utils/customHooks/useScreenWidth.d.ts +10 -1
- package/dist/utils/customHooks/useScreenWidth.js +14 -8
- package/package.json +6 -6
- package/dist/components/Section/index.styled.d.ts +0 -1
- package/dist/components/Wrappers/index.styled.d.ts +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
interface DividerProps {
|
|
3
|
+
invert?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const Divider: FunctionComponent<DividerProps>;
|
|
6
|
+
export {};
|
|
@@ -13,7 +13,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
13
13
|
var themes_1 = require("../../themes");
|
|
14
14
|
var StyledHr = styled_components_1.default.hr(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 0;\n border: none;\n border-bottom: 0.1rem solid ", ";\n"], ["\n margin: 0;\n border: none;\n border-bottom: 0.1rem solid ", ";\n"])), function (_a) {
|
|
15
15
|
var invert = _a.invert;
|
|
16
|
-
return invert ? themes_1.colors.greyColor80 : themes_1.colors.greyColor15;
|
|
16
|
+
return (invert ? themes_1.colors.greyColor80 : themes_1.colors.greyColor15);
|
|
17
17
|
});
|
|
18
18
|
var Divider = function (_a) {
|
|
19
19
|
var invert = _a.invert;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function OptionsAnimateWrapper({ options, optionsRef, relativeToRef, showOptions, invert, yOrientation, fixPos, optionsAnchor, children, }: {
|
|
1
|
+
export function OptionsAnimateWrapper({ options, optionsRef, relativeToRef, showOptions, invert, yOrientation, fixPos, optionsAnchor, children, lightboxStyle }: {
|
|
2
2
|
options: any;
|
|
3
3
|
optionsRef: any;
|
|
4
4
|
relativeToRef: any;
|
|
@@ -8,5 +8,6 @@ export function OptionsAnimateWrapper({ options, optionsRef, relativeToRef, show
|
|
|
8
8
|
fixPos: any;
|
|
9
9
|
optionsAnchor: any;
|
|
10
10
|
children: any;
|
|
11
|
+
lightboxStyle: any;
|
|
11
12
|
}): React.JSX.Element;
|
|
12
13
|
import React from "react";
|
|
@@ -40,7 +40,7 @@ var styled_1 = require("./styled");
|
|
|
40
40
|
var OptionsAnimateWrapper = function (_a) {
|
|
41
41
|
var _b;
|
|
42
42
|
var _c;
|
|
43
|
-
var options = _a.options, optionsRef = _a.optionsRef, relativeToRef = _a.relativeToRef, showOptions = _a.showOptions, invert = _a.invert, yOrientation = _a.yOrientation, fixPos = _a.fixPos, optionsAnchor = _a.optionsAnchor, children = _a.children;
|
|
43
|
+
var options = _a.options, optionsRef = _a.optionsRef, relativeToRef = _a.relativeToRef, showOptions = _a.showOptions, invert = _a.invert, yOrientation = _a.yOrientation, fixPos = _a.fixPos, optionsAnchor = _a.optionsAnchor, children = _a.children, lightboxStyle = _a.lightboxStyle;
|
|
44
44
|
var selectCompRect = (_c = relativeToRef === null || relativeToRef === void 0 ? void 0 : relativeToRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
|
|
45
45
|
//we need to recalc when ops length change because, in tag comps, when loading a fixed set of 'loading' options are shown
|
|
46
46
|
//before the actual number of options are loaded
|
|
@@ -56,7 +56,7 @@ var OptionsAnimateWrapper = function (_a) {
|
|
|
56
56
|
openHeight: (_d = (_c = optionsRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) === null || _d === void 0 ? void 0 : _d.height,
|
|
57
57
|
});
|
|
58
58
|
}, [options.length]);
|
|
59
|
-
return (react_1.default.createElement(styled_1.StyledOptionsAnimateWrapper, { invert: invert, isOpen: showOptions, width: width, openHeight: openHeight, style: __assign({ zIndex: 100000 }, (fixPos
|
|
59
|
+
return (react_1.default.createElement(styled_1.StyledOptionsAnimateWrapper, { invert: invert, isOpen: showOptions, width: width, openHeight: openHeight, style: __assign(__assign(__assign({}, (lightboxStyle || {})), { zIndex: 100000 }), (fixPos
|
|
60
60
|
? __assign({ position: "fixed", top: "".concat(fixPos.y -
|
|
61
61
|
(yOrientation === "top" ? (selectCompRect === null || selectCompRect === void 0 ? void 0 : selectCompRect.height) || 0 : 0), "px"), left: "".concat(fixPos.x, "px") }, (yOrientation === "top"
|
|
62
62
|
? { transform: "translateY(-100%)" }
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -60,10 +49,14 @@ exports.OptionsShell = react_1.default.forwardRef(function (_a, ref) {
|
|
|
60
49
|
}, [showOptions]);
|
|
61
50
|
return isDesktop ? (react_1.default.createElement(react_1.Fragment, null,
|
|
62
51
|
popOutOfOverflowHiddenParent && react_1.default.createElement("div", { ref: trackerRef }),
|
|
63
|
-
react_1.default.createElement(OptionsAnimateWrapper_1.OptionsAnimateWrapper, { options: options, optionsRef: ref, relativeToRef: relativeToRef, showOptions: showOptions, invert: invert, yOrientation: yOrientation, fixPos: fixPos, optionsAnchor: optionsAnchor, children: children },
|
|
52
|
+
react_1.default.createElement(OptionsAnimateWrapper_1.OptionsAnimateWrapper, { options: options, optionsRef: ref, relativeToRef: relativeToRef, showOptions: showOptions, invert: invert, yOrientation: yOrientation, fixPos: fixPos, optionsAnchor: optionsAnchor, children: children, lightboxStyle: lightboxStyle },
|
|
64
53
|
react_1.default.createElement(styled_1.StyledOptionsWrapper, { id: "StyledOptionsWrapper", ref: ref, invert: invert, lightboxHeight: lightboxHeight,
|
|
65
54
|
// className={className}
|
|
66
|
-
style:
|
|
55
|
+
style: {
|
|
56
|
+
position: "absolute",
|
|
57
|
+
bottom: yOrientation === "top" ? undefined : 0,
|
|
58
|
+
top: yOrientation === "top" ? 0 : undefined,
|
|
59
|
+
} }, children)))) : (react_1.default.createElement(framer_motion_1.AnimatePresence, null, showOptions ? (react_1.default.createElement(Modal_1.Modal, { fitToContentHeight: true, title: optionsModalLabel || label, onClose: handleHideOptions, invert: invert, S: S },
|
|
67
60
|
SelectComp && SelectComp,
|
|
68
61
|
react_1.default.createElement(styled_1.StyledModalOptionsWrapper, { invert: invert, ref: ref }, children),
|
|
69
62
|
showDoneButton && (react_1.default.createElement("div", { style: {
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
export interface SectionProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
borderTop?: boolean;
|
|
4
|
+
borderRight?: boolean;
|
|
5
|
+
borderLeft?: boolean;
|
|
6
|
+
borderBottom?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @component Renders a section component with customizable border properties.
|
|
11
|
+
*
|
|
12
|
+
* - The props object containing the following properties:
|
|
13
|
+
* @prop {boolean} props.borderTop: A boolean indicating whether to display a top border. Defaults to false.
|
|
14
|
+
* @prop {boolean} props.borderRight: A boolean indicating whether to display a right border. Defaults to false.
|
|
15
|
+
* @prop {boolean} props.borderLeft: A boolean indicating whether to display a left border. Defaults to false.
|
|
16
|
+
* @prop {boolean} props.borderBottom: A boolean indicating whether to display a bottom border. Defaults to false.
|
|
17
|
+
* @prop {React.CSSProperties} props.style: Additional CSS styles to apply to the section.
|
|
18
|
+
* @prop {React.ReactNode} props.children: The content to be rendered inside the section element.
|
|
19
|
+
* @return {ReactElement} The rendered section component.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Section: FunctionComponent<SectionProps>;
|
|
@@ -16,18 +16,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Section = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var
|
|
20
|
-
/*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
19
|
+
var styled_1 = require("./styled");
|
|
20
|
+
/* especially meant for usecases where the page container has a max width,
|
|
21
|
+
/* but we need its bottom border to stretch the full width of the screen */
|
|
22
|
+
/* props can be any valid color value,
|
|
23
|
+
/* can be borderBottom/Top/Left/Right * can be style, className & children */
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* @component Renders a section component with customizable border properties.
|
|
26
|
+
*
|
|
27
|
+
* - The props object containing the following properties:
|
|
28
|
+
* @prop {boolean} props.borderTop: A boolean indicating whether to display a top border. Defaults to false.
|
|
29
|
+
* @prop {boolean} props.borderRight: A boolean indicating whether to display a right border. Defaults to false.
|
|
30
|
+
* @prop {boolean} props.borderLeft: A boolean indicating whether to display a left border. Defaults to false.
|
|
31
|
+
* @prop {boolean} props.borderBottom: A boolean indicating whether to display a bottom border. Defaults to false.
|
|
32
|
+
* @prop {React.CSSProperties} props.style: Additional CSS styles to apply to the section.
|
|
33
|
+
* @prop {React.ReactNode} props.children: The content to be rendered inside the section element.
|
|
34
|
+
* @return {ReactElement} The rendered section component.
|
|
29
35
|
*/
|
|
30
36
|
var Section = function (props) {
|
|
31
|
-
return (react_1.default.createElement(
|
|
37
|
+
return (react_1.default.createElement(styled_1.StyledSection, __assign({}, props), props.children));
|
|
32
38
|
};
|
|
33
39
|
exports.Section = Section;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledSection: import("styled-components").StyledComponent<"section", any, {}, never>;
|
|
@@ -23,7 +23,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
23
23
|
var colors_1 = require("../../themes/colors");
|
|
24
24
|
var setBorder = function (_a) {
|
|
25
25
|
var props = _a.props;
|
|
26
|
-
var borderStyles =
|
|
26
|
+
var borderStyles = '';
|
|
27
27
|
var greyColor15 = colors_1.colors.greyColor15;
|
|
28
28
|
if (props.borderTop || props.borderRight || props.borderLeft || props.borderBottom) {
|
|
29
29
|
if (props.borderTop)
|
|
@@ -40,8 +40,7 @@ var setBorder = function (_a) {
|
|
|
40
40
|
var setFill = function (_a) {
|
|
41
41
|
var _b;
|
|
42
42
|
var props = _a.props;
|
|
43
|
-
var colorsObj = ((_b = props.theme) === null || _b === void 0 ? void 0 : _b.colors)
|
|
44
|
-
? __assign(__assign({}, colors_1.colors), props.theme.colors) : colors_1.colors;
|
|
43
|
+
var colorsObj = ((_b = props.theme) === null || _b === void 0 ? void 0 : _b.colors) ? __assign(__assign({}, colors_1.colors), props.theme.colors) : colors_1.colors;
|
|
45
44
|
var colorKey = Object.keys(props).find(function (p) { return !!colorsObj[p]; });
|
|
46
45
|
return colorKey ? "background-color: ".concat(colorsObj[colorKey], ";") : '';
|
|
47
46
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
className: any;
|
|
4
|
-
children: any;
|
|
5
|
-
id: any;
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
interface WrapperCardGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
3
|
minWidth?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
4
|
+
}
|
|
5
|
+
export declare const WrapperCardGrid: FunctionComponent<WrapperCardGridProps>;
|
|
6
|
+
export {};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { WrapperCardGrid } from './WrapperCardGrid';
|
|
3
|
+
export interface WrapperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
maxWidth?: number;
|
|
5
|
+
align?: 'left' | 'center';
|
|
6
|
+
left?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Wrapper: FunctionComponent<WrapperProps>;
|
|
9
|
+
export { WrapperCardGrid };
|
|
10
|
+
export declare const Wrapper1500: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
11
|
+
export declare const Wrapper1120: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
12
|
+
export declare const Wrapper1000: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
13
|
+
export declare const Wrapper900: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
14
|
+
export declare const Wrapper800: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
15
|
+
export declare const Wrapper820: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
16
|
+
export declare const Wrapper700: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
17
|
+
export declare const Wrapper650: FunctionComponent<Omit<WrapperProps, 'maxWidth'>>;
|
|
@@ -14,29 +14,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Wrapper650 = exports.Wrapper700 = exports.Wrapper820 = exports.Wrapper800 = exports.Wrapper900 = exports.Wrapper1000 = exports.Wrapper1120 = exports.Wrapper1500 = exports.WrapperCardGrid = void 0;
|
|
17
|
+
exports.Wrapper650 = exports.Wrapper700 = exports.Wrapper820 = exports.Wrapper800 = exports.Wrapper900 = exports.Wrapper1000 = exports.Wrapper1120 = exports.Wrapper1500 = exports.WrapperCardGrid = exports.Wrapper = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var
|
|
19
|
+
var WrapperCardGrid_1 = require("./WrapperCardGrid");
|
|
20
|
+
Object.defineProperty(exports, "WrapperCardGrid", { enumerable: true, get: function () { return WrapperCardGrid_1.WrapperCardGrid; } });
|
|
21
|
+
var styled_1 = require("./styled");
|
|
20
22
|
var Wrapper = function (_a) {
|
|
21
|
-
var style = _a.style, children = _a.children, className = _a.className, maxWidth = _a.maxWidth,
|
|
23
|
+
var style = _a.style, children = _a.children, className = _a.className, maxWidth = _a.maxWidth, align = _a.align, left = _a.left;
|
|
22
24
|
align = align || (left ? 'left' : 'center');
|
|
23
|
-
return (react_1.default.createElement(
|
|
25
|
+
return (react_1.default.createElement(styled_1.StyledWrapper, { maxWidth: maxWidth, align: align, className: className || '', style: style }, children));
|
|
24
26
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var Wrapper1500 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 1500 })); };
|
|
27
|
+
exports.Wrapper = Wrapper;
|
|
28
|
+
var Wrapper1500 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 1500 }))); };
|
|
28
29
|
exports.Wrapper1500 = Wrapper1500;
|
|
29
|
-
var Wrapper1120 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 1120 })); };
|
|
30
|
+
var Wrapper1120 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 1120 }))); };
|
|
30
31
|
exports.Wrapper1120 = Wrapper1120;
|
|
31
|
-
var Wrapper1000 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 1000 })); };
|
|
32
|
+
var Wrapper1000 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 1000 }))); };
|
|
32
33
|
exports.Wrapper1000 = Wrapper1000;
|
|
33
|
-
var Wrapper900 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 900 })); };
|
|
34
|
+
var Wrapper900 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 900 }))); };
|
|
34
35
|
exports.Wrapper900 = Wrapper900;
|
|
35
|
-
var Wrapper800 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 800 })); };
|
|
36
|
+
var Wrapper800 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 800 }))); };
|
|
36
37
|
exports.Wrapper800 = Wrapper800;
|
|
37
|
-
var Wrapper820 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 820 })); };
|
|
38
|
+
var Wrapper820 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 820 }))); };
|
|
38
39
|
exports.Wrapper820 = Wrapper820;
|
|
39
|
-
var Wrapper700 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 700 })); };
|
|
40
|
+
var Wrapper700 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 700 }))); };
|
|
40
41
|
exports.Wrapper700 = Wrapper700;
|
|
41
|
-
var Wrapper650 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 650 })); };
|
|
42
|
+
var Wrapper650 = function (props) { return (react_1.default.createElement(exports.Wrapper, __assign({}, props, { maxWidth: 650 }))); };
|
|
42
43
|
exports.Wrapper650 = Wrapper650;
|
|
@@ -11,9 +11,9 @@ exports.StyledWrapper = void 0;
|
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
exports.StyledWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: ", ";\n margin: ", ";\n"], ["\n max-width: ", ";\n margin: ", ";\n"])), function (_a) {
|
|
13
13
|
var maxWidth = _a.maxWidth;
|
|
14
|
-
return maxWidth
|
|
14
|
+
return (maxWidth ? "".concat(maxWidth, "px") : 'unset');
|
|
15
15
|
}, function (_a) {
|
|
16
16
|
var align = _a.align;
|
|
17
|
-
return align === 'left' ? 'unset' : '0 auto';
|
|
17
|
+
return (align === 'left' ? 'unset' : '0 auto');
|
|
18
18
|
});
|
|
19
19
|
var templateObject_1;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface UseScreenWidthOptions {
|
|
2
|
+
resizeFn?: () => void;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook that tracks the screen width and invokes a resize function if provided.
|
|
6
|
+
*
|
|
7
|
+
* @param {resizerFn} resizeFn - The resize function to invoke when the screen width changes. Defaults to `() => {}` -.
|
|
8
|
+
* @return {number} The current screen width.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useScreenWidth: (options?: UseScreenWidthOptions) => number;
|
|
@@ -3,20 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useScreenWidth = void 0;
|
|
4
4
|
var lodash_1 = require("lodash");
|
|
5
5
|
var react_1 = require("react");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Custom hook that tracks the screen width and invokes a resize function if provided.
|
|
8
|
+
*
|
|
9
|
+
* @param {resizerFn} resizeFn - The resize function to invoke when the screen width changes. Defaults to `() => {}` -.
|
|
10
|
+
* @return {number} The current screen width.
|
|
11
|
+
*/
|
|
12
|
+
var useScreenWidth = function (options) {
|
|
13
|
+
if (options === void 0) { options = {}; }
|
|
14
|
+
var resizeFn = options.resizeFn;
|
|
15
|
+
var _a = (0, react_1.useState)(document.documentElement.clientWidth), screenWidth = _a[0], setScreenWidth = _a[1];
|
|
16
|
+
var handleResize = (0, lodash_1.debounce)(function () {
|
|
10
17
|
setScreenWidth(document.documentElement.clientWidth);
|
|
11
|
-
resizeFn
|
|
12
|
-
};
|
|
13
|
-
handleResize = (0, lodash_1.debounce)(handleResize, 500);
|
|
18
|
+
resizeFn === null || resizeFn === void 0 ? void 0 : resizeFn();
|
|
19
|
+
}, 500);
|
|
14
20
|
(0, react_1.useEffect)(function () {
|
|
15
21
|
window.addEventListener('resize', handleResize);
|
|
16
22
|
return function () {
|
|
17
23
|
window.removeEventListener('resize', handleResize);
|
|
18
24
|
};
|
|
19
|
-
}, []);
|
|
25
|
+
}, [handleResize]);
|
|
20
26
|
return screenWidth;
|
|
21
27
|
};
|
|
22
28
|
exports.useScreenWidth = useScreenWidth;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oolib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.113.1",
|
|
4
4
|
"description": " OKE Component Library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -85,8 +85,9 @@
|
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"framer-motion": "^4.1.17",
|
|
89
88
|
"@faker-js/faker": "^8.3.1",
|
|
89
|
+
"@lexical/react": "^0.13.1",
|
|
90
|
+
"@lexical/table": "^0.13.1",
|
|
90
91
|
"@react-hook/resize-observer": "^1.2.6",
|
|
91
92
|
"babel-polyfill": "^6.26.0",
|
|
92
93
|
"d3": "^7.8.5",
|
|
@@ -95,15 +96,14 @@
|
|
|
95
96
|
"draft-js": "^0.11.7",
|
|
96
97
|
"draftjs-conductor": "^2.2.0",
|
|
97
98
|
"faker": "^6.6.6",
|
|
99
|
+
"framer-motion": "^4.1.17",
|
|
98
100
|
"immutable": "^3.7.6",
|
|
101
|
+
"lexical": "^0.13.1",
|
|
99
102
|
"lodash": "^4.17.21",
|
|
100
103
|
"modularscale-js": "^3.0.1",
|
|
101
104
|
"moment": "^2.24.0",
|
|
102
105
|
"phosphor-react": "^1.4.1",
|
|
103
106
|
"react-player": "^2.12.0",
|
|
104
|
-
"react-virtualized": "^9.22.5"
|
|
105
|
-
"lexical": "0.13.1",
|
|
106
|
-
"@lexical/react": "0.13.1",
|
|
107
|
-
"@lexical/table": "0.13.1"
|
|
107
|
+
"react-virtualized": "^9.22.5"
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const StyledSection: import("styled-components").StyledComponent<"section", any, {}, never>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const StyledWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|