@zuzjs/ui 0.2.3 → 0.2.4
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/index.js +25 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1238,9 +1238,9 @@ const Form = forwardRef((props, ref) => {
|
|
|
1238
1238
|
get
|
|
1239
1239
|
}));
|
|
1240
1240
|
useEffect(() => {
|
|
1241
|
+
let f = buildFields();
|
|
1242
|
+
setHTML(f.children);
|
|
1241
1243
|
if (!forms[name]) {
|
|
1242
|
-
let f = buildFields();
|
|
1243
|
-
setHTML(f.children);
|
|
1244
1244
|
dispatch(ADD_FORM(name, f.fields, forms));
|
|
1245
1245
|
}
|
|
1246
1246
|
}, [children, (_a = forms[name]) === null || _a === void 0 ? void 0 : _a.loading]);
|
|
@@ -1327,4 +1327,26 @@ const Tweet = (props) => {
|
|
|
1327
1327
|
return (jsx(Box, { as: `tweet`, weight: 1, bref: _tweet }));
|
|
1328
1328
|
};
|
|
1329
1329
|
|
|
1330
|
-
|
|
1330
|
+
const ContextMenu = forwardRef((props, ref) => {
|
|
1331
|
+
const { as, size, color, hover, pos, items } = props;
|
|
1332
|
+
return (jsx(Box, Object.assign({ hover: hover || {}, flex: true, fixed: true, top: (pos === null || pos === void 0 ? void 0 : pos.y) || 0, left: (pos === null || pos === void 0 ? void 0 : pos.x) || 0, bref: ref, as: `contextmenu-${as}`, ai: `c`, jc: `c`, size: size || 24, color: color || `#111111` }, { children: items && items.map((m, i) => jsx(Button, Object.assign({ onClick: m.on ? m.on : () => { } }, { children: m.label }), `cm-${i}-${m.id}`)) })));
|
|
1333
|
+
});
|
|
1334
|
+
|
|
1335
|
+
const buildElement = (el) => {
|
|
1336
|
+
switch (el.is) {
|
|
1337
|
+
case "Box":
|
|
1338
|
+
return jsx(Box, Object.assign({}, (el.props || {}), { children: el.children || null }), el.key || nanoid());
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
const buildComponent = (data) => {
|
|
1342
|
+
return data.map(e => buildElement(e));
|
|
1343
|
+
};
|
|
1344
|
+
|
|
1345
|
+
const Header = forwardRef((props, ref) => {
|
|
1346
|
+
const data = [
|
|
1347
|
+
{ is: `Box` }
|
|
1348
|
+
];
|
|
1349
|
+
return (jsx(Fragment, { children: buildComponent(data) }));
|
|
1350
|
+
});
|
|
1351
|
+
|
|
1352
|
+
export { App, Component as Block, Box, Button, Checkbox, ContextMenu, Cover, Form, Header, Heading, Icon, Image, Input, Placeholder, AppProvider as Provider, Select, Spacer, Spinner, Text, Toaster, Tweet, addProps, addScript, buildCSS, buildFormData, byId, byName, createSlice, el, filterHTMLProps, filterStyleProps, getCookie, getUriParams, grab, isEmail, isIPv4, isUrl, randstr, removeCookie, rgb2hex, setCSSVar, setCookie, shuffleArray, ucfirst, useDevice, useDispatch, useImage, useResizeObserver, useStore, useTheme, useToast, uuid };
|