@vitus-labs/elements 0.77.0 → 0.80.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/index.d.ts +555 -11
- package/lib/types/Element/types.d.ts +391 -4
- package/lib/types/Element/types.d.ts.map +1 -1
- package/lib/types/Element/utils.d.ts.map +1 -1
- package/lib/types/List/component.d.ts +19 -7
- package/lib/types/List/component.d.ts.map +1 -1
- package/lib/types/Overlay/component.d.ts +23 -0
- package/lib/types/Overlay/component.d.ts.map +1 -1
- package/lib/types/Overlay/useOverlay.d.ts +59 -0
- package/lib/types/Overlay/useOverlay.d.ts.map +1 -1
- package/lib/types/Portal/component.d.ts +10 -0
- package/lib/types/Portal/component.d.ts.map +1 -1
- package/lib/types/Text/component.d.ts +21 -6
- package/lib/types/Text/component.d.ts.map +1 -1
- package/lib/types/Util/component.d.ts +9 -0
- package/lib/types/Util/component.d.ts.map +1 -1
- package/lib/types/helpers/Iterator/types.d.ts +28 -0
- package/lib/types/helpers/Iterator/types.d.ts.map +1 -1
- package/lib/types/helpers/Wrapper/component.d.ts +2 -2
- package/lib/vitus-labs-elements.browser.js +45 -41
- package/lib/vitus-labs-elements.browser.js.map +1 -1
- package/lib/vitus-labs-elements.js +50 -46
- package/lib/vitus-labs-elements.js.map +1 -1
- package/lib/vitus-labs-elements.module.js +44 -40
- package/lib/vitus-labs-elements.module.js.map +1 -1
- package/lib/vitus-labs-elements.native.js +44 -40
- package/lib/vitus-labs-elements.native.js.map +1 -1
- package/package.json +9 -9
- package/lib/types/Overlay/useOverlay.backup.d.ts +0 -36
- package/lib/types/Overlay/useOverlay.backup.d.ts.map +0 -1
|
@@ -74,7 +74,7 @@ var Styled$2 = config.styled(config.component) `
|
|
|
74
74
|
})};
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const Component$9 = forwardRef(({ children, tag, block, extendCss, direction, alignX, alignY, equalCols, isInline, ...props }, ref) => {
|
|
78
78
|
const debugProps = process.env.NODE_ENV !== 'production'
|
|
79
79
|
? {
|
|
80
80
|
'data-vl-element': 'Element',
|
|
@@ -179,7 +179,7 @@ var Styled$1 = config.styled(config.component) `
|
|
|
179
179
|
})};
|
|
180
180
|
`;
|
|
181
181
|
|
|
182
|
-
const Component$
|
|
182
|
+
const Component$8 = ({ contentType, tag, parentDirection, direction, alignX, alignY, equalCols, gap, extendCss, ...props }) => {
|
|
183
183
|
const debugProps = process.env.NODE_ENV !== 'production'
|
|
184
184
|
? {
|
|
185
185
|
'data-vl-element': contentType,
|
|
@@ -196,7 +196,7 @@ const Component$6 = ({ contentType, tag, parentDirection, direction, alignX, ali
|
|
|
196
196
|
extraStyles: extendCss,
|
|
197
197
|
}, ...debugProps, ...props }));
|
|
198
198
|
};
|
|
199
|
-
var component$
|
|
199
|
+
var component$1 = memo(Component$8);
|
|
200
200
|
|
|
201
201
|
const INLINE_ELEMENTS = {
|
|
202
202
|
span: true,
|
|
@@ -264,7 +264,7 @@ const defaultDirection = 'inline';
|
|
|
264
264
|
const defaultContentDirection = 'rows';
|
|
265
265
|
const defaultAlignX = 'left';
|
|
266
266
|
const defaultAlignY = 'center';
|
|
267
|
-
const Component$
|
|
267
|
+
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) => {
|
|
268
268
|
// --------------------------------------------------------
|
|
269
269
|
// check if should render only single element
|
|
270
270
|
// --------------------------------------------------------
|
|
@@ -325,20 +325,21 @@ const Component$5 = forwardRef(({ innerRef, tag, label, content, children, befor
|
|
|
325
325
|
// return simple/empty element like input or image etc.
|
|
326
326
|
// --------------------------------------------------------
|
|
327
327
|
if (shouldBeEmpty) {
|
|
328
|
-
return React.createElement(
|
|
328
|
+
return React.createElement(Component$9, { ...props, ...WRAPPER_PROPS });
|
|
329
329
|
}
|
|
330
330
|
const contentRenderOutput = render(CHILDREN);
|
|
331
|
-
return (React.createElement(
|
|
332
|
-
beforeContent && (React.createElement(component$
|
|
333
|
-
isSimpleElement ? (contentRenderOutput) : (React.createElement(component$
|
|
334
|
-
afterContent && (React.createElement(component$
|
|
331
|
+
return (React.createElement(Component$9, { ...props, ...WRAPPER_PROPS, isInline: isInline },
|
|
332
|
+
beforeContent && (React.createElement(component$1, { tag: SUB_TAG, contentType: "before", parentDirection: wrapperDirection, extendCss: beforeContentCss, direction: beforeContentDirection, alignX: beforeContentAlignX, alignY: beforeContentAlignY, equalCols: equalCols, gap: gap }, render(beforeContent))),
|
|
333
|
+
isSimpleElement ? (contentRenderOutput) : (React.createElement(component$1, { tag: SUB_TAG, contentType: "content", parentDirection: wrapperDirection, extendCss: contentCss, direction: contentDirection, alignX: contentAlignX, alignY: contentAlignY, equalCols: equalCols }, contentRenderOutput)),
|
|
334
|
+
afterContent && (React.createElement(component$1, { tag: SUB_TAG, contentType: "after", parentDirection: wrapperDirection, extendCss: afterContentCss, direction: afterContentDirection, alignX: afterContentAlignX, alignY: afterContentAlignY, equalCols: equalCols, gap: gap }, render(afterContent)))));
|
|
335
335
|
});
|
|
336
336
|
const name$5 = `${PKG_NAME}/Element`;
|
|
337
|
-
Component$
|
|
338
|
-
Component$
|
|
339
|
-
Component$
|
|
337
|
+
Component$7.displayName = name$5;
|
|
338
|
+
Component$7.pkgName = PKG_NAME;
|
|
339
|
+
Component$7.VITUS_LABS__COMPONENT = name$5;
|
|
340
340
|
|
|
341
341
|
// @ts-nocheck
|
|
342
|
+
/* eslint-disable no-param-reassign */
|
|
342
343
|
const isNumber = (a, b) => Number.isInteger(a) && Number.isInteger(b);
|
|
343
344
|
const types = {
|
|
344
345
|
height: 'offsetHeight',
|
|
@@ -401,7 +402,7 @@ const attachItemProps = ({ i, length, }) => {
|
|
|
401
402
|
position,
|
|
402
403
|
};
|
|
403
404
|
};
|
|
404
|
-
const Component$
|
|
405
|
+
const Component$6 = (props) => {
|
|
405
406
|
const { itemKey, valueName, children, component, data, wrapComponent: Wrapper, wrapProps, itemProps, } = props;
|
|
406
407
|
const injectItemProps = useMemo(() => (typeof itemProps === 'function' ? itemProps : () => itemProps), [itemProps]);
|
|
407
408
|
const injectWrapItemProps = useMemo(() => (typeof wrapProps === 'function' ? wrapProps : () => wrapProps), [wrapProps]);
|
|
@@ -547,19 +548,19 @@ const Component$4 = (props) => {
|
|
|
547
548
|
};
|
|
548
549
|
return renderItems();
|
|
549
550
|
};
|
|
550
|
-
Component$
|
|
551
|
-
Component$
|
|
551
|
+
Component$6.isIterator = true;
|
|
552
|
+
Component$6.RESERVED_PROPS = RESERVED_PROPS;
|
|
552
553
|
|
|
553
|
-
const
|
|
554
|
-
const renderedList = React.createElement(Component$
|
|
554
|
+
const Component$5 = forwardRef(({ rootElement = false, ...props }, ref) => {
|
|
555
|
+
const renderedList = React.createElement(Component$6, { ...pick(props, Component$6.RESERVED_PROPS) });
|
|
555
556
|
if (!rootElement)
|
|
556
557
|
return renderedList;
|
|
557
|
-
return (React.createElement(Component$
|
|
558
|
+
return (React.createElement(Component$7, { ref: ref, ...omit(props, Component$6.RESERVED_PROPS) }, renderedList));
|
|
558
559
|
});
|
|
559
560
|
const name$4 = `${PKG_NAME}/List`;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
Component$5.displayName = name$4;
|
|
562
|
+
Component$5.pkgName = PKG_NAME;
|
|
563
|
+
Component$5.VITUS_LABS__COMPONENT = name$4;
|
|
563
564
|
|
|
564
565
|
// @ts-nocheck
|
|
565
566
|
const RESERVED_KEYS = [
|
|
@@ -568,7 +569,7 @@ const RESERVED_KEYS = [
|
|
|
568
569
|
'itemProps',
|
|
569
570
|
'activeItemRequired',
|
|
570
571
|
];
|
|
571
|
-
const component
|
|
572
|
+
const component = (WrappedComponent) => {
|
|
572
573
|
const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
573
574
|
const Enhanced = (props) => {
|
|
574
575
|
const { type = 'single', activeItemRequired, activeItems, itemProps = {}, ...rest } = props;
|
|
@@ -691,7 +692,7 @@ const component$1 = (WrappedComponent) => {
|
|
|
691
692
|
return Enhanced;
|
|
692
693
|
};
|
|
693
694
|
|
|
694
|
-
const Component$
|
|
695
|
+
const Component$4 = ({ DOMLocation, tag = 'div', children, }) => {
|
|
695
696
|
const [element, setElement] = useState();
|
|
696
697
|
useEffect(() => {
|
|
697
698
|
if (!tag)
|
|
@@ -709,14 +710,14 @@ const Component$3 = ({ DOMLocation, tag = 'div', children, }) => {
|
|
|
709
710
|
return createPortal(children, element);
|
|
710
711
|
};
|
|
711
712
|
const name$3 = `${PKG_NAME}/Portal`;
|
|
712
|
-
Component$
|
|
713
|
-
Component$
|
|
714
|
-
Component$
|
|
713
|
+
Component$4.displayName = name$3;
|
|
714
|
+
Component$4.pkgName = PKG_NAME;
|
|
715
|
+
Component$4.VITUS_LABS__COMPONENT = name$3;
|
|
715
716
|
|
|
716
717
|
const context = createContext({});
|
|
717
718
|
const { Provider } = context;
|
|
718
719
|
const useOverlayContext = () => useContext(context);
|
|
719
|
-
const Component$
|
|
720
|
+
const Component$3 = ({ children, blocked, setBlocked, setUnblocked, }) => {
|
|
720
721
|
const ctx = useMemo(() => ({
|
|
721
722
|
blocked,
|
|
722
723
|
setBlocked,
|
|
@@ -1153,11 +1154,11 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, parentContainer, closeOnEsc = tru
|
|
|
1153
1154
|
blocked,
|
|
1154
1155
|
setBlocked,
|
|
1155
1156
|
setUnblocked,
|
|
1156
|
-
Provider: Component$
|
|
1157
|
+
Provider: Component$3,
|
|
1157
1158
|
};
|
|
1158
1159
|
};
|
|
1159
1160
|
|
|
1160
|
-
const Component$
|
|
1161
|
+
const Component$2 = ({ children, trigger, DOMLocation, triggerRefName = 'ref', contentRefName = 'ref', ...props }) => {
|
|
1161
1162
|
const { active, triggerRef, contentRef, showContent, hideContent, align, alignX, alignY, Provider, ...ctx } = useOverlay(props);
|
|
1162
1163
|
const { openOn, closeOn } = props;
|
|
1163
1164
|
const passHandlers = useMemo(() => openOn === 'manual' ||
|
|
@@ -1172,9 +1173,9 @@ const Component$1 = ({ children, trigger, DOMLocation, triggerRefName = 'ref', c
|
|
|
1172
1173
|
false ));
|
|
1173
1174
|
};
|
|
1174
1175
|
const name$2 = `${PKG_NAME}/Overlay`;
|
|
1175
|
-
Component$
|
|
1176
|
-
Component$
|
|
1177
|
-
Component$
|
|
1176
|
+
Component$2.displayName = name$2;
|
|
1177
|
+
Component$2.pkgName = PKG_NAME;
|
|
1178
|
+
Component$2.VITUS_LABS__COMPONENT = name$2;
|
|
1178
1179
|
|
|
1179
1180
|
const styles = ({ css, theme: t }) => css `
|
|
1180
1181
|
${t.extraStyles && extendCss(t.extraStyles)};
|
|
@@ -1192,8 +1193,8 @@ var Styled = config.styled(config.textComponent) `
|
|
|
1192
1193
|
})};
|
|
1193
1194
|
`;
|
|
1194
1195
|
|
|
1195
|
-
const
|
|
1196
|
-
const renderContent = (as = undefined) => (React.createElement(Styled, { ref: ref, as: as, "$text": { extraStyles:
|
|
1196
|
+
const Component$1 = forwardRef(({ paragraph, label, children, tag, css, ...props }, ref) => {
|
|
1197
|
+
const renderContent = (as = undefined) => (React.createElement(Styled, { ref: ref, as: as, "$text": { extraStyles: css }, ...props }, children || label));
|
|
1197
1198
|
let finalTag;
|
|
1198
1199
|
{
|
|
1199
1200
|
if (paragraph)
|
|
@@ -1205,16 +1206,19 @@ const component = forwardRef(({ paragraph, label, children, tag, extendCss, ...p
|
|
|
1205
1206
|
return renderContent(finalTag);
|
|
1206
1207
|
});
|
|
1207
1208
|
const name$1 = `${PKG_NAME}/Text`;
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1209
|
+
Component$1.displayName = name$1;
|
|
1210
|
+
Component$1.pkgName = PKG_NAME;
|
|
1211
|
+
Component$1.VITUS_LABS__COMPONENT = name$1;
|
|
1212
|
+
Component$1.isText = true;
|
|
1212
1213
|
|
|
1213
|
-
const Component = ({ children, className = '', style }) =>
|
|
1214
|
+
const Component = ({ children, className = '', style }) => {
|
|
1215
|
+
const mergedClasses = useMemo(() => Array.isArray(className) ? className.join(' ') : className, [className]);
|
|
1216
|
+
return render(children, { className: mergedClasses, style });
|
|
1217
|
+
};
|
|
1214
1218
|
const name = `${PKG_NAME}/Util`;
|
|
1215
1219
|
Component.displayName = name;
|
|
1216
1220
|
Component.pkgName = PKG_NAME;
|
|
1217
1221
|
Component.VITUS_LABS__COMPONENT = name;
|
|
1218
1222
|
|
|
1219
|
-
export { Component$
|
|
1223
|
+
export { Component$7 as Element, Component$5 as List, Component$2 as Overlay, Component$3 as OverlayProvider, Component$4 as Portal, Component$1 as Text, Component as Util, useOverlay, component as withActiveState, withEqualBeforeAfter as withEqualSizeBeforeAfter };
|
|
1220
1224
|
//# sourceMappingURL=vitus-labs-elements.module.js.map
|