@vitus-labs/elements 0.79.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 +550 -6
- package/lib/types/Element/types.d.ts +388 -1
- 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 +19 -4
- 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
|
@@ -81,7 +81,7 @@ var Styled$2 = core.config.styled(core.config.component) `
|
|
|
81
81
|
})};
|
|
82
82
|
`;
|
|
83
83
|
|
|
84
|
-
const
|
|
84
|
+
const Component$9 = React.forwardRef(({ children, tag, block, extendCss, direction, alignX, alignY, equalCols, isInline, ...props }, ref) => {
|
|
85
85
|
const debugProps = process.env.NODE_ENV !== 'production'
|
|
86
86
|
? {
|
|
87
87
|
'data-vl-element': 'Element',
|
|
@@ -186,7 +186,7 @@ var Styled$1 = core.config.styled(core.config.component) `
|
|
|
186
186
|
})};
|
|
187
187
|
`;
|
|
188
188
|
|
|
189
|
-
const Component$
|
|
189
|
+
const Component$8 = ({ contentType, tag, parentDirection, direction, alignX, alignY, equalCols, gap, extendCss, ...props }) => {
|
|
190
190
|
const debugProps = process.env.NODE_ENV !== 'production'
|
|
191
191
|
? {
|
|
192
192
|
'data-vl-element': contentType,
|
|
@@ -203,7 +203,7 @@ const Component$6 = ({ contentType, tag, parentDirection, direction, alignX, ali
|
|
|
203
203
|
extraStyles: extendCss,
|
|
204
204
|
}, ...debugProps, ...props }));
|
|
205
205
|
};
|
|
206
|
-
var component$
|
|
206
|
+
var component$1 = React.memo(Component$8);
|
|
207
207
|
|
|
208
208
|
const INLINE_ELEMENTS = {
|
|
209
209
|
span: true,
|
|
@@ -271,7 +271,7 @@ const defaultDirection = 'inline';
|
|
|
271
271
|
const defaultContentDirection = 'rows';
|
|
272
272
|
const defaultAlignX = 'left';
|
|
273
273
|
const defaultAlignY = 'center';
|
|
274
|
-
const Component$
|
|
274
|
+
const Component$7 = React.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) => {
|
|
275
275
|
// --------------------------------------------------------
|
|
276
276
|
// check if should render only single element
|
|
277
277
|
// --------------------------------------------------------
|
|
@@ -332,20 +332,21 @@ const Component$5 = React.forwardRef(({ innerRef, tag, label, content, children,
|
|
|
332
332
|
// return simple/empty element like input or image etc.
|
|
333
333
|
// --------------------------------------------------------
|
|
334
334
|
if (shouldBeEmpty) {
|
|
335
|
-
return React__default["default"].createElement(
|
|
335
|
+
return React__default["default"].createElement(Component$9, { ...props, ...WRAPPER_PROPS });
|
|
336
336
|
}
|
|
337
337
|
const contentRenderOutput = core.render(CHILDREN);
|
|
338
|
-
return (React__default["default"].createElement(
|
|
339
|
-
beforeContent && (React__default["default"].createElement(component$
|
|
340
|
-
isSimpleElement ? (contentRenderOutput) : (React__default["default"].createElement(component$
|
|
341
|
-
afterContent && (React__default["default"].createElement(component$
|
|
338
|
+
return (React__default["default"].createElement(Component$9, { ...props, ...WRAPPER_PROPS, isInline: isInline },
|
|
339
|
+
beforeContent && (React__default["default"].createElement(component$1, { tag: SUB_TAG, contentType: "before", parentDirection: wrapperDirection, extendCss: beforeContentCss, direction: beforeContentDirection, alignX: beforeContentAlignX, alignY: beforeContentAlignY, equalCols: equalCols, gap: gap }, core.render(beforeContent))),
|
|
340
|
+
isSimpleElement ? (contentRenderOutput) : (React__default["default"].createElement(component$1, { tag: SUB_TAG, contentType: "content", parentDirection: wrapperDirection, extendCss: contentCss, direction: contentDirection, alignX: contentAlignX, alignY: contentAlignY, equalCols: equalCols }, contentRenderOutput)),
|
|
341
|
+
afterContent && (React__default["default"].createElement(component$1, { tag: SUB_TAG, contentType: "after", parentDirection: wrapperDirection, extendCss: afterContentCss, direction: afterContentDirection, alignX: afterContentAlignX, alignY: afterContentAlignY, equalCols: equalCols, gap: gap }, core.render(afterContent)))));
|
|
342
342
|
});
|
|
343
343
|
const name$5 = `${PKG_NAME}/Element`;
|
|
344
|
-
Component$
|
|
345
|
-
Component$
|
|
346
|
-
Component$
|
|
344
|
+
Component$7.displayName = name$5;
|
|
345
|
+
Component$7.pkgName = PKG_NAME;
|
|
346
|
+
Component$7.VITUS_LABS__COMPONENT = name$5;
|
|
347
347
|
|
|
348
348
|
// @ts-nocheck
|
|
349
|
+
/* eslint-disable no-param-reassign */
|
|
349
350
|
const isNumber = (a, b) => Number.isInteger(a) && Number.isInteger(b);
|
|
350
351
|
const types = {
|
|
351
352
|
height: 'offsetHeight',
|
|
@@ -408,7 +409,7 @@ const attachItemProps = ({ i, length, }) => {
|
|
|
408
409
|
position,
|
|
409
410
|
};
|
|
410
411
|
};
|
|
411
|
-
const Component$
|
|
412
|
+
const Component$6 = (props) => {
|
|
412
413
|
const { itemKey, valueName, children, component, data, wrapComponent: Wrapper, wrapProps, itemProps, } = props;
|
|
413
414
|
const injectItemProps = React.useMemo(() => (typeof itemProps === 'function' ? itemProps : () => itemProps), [itemProps]);
|
|
414
415
|
const injectWrapItemProps = React.useMemo(() => (typeof wrapProps === 'function' ? wrapProps : () => wrapProps), [wrapProps]);
|
|
@@ -554,19 +555,19 @@ const Component$4 = (props) => {
|
|
|
554
555
|
};
|
|
555
556
|
return renderItems();
|
|
556
557
|
};
|
|
557
|
-
Component$
|
|
558
|
-
Component$
|
|
558
|
+
Component$6.isIterator = true;
|
|
559
|
+
Component$6.RESERVED_PROPS = RESERVED_PROPS;
|
|
559
560
|
|
|
560
|
-
const
|
|
561
|
-
const renderedList = React__default["default"].createElement(Component$
|
|
561
|
+
const Component$5 = React.forwardRef(({ rootElement = false, ...props }, ref) => {
|
|
562
|
+
const renderedList = React__default["default"].createElement(Component$6, { ...core.pick(props, Component$6.RESERVED_PROPS) });
|
|
562
563
|
if (!rootElement)
|
|
563
564
|
return renderedList;
|
|
564
|
-
return (React__default["default"].createElement(Component$
|
|
565
|
+
return (React__default["default"].createElement(Component$7, { ref: ref, ...core.omit(props, Component$6.RESERVED_PROPS) }, renderedList));
|
|
565
566
|
});
|
|
566
567
|
const name$4 = `${PKG_NAME}/List`;
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
568
|
+
Component$5.displayName = name$4;
|
|
569
|
+
Component$5.pkgName = PKG_NAME;
|
|
570
|
+
Component$5.VITUS_LABS__COMPONENT = name$4;
|
|
570
571
|
|
|
571
572
|
// @ts-nocheck
|
|
572
573
|
const RESERVED_KEYS = [
|
|
@@ -575,7 +576,7 @@ const RESERVED_KEYS = [
|
|
|
575
576
|
'itemProps',
|
|
576
577
|
'activeItemRequired',
|
|
577
578
|
];
|
|
578
|
-
const component
|
|
579
|
+
const component = (WrappedComponent) => {
|
|
579
580
|
const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
580
581
|
const Enhanced = (props) => {
|
|
581
582
|
const { type = 'single', activeItemRequired, activeItems, itemProps = {}, ...rest } = props;
|
|
@@ -698,7 +699,7 @@ const component$1 = (WrappedComponent) => {
|
|
|
698
699
|
return Enhanced;
|
|
699
700
|
};
|
|
700
701
|
|
|
701
|
-
const Component$
|
|
702
|
+
const Component$4 = ({ DOMLocation, tag = 'div', children, }) => {
|
|
702
703
|
const [element, setElement] = React.useState();
|
|
703
704
|
React.useEffect(() => {
|
|
704
705
|
if (!tag)
|
|
@@ -716,14 +717,14 @@ const Component$3 = ({ DOMLocation, tag = 'div', children, }) => {
|
|
|
716
717
|
return reactDom.createPortal(children, element);
|
|
717
718
|
};
|
|
718
719
|
const name$3 = `${PKG_NAME}/Portal`;
|
|
719
|
-
Component$
|
|
720
|
-
Component$
|
|
721
|
-
Component$
|
|
720
|
+
Component$4.displayName = name$3;
|
|
721
|
+
Component$4.pkgName = PKG_NAME;
|
|
722
|
+
Component$4.VITUS_LABS__COMPONENT = name$3;
|
|
722
723
|
|
|
723
724
|
const context = React.createContext({});
|
|
724
725
|
const { Provider } = context;
|
|
725
726
|
const useOverlayContext = () => React.useContext(context);
|
|
726
|
-
const Component$
|
|
727
|
+
const Component$3 = ({ children, blocked, setBlocked, setUnblocked, }) => {
|
|
727
728
|
const ctx = React.useMemo(() => ({
|
|
728
729
|
blocked,
|
|
729
730
|
setBlocked,
|
|
@@ -1160,11 +1161,11 @@ offsetX = 0, offsetY = 0, throttleDelay = 200, parentContainer, closeOnEsc = tru
|
|
|
1160
1161
|
blocked,
|
|
1161
1162
|
setBlocked,
|
|
1162
1163
|
setUnblocked,
|
|
1163
|
-
Provider: Component$
|
|
1164
|
+
Provider: Component$3,
|
|
1164
1165
|
};
|
|
1165
1166
|
};
|
|
1166
1167
|
|
|
1167
|
-
const Component$
|
|
1168
|
+
const Component$2 = ({ children, trigger, DOMLocation, triggerRefName = 'ref', contentRefName = 'ref', ...props }) => {
|
|
1168
1169
|
const { active, triggerRef, contentRef, showContent, hideContent, align, alignX, alignY, Provider, ...ctx } = useOverlay(props);
|
|
1169
1170
|
const { openOn, closeOn } = props;
|
|
1170
1171
|
const passHandlers = React.useMemo(() => openOn === 'manual' ||
|
|
@@ -1179,9 +1180,9 @@ const Component$1 = ({ children, trigger, DOMLocation, triggerRefName = 'ref', c
|
|
|
1179
1180
|
false ));
|
|
1180
1181
|
};
|
|
1181
1182
|
const name$2 = `${PKG_NAME}/Overlay`;
|
|
1182
|
-
Component$
|
|
1183
|
-
Component$
|
|
1184
|
-
Component$
|
|
1183
|
+
Component$2.displayName = name$2;
|
|
1184
|
+
Component$2.pkgName = PKG_NAME;
|
|
1185
|
+
Component$2.VITUS_LABS__COMPONENT = name$2;
|
|
1185
1186
|
|
|
1186
1187
|
const styles = ({ css, theme: t }) => css `
|
|
1187
1188
|
${t.extraStyles && unistyle.extendCss(t.extraStyles)};
|
|
@@ -1199,8 +1200,8 @@ var Styled = core.config.styled(core.config.textComponent) `
|
|
|
1199
1200
|
})};
|
|
1200
1201
|
`;
|
|
1201
1202
|
|
|
1202
|
-
const
|
|
1203
|
-
const renderContent = (as = undefined) => (React__default["default"].createElement(Styled, { ref: ref, as: as, "$text": { extraStyles:
|
|
1203
|
+
const Component$1 = React.forwardRef(({ paragraph, label, children, tag, css, ...props }, ref) => {
|
|
1204
|
+
const renderContent = (as = undefined) => (React__default["default"].createElement(Styled, { ref: ref, as: as, "$text": { extraStyles: css }, ...props }, children || label));
|
|
1204
1205
|
let finalTag;
|
|
1205
1206
|
{
|
|
1206
1207
|
if (paragraph)
|
|
@@ -1212,12 +1213,15 @@ const component = React.forwardRef(({ paragraph, label, children, tag, extendCss
|
|
|
1212
1213
|
return renderContent(finalTag);
|
|
1213
1214
|
});
|
|
1214
1215
|
const name$1 = `${PKG_NAME}/Text`;
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1216
|
+
Component$1.displayName = name$1;
|
|
1217
|
+
Component$1.pkgName = PKG_NAME;
|
|
1218
|
+
Component$1.VITUS_LABS__COMPONENT = name$1;
|
|
1219
|
+
Component$1.isText = true;
|
|
1219
1220
|
|
|
1220
|
-
const Component = ({ children, className = '', style }) =>
|
|
1221
|
+
const Component = ({ children, className = '', style }) => {
|
|
1222
|
+
const mergedClasses = React.useMemo(() => Array.isArray(className) ? className.join(' ') : className, [className]);
|
|
1223
|
+
return core.render(children, { className: mergedClasses, style });
|
|
1224
|
+
};
|
|
1221
1225
|
const name = `${PKG_NAME}/Util`;
|
|
1222
1226
|
Component.displayName = name;
|
|
1223
1227
|
Component.pkgName = PKG_NAME;
|
|
@@ -1227,14 +1231,14 @@ Object.defineProperty(exports, 'Provider', {
|
|
|
1227
1231
|
enumerable: true,
|
|
1228
1232
|
get: function () { return unistyle.Provider; }
|
|
1229
1233
|
});
|
|
1230
|
-
exports.Element = Component$
|
|
1231
|
-
exports.List =
|
|
1232
|
-
exports.Overlay = Component$
|
|
1233
|
-
exports.OverlayProvider = Component$
|
|
1234
|
-
exports.Portal = Component$
|
|
1235
|
-
exports.Text =
|
|
1234
|
+
exports.Element = Component$7;
|
|
1235
|
+
exports.List = Component$5;
|
|
1236
|
+
exports.Overlay = Component$2;
|
|
1237
|
+
exports.OverlayProvider = Component$3;
|
|
1238
|
+
exports.Portal = Component$4;
|
|
1239
|
+
exports.Text = Component$1;
|
|
1236
1240
|
exports.Util = Component;
|
|
1237
1241
|
exports.useOverlay = useOverlay;
|
|
1238
|
-
exports.withActiveState = component
|
|
1242
|
+
exports.withActiveState = component;
|
|
1239
1243
|
exports.withEqualSizeBeforeAfter = withEqualBeforeAfter;
|
|
1240
1244
|
//# sourceMappingURL=vitus-labs-elements.js.map
|