@blaze-cms/plugin-data-ui 0.133.0-admin-updates.0 → 0.133.0-project-admin-customisations.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/CHANGELOG.md +27 -1
- package/README.md +42 -0
- package/lib/components/EntityDataListing/EntityDataListing.js +3 -24
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +39 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +12 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -0
- package/lib/components/EntityManager/Entity/Entity.js +16 -3
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +44 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +32 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +45 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +12 -2
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +38 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js +36 -0
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -0
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +44 -0
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib/components/InfoBoxes/hooks/useData.js +42 -0
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +26 -0
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -0
- package/lib/components/InfoBoxes/index.js +12 -0
- package/lib/components/InfoBoxes/index.js.map +1 -0
- package/lib/components/InfoBoxes/presentational/InfoBox.js +46 -0
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib/components/ListingTable/ListingTable.js +113 -80
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +8 -20
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +92 -26
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +73 -11
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/index.js +3 -11
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +64 -13
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-listing-query.js +11 -2
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/get-default-query-params.js +3 -4
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib-es/components/EntityDataListing/EntityDataListing.js +3 -14
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +30 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +3 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/Entity.js +16 -3
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +30 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +26 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +39 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +12 -2
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js +28 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +30 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js +37 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +19 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -0
- package/lib-es/components/InfoBoxes/index.js +3 -0
- package/lib-es/components/InfoBoxes/index.js.map +1 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +31 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib-es/components/ListingTable/ListingTable.js +46 -49
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +11 -19
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +76 -24
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js +65 -7
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/index.js +1 -9
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js +49 -5
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-listing-query.js +10 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js +1 -3
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/package.json +10 -9
- package/src/components/EntityDataListing/EntityDataListing.js +3 -12
- package/src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +26 -0
- package/src/components/EntityManager/Entity/EntitiyNavLinks/index.js +3 -0
- package/src/components/EntityManager/Entity/Entity.js +10 -1
- package/src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +22 -0
- package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +33 -0
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +28 -0
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +34 -16
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +33 -0
- package/src/components/InfoBoxes/InfoBoxes.js +24 -0
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +22 -0
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/src/components/InfoBoxes/hooks/useData.js +20 -0
- package/src/components/InfoBoxes/hooks/useInfoBox.js +13 -0
- package/src/components/InfoBoxes/index.js +3 -0
- package/src/components/InfoBoxes/presentational/InfoBox.js +34 -0
- package/src/components/ListingTable/ListingTable.js +57 -38
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +8 -22
- package/src/components/ListingTable/mappers/populate-rows.js +83 -18
- package/src/components/ListingTable/service/index.js +42 -5
- package/src/index.js +1 -8
- package/src/utils/add-content-menu-items.js +45 -3
- package/src/utils/build-listing-query.js +11 -1
- package/src/utils/get-default-query-params.js +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _client = require("@apollo/client");
|
|
12
|
+
var _buildDynamicQuery = _interopRequireDefault(require("../helpers/build-dynamic-query"));
|
|
13
|
+
var _templateObject;
|
|
14
|
+
var useCustomSidebarData = function useCustomSidebarData(_ref) {
|
|
15
|
+
var id = _ref.id,
|
|
16
|
+
schema = _ref.schema,
|
|
17
|
+
displayProperties = _ref.displayProperties;
|
|
18
|
+
var query = (0, _buildDynamicQuery["default"])({
|
|
19
|
+
id: id,
|
|
20
|
+
schema: schema,
|
|
21
|
+
displayProperties: displayProperties
|
|
22
|
+
});
|
|
23
|
+
var customSidebarInfoQuery = query || (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query {\n __typename\n }\n "])));
|
|
24
|
+
var _useQuery = (0, _client.useQuery)(customSidebarInfoQuery, {
|
|
25
|
+
variables: {
|
|
26
|
+
id: id
|
|
27
|
+
},
|
|
28
|
+
skip: !query
|
|
29
|
+
}),
|
|
30
|
+
_useQuery$data = _useQuery.data,
|
|
31
|
+
data = _useQuery$data === void 0 ? {} : _useQuery$data,
|
|
32
|
+
loading = _useQuery.loading,
|
|
33
|
+
error = _useQuery.error;
|
|
34
|
+
return {
|
|
35
|
+
data: data.__typename !== 'Query' ? data : null,
|
|
36
|
+
loading: loading,
|
|
37
|
+
error: error
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var _default = useCustomSidebarData;
|
|
41
|
+
exports["default"] = _default;
|
|
42
|
+
useCustomSidebarData.propTypes = {
|
|
43
|
+
displayProperties: _propTypes["default"].object.isRequired
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=useCustomSidebarData.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCustomSidebarData.js","names":["_propTypes","_interopRequireDefault","require","_client","_buildDynamicQuery","_templateObject","useCustomSidebarData","_ref","id","schema","displayProperties","query","buildDynamicQuery","customSidebarInfoQuery","gql","_taggedTemplateLiteral2","_useQuery","useQuery","variables","skip","_useQuery$data","data","loading","error","__typename","_default","exports","propTypes","ProptTypes","object","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js"],"sourcesContent":["import ProptTypes from 'prop-types';\nimport { useQuery, gql } from '@apollo/client';\nimport buildDynamicQuery from '../helpers/build-dynamic-query';\n\nconst useCustomSidebarData = ({ id, schema, displayProperties }) => {\n const query = buildDynamicQuery({ id, schema, displayProperties });\n\n const customSidebarInfoQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {\n variables: { id },\n skip: !query\n });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n};\n\nexport default useCustomSidebarData;\n\nuseCustomSidebarData.propTypes = {\n displayProperties: ProptTypes.object.isRequired\n};\n"],"mappings":";;;;;;;;;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vC,CAAC"}
|
|
@@ -28,6 +28,8 @@ var _reactFormBuilder = require("@blaze-cms/react-form-builder");
|
|
|
28
28
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
29
|
var _versioningUi = require("@blaze-cms/versioning-ui");
|
|
30
30
|
var _constants = require("../../../../constants");
|
|
31
|
+
var _CustomSidebarInfoContainer = _interopRequireDefault(require("./container/CustomSidebarInfoContainer"));
|
|
32
|
+
var _EntitiyNavLinks = _interopRequireDefault(require("../EntitiyNavLinks"));
|
|
31
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
35
|
var SideBarRelations = function SideBarRelations(_ref) {
|
|
@@ -144,16 +146,24 @@ var SideBarRelations = function SideBarRelations(_ref) {
|
|
|
144
146
|
"data-testid": "sideBarRelations-main-div"
|
|
145
147
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
148
|
className: "sidebar__content"
|
|
147
|
-
},
|
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
148
150
|
className: "sidebar__status"
|
|
151
|
+
}, formattedCreated && /*#__PURE__*/_react["default"].createElement("div", {
|
|
152
|
+
className: "sidebar__top"
|
|
149
153
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
154
|
className: "sidebar__status__wrapper"
|
|
151
155
|
}, /*#__PURE__*/_react["default"].createElement("b", null, "Status"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
152
156
|
className: statusClassName
|
|
153
|
-
}, formattedStatus)), formattedStatus === _constants.PUBLISHED && /*#__PURE__*/_react["default"].createElement("p", null, formattedStatus, " on: ", /*#__PURE__*/_react["default"].createElement("span", null, " ", formattedPublished)), /*#__PURE__*/_react["default"].createElement("p", null, "Created: ", /*#__PURE__*/_react["default"].createElement("span", null, formattedCreated)), /*#__PURE__*/_react["default"].createElement("p", null, "Updated: ", /*#__PURE__*/_react["default"].createElement("span", null, formattedUpdated))), /*#__PURE__*/_react["default"].createElement(
|
|
157
|
+
}, formattedStatus)), formattedStatus === _constants.PUBLISHED && /*#__PURE__*/_react["default"].createElement("p", null, formattedStatus, " on: ", /*#__PURE__*/_react["default"].createElement("span", null, " ", formattedPublished))), !schema.displayProperties.adminMainInfoProperty && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("p", null, "Created: ", /*#__PURE__*/_react["default"].createElement("span", null, formattedCreated)), /*#__PURE__*/_react["default"].createElement("p", null, "Updated: ", /*#__PURE__*/_react["default"].createElement("span", null, formattedUpdated))), /*#__PURE__*/_react["default"].createElement(_CustomSidebarInfoContainer["default"], {
|
|
158
|
+
id: itemId,
|
|
159
|
+
schema: schema,
|
|
160
|
+
displayProperties: schema.displayProperties
|
|
161
|
+
})), /*#__PURE__*/_react["default"].createElement(_versioningUi.VersionsList, {
|
|
154
162
|
itemEntity: itemEntity,
|
|
155
163
|
itemId: itemId,
|
|
156
164
|
interfaces: interfaces
|
|
165
|
+
}), /*#__PURE__*/_react["default"].createElement(_EntitiyNavLinks["default"], {
|
|
166
|
+
schema: schema
|
|
157
167
|
}), relationsComponents && relationsComponents.map(function (_ref7) {
|
|
158
168
|
var id = _ref7.id,
|
|
159
169
|
staticData = _ref7.staticData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_v","_client","_adminUiUtils","_reactFormBuilder","_classnames","_versioningUi","_constants","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SideBarRelations","_ref","schema","onChange","formData","entity","RelationComponent","formFieldTypes","relation","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","status","client","useApolloClient","_useState","useState","_useState2","_slicedToArray2","relationsComponents","setRelationsComponents","useEffect","_asyncToGenerator2","_regenerator","mark","_callee3","fetchRelationSchema","allRelationComponents","wrap","_callee3$","_context3","prev","next","_ref4","_callee","_ref3","entityIdentifier","_yield$client$query","_yield$client$query$d","relationSchema","_callee$","_context","abrupt","query","getQuery","variables","identifier","sent","data","getEntitySchemas","stop","_x","apply","arguments","Promise","all","relations","filter","_ref5","showInForm","foreignKey","properties","map","_ref6","_callee2","_callee2$","_context2","t0","uuidv1","t1","t2","id","staticData","_x2","itemId","itemEntity","interfaces","statusClassName","classnames","PUBLISHED","UNPUBLISHED","createElement","className","VersionsList","_ref7","entitySchema","onSelect","propTypes","PropTypes","object","isRequired","func","defaultProps","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n status\n } = formData;\n const client = useApolloClient();\n const [relationsComponents, setRelationsComponents] = useState(null);\n useEffect(\n () => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n },\n [client, relationsComponents, schema, schema.relations]\n );\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div className=\"sidebar\" data-testid=\"sideBarRelations-main-div\">\n <div className=\"sidebar__content\">\n {formattedCreated && (\n <div className=\"sidebar__status\">\n <div className=\"sidebar__status__wrapper\">\n <b>Status</b>\n <span className={statusClassName}>{formattedStatus}</span>\n </div>\n {formattedStatus === PUBLISHED && (\n <p>\n {formattedStatus} on: <span> {formattedPublished}</span>\n </p>\n )}\n\n <p>\n Created: <span>{formattedCreated}</span>\n </p>\n <p>\n Updated: <span>{formattedUpdated}</span>\n </p>\n </div>\n )}\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n {relationsComponents &&\n relationsComponents.map(({ id, staticData, schema: entitySchema }) => (\n <RelationComponent\n formData={formData}\n schema={entitySchema}\n key={id}\n staticData={staticData}\n onSelect={onChange}\n />\n ))}\n </div>\n </div>\n );\n};\n\nSideBarRelations.propTypes = {\n schema: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n formData: PropTypes.object.isRequired,\n entity: PropTypes.object\n};\n\nSideBarRelations.defaultProps = {\n entity: {}\n};\n\nexport default SideBarRelations;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,EAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAA+D,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAgB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAA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YAAG,WACQ,eAAApH,MAAA,YAAAoH,aAAA,eAAOxE,gBAAuB,CACtC,CACA,CACN,eAED5C,MAAA,YAAAoH,aAAA,CAAC1G,aAAA,CAAA4G,YAAY;IAACR,UAAU,EAAEA,UAAW;IAACD,MAAM,EAAEA,MAAO;IAACE,UAAU,EAAEA;EAAW,CAAE,CAAC,EAC/EzD,mBAAmB,IAClBA,mBAAmB,CAAC2C,GAAG,CAAC,UAAAsB,KAAA;IAAA,IAAGb,EAAE,GAAAa,KAAA,CAAFb,EAAE;MAAEC,UAAU,GAAAY,KAAA,CAAVZ,UAAU;MAAUa,YAAY,GAAAD,KAAA,CAApBnF,MAAM;IAAA,oBAC/CpC,MAAA,YAAAoH,aAAA,CAAC5E,iBAAiB;MAChBF,QAAQ,EAAEA,QAAS;MACnBF,MAAM,EAAEoF,YAAa;MACrB5F,GAAG,EAAE8E,EAAG;MACRC,UAAU,EAAEA,UAAW;MACvBc,QAAQ,EAAEpF;IAAS,CACpB,CAAC;EAAA,CACH,CACA,CACF,CAAC;AAEV,CAAC;AAEDH,gBAAgB,CAACwF,SAAS,GAAG;EAC3BtF,MAAM,EAAEuF,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCxF,QAAQ,EAAEsF,qBAAS,CAACG,IAAI,CAACD,UAAU;EACnCvF,QAAQ,EAAEqF,qBAAS,CAACC,MAAM,CAACC,UAAU;EACrCtF,MAAM,EAAEoF,qBAAS,CAACC;AACpB,CAAC;AAED1F,gBAAgB,CAAC6F,YAAY,GAAG;EAC9BxF,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAAyF,QAAA,GAEa9F,gBAAgB;AAAA+F,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_v","_client","_adminUiUtils","_reactFormBuilder","_classnames","_versioningUi","_constants","_CustomSidebarInfoContainer","_EntitiyNavLinks","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SideBarRelations","_ref","schema","onChange","formData","entity","RelationComponent","formFieldTypes","relation","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","status","client","useApolloClient","_useState","useState","_useState2","_slicedToArray2","relationsComponents","setRelationsComponents","useEffect","_asyncToGenerator2","_regenerator","mark","_callee3","fetchRelationSchema","allRelationComponents","wrap","_callee3$","_context3","prev","next","_ref4","_callee","_ref3","entityIdentifier","_yield$client$query","_yield$client$query$d","relationSchema","_callee$","_context","abrupt","query","getQuery","variables","identifier","sent","data","getEntitySchemas","stop","_x","apply","arguments","Promise","all","relations","filter","_ref5","showInForm","foreignKey","properties","map","_ref6","_callee2","_callee2$","_context2","t0","uuidv1","t1","t2","id","staticData","_x2","itemId","itemEntity","interfaces","statusClassName","classnames","PUBLISHED","UNPUBLISHED","createElement","className","displayProperties","adminMainInfoProperty","Fragment","VersionsList","_ref7","entitySchema","onSelect","propTypes","PropTypes","object","isRequired","func","defaultProps","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n status\n } = formData;\n const client = useApolloClient();\n\n const [relationsComponents, setRelationsComponents] = useState(null);\n\n useEffect(\n () => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n },\n [client, relationsComponents, schema, schema.relations]\n );\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div className=\"sidebar\" data-testid=\"sideBarRelations-main-div\">\n <div className=\"sidebar__content\">\n <div className=\"sidebar__status\">\n {formattedCreated && (\n <div className=\"sidebar__top\">\n <div className=\"sidebar__status__wrapper\">\n <b>Status</b>\n <span className={statusClassName}>{formattedStatus}</span>\n </div>\n {formattedStatus === PUBLISHED && (\n <p>\n {formattedStatus} on: <span> {formattedPublished}</span>\n </p>\n )}\n </div>\n )}\n\n {!schema.displayProperties.adminMainInfoProperty && (\n <>\n <p>\n Created: <span>{formattedCreated}</span>\n </p>\n <p>\n Updated: <span>{formattedUpdated}</span>\n </p>\n </>\n )}\n\n <CustomSidebarInfoContainer\n id={itemId}\n schema={schema}\n displayProperties={schema.displayProperties}\n />\n </div>\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n <EntityNavLinks schema={schema} />\n\n {relationsComponents &&\n relationsComponents.map(({ id, staticData, schema: entitySchema }) => (\n <RelationComponent\n formData={formData}\n schema={entitySchema}\n key={id}\n staticData={staticData}\n onSelect={onChange}\n />\n ))}\n </div>\n </div>\n );\n};\n\nSideBarRelations.propTypes = {\n schema: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n formData: PropTypes.object.isRequired,\n entity: PropTypes.object\n};\n\nSideBarRelations.defaultProps = {\n entity: {}\n};\n\nexport default SideBarRelations;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,EAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,gBAAA,GAAAT,sBAAA,CAAAF,OAAA;AAAgD,SAAAY,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAd,wBAAAkB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,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CAACC,UAAU;EACnC3F,QAAQ,EAAEyF,qBAAS,CAACG,IAAI,CAACD,UAAU;EACnC1F,QAAQ,EAAEwF,qBAAS,CAACC,MAAM,CAACC,UAAU;EACrCzF,MAAM,EAAEuF,qBAAS,CAACC;AACpB,CAAC;AAED7F,gBAAgB,CAACgG,YAAY,GAAG;EAC9B3F,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAA4F,QAAA,GAEajG,gBAAgB;AAAAkG,OAAA,cAAAD,QAAA"}
|
package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
require("core-js/modules/es.array.map.js");
|
|
10
|
+
require("core-js/modules/es.array.filter.js");
|
|
11
|
+
require("core-js/modules/es.object.to-string.js");
|
|
12
|
+
require("core-js/modules/es.object.values.js");
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
var CustomSidebarInfo = function CustomSidebarInfo(_ref) {
|
|
16
|
+
var items = _ref.items,
|
|
17
|
+
customSidebarInfoKey = _ref.customSidebarInfoKey;
|
|
18
|
+
if (!items) return null;
|
|
19
|
+
var customSidebarInfoItems = items.map(function (item) {
|
|
20
|
+
return Object.values(item).map(function (info) {
|
|
21
|
+
if (!info.label || !info.value) return null;
|
|
22
|
+
return /*#__PURE__*/_react["default"].createElement("p", null, info.label, ": ", /*#__PURE__*/_react["default"].createElement("span", null, info.value));
|
|
23
|
+
}).filter(Boolean);
|
|
24
|
+
});
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
|
+
className: "custom-sidebar-info",
|
|
27
|
+
key: customSidebarInfoKey
|
|
28
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
|
+
className: "custom-sidebar-info--container"
|
|
30
|
+
}, customSidebarInfoItems));
|
|
31
|
+
};
|
|
32
|
+
var _default = CustomSidebarInfo;
|
|
33
|
+
exports["default"] = _default;
|
|
34
|
+
CustomSidebarInfo.propTypes = {
|
|
35
|
+
customSidebarInfoKey: _propTypes["default"].string.isRequired,
|
|
36
|
+
items: _propTypes["default"].array.isRequired
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=CustomSidebarInfo.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomSidebarInfo.js","names":["_propTypes","_interopRequireDefault","require","_react","CustomSidebarInfo","_ref","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","createElement","filter","Boolean","className","key","_default","exports","propTypes","PropTypes","string","isRequired","array"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {\n if (!items) return null;\n\n const customSidebarInfoItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <p>\n {info.label}: <span>{info.value}</span>\n </p>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"custom-sidebar-info\" key={customSidebarInfoKey}>\n <div className=\"custom-sidebar-info--container\">{customSidebarInfoItems}</div>\n </div>\n );\n};\n\nexport default CustomSidebarInfo;\n\nCustomSidebarInfo.propTypes = {\n customSidebarInfoKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAAwC;EAAA,IAAlCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;EACtD,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,IAAME,sBAAsB,GAAGF,KAAK,CAACG,GAAG,CAAC,UAAAC,IAAI;IAAA,OAC3CC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAAC,UAAAI,IAAI,EAAI;MACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;MAE3C,oBACEZ,MAAA,YAAAa,aAAA,YACGH,IAAI,CAACC,KAAK,EAAC,IAAE,eAAAX,MAAA,YAAAa,aAAA,eAAOH,IAAI,CAACE,KAAY,CACrC,CAAC;IAER,CAAC,CAAC,CACDE,MAAM,CAACC,OAAO,CAAC;EAAA,CACpB,CAAC;EAED,oBACEf,MAAA,YAAAa,aAAA;IAAKG,SAAS,EAAC,qBAAqB;IAACC,GAAG,EAAEb;EAAqB,gBAC7DJ,MAAA,YAAAa,aAAA;IAAKG,SAAS,EAAC;EAAgC,GAAEX,sBAA4B,CAC1E,CAAC;AAEV,CAAC;AAAC,IAAAa,QAAA,GAEajB,iBAAiB;AAAAkB,OAAA,cAAAD,QAAA;AAEhCjB,iBAAiB,CAACmB,SAAS,GAAG;EAC5BhB,oBAAoB,EAAEiB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjDpB,KAAK,EAAEkB,qBAAS,CAACG,KAAK,CAACD;AACzB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
require("core-js/modules/es.array.map.js");
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _InfoBoxContainer = _interopRequireDefault(require("./container/InfoBoxContainer"));
|
|
13
|
+
var InfoBoxes = function InfoBoxes(_ref) {
|
|
14
|
+
var id = _ref.id,
|
|
15
|
+
schema = _ref.schema;
|
|
16
|
+
var _schema$displayProper = schema.displayProperties.adminInfoBoxes,
|
|
17
|
+
adminInfoBoxes = _schema$displayProper === void 0 ? [] : _schema$displayProper;
|
|
18
|
+
if (adminInfoBoxes.length <= 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return adminInfoBoxes.map(function (infoBox) {
|
|
22
|
+
return /*#__PURE__*/_react["default"].createElement(_InfoBoxContainer["default"], {
|
|
23
|
+
id: id,
|
|
24
|
+
schema: schema,
|
|
25
|
+
key: infoBox.key,
|
|
26
|
+
infoBox: infoBox
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var _default = InfoBoxes;
|
|
31
|
+
exports["default"] = _default;
|
|
32
|
+
InfoBoxes.propTypes = {
|
|
33
|
+
id: _propTypes["default"].string.isRequired,
|
|
34
|
+
schema: _propTypes["default"].object.isRequired
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=InfoBoxes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBoxes.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxContainer","InfoBoxes","_ref","id","schema","_schema$displayProper","displayProperties","adminInfoBoxes","length","map","infoBox","createElement","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../src/components/InfoBoxes/InfoBoxes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxContainer from './container/InfoBoxContainer';\n\nconst InfoBoxes = ({ id, schema }) => {\n const {\n displayProperties: { adminInfoBoxes = [] }\n } = schema;\n\n if (adminInfoBoxes.length <= 0) {\n return null;\n }\n\n return adminInfoBoxes.map(infoBox => (\n <InfoBoxContainer id={id} schema={schema} key={infoBox.key} infoBox={infoBox} />\n ));\n};\n\nexport default InfoBoxes;\n\nInfoBoxes.propTypes = {\n id: PropTypes.string.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAMG,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAAuB;EAAA,IAAjBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;EAC7B,IAAAC,qBAAA,GAEID,MAAM,CADRE,iBAAiB,CAAIC,cAAc;IAAdA,cAAc,GAAAF,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAG1C,IAAIE,cAAc,CAACC,MAAM,IAAI,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,OAAOD,cAAc,CAACE,GAAG,CAAC,UAAAC,OAAO;IAAA,oBAC/BX,MAAA,YAAAY,aAAA,CAACX,iBAAA,WAAgB;MAACG,EAAE,EAAEA,EAAG;MAACC,MAAM,EAAEA,MAAO;MAACQ,GAAG,EAAEF,OAAO,CAACE,GAAI;MAACF,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAAA,CACjF,CAAC;AACJ,CAAC;AAAC,IAAAG,QAAA,GAEaZ,SAAS;AAAAa,OAAA,cAAAD,QAAA;AAExBZ,SAAS,CAACc,SAAS,GAAG;EACpBZ,EAAE,EAAEa,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/Bd,MAAM,EAAEY,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
require("core-js/modules/es.object.keys.js");
|
|
10
|
+
require("core-js/modules/es.array.flat-map.js");
|
|
11
|
+
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
12
|
+
require("core-js/modules/es.object.to-string.js");
|
|
13
|
+
require("core-js/modules/es.object.values.js");
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _useData2 = _interopRequireDefault(require("../hooks/useData"));
|
|
17
|
+
var _InfoBox = _interopRequireDefault(require("../presentational/InfoBox"));
|
|
18
|
+
var InfoBoxContainer = function InfoBoxContainer(_ref) {
|
|
19
|
+
var id = _ref.id,
|
|
20
|
+
schema = _ref.schema,
|
|
21
|
+
infoBox = _ref.infoBox;
|
|
22
|
+
var _useData = (0, _useData2["default"])({
|
|
23
|
+
id: id,
|
|
24
|
+
schema: schema,
|
|
25
|
+
infoBox: infoBox
|
|
26
|
+
}),
|
|
27
|
+
data = _useData.data;
|
|
28
|
+
if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
|
|
29
|
+
var items = Object.values(data).flatMap(function (item) {
|
|
30
|
+
return Object.values(item);
|
|
31
|
+
});
|
|
32
|
+
return /*#__PURE__*/_react["default"].createElement(_InfoBox["default"], {
|
|
33
|
+
items: items,
|
|
34
|
+
infoBoxKey: infoBox.key
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var _default = InfoBoxContainer;
|
|
38
|
+
exports["default"] = _default;
|
|
39
|
+
InfoBoxContainer.propTypes = {
|
|
40
|
+
id: _propTypes["default"].string.isRequired,
|
|
41
|
+
infoBox: _propTypes["default"].object.isRequired,
|
|
42
|
+
schema: _propTypes["default"].object.isRequired
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=InfoBoxContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBoxContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_useData2","_InfoBox","InfoBoxContainer","_ref","id","schema","infoBox","_useData","useData","data","Object","keys","length","items","values","flatMap","item","createElement","infoBoxKey","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../../src/components/InfoBoxes/container/InfoBoxContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport useData from '../hooks/useData';\nimport InfoBox from '../presentational/InfoBox';\n\nconst InfoBoxContainer = ({ id, schema, infoBox }) => {\n const { data } = useData({ id, schema, infoBox });\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <InfoBox items={items} infoBoxKey={infoBox.key} />;\n};\n\nexport default InfoBoxContainer;\n\nInfoBoxContainer.propTypes = {\n id: PropTypes.string.isRequired,\n infoBox: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAgC;EAAA,IAA1BC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EAC7C,IAAAC,QAAA,GAAiB,IAAAC,oBAAO,EAAC;MAAEJ,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAAzCG,IAAI,GAAAF,QAAA,CAAJE,IAAI;EAEZ,IAAI,CAACA,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,IAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAAC,UAAAC,IAAI;IAAA,OAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC;EAAA,EAAC;EAEtE,oBAAOjB,MAAA,YAAAkB,aAAA,CAAChB,QAAA,WAAO;IAACY,KAAK,EAAEA,KAAM;IAACK,UAAU,EAAEZ,OAAO,CAACa;EAAI,CAAE,CAAC;AAC3D,CAAC;AAAC,IAAAC,QAAA,GAEalB,gBAAgB;AAAAmB,OAAA,cAAAD,QAAA;AAE/BlB,gBAAgB,CAACoB,SAAS,GAAG;EAC3BlB,EAAE,EAAEmB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BnB,OAAO,EAAEiB,qBAAS,CAACG,MAAM,CAACD,UAAU;EACpCpB,MAAM,EAAEkB,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = buildDynamicQuery;
|
|
9
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _client = require("@apollo/client");
|
|
11
|
+
var _coreErrors = require("@blaze-cms/core-errors");
|
|
12
|
+
var _templateObject;
|
|
13
|
+
function buildDynamicQuery(_ref) {
|
|
14
|
+
var id = _ref.id,
|
|
15
|
+
schema = _ref.schema,
|
|
16
|
+
infoBox = _ref.infoBox;
|
|
17
|
+
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
18
|
+
throw new _coreErrors.BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
19
|
+
}
|
|
20
|
+
var fields = "".concat(infoBox.property, " {\n label\n value\n }");
|
|
21
|
+
return {
|
|
22
|
+
query: (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["query getInfoBoxData($id: String!){\n ", "( id: $id ) {\n id\n ", "\n __typename\n }\n }"])), schema.actions.get, fields)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=build-dynamic-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","_templateObject","buildDynamicQuery","_ref","id","schema","infoBox","actions","get","properties","BlazeError","fields","concat","property","query","gql","_taggedTemplateLiteral2"],"sources":["../../../../src/components/InfoBoxes/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, infoBox }) {\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n const fields = `${infoBox.property} {\n label\n value\n }`;\n\n return {\n query: gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields}\n __typename\n }\n }`\n };\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAoD,IAAAE,eAAA;AAErC,SAASC,iBAAiBA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EAC7D,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACI,UAAU,EAAE;IAC3E,MAAM,IAAIC,sBAAU,CAClB,gFACF,CAAC;EACH;EAEA,IAAMC,MAAM,MAAAC,MAAA,CAAMN,OAAO,CAACO,QAAQ,wCAG9B;EAEJ,OAAO;IACLC,KAAK,MAAEC,WAAG,EAAAd,eAAA,KAAAA,eAAA,OAAAe,uBAAA,iIACRX,MAAM,CAACE,OAAO,CAACC,GAAG,EAEjBG,MAAM;EAIX,CAAC;AACH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _client = require("@apollo/client");
|
|
11
|
+
var _useInfoBox = _interopRequireDefault(require("./useInfoBox"));
|
|
12
|
+
var _templateObject;
|
|
13
|
+
function useData(_ref) {
|
|
14
|
+
var id = _ref.id,
|
|
15
|
+
schema = _ref.schema,
|
|
16
|
+
infoBox = _ref.infoBox;
|
|
17
|
+
var _useInfoBoxData = (0, _useInfoBox["default"])({
|
|
18
|
+
id: id,
|
|
19
|
+
schema: schema,
|
|
20
|
+
infoBox: infoBox
|
|
21
|
+
}),
|
|
22
|
+
query = _useInfoBoxData.query;
|
|
23
|
+
var infoBoxQuery = query || (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query {\n __typename\n }\n "])));
|
|
24
|
+
var _useQuery = (0, _client.useQuery)(infoBoxQuery, {
|
|
25
|
+
variables: {
|
|
26
|
+
id: id
|
|
27
|
+
},
|
|
28
|
+
skip: !query
|
|
29
|
+
}),
|
|
30
|
+
_useQuery$data = _useQuery.data,
|
|
31
|
+
data = _useQuery$data === void 0 ? {} : _useQuery$data,
|
|
32
|
+
loading = _useQuery.loading,
|
|
33
|
+
error = _useQuery.error;
|
|
34
|
+
return {
|
|
35
|
+
data: data.__typename !== 'Query' ? data : null,
|
|
36
|
+
loading: loading,
|
|
37
|
+
error: error
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var _default = useData;
|
|
41
|
+
exports["default"] = _default;
|
|
42
|
+
//# sourceMappingURL=useData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useData.js","names":["_client","require","_useInfoBox","_interopRequireDefault","_templateObject","useData","_ref","id","schema","infoBox","_useInfoBoxData","useInfoBoxData","query","infoBoxQuery","gql","_taggedTemplateLiteral2","_useQuery","useQuery","variables","skip","_useQuery$data","data","loading","error","__typename","_default","exports"],"sources":["../../../../src/components/InfoBoxes/hooks/useData.js"],"sourcesContent":["import { useQuery, gql } from '@apollo/client';\nimport useInfoBoxData from './useInfoBox';\n\nfunction useData({ id, schema, infoBox }) {\n const { query } = useInfoBoxData({ id, schema, infoBox });\n\n const infoBoxQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(infoBoxQuery, { variables: { id }, skip: !query });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n}\n\nexport default useData;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0C,IAAAG,eAAA;AAE1C,SAASC,OAAOA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EACpC,IAAAC,eAAA,GAAkB,IAAAC,sBAAc,EAAC;MAAEJ,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAAjDG,KAAK,GAAAF,eAAA,CAALE,KAAK;EAEb,IAAMC,YAAY,GAChBD,KAAK,QACLE,WAAG,EAAAV,eAAA,KAAAA,eAAA,OAAAW,uBAAA,sEAIF;EAEH,IAAAC,SAAA,GAAsC,IAAAC,gBAAQ,EAACJ,YAAY,EAAE;MAAEK,SAAS,EAAE;QAAEX,EAAE,EAAFA;MAAG,CAAC;MAAEY,IAAI,EAAE,CAACP;IAAM,CAAC,CAAC;IAAAQ,cAAA,GAAAJ,SAAA,CAAzFK,IAAI;IAAJA,IAAI,GAAAD,cAAA,cAAG,CAAC,CAAC,GAAAA,cAAA;IAAEE,OAAO,GAAAN,SAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,SAAA,CAALO,KAAK;EAEjC,OAAO;IAAEF,IAAI,EAAEA,IAAI,CAACG,UAAU,KAAK,OAAO,GAAGH,IAAI,GAAG,IAAI;IAAEC,OAAO,EAAPA,OAAO;IAAEC,KAAK,EAALA;EAAM,CAAC;AAC5E;AAAC,IAAAE,QAAA,GAEcpB,OAAO;AAAAqB,OAAA,cAAAD,QAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _buildDynamicQuery2 = _interopRequireDefault(require("../helpers/build-dynamic-query"));
|
|
10
|
+
function useInfoBox(_ref) {
|
|
11
|
+
var id = _ref.id,
|
|
12
|
+
schema = _ref.schema,
|
|
13
|
+
infoBox = _ref.infoBox;
|
|
14
|
+
var _buildDynamicQuery = (0, _buildDynamicQuery2["default"])({
|
|
15
|
+
id: id,
|
|
16
|
+
schema: schema,
|
|
17
|
+
infoBox: infoBox
|
|
18
|
+
}),
|
|
19
|
+
query = _buildDynamicQuery.query;
|
|
20
|
+
return {
|
|
21
|
+
query: query || null
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
var _default = useInfoBox;
|
|
25
|
+
exports["default"] = _default;
|
|
26
|
+
//# sourceMappingURL=useInfoBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfoBox.js","names":["_buildDynamicQuery2","_interopRequireDefault","require","useInfoBox","_ref","id","schema","infoBox","_buildDynamicQuery","buildDynamicQuery","query","_default","exports"],"sources":["../../../../src/components/InfoBoxes/hooks/useInfoBox.js"],"sourcesContent":["import buildDynamicQuery from '../helpers/build-dynamic-query';\n\nfunction useInfoBox({ id, schema, infoBox }) {\n const { query } = buildDynamicQuery({\n id,\n schema,\n infoBox\n });\n\n return { query: query || null };\n}\n\nexport default useInfoBox;\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,UAAUA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EACvC,IAAAC,kBAAA,GAAkB,IAAAC,8BAAiB,EAAC;MAClCJ,EAAE,EAAFA,EAAE;MACFC,MAAM,EAANA,MAAM;MACNC,OAAO,EAAPA;IACF,CAAC,CAAC;IAJMG,KAAK,GAAAF,kBAAA,CAALE,KAAK;EAMb,OAAO;IAAEA,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAAC,IAAAC,QAAA,GAEcR,UAAU;AAAAS,OAAA,cAAAD,QAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _InfoBoxes = _interopRequireDefault(require("./InfoBoxes"));
|
|
10
|
+
var _default = _InfoBoxes["default"];
|
|
11
|
+
exports["default"] = _default;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_InfoBoxes","_interopRequireDefault","require","_default","InfoBoxes","exports"],"sources":["../../../src/components/InfoBoxes/index.js"],"sourcesContent":["import InfoBoxes from './InfoBoxes';\n\nexport default InfoBoxes;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,IAAAC,QAAA,GAErBC,qBAAS;AAAAC,OAAA,cAAAF,QAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
require("core-js/modules/es.array.map.js");
|
|
10
|
+
require("core-js/modules/es.array.filter.js");
|
|
11
|
+
require("core-js/modules/es.object.to-string.js");
|
|
12
|
+
require("core-js/modules/es.object.values.js");
|
|
13
|
+
require("core-js/modules/es.array.concat.js");
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var InfoBox = function InfoBox(_ref) {
|
|
17
|
+
var items = _ref.items,
|
|
18
|
+
infoBoxKey = _ref.infoBoxKey;
|
|
19
|
+
if (!items) return null;
|
|
20
|
+
var infoBoxItems = items.map(function (item) {
|
|
21
|
+
return Object.values(item).map(function (info) {
|
|
22
|
+
if (!info.label || !info.value) return null;
|
|
23
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
24
|
+
className: "info-box--item",
|
|
25
|
+
key: "".concat(infoBoxKey, "-").concat(info.label.toLowerCase())
|
|
26
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
|
+
className: "info-box--label"
|
|
28
|
+
}, info.label, ": "), /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
|
+
className: "info-box--value"
|
|
30
|
+
}, info.value));
|
|
31
|
+
}).filter(Boolean);
|
|
32
|
+
});
|
|
33
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
34
|
+
className: "info-box",
|
|
35
|
+
key: infoBoxKey
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
37
|
+
className: "info-box--container"
|
|
38
|
+
}, infoBoxItems));
|
|
39
|
+
};
|
|
40
|
+
var _default = InfoBox;
|
|
41
|
+
exports["default"] = _default;
|
|
42
|
+
InfoBox.propTypes = {
|
|
43
|
+
infoBoxKey: _propTypes["default"].string.isRequired,
|
|
44
|
+
items: _propTypes["default"].array.isRequired
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=InfoBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBox.js","names":["_propTypes","_interopRequireDefault","require","_react","InfoBox","_ref","items","infoBoxKey","infoBoxItems","map","item","Object","values","info","label","value","createElement","className","key","concat","toLowerCase","filter","Boolean","_default","exports","propTypes","PropTypes","string","isRequired","array"],"sources":["../../../../src/components/InfoBoxes/presentational/InfoBox.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst InfoBox = ({ items, infoBoxKey }) => {\n if (!items) return null;\n\n const infoBoxItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <div className=\"info-box--item\" key={`${infoBoxKey}-${info.label.toLowerCase()}`}>\n <div className=\"info-box--label\">{info.label}: </div>\n <div className=\"info-box--value\">{info.value}</div>\n </div>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"info-box\" key={infoBoxKey}>\n <div className=\"info-box--container\">{infoBoxItems}</div>\n </div>\n );\n};\n\nexport default InfoBox;\n\nInfoBox.propTypes = {\n infoBoxKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAA8B;EAAA,IAAxBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;EAClC,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,IAAME,YAAY,GAAGF,KAAK,CAACG,GAAG,CAAC,UAAAC,IAAI;IAAA,OACjCC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAAC,UAAAI,IAAI,EAAI;MACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;MAE3C,oBACEZ,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC,gBAAgB;QAACC,GAAG,KAAAC,MAAA,CAAKZ,UAAU,OAAAY,MAAA,CAAIN,IAAI,CAACC,KAAK,CAACM,WAAW,CAAC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