@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 0.147.0-rc-eagle.2
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/components/EntityDataListing/EntityDataListing.js +21 -19
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +2 -3
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +286 -458
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +2 -3
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +91 -166
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +2 -3
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +34 -46
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +35 -80
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +17 -10
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +33 -30
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +2 -3
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +155 -296
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +159 -257
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +25 -36
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/helpers.js +46 -68
- package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
- package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +2 -3
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +2 -3
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +66 -83
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +26 -42
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/hooks/useCallbackDebounce.js +5 -9
- package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib/constants.js +30 -31
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +17 -20
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +12 -15
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +15 -18
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +11 -14
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/icons/index.js +8 -9
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +81 -121
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +67 -93
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +12 -9
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +11 -8
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +17 -14
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +15 -9
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +7 -6
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +4 -6
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +4 -12
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/lib/utils/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +15 -26
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +2 -2
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/components/Tabs/index.js +6 -7
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/index.js +11 -3
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/build-update-data-query.js.map +1 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib-es/utils/hoc/withContext.js +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/package.json +27 -22
- package/src/components/EntityManager/Entity/Entity.js +63 -81
- package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
- package/src/components/EntityManager/EntityManager.js +52 -45
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
- package/src/components/InfoBoxes/hooks/useData.js +6 -1
- package/src/components/ListingTable/ListingTable.js +13 -21
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +105 -120
- package/src/components/ListingTable/service/index.js +2 -3
- package/src/components/Tabs/index.js +17 -21
- package/src/index.js +9 -7
- package/src/utils/hoc/withContext.js +5 -4
- package/CHANGELOG.md +0 -1947
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getAction = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
require("core-js/modules/es.array.concat.js");
|
|
11
8
|
var _client = require("@apollo/client");
|
|
12
9
|
var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const generateQuery = (action, props) => `
|
|
11
|
+
query getEntityData(
|
|
12
|
+
$where: JSON
|
|
13
|
+
$limit: Int
|
|
14
|
+
$offset: Int
|
|
15
|
+
$sort: [${(0, _lodash.default)(action)}SortItem]){
|
|
16
|
+
${action} (where: $where, limit: $limit, offset: $offset, sort: $sort){
|
|
17
|
+
${props}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
17
21
|
|
|
18
22
|
// TODO: extend function to handle properties and make them dynamic with a config schema for each entity.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (0, _client.gql)
|
|
23
|
+
const getAction = (action, props) => {
|
|
24
|
+
const query = generateQuery(action, props);
|
|
25
|
+
return (0, _client.gql)`
|
|
26
|
+
${query}
|
|
27
|
+
`;
|
|
22
28
|
};
|
|
29
|
+
exports.getAction = getAction;
|
|
23
30
|
//# sourceMappingURL=query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":["_client","require","_lodash","_interopRequireDefault","
|
|
1
|
+
{"version":3,"file":"query.js","names":["_client","require","_lodash","_interopRequireDefault","generateQuery","action","props","upperFirst","getAction","query","gql","exports"],"sources":["../../../../src/components/EntityManager/utils/query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport upperFirst from 'lodash.upperfirst';\n\nconst generateQuery = (action, props) => `\n query getEntityData(\n $where: JSON\n $limit: Int\n $offset: Int\n $sort: [${upperFirst(action)}SortItem]){\n ${action} (where: $where, limit: $limit, offset: $offset, sort: $sort){\n ${props}\n }\n }\n `;\n\n// TODO: extend function to handle properties and make them dynamic with a config schema for each entity.\nconst getAction = (action, props) => {\n const query = generateQuery(action, props);\n return gql`\n ${query}\n `;\n};\n\nexport { getAction };\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,MAAMG,aAAa,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;AACzC;AACA;AACA;AACA;AACA,cAAc,IAAAC,eAAU,EAACF,MAAM,CAAC;AAChC,MAAMA,MAAM;AACZ,QAAQC,KAAK;AACb;AACA;AACA,GAAG;;AAEH;AACA,MAAME,SAAS,GAAGA,CAACH,MAAM,EAAEC,KAAK,KAAK;EACnC,MAAMG,KAAK,GAAGL,aAAa,CAACC,MAAM,EAAEC,KAAK,CAAC;EAC1C,OAAO,IAAAI,WAAG;AACZ,MAAMD,KAAK;AACX,GAAG;AACH,CAAC;AAACE,OAAA,CAAAH,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
7
|
+
exports.default = void 0;
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
12
|
var _tooltip = _interopRequireDefault(require("@blaze-react/tooltip"));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const _excluded = ["info"];
|
|
14
|
+
const InfoBoxTooltip = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
info
|
|
17
|
+
} = _ref,
|
|
18
|
+
tooltipProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
19
|
+
const {
|
|
20
|
+
tooltipContent,
|
|
21
|
+
tooltipIcon
|
|
22
|
+
} = info;
|
|
20
23
|
if (!tooltipContent) return null;
|
|
21
|
-
|
|
24
|
+
const renderTooltipIcon = icon => {
|
|
22
25
|
if (!icon) return null;
|
|
23
|
-
return /*#__PURE__*/_react
|
|
24
|
-
className:
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement("i", {
|
|
27
|
+
className: `${icon} info-box--icon`
|
|
25
28
|
});
|
|
26
29
|
};
|
|
27
|
-
return /*#__PURE__*/_react
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, (0, _extends2.default)({
|
|
28
31
|
tooltipContent: tooltipContent,
|
|
29
32
|
trigger: "click",
|
|
30
33
|
className: "info-box--tooltip"
|
|
31
34
|
}, tooltipProps), renderTooltipIcon(tooltipIcon));
|
|
32
35
|
};
|
|
33
36
|
InfoBoxTooltip.propTypes = {
|
|
34
|
-
info: _propTypes
|
|
35
|
-
tooltipContent: _propTypes
|
|
36
|
-
tooltipIcon: _propTypes
|
|
37
|
+
info: _propTypes.default.shape({
|
|
38
|
+
tooltipContent: _propTypes.default.node,
|
|
39
|
+
tooltipIcon: _propTypes.default.string
|
|
37
40
|
}).isRequired
|
|
38
41
|
};
|
|
39
|
-
var _default = exports
|
|
42
|
+
var _default = exports.default = InfoBoxTooltip;
|
|
40
43
|
//# sourceMappingURL=InfoBoxTooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBoxTooltip.js","names":["_react","_interopRequireDefault","require","_propTypes","_tooltip","_excluded","InfoBoxTooltip","_ref","info","tooltipProps","_objectWithoutProperties2","tooltipContent","tooltipIcon","renderTooltipIcon","icon","createElement","className","
|
|
1
|
+
{"version":3,"file":"InfoBoxTooltip.js","names":["_react","_interopRequireDefault","require","_propTypes","_tooltip","_excluded","InfoBoxTooltip","_ref","info","tooltipProps","_objectWithoutProperties2","default","tooltipContent","tooltipIcon","renderTooltipIcon","icon","createElement","className","_extends2","trigger","propTypes","PropTypes","shape","node","string","isRequired","_default","exports"],"sources":["../../../src/components/InfoBoxes/InfoBoxTooltip.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tooltip from '@blaze-react/tooltip';\n\nconst InfoBoxTooltip = ({ info, ...tooltipProps }) => {\n const { tooltipContent, tooltipIcon } = info;\n if (!tooltipContent) return null;\n\n const renderTooltipIcon = icon => {\n if (!icon) return null;\n return <i className={`${icon} info-box--icon`} />;\n };\n\n return (\n <Tooltip\n tooltipContent={tooltipContent}\n trigger=\"click\"\n className=\"info-box--tooltip\"\n {...tooltipProps}>\n {renderTooltipIcon(tooltipIcon)}\n </Tooltip>\n );\n};\n\nInfoBoxTooltip.propTypes = {\n info: PropTypes.shape({\n tooltipContent: PropTypes.node,\n tooltipIcon: PropTypes.string\n }).isRequired\n};\n\nexport default InfoBoxTooltip;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA2C,MAAAG,SAAA;AAE3C,MAAMC,cAAc,GAAGC,IAAA,IAA+B;EAAA,IAA9B;MAAEC;IAAsB,CAAC,GAAAD,IAAA;IAAdE,YAAY,OAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,EAAAF,SAAA;EAC7C,MAAM;IAAEO,cAAc;IAAEC;EAAY,CAAC,GAAGL,IAAI;EAC5C,IAAI,CAACI,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,iBAAiB,GAAGC,IAAI,IAAI;IAChC,IAAI,CAACA,IAAI,EAAE,OAAO,IAAI;IACtB,oBAAOf,MAAA,CAAAW,OAAA,CAAAK,aAAA;MAAGC,SAAS,EAAE,GAAGF,IAAI;IAAkB,CAAE,CAAC;EACnD,CAAC;EAED,oBACEf,MAAA,CAAAW,OAAA,CAAAK,aAAA,CAACZ,QAAA,CAAAO,OAAO,MAAAO,SAAA,CAAAP,OAAA;IACNC,cAAc,EAAEA,cAAe;IAC/BO,OAAO,EAAC,OAAO;IACfF,SAAS,EAAC;EAAmB,GACzBR,YAAY,GACfK,iBAAiB,CAACD,WAAW,CACvB,CAAC;AAEd,CAAC;AAEDP,cAAc,CAACc,SAAS,GAAG;EACzBZ,IAAI,EAAEa,kBAAS,CAACC,KAAK,CAAC;IACpBV,cAAc,EAAES,kBAAS,CAACE,IAAI;IAC9BV,WAAW,EAAEQ,kBAAS,CAACG;EACzB,CAAC,CAAC,CAACC;AACL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAEaL,cAAc","ignoreList":[]}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
7
|
+
exports.default = void 0;
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
var _react = _interopRequireDefault(require("react"));
|
|
12
10
|
var _InfoBoxContainer = _interopRequireDefault(require("./container/InfoBoxContainer"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const InfoBoxes = ({
|
|
12
|
+
id,
|
|
13
|
+
schema
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
displayProperties: {
|
|
17
|
+
adminInfoBoxes = []
|
|
18
|
+
}
|
|
19
|
+
} = schema;
|
|
18
20
|
if (adminInfoBoxes.length <= 0) {
|
|
19
21
|
return null;
|
|
20
22
|
}
|
|
21
|
-
return adminInfoBoxes.map(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
});
|
|
23
|
+
return adminInfoBoxes.map(infoBox => /*#__PURE__*/_react.default.createElement(_InfoBoxContainer.default, {
|
|
24
|
+
id: id,
|
|
25
|
+
schema: schema,
|
|
26
|
+
key: infoBox.key,
|
|
27
|
+
infoBox: infoBox
|
|
28
|
+
}));
|
|
29
29
|
};
|
|
30
|
-
var _default = exports
|
|
30
|
+
var _default = exports.default = InfoBoxes;
|
|
31
31
|
InfoBoxes.propTypes = {
|
|
32
|
-
id: _propTypes
|
|
33
|
-
schema: _propTypes
|
|
32
|
+
id: _propTypes.default.string.isRequired,
|
|
33
|
+
schema: _propTypes.default.object.isRequired
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=InfoBoxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBoxes.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxContainer","InfoBoxes","
|
|
1
|
+
{"version":3,"file":"InfoBoxes.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxContainer","InfoBoxes","id","schema","displayProperties","adminInfoBoxes","length","map","infoBox","default","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,MAAMG,SAAS,GAAGA,CAAC;EAAEC,EAAE;EAAEC;AAAO,CAAC,KAAK;EACpC,MAAM;IACJC,iBAAiB,EAAE;MAAEC,cAAc,GAAG;IAAG;EAC3C,CAAC,GAAGF,MAAM;EAEV,IAAIE,cAAc,CAACC,MAAM,IAAI,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,OAAOD,cAAc,CAACE,GAAG,CAACC,OAAO,iBAC/BT,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACV,iBAAA,CAAAS,OAAgB;IAACP,EAAE,EAAEA,EAAG;IAACC,MAAM,EAAEA,MAAO;IAACQ,GAAG,EAAEH,OAAO,CAACG,GAAI;IAACH,OAAO,EAAEA;EAAQ,CAAE,CAChF,CAAC;AACJ,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEaR,SAAS;AAExBA,SAAS,CAACa,SAAS,GAAG;EACpBZ,EAAE,EAAEa,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/Bd,MAAM,EAAEY,kBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -1,58 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.array.iterator.js");
|
|
4
|
-
require("core-js/modules/es.object.define-property.js");
|
|
5
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
6
|
-
require("core-js/modules/es.string.iterator.js");
|
|
7
|
-
require("core-js/modules/es.weak-map.js");
|
|
8
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
10
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
11
4
|
Object.defineProperty(exports, "__esModule", {
|
|
12
5
|
value: true
|
|
13
6
|
});
|
|
14
|
-
exports
|
|
15
|
-
require("core-js/modules/es.array.flat-map.js");
|
|
16
|
-
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
17
|
-
require("core-js/modules/es.object.keys.js");
|
|
18
|
-
require("core-js/modules/es.object.to-string.js");
|
|
19
|
-
require("core-js/modules/es.object.values.js");
|
|
7
|
+
exports.default = void 0;
|
|
20
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
22
|
-
var
|
|
10
|
+
var _useData = _interopRequireDefault(require("../hooks/useData"));
|
|
23
11
|
var _InfoBox = _interopRequireDefault(require("../presentational/InfoBox"));
|
|
24
12
|
var _RecordEditContext = require("../../EntityManager/utils/RecordEditContext");
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
externalUpdateTime
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
const InfoBoxContainer = ({
|
|
15
|
+
id,
|
|
16
|
+
schema,
|
|
17
|
+
infoBox
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
externalUpdateTime
|
|
21
|
+
} = (0, _react.useContext)(_RecordEditContext.RecordEditContext);
|
|
22
|
+
const {
|
|
23
|
+
data,
|
|
24
|
+
refetch
|
|
25
|
+
} = (0, _useData.default)({
|
|
26
|
+
id,
|
|
27
|
+
schema,
|
|
28
|
+
infoBox
|
|
29
|
+
});
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
41
31
|
refetch();
|
|
42
32
|
}, [externalUpdateTime, refetch]);
|
|
43
33
|
if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement(_InfoBox["default"], {
|
|
34
|
+
const items = Object.values(data).flatMap(item => Object.values(item));
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_InfoBox.default, {
|
|
48
36
|
items: items,
|
|
49
37
|
infoBoxKey: infoBox.key
|
|
50
38
|
});
|
|
51
39
|
};
|
|
52
|
-
var _default = exports
|
|
40
|
+
var _default = exports.default = InfoBoxContainer;
|
|
53
41
|
InfoBoxContainer.propTypes = {
|
|
54
|
-
id: _propTypes
|
|
55
|
-
infoBox: _propTypes
|
|
56
|
-
schema: _propTypes
|
|
42
|
+
id: _propTypes.default.string.isRequired,
|
|
43
|
+
infoBox: _propTypes.default.object.isRequired,
|
|
44
|
+
schema: _propTypes.default.object.isRequired
|
|
57
45
|
};
|
|
58
46
|
//# sourceMappingURL=InfoBoxContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBoxContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","
|
|
1
|
+
{"version":3,"file":"InfoBoxContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","_useData","_InfoBox","_RecordEditContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","InfoBoxContainer","id","schema","infoBox","externalUpdateTime","useContext","RecordEditContext","data","refetch","useData","useEffect","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, { useContext, useEffect } from 'react';\nimport useData from '../hooks/useData';\nimport InfoBox from '../presentational/InfoBox';\nimport { RecordEditContext } from '../../EntityManager/utils/RecordEditContext';\n\nconst InfoBoxContainer = ({ id, schema, infoBox }) => {\n const { externalUpdateTime } = useContext(RecordEditContext);\n\n const { data, refetch } = useData({ id, schema, infoBox });\n\n useEffect(() => {\n refetch();\n }, [externalUpdateTime, refetch]);\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,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAAgF,SAAAE,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAEhF,MAAMkB,gBAAgB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,KAAK;EACpD,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,iBAAU,EAACC,oCAAiB,CAAC;EAE5D,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAG,IAAAC,gBAAO,EAAC;IAAER,EAAE;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC;EAE1D,IAAAO,gBAAS,EAAC,MAAM;IACdF,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAACJ,kBAAkB,EAAEI,OAAO,CAAC,CAAC;EAEjC,IAAI,CAACD,IAAI,IAAI,CAACV,MAAM,CAACc,IAAI,CAACJ,IAAI,CAAC,IAAIV,MAAM,CAACc,IAAI,CAACJ,IAAI,CAAC,CAACK,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGhB,MAAM,CAACiB,MAAM,CAACP,IAAI,CAAC,CAACQ,OAAO,CAACC,IAAI,IAAInB,MAAM,CAACiB,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOxC,MAAA,CAAAe,OAAA,CAAA0B,aAAA,CAACtC,QAAA,CAAAY,OAAO;IAACsB,KAAK,EAAEA,KAAM;IAACK,UAAU,EAAEf,OAAO,CAACgB;EAAI,CAAE,CAAC;AAC3D,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9B,OAAA,GAEaS,gBAAgB;AAE/BA,gBAAgB,CAACsB,SAAS,GAAG;EAC3BrB,EAAE,EAAEsB,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BtB,OAAO,EAAEoB,kBAAS,CAACG,MAAM,CAACD,UAAU;EACpCvB,MAAM,EAAEqB,kBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
require("core-js/modules/es.array.map.js");
|
|
6
|
+
exports.default = buildDynamicQuery;
|
|
11
7
|
var _client = require("@apollo/client");
|
|
12
8
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
function buildDynamicQuery({
|
|
10
|
+
id,
|
|
11
|
+
schema,
|
|
12
|
+
properties
|
|
13
|
+
}) {
|
|
18
14
|
if (!id) return null;
|
|
19
15
|
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
20
16
|
throw new _coreErrors.BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
21
17
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const fields = properties.map(infoProperty => `${infoProperty} {
|
|
19
|
+
label
|
|
20
|
+
value
|
|
21
|
+
showLabel
|
|
22
|
+
url
|
|
23
|
+
tooltipIcon
|
|
24
|
+
tooltipContent
|
|
25
|
+
}`);
|
|
26
|
+
return (0, _client.gql)`query getInfoBoxData($id: String!){
|
|
27
|
+
${schema.actions.get}( id: $id ) {
|
|
28
|
+
id
|
|
29
|
+
${fields.map(field => field)}
|
|
30
|
+
__typename
|
|
31
|
+
}
|
|
32
|
+
}`;
|
|
28
33
|
}
|
|
29
34
|
//# sourceMappingURL=build-dynamic-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","
|
|
1
|
+
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","buildDynamicQuery","id","schema","properties","actions","get","BlazeError","fields","map","infoProperty","gql","field"],"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, properties }) {\n if (!id) return null;\n\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 = properties.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n showLabel\n url\n tooltipIcon\n tooltipContent\n }`\n );\n\n return gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields.map(field => field)}\n __typename\n }\n }`;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEe,SAASE,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAW,CAAC,EAAE;EACpE,IAAI,CAACF,EAAE,EAAE,OAAO,IAAI;EAEpB,IAAI,CAACC,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACC,UAAU,EAAE;IAC3E,MAAM,IAAIG,sBAAU,CAClB,gFACF,CAAC;EACH;EAEA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,GAAG,CAC3BC,YAAY,IACV,GAAGA,YAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,MACE,CAAC;EAED,OAAO,IAAAC,WAAG;AACZ,MAAMR,MAAM,CAACE,OAAO,CAACC,GAAG;AACxB;AACA,QAAQE,MAAM,CAACC,GAAG,CAACG,KAAK,IAAIA,KAAK,CAAC;AAClC;AACA;AACA,IAAI;AACJ","ignoreList":[]}
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
7
|
+
exports.default = void 0;
|
|
10
8
|
var _client = require("@apollo/client");
|
|
11
9
|
var _useInfoBox = _interopRequireDefault(require("./useInfoBox"));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
function useData({
|
|
11
|
+
id,
|
|
12
|
+
schema,
|
|
13
|
+
infoBox
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
query
|
|
17
|
+
} = (0, _useInfoBox.default)({
|
|
18
|
+
id,
|
|
19
|
+
schema,
|
|
20
|
+
infoBox
|
|
21
|
+
});
|
|
22
|
+
const infoBoxQuery = query || (0, _client.gql)`
|
|
23
|
+
query {
|
|
24
|
+
__typename
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const {
|
|
28
|
+
data = {},
|
|
29
|
+
loading,
|
|
30
|
+
error,
|
|
31
|
+
refetch
|
|
32
|
+
} = (0, _client.useQuery)(infoBoxQuery, {
|
|
33
|
+
variables: {
|
|
34
|
+
id
|
|
35
|
+
},
|
|
36
|
+
skip: !query
|
|
37
|
+
});
|
|
35
38
|
return {
|
|
36
39
|
data: data.__typename !== 'Query' ? data : null,
|
|
37
|
-
loading
|
|
38
|
-
error
|
|
39
|
-
refetch
|
|
40
|
+
loading,
|
|
41
|
+
error,
|
|
42
|
+
refetch
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
|
-
var _default = exports
|
|
45
|
+
var _default = exports.default = useData;
|
|
43
46
|
//# sourceMappingURL=useData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useData.js","names":["_client","require","_useInfoBox","_interopRequireDefault","
|
|
1
|
+
{"version":3,"file":"useData.js","names":["_client","require","_useInfoBox","_interopRequireDefault","useData","id","schema","infoBox","query","useInfoBoxData","infoBoxQuery","gql","data","loading","error","refetch","useQuery","variables","skip","__typename","_default","exports","default"],"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 {\n data = {},\n loading,\n error,\n refetch\n } = useQuery(infoBoxQuery, {\n variables: { id },\n skip: !query\n });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error, refetch };\n}\n\nexport default useData;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,SAASG,OAAOA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,mBAAc,EAAC;IAAEJ,EAAE;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC;EAEzD,MAAMG,YAAY,GAChBF,KAAK,IACL,IAAAG,WAAG;AACP;AACA;AACA;AACA,KAAK;EAEH,MAAM;IACJC,IAAI,GAAG,CAAC,CAAC;IACTC,OAAO;IACPC,KAAK;IACLC;EACF,CAAC,GAAG,IAAAC,gBAAQ,EAACN,YAAY,EAAE;IACzBO,SAAS,EAAE;MAAEZ;IAAG,CAAC;IACjBa,IAAI,EAAE,CAACV;EACT,CAAC,CAAC;EAEF,OAAO;IAAEI,IAAI,EAAEA,IAAI,CAACO,UAAU,KAAK,OAAO,GAAGP,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC,KAAK;IAAEC;EAAQ,CAAC;AACrF;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclB,OAAO","ignoreList":[]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
7
|
+
exports.default = void 0;
|
|
9
8
|
var _buildDynamicQuery = _interopRequireDefault(require("../helpers/build-dynamic-query"));
|
|
10
|
-
function useInfoBox(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
function useInfoBox({
|
|
10
|
+
id,
|
|
11
|
+
schema,
|
|
12
|
+
infoBox
|
|
13
|
+
}) {
|
|
14
|
+
const query = (0, _buildDynamicQuery.default)({
|
|
15
|
+
id,
|
|
16
|
+
schema,
|
|
17
17
|
properties: [infoBox.property]
|
|
18
18
|
});
|
|
19
19
|
return {
|
|
20
20
|
query: query || null
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
var _default = exports
|
|
23
|
+
var _default = exports.default = useInfoBox;
|
|
24
24
|
//# sourceMappingURL=useInfoBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfoBox.js","names":["_buildDynamicQuery","_interopRequireDefault","require","useInfoBox","
|
|
1
|
+
{"version":3,"file":"useInfoBox.js","names":["_buildDynamicQuery","_interopRequireDefault","require","useInfoBox","id","schema","infoBox","query","buildDynamicQuery","properties","property","_default","exports","default"],"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 properties: [infoBox.property]\n });\n\n return { query: query || null };\n}\n\nexport default useInfoBox;\n"],"mappings":";;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,UAAUA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EAC3C,MAAMC,KAAK,GAAG,IAAAC,0BAAiB,EAAC;IAC9BJ,EAAE;IACFC,MAAM;IACNI,UAAU,EAAE,CAACH,OAAO,CAACI,QAAQ;EAC/B,CAAC,CAAC;EAEF,OAAO;IAAEH,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcV,UAAU","ignoreList":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
7
|
+
exports.default = void 0;
|
|
9
8
|
var _InfoBoxes = _interopRequireDefault(require("./InfoBoxes"));
|
|
10
|
-
var _default = exports
|
|
9
|
+
var _default = exports.default = _InfoBoxes.default;
|
|
11
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_InfoBoxes","_interopRequireDefault","require","_default","exports","InfoBoxes"],"sources":["../../../src/components/InfoBoxes/index.js"],"sourcesContent":["import InfoBoxes from './InfoBoxes';\n\nexport default InfoBoxes;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_InfoBoxes","_interopRequireDefault","require","_default","exports","default","InfoBoxes"],"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,GAAAC,OAAA,CAAAC,OAAA,GAErBC,kBAAS","ignoreList":[]}
|