@vitus-labs/elements 0.23.0-alpha.2 → 0.24.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/lib/analysis/vitus-labs-elements.browser.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.module.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.native.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.umd.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.umd.min.js.html +1 -1
- package/lib/index.d.ts +14 -7
- package/lib/types/Overlay/index.d.ts +3 -3
- package/lib/types/Overlay/useOverlay.d.ts +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/vitus-labs-elements.browser.js +22 -14
- package/lib/vitus-labs-elements.browser.js.map +1 -1
- package/lib/vitus-labs-elements.js +67 -36
- package/lib/vitus-labs-elements.js.map +1 -1
- package/lib/vitus-labs-elements.module.js +63 -33
- package/lib/vitus-labs-elements.module.js.map +1 -1
- package/lib/vitus-labs-elements.native.js +63 -33
- package/lib/vitus-labs-elements.native.js.map +1 -1
- package/lib/vitus-labs-elements.umd.js +67 -36
- package/lib/vitus-labs-elements.umd.js.map +1 -1
- package/lib/vitus-labs-elements.umd.min.js +6 -6
- package/lib/vitus-labs-elements.umd.min.js.map +1 -1
- package/package.json +5 -5
|
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
|
|
|
6424
6424
|
</script>
|
|
6425
6425
|
<script>
|
|
6426
6426
|
/*<!--*/
|
|
6427
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-elements.umd.min.js","children":[{"name":"src","children":[{"uid":"
|
|
6427
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-elements.umd.min.js","children":[{"name":"src","children":[{"uid":"bbb5-217","name":"constants.ts"},{"name":"helpers","children":[{"name":"Wrapper","children":[{"uid":"bbb5-219","name":"constants.ts"},{"uid":"bbb5-221","name":"utils.ts"},{"uid":"bbb5-223","name":"styled.ts"},{"uid":"bbb5-225","name":"component.tsx"}]},{"name":"Content","children":[{"uid":"bbb5-227","name":"styled.ts"},{"uid":"bbb5-229","name":"component.tsx"}]},{"name":"Iterator/component.tsx","uid":"bbb5-239"}]},{"name":"Element","children":[{"uid":"bbb5-231","name":"constants.ts"},{"uid":"bbb5-233","name":"utils.ts"},{"uid":"bbb5-235","name":"component.tsx"},{"uid":"bbb5-237","name":"withEqualSizeBeforeAfter.tsx"}]},{"name":"List","children":[{"uid":"bbb5-241","name":"component.tsx"},{"uid":"bbb5-243","name":"withActiveState.tsx"}]},{"name":"Portal/component.ts","uid":"bbb5-245"},{"name":"Overlay","children":[{"uid":"bbb5-247","name":"context.tsx"},{"uid":"bbb5-249","name":"useOverlay.tsx"},{"uid":"bbb5-251","name":"component.tsx"}]},{"name":"Text","children":[{"uid":"bbb5-253","name":"styled.ts"},{"uid":"bbb5-255","name":"component.tsx"}]},{"uid":"bbb5-257","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"bbb5-217":{"renderedLength":102,"gzipLength":117,"brotliLength":0,"mainUid":"bbb5-216"},"bbb5-219":{"renderedLength":262,"gzipLength":212,"brotliLength":0,"mainUid":"bbb5-218"},"bbb5-221":{"renderedLength":117,"gzipLength":132,"brotliLength":0,"mainUid":"bbb5-220"},"bbb5-223":{"renderedLength":1040,"gzipLength":459,"brotliLength":0,"mainUid":"bbb5-222"},"bbb5-225":{"renderedLength":1314,"gzipLength":484,"brotliLength":0,"mainUid":"bbb5-224"},"bbb5-227":{"renderedLength":1756,"gzipLength":649,"brotliLength":0,"mainUid":"bbb5-226"},"bbb5-229":{"renderedLength":563,"gzipLength":281,"brotliLength":0,"mainUid":"bbb5-228"},"bbb5-231":{"renderedLength":945,"gzipLength":269,"brotliLength":0,"mainUid":"bbb5-230"},"bbb5-233":{"renderedLength":142,"gzipLength":118,"brotliLength":0,"mainUid":"bbb5-232"},"bbb5-235":{"renderedLength":4771,"gzipLength":1131,"brotliLength":0,"mainUid":"bbb5-234"},"bbb5-237":{"renderedLength":1970,"gzipLength":607,"brotliLength":0,"mainUid":"bbb5-236"},"bbb5-239":{"renderedLength":7246,"gzipLength":1374,"brotliLength":0,"mainUid":"bbb5-238"},"bbb5-241":{"renderedLength":587,"gzipLength":311,"brotliLength":0,"mainUid":"bbb5-240"},"bbb5-243":{"renderedLength":4820,"gzipLength":1099,"brotliLength":0,"mainUid":"bbb5-242"},"bbb5-245":{"renderedLength":483,"gzipLength":281,"brotliLength":0,"mainUid":"bbb5-244"},"bbb5-247":{"renderedLength":327,"gzipLength":199,"brotliLength":0,"mainUid":"bbb5-246"},"bbb5-249":{"renderedLength":14103,"gzipLength":2382,"brotliLength":0,"mainUid":"bbb5-248"},"bbb5-251":{"renderedLength":940,"gzipLength":437,"brotliLength":0,"mainUid":"bbb5-250"},"bbb5-253":{"renderedLength":352,"gzipLength":237,"brotliLength":0,"mainUid":"bbb5-252"},"bbb5-255":{"renderedLength":615,"gzipLength":369,"brotliLength":0,"mainUid":"bbb5-254"},"bbb5-257":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"bbb5-256"}},"nodeMetas":{"bbb5-216":{"id":"/src/constants.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-217"},"imported":[],"importedBy":[{"uid":"bbb5-234"},{"uid":"bbb5-240"},{"uid":"bbb5-250"},{"uid":"bbb5-244"},{"uid":"bbb5-254"}]},"bbb5-218":{"id":"/src/helpers/Wrapper/constants.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-219"},"imported":[],"importedBy":[{"uid":"bbb5-220"}]},"bbb5-220":{"id":"/src/helpers/Wrapper/utils.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-221"},"imported":[{"uid":"bbb5-218"}],"importedBy":[{"uid":"bbb5-224"}]},"bbb5-222":{"id":"/src/helpers/Wrapper/styled.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-223"},"imported":[{"uid":"bbb5-265"},{"uid":"bbb5-258"}],"importedBy":[{"uid":"bbb5-224"}]},"bbb5-224":{"id":"/src/helpers/Wrapper/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-225"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-220"},{"uid":"bbb5-222"}],"importedBy":[{"uid":"bbb5-269"}]},"bbb5-226":{"id":"/src/helpers/Content/styled.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-227"},"imported":[{"uid":"bbb5-265"},{"uid":"bbb5-258"}],"importedBy":[{"uid":"bbb5-228"}]},"bbb5-228":{"id":"/src/helpers/Content/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-229"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-226"}],"importedBy":[{"uid":"bbb5-270"}]},"bbb5-230":{"id":"/src/Element/constants.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-231"},"imported":[],"importedBy":[{"uid":"bbb5-232"}]},"bbb5-232":{"id":"/src/Element/utils.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-233"},"imported":[{"uid":"bbb5-230"}],"importedBy":[{"uid":"bbb5-234"}]},"bbb5-234":{"id":"/src/Element/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-235"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-265"},{"uid":"bbb5-216"},{"uid":"bbb5-266"},{"uid":"bbb5-232"}],"importedBy":[{"uid":"bbb5-259"}]},"bbb5-236":{"id":"/src/Element/withEqualSizeBeforeAfter.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-237"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-265"}],"importedBy":[{"uid":"bbb5-259"}]},"bbb5-238":{"id":"/src/helpers/Iterator/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-239"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-265"}],"importedBy":[{"uid":"bbb5-267"}]},"bbb5-240":{"id":"/src/List/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-241"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-265"},{"uid":"bbb5-216"},{"uid":"bbb5-259"},{"uid":"bbb5-267"}],"importedBy":[{"uid":"bbb5-260"}]},"bbb5-242":{"id":"/src/List/withActiveState.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-243"},"imported":[{"uid":"bbb5-264"}],"importedBy":[{"uid":"bbb5-260"}]},"bbb5-244":{"id":"/src/Portal/component.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-245"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-268"},{"uid":"bbb5-216"}],"importedBy":[{"uid":"bbb5-262"}]},"bbb5-246":{"id":"/src/Overlay/context.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-247"},"imported":[{"uid":"bbb5-264"}],"importedBy":[{"uid":"bbb5-261"},{"uid":"bbb5-250"},{"uid":"bbb5-248"}]},"bbb5-248":{"id":"/src/Overlay/useOverlay.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-249"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-265"},{"uid":"bbb5-258"},{"uid":"bbb5-246"}],"importedBy":[{"uid":"bbb5-261"},{"uid":"bbb5-250"}]},"bbb5-250":{"id":"/src/Overlay/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-251"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-265"},{"uid":"bbb5-216"},{"uid":"bbb5-262"},{"uid":"bbb5-248"},{"uid":"bbb5-246"}],"importedBy":[{"uid":"bbb5-261"}]},"bbb5-252":{"id":"/src/Text/styled.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-253"},"imported":[{"uid":"bbb5-265"},{"uid":"bbb5-258"}],"importedBy":[{"uid":"bbb5-254"}]},"bbb5-254":{"id":"/src/Text/component.tsx","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-255"},"imported":[{"uid":"bbb5-264"},{"uid":"bbb5-216"},{"uid":"bbb5-252"}],"importedBy":[{"uid":"bbb5-263"}]},"bbb5-256":{"id":"/src/index.ts","moduleParts":{"vitus-labs-elements.umd.min.js":"bbb5-257"},"imported":[{"uid":"bbb5-258"},{"uid":"bbb5-259"},{"uid":"bbb5-260"},{"uid":"bbb5-261"},{"uid":"bbb5-262"},{"uid":"bbb5-263"}],"importedBy":[],"isEntry":true},"bbb5-258":{"id":"@vitus-labs/unistyle","moduleParts":{},"imported":[],"importedBy":[{"uid":"bbb5-256"},{"uid":"bbb5-248"},{"uid":"bbb5-252"},{"uid":"bbb5-222"},{"uid":"bbb5-226"}],"isExternal":true},"bbb5-259":{"id":"/src/Element/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-234"},{"uid":"bbb5-236"}],"importedBy":[{"uid":"bbb5-256"},{"uid":"bbb5-240"}]},"bbb5-260":{"id":"/src/List/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-240"},{"uid":"bbb5-242"}],"importedBy":[{"uid":"bbb5-256"}]},"bbb5-261":{"id":"/src/Overlay/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-250"},{"uid":"bbb5-248"},{"uid":"bbb5-246"}],"importedBy":[{"uid":"bbb5-256"}]},"bbb5-262":{"id":"/src/Portal/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-244"}],"importedBy":[{"uid":"bbb5-256"},{"uid":"bbb5-250"}]},"bbb5-263":{"id":"/src/Text/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-254"}],"importedBy":[{"uid":"bbb5-256"}]},"bbb5-264":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"bbb5-234"},{"uid":"bbb5-236"},{"uid":"bbb5-240"},{"uid":"bbb5-242"},{"uid":"bbb5-250"},{"uid":"bbb5-248"},{"uid":"bbb5-246"},{"uid":"bbb5-244"},{"uid":"bbb5-254"},{"uid":"bbb5-238"},{"uid":"bbb5-224"},{"uid":"bbb5-228"}],"isExternal":true},"bbb5-265":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"bbb5-234"},{"uid":"bbb5-236"},{"uid":"bbb5-240"},{"uid":"bbb5-250"},{"uid":"bbb5-248"},{"uid":"bbb5-252"},{"uid":"bbb5-238"},{"uid":"bbb5-222"},{"uid":"bbb5-226"}],"isExternal":true},"bbb5-266":{"id":"/src/helpers/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-269"},{"uid":"bbb5-270"}],"importedBy":[{"uid":"bbb5-234"}]},"bbb5-267":{"id":"/src/helpers/Iterator/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-238"}],"importedBy":[{"uid":"bbb5-240"}]},"bbb5-268":{"id":"react-dom","moduleParts":{},"imported":[],"importedBy":[{"uid":"bbb5-244"}],"isExternal":true},"bbb5-269":{"id":"/src/helpers/Wrapper/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-224"}],"importedBy":[{"uid":"bbb5-266"}]},"bbb5-270":{"id":"/src/helpers/Content/index.ts","moduleParts":{},"imported":[{"uid":"bbb5-228"}],"importedBy":[{"uid":"bbb5-266"}]}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
6428
6428
|
|
|
6429
6429
|
const run = () => {
|
|
6430
6430
|
const width = window.innerWidth;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Provider } from '@vitus-labs/unistyle';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { ComponentType, VFC, ForwardedRef, PropsWithChildren, ReactElement, ReactNode, ReactText, ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import React__default, { ComponentType, VFC, ForwardedRef, PropsWithChildren, ReactElement, ReactNode, ReactText, ForwardRefExoticComponent, FC } from 'react';
|
|
4
4
|
import { renderContent, config, HTMLTags, HTMLTagsText } from '@vitus-labs/core';
|
|
5
5
|
|
|
6
6
|
declare type ExtractNullableKeys<T> = {
|
|
@@ -87,7 +87,7 @@ declare type VLElement<P extends Record<string, unknown> = {}> = {
|
|
|
87
87
|
}): ReactElement | null;
|
|
88
88
|
} & VLStatic;
|
|
89
89
|
|
|
90
|
-
declare const component$
|
|
90
|
+
declare const component$6: VLElement;
|
|
91
91
|
|
|
92
92
|
declare type Props$6 = Partial<{
|
|
93
93
|
equalBeforeAfter: boolean;
|
|
@@ -136,7 +136,7 @@ declare type Props$4 = MergeTypes<[
|
|
|
136
136
|
content: never;
|
|
137
137
|
}
|
|
138
138
|
]>;
|
|
139
|
-
declare const component$
|
|
139
|
+
declare const component$5: VLElement<Props$4>;
|
|
140
140
|
|
|
141
141
|
declare type Key = string | number;
|
|
142
142
|
declare type Props$3 = {
|
|
@@ -145,7 +145,7 @@ declare type Props$3 = {
|
|
|
145
145
|
activeItems?: Key | Array<string | number>;
|
|
146
146
|
itemProps?: Record<string, unknown> | ((props: Record<string, unknown>) => Record<string, unknown>);
|
|
147
147
|
};
|
|
148
|
-
declare const component$
|
|
148
|
+
declare const component$4: SimpleHoc<Props$3>;
|
|
149
149
|
|
|
150
150
|
declare type Align$1 = 'bottom' | 'top' | 'left' | 'bottom' | 'right';
|
|
151
151
|
declare type AlignX$1 = 'left' | 'center' | 'right';
|
|
@@ -162,7 +162,7 @@ declare type UseOverlayProps = {
|
|
|
162
162
|
offsetX?: number;
|
|
163
163
|
offsetY?: number;
|
|
164
164
|
throttleDelay?: number;
|
|
165
|
-
customScrollListener?: HTMLElement;
|
|
165
|
+
customScrollListener?: HTMLElement | null;
|
|
166
166
|
closeOnEsc?: boolean;
|
|
167
167
|
disabled?: boolean;
|
|
168
168
|
onOpen?: () => void;
|
|
@@ -205,7 +205,14 @@ declare type Props$2 = {
|
|
|
205
205
|
triggerRefName?: string;
|
|
206
206
|
contentRefName?: string;
|
|
207
207
|
} & UseOverlayProps;
|
|
208
|
-
declare const component$
|
|
208
|
+
declare const component$3: VLComponent<Props$2>;
|
|
209
|
+
|
|
210
|
+
declare type Context = {
|
|
211
|
+
blocked: boolean;
|
|
212
|
+
setBlocked: () => void;
|
|
213
|
+
setUnblocked: () => void;
|
|
214
|
+
};
|
|
215
|
+
declare const component$2: FC<Context>;
|
|
209
216
|
|
|
210
217
|
declare type Props$1 = {
|
|
211
218
|
position?: HTMLElement;
|
|
@@ -225,4 +232,4 @@ declare const component: VLForwardedComponent<Props> & {
|
|
|
225
232
|
isText?: true;
|
|
226
233
|
};
|
|
227
234
|
|
|
228
|
-
export { component$
|
|
235
|
+
export { component$6 as Element, Props$7 as ElementProps, component$5 as List, Props$4 as ListProps, component$3 as Overlay, Props$2 as OverlayProps, component$2 as OverlayProvider, component$1 as Portal, Props$1 as PortalProps, component as Text, Props as TextProps, UseOverlayProps, VLElement, _default as useOverlay, component$4 as withActiveState, withEqualBeforeAfter as withEqualSizeBeforeAfter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import component from './component';
|
|
2
|
-
import type { Props } from './component';
|
|
1
|
+
import component, { Props } from './component';
|
|
3
2
|
import useOverlay, { UseOverlayProps } from './useOverlay';
|
|
3
|
+
import OverlayProvider from './context';
|
|
4
4
|
export type { Props, UseOverlayProps };
|
|
5
|
-
export { useOverlay };
|
|
5
|
+
export { useOverlay, OverlayProvider };
|
|
6
6
|
export default component;
|
|
@@ -13,7 +13,7 @@ export declare type UseOverlayProps = {
|
|
|
13
13
|
offsetX?: number;
|
|
14
14
|
offsetY?: number;
|
|
15
15
|
throttleDelay?: number;
|
|
16
|
-
customScrollListener?: HTMLElement;
|
|
16
|
+
customScrollListener?: HTMLElement | null;
|
|
17
17
|
closeOnEsc?: boolean;
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
onOpen?: () => void;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Provider } from '@vitus-labs/unistyle';
|
|
2
2
|
import Element, { Props as ElementProps, VLElement, withEqualSizeBeforeAfter } from "./Element";
|
|
3
3
|
import List, { Props as ListProps, withActiveState } from "./List";
|
|
4
|
-
import Overlay, { Props as OverlayProps, useOverlay, UseOverlayProps } from "./Overlay";
|
|
4
|
+
import Overlay, { Props as OverlayProps, useOverlay, OverlayProvider, UseOverlayProps } from "./Overlay";
|
|
5
5
|
import Portal, { Props as PortalProps } from "./Portal";
|
|
6
6
|
import Text, { Props as TextProps } from "./Text";
|
|
7
7
|
export type { VLElement, ElementProps, ListProps, OverlayProps, UseOverlayProps, PortalProps, TextProps, };
|
|
8
|
-
export { Element, withEqualSizeBeforeAfter, withActiveState, List, Overlay, useOverlay, Portal, Text, Provider, };
|
|
8
|
+
export { Element, withEqualSizeBeforeAfter, withActiveState, List, Overlay, useOverlay, OverlayProvider, Portal, Text, Provider, };
|
|
@@ -252,11 +252,11 @@ const EMPTY_ELEMENTS = {
|
|
|
252
252
|
const isInlineElement = (tag) => tag ? INLINE_ELEMENTS[tag] : false;
|
|
253
253
|
const getShouldBeEmpty = (tag) => tag ? EMPTY_ELEMENTS[tag] : false;
|
|
254
254
|
|
|
255
|
-
const
|
|
256
|
-
const
|
|
255
|
+
const defaultDirection = 'inline';
|
|
256
|
+
const defaultContentDirection = 'rows';
|
|
257
257
|
const defaultAlignX = 'left';
|
|
258
258
|
const defaultAlignY = 'center';
|
|
259
|
-
const component$7 = forwardRef(({ innerRef, tag, label, content, children, beforeContent, afterContent, block, equalCols, gap, direction
|
|
259
|
+
const component$7 = forwardRef(({ innerRef, tag, label, content, children, beforeContent, afterContent, block, equalCols, gap, direction, alignX = defaultAlignX, alignY = defaultAlignY, css, contentCss, beforeContentCss, afterContentCss, contentDirection = defaultContentDirection, contentAlignX = defaultAlignX, contentAlignY = defaultAlignY, beforeContentDirection = defaultDirection, beforeContentAlignX = defaultAlignX, beforeContentAlignY = defaultAlignY, afterContentDirection = defaultDirection, afterContentAlignX = defaultAlignX, afterContentAlignY = defaultAlignY, ...props }, ref) => {
|
|
260
260
|
// --------------------------------------------------------
|
|
261
261
|
// check if should render only single element
|
|
262
262
|
// --------------------------------------------------------
|
|
@@ -721,7 +721,6 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
721
721
|
const hideContent = useCallback(() => {
|
|
722
722
|
handleActive(false);
|
|
723
723
|
}, []);
|
|
724
|
-
const hasCustomListener = !!customScrollListener;
|
|
725
724
|
// if an Overlay has an Overlay child, this will prevent closing parent child
|
|
726
725
|
// + calculate correct position when an Overlay is opened
|
|
727
726
|
useEffect(() => {
|
|
@@ -746,13 +745,13 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
746
745
|
return undefined;
|
|
747
746
|
window.addEventListener('resize', handleContentPosition, false);
|
|
748
747
|
window.addEventListener('scroll', handleContentPosition, false);
|
|
749
|
-
if (
|
|
748
|
+
if (customScrollListener) {
|
|
750
749
|
customScrollListener.addEventListener('scroll', handleContentPosition, false);
|
|
751
750
|
}
|
|
752
751
|
return () => {
|
|
753
752
|
window.removeEventListener('resize', handleContentPosition, false);
|
|
754
753
|
window.removeEventListener('scroll', handleContentPosition, false);
|
|
755
|
-
if (
|
|
754
|
+
if (customScrollListener) {
|
|
756
755
|
customScrollListener.removeEventListener('scroll', handleContentPosition, false);
|
|
757
756
|
}
|
|
758
757
|
};
|
|
@@ -762,7 +761,7 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
762
761
|
useEffect(() => {
|
|
763
762
|
const shouldSetOverflow = type === 'modal' && document.body;
|
|
764
763
|
if (active) {
|
|
765
|
-
if (
|
|
764
|
+
if (customScrollListener) {
|
|
766
765
|
// eslint-disable-next-line no-param-reassign
|
|
767
766
|
customScrollListener.style.overflow = 'hidden';
|
|
768
767
|
}
|
|
@@ -770,8 +769,17 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
770
769
|
document.body.style.overflow = 'hidden';
|
|
771
770
|
}
|
|
772
771
|
}
|
|
772
|
+
else {
|
|
773
|
+
if (customScrollListener) {
|
|
774
|
+
// eslint-disable-next-line no-param-reassign
|
|
775
|
+
customScrollListener.style.overflow = '';
|
|
776
|
+
}
|
|
777
|
+
if (shouldSetOverflow) {
|
|
778
|
+
document.body.style.overflow = '';
|
|
779
|
+
}
|
|
780
|
+
}
|
|
773
781
|
return () => {
|
|
774
|
-
if (
|
|
782
|
+
if (customScrollListener) {
|
|
775
783
|
// eslint-disable-next-line no-param-reassign
|
|
776
784
|
customScrollListener.style.overflow = '';
|
|
777
785
|
}
|
|
@@ -785,7 +793,7 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
785
793
|
if (!active)
|
|
786
794
|
return undefined;
|
|
787
795
|
window.addEventListener('scroll', handleVisibility, false);
|
|
788
|
-
if (
|
|
796
|
+
if (customScrollListener) {
|
|
789
797
|
customScrollListener.addEventListener('scroll', handleVisibility, false);
|
|
790
798
|
}
|
|
791
799
|
if (closeOnEsc) {
|
|
@@ -793,7 +801,7 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
793
801
|
}
|
|
794
802
|
return () => {
|
|
795
803
|
window.removeEventListener('scroll', handleVisibility, false);
|
|
796
|
-
if (
|
|
804
|
+
if (customScrollListener) {
|
|
797
805
|
customScrollListener.removeEventListener('scroll', handleVisibility, false);
|
|
798
806
|
}
|
|
799
807
|
if (closeOnEsc) {
|
|
@@ -819,7 +827,7 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
819
827
|
window.removeEventListener('click', handleClick, false);
|
|
820
828
|
window.removeEventListener('mousemove', handleVisibility, false);
|
|
821
829
|
};
|
|
822
|
-
}, [openOn, closeOn, blocked, disabled]);
|
|
830
|
+
}, [openOn, closeOn, blocked, disabled, active]);
|
|
823
831
|
const isNodeOrChild = (ref) => (e) => {
|
|
824
832
|
if (e && e.target && ref.current) {
|
|
825
833
|
return ref.current.contains(e.target) || e.target === ref.current;
|
|
@@ -988,8 +996,8 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, customScrollListener, closeOnEsc
|
|
|
988
996
|
}
|
|
989
997
|
};
|
|
990
998
|
const handleContentPosition = throttle(calculateContentPosition, throttleDelay);
|
|
991
|
-
const handleClick =
|
|
992
|
-
const handleVisibility =
|
|
999
|
+
const handleClick = handleVisibilityByEventType;
|
|
1000
|
+
const handleVisibility = throttle(handleVisibilityByEventType, throttleDelay);
|
|
993
1001
|
const handleEscKey = (e) => {
|
|
994
1002
|
if (e.key === 'Escape') {
|
|
995
1003
|
hideContent();
|
|
@@ -1065,5 +1073,5 @@ component.pkgName = PKG_NAME;
|
|
|
1065
1073
|
component.VITUS_LABS__COMPONENT = name;
|
|
1066
1074
|
component.isText = true;
|
|
1067
1075
|
|
|
1068
|
-
export { component$7 as Element, component$5 as List, component$1 as Overlay, component$3 as Portal, component as Text, useOverlay, component$4 as withActiveState, withEqualBeforeAfter as withEqualSizeBeforeAfter };
|
|
1076
|
+
export { component$7 as Element, component$5 as List, component$1 as Overlay, component$2 as OverlayProvider, component$3 as Portal, component as Text, useOverlay, component$4 as withActiveState, withEqualBeforeAfter as withEqualSizeBeforeAfter };
|
|
1069
1077
|
//# sourceMappingURL=vitus-labs-elements.browser.js.map
|