@xyo-network/react-property 2.46.8 → 2.47.0-rc.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/cjs/components/Property.js +13 -10
- package/dist/cjs/components/Property.js.map +1 -1
- package/dist/cjs/components/Value.js +5 -4
- package/dist/cjs/components/Value.js.map +1 -1
- package/dist/docs.json +1251 -1197
- package/dist/esm/components/Property.js +13 -9
- package/dist/esm/components/Property.js.map +1 -1
- package/dist/esm/components/Value.js +5 -3
- package/dist/esm/components/Value.js.map +1 -1
- package/dist/types/components/Property.d.ts +2 -2
- package/dist/types/components/Property.d.ts.map +1 -1
- package/dist/types/components/Value.d.ts +2 -2
- package/dist/types/components/Value.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/Property.tsx +52 -57
- package/src/components/Value.tsx +7 -4
|
@@ -5,11 +5,12 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
|
8
|
+
const react_1 = require("react");
|
|
8
9
|
const ActionsMenu_1 = require("./ActionsMenu");
|
|
9
10
|
const IdenticonCorner_1 = require("./IdenticonCorner");
|
|
10
11
|
const Title_1 = require("./Title");
|
|
11
12
|
const Value_1 = require("./Value");
|
|
12
|
-
const PropertyBox = (_a) => {
|
|
13
|
+
const PropertyBox = (0, react_1.forwardRef)((_a, ref) => {
|
|
13
14
|
var { titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false } = _a, props = tslib_1.__rest(_a, ["titleProps", "title", "value", "children", "size", "tip", "actions", "required", "badge"]);
|
|
14
15
|
const sizeValueHeight = {
|
|
15
16
|
large: 48,
|
|
@@ -21,14 +22,16 @@ const PropertyBox = (_a) => {
|
|
|
21
22
|
medium: 'body1',
|
|
22
23
|
small: 'body2',
|
|
23
24
|
};
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, Object.assign({ flexDirection: "column", minWidth: 0, alignItems: "stretch", overflow: "hidden" }, props, { children: [title !== undefined ? ((0, jsx_runtime_1.jsx)(Title_1.PropertyTitle, Object.assign({ tip: tip, title: required ? `${title}*` : title, size: size, more: (0, jsx_runtime_1.jsx)(ActionsMenu_1.PropertyActionsMenu, { actions: actions }) }, titleProps))) : null, (0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, Object.assign({ pl: 1, columnGap: 1, justifyContent: value === undefined ? 'center' : 'space-between', overflow: "hidden", height: sizeValueHeight[size] }, { children: [children ? (children) : value !== undefined ? ((0, jsx_runtime_1.jsx)(Value_1.PropertyValue, { value: value, typographyVariant: sizeVariants[size] })) : ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 16 })), value !== undefined ? badge ? (0, jsx_runtime_1.jsx)(IdenticonCorner_1.IdenticonCorner, { value: value }) : null : null] }))] })));
|
|
25
|
-
};
|
|
26
|
-
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, Object.assign({ ref: ref, flexDirection: "column", minWidth: 0, alignItems: "stretch", overflow: "hidden" }, props, { children: [title !== undefined ? ((0, jsx_runtime_1.jsx)(Title_1.PropertyTitle, Object.assign({ tip: tip, title: required ? `${title}*` : title, size: size, more: (0, jsx_runtime_1.jsx)(ActionsMenu_1.PropertyActionsMenu, { actions: actions }) }, titleProps))) : null, (0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, Object.assign({ pl: 1, columnGap: 1, justifyContent: value === undefined ? 'center' : 'space-between', overflow: "hidden", height: sizeValueHeight[size] }, { children: [children ? (children) : value !== undefined ? ((0, jsx_runtime_1.jsx)(Value_1.PropertyValue, { value: value, typographyVariant: sizeVariants[size] })) : ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 16 })), value !== undefined ? badge ? (0, jsx_runtime_1.jsx)(IdenticonCorner_1.IdenticonCorner, { value: value }) : null : null] }))] })));
|
|
26
|
+
});
|
|
27
|
+
PropertyBox.displayName = 'PropertyBox';
|
|
28
|
+
const PropertyPaper = (0, react_1.forwardRef)((_a, ref) => {
|
|
27
29
|
var { style, variant, elevation = 2, square } = _a, props = tslib_1.__rest(_a, ["style", "variant", "elevation", "square"]);
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: Object.assign({ minWidth: 0, overflow: 'hidden' }, style), variant: variant, elevation: elevation, square: square }, { children: (0, jsx_runtime_1.jsx)(PropertyBox, Object.assign({}, props, { paper: false })) })));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ ref: ref, style: Object.assign({ minWidth: 0, overflow: 'hidden' }, style), variant: variant, elevation: elevation, square: square }, { children: (0, jsx_runtime_1.jsx)(PropertyBox, Object.assign({}, props, { paper: false })) })));
|
|
31
|
+
});
|
|
32
|
+
PropertyPaper.displayName = 'PropertyPaper';
|
|
33
|
+
exports.Property = (0, react_1.forwardRef)((props, ref) => {
|
|
34
|
+
return props.paper ? (0, jsx_runtime_1.jsx)(PropertyPaper, Object.assign({ ref: ref }, props)) : (0, jsx_runtime_1.jsx)(PropertyBox, Object.assign({ ref: ref }, props));
|
|
35
|
+
});
|
|
36
|
+
exports.Property.displayName = 'Property';
|
|
34
37
|
//# sourceMappingURL=Property.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/components/Property.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA0E;AAC1E,yDAA+C;
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/components/Property.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA0E;AAC1E,yDAA+C;AAE/C,iCAAkC;AAElC,+CAAmD;AACnD,uDAAmD;AAEnD,mCAAuC;AACvC,mCAAuC;AAEvC,M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AAE,GAAG,IAAM,KAAK,EAAI,CAAA;AACpG,CAAC,CAAC,CAAA;AACF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAA"}
|
|
@@ -4,9 +4,10 @@ exports.PropertyValue = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_shared_1 = require("@xyo-network/react-shared");
|
|
7
|
-
const
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
exports.PropertyValue = (0, react_1.forwardRef)((_a, ref) => {
|
|
8
9
|
var { typographyVariant = 'body1', value } = _a, props = tslib_1.__rest(_a, ["typographyVariant", "value"]);
|
|
9
|
-
return value !== undefined ? ((0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ typographyProps: { component: undefined, title: value === null || value === void 0 ? void 0 : value.toString(), variant: typographyVariant }, width: "100%" }, props, { children: value }))) : null;
|
|
10
|
-
};
|
|
11
|
-
exports.PropertyValue = PropertyValue;
|
|
10
|
+
return value !== undefined ? ((0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ typographyProps: { component: undefined, title: value === null || value === void 0 ? void 0 : value.toString(), variant: typographyVariant }, width: "100%", ref: ref }, props, { children: value }))) : null;
|
|
11
|
+
});
|
|
12
|
+
exports.PropertyValue.displayName = 'PropertyValue';
|
|
12
13
|
//# sourceMappingURL=Value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../src/components/Value.tsx"],"names":[],"mappings":";;;;;AACA,4DAA2E;
|
|
1
|
+
{"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../src/components/Value.tsx"],"names":[],"mappings":";;;;;AACA,4DAA2E;AAC3E,iCAAkC;AAOrB,QAAA,aAAa,GAAG,IAAA,kBAAU,EAAqC,CAAC,EAAgD,EAAE,GAAG,EAAE,EAAE;QAAzD,EAAE,iBAAiB,GAAG,OAAO,EAAE,KAAK,OAAY,EAAP,KAAK,sBAA9C,8BAAgD,CAAF;IACzH,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAC3B,uBAAC,2BAAY,kBAAC,eAAe,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAC,MAAM,EAAC,GAAG,EAAE,GAAG,IAAM,KAAK,cAC5I,KAAK,IACO,CAChB,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAC,CAAA;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|