@blaze-cms/plugin-data-ui 0.146.0-node18-core-styles-tooltips.1 → 0.146.0-node18-core-styles-tooltips.3
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-es/components/EntityDataListing/EntityDataListing.js +33 -0
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -0
- package/lib-es/components/EntityDataListing/index.js +3 -0
- package/lib-es/components/EntityDataListing/index.js.map +1 -0
- 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 +447 -0
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +103 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +45 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +3 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js +3 -0
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -0
- 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 +29 -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 +49 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +117 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +36 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js +5 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +46 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +32 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js +5 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js +12 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js +5 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +39 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js +5 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +53 -0
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/index.js +3 -0
- package/lib-es/components/EntityManager/Entity/index.js.map +1 -0
- package/lib-es/components/EntityManager/EntityManager.js +133 -0
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -0
- package/lib-es/components/EntityManager/index.js +3 -0
- package/lib-es/components/EntityManager/index.js.map +1 -0
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +6 -0
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -0
- package/lib-es/components/EntityManager/utils/data-mappers.js +55 -0
- package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -0
- package/lib-es/components/EntityManager/utils/entity.js +69 -0
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -0
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js +56 -0
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -0
- package/lib-es/components/EntityManager/utils/is-form-empty.js +9 -0
- package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -0
- package/lib-es/components/EntityManager/utils/query.js +23 -0
- package/lib-es/components/EntityManager/utils/query.js.map +1 -0
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +36 -0
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.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 +38 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +28 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js +39 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +17 -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 +40 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js +12 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js +30 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -0
- package/lib-es/components/ListingTable/ListingTable.js +207 -0
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -0
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +57 -0
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -0
- package/lib-es/components/ListingTable/ListingTableContent/index.js +3 -0
- package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -0
- package/lib-es/components/ListingTable/TableActions/TableActions.js +34 -0
- package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -0
- package/lib-es/components/ListingTable/TableActions/index.js +3 -0
- package/lib-es/components/ListingTable/TableActions/index.js.map +1 -0
- package/lib-es/components/ListingTable/index.js +3 -0
- package/lib-es/components/ListingTable/index.js.map +1 -0
- package/lib-es/components/ListingTable/mappers/populate-rows.js +140 -0
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -0
- package/lib-es/components/ListingTable/service/index.js +86 -0
- package/lib-es/components/ListingTable/service/index.js.map +1 -0
- package/lib-es/components/Tabs/index.js +40 -0
- package/lib-es/components/Tabs/index.js.map +1 -0
- package/lib-es/components/hooks/useCallbackDebounce.js +12 -0
- package/lib-es/components/hooks/useCallbackDebounce.js.map +1 -0
- package/lib-es/constants.js +39 -0
- package/lib-es/constants.js.map +1 -0
- package/lib-es/icons/ContentIcon.js +80 -0
- package/lib-es/icons/ContentIcon.js.map +1 -0
- package/lib-es/icons/SettingsIcon.js +36 -0
- package/lib-es/icons/SettingsIcon.js.map +1 -0
- package/lib-es/icons/TaxonomyIcon.js +60 -0
- package/lib-es/icons/TaxonomyIcon.js.map +1 -0
- package/lib-es/icons/UsersIcon.js +33 -0
- package/lib-es/icons/UsersIcon.js.map +1 -0
- package/lib-es/icons/index.js +6 -0
- package/lib-es/icons/index.js.map +1 -0
- package/lib-es/index.js +84 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/utils/add-content-menu-items.js +72 -0
- package/lib-es/utils/add-content-menu-items.js.map +1 -0
- package/lib-es/utils/build-create-entity-mutation.js +21 -0
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -0
- package/lib-es/utils/build-delete-entity-mutation.js +18 -0
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -0
- package/lib-es/utils/build-listing-query.js +28 -0
- package/lib-es/utils/build-listing-query.js.map +1 -0
- package/lib-es/utils/build-update-data-query.js +24 -0
- package/lib-es/utils/build-update-data-query.js.map +1 -0
- package/lib-es/utils/build-update-publish-unpublish-mutation.js +22 -0
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -0
- package/lib-es/utils/get-default-query-params.js +17 -0
- package/lib-es/utils/get-default-query-params.js.map +1 -0
- package/lib-es/utils/hoc/withContext.js +8 -0
- package/lib-es/utils/hoc/withContext.js.map +1 -0
- package/lib-es/utils/hooks/useToggle.js +8 -0
- package/lib-es/utils/hooks/useToggle.js.map +1 -0
- package/lib-es/utils/index.js +3 -0
- package/lib-es/utils/index.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import More from '@blaze-react/more';
|
|
5
|
+
import Button from '@blaze-react/button';
|
|
6
|
+
const TableActions = ({
|
|
7
|
+
editUrl,
|
|
8
|
+
data,
|
|
9
|
+
showDeleteModal
|
|
10
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "more-menu__wrapper"
|
|
12
|
+
}, /*#__PURE__*/React.createElement(More, {
|
|
13
|
+
isMoreMenu: true
|
|
14
|
+
}, /*#__PURE__*/React.createElement(More.Avatar, {
|
|
15
|
+
isMoreMenu: true
|
|
16
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
17
|
+
className: "material-icons"
|
|
18
|
+
}, "more_vert")), /*#__PURE__*/React.createElement(More.Content, {
|
|
19
|
+
isMoreMenu: true
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
21
|
+
to: editUrl,
|
|
22
|
+
className: "more-menu__link",
|
|
23
|
+
role: "button"
|
|
24
|
+
}, "Edit"), /*#__PURE__*/React.createElement(Button, {
|
|
25
|
+
className: "more-menu__link",
|
|
26
|
+
onClick: () => showDeleteModal(data)
|
|
27
|
+
}, "Delete"))));
|
|
28
|
+
TableActions.propTypes = {
|
|
29
|
+
editUrl: PropTypes.string.isRequired,
|
|
30
|
+
showDeleteModal: PropTypes.func.isRequired,
|
|
31
|
+
data: PropTypes.object.isRequired
|
|
32
|
+
};
|
|
33
|
+
export default TableActions;
|
|
34
|
+
//# sourceMappingURL=TableActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableActions.js","names":["React","Link","PropTypes","More","Button","TableActions","editUrl","data","showDeleteModal","createElement","className","isMoreMenu","Avatar","Content","to","role","onClick","propTypes","string","isRequired","func","object"],"sources":["../../../../src/components/ListingTable/TableActions/TableActions.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport More from '@blaze-react/more';\nimport Button from '@blaze-react/button';\n\nconst TableActions = ({ editUrl, data, showDeleteModal }) => (\n <div className=\"more-menu__wrapper\">\n <More isMoreMenu>\n <More.Avatar isMoreMenu>\n <span className=\"material-icons\">more_vert</span>\n </More.Avatar>\n <More.Content isMoreMenu>\n <Link to={editUrl} className=\"more-menu__link\" role=\"button\">\n Edit\n </Link>\n <Button className=\"more-menu__link\" onClick={() => showDeleteModal(data)}>\n Delete\n </Button>\n </More.Content>\n </More>\n </div>\n);\n\nTableActions.propTypes = {\n editUrl: PropTypes.string.isRequired,\n showDeleteModal: PropTypes.func.isRequired,\n data: PropTypes.object.isRequired\n};\n\nexport default TableActions;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAOC,MAAM,MAAM,qBAAqB;AAExC,MAAMC,YAAY,GAAGA,CAAC;EAAEC,OAAO;EAAEC,IAAI;EAAEC;AAAgB,CAAC,kBACtDR,KAAA,CAAAS,aAAA;EAAKC,SAAS,EAAC;AAAoB,gBACjCV,KAAA,CAAAS,aAAA,CAACN,IAAI;EAACQ,UAAU;AAAA,gBACdX,KAAA,CAAAS,aAAA,CAACN,IAAI,CAACS,MAAM;EAACD,UAAU;AAAA,gBACrBX,KAAA,CAAAS,aAAA;EAAMC,SAAS,EAAC;AAAgB,GAAC,WAAe,CACrC,CAAC,eACdV,KAAA,CAAAS,aAAA,CAACN,IAAI,CAACU,OAAO;EAACF,UAAU;AAAA,gBACtBX,KAAA,CAAAS,aAAA,CAACR,IAAI;EAACa,EAAE,EAAER,OAAQ;EAACI,SAAS,EAAC,iBAAiB;EAACK,IAAI,EAAC;AAAQ,GAAC,MAEvD,CAAC,eACPf,KAAA,CAAAS,aAAA,CAACL,MAAM;EAACM,SAAS,EAAC,iBAAiB;EAACM,OAAO,EAAEA,CAAA,KAAMR,eAAe,CAACD,IAAI;AAAE,GAAC,QAElE,CACI,CACV,CACH,CACN;AAEDF,YAAY,CAACY,SAAS,GAAG;EACvBX,OAAO,EAAEJ,SAAS,CAACgB,MAAM,CAACC,UAAU;EACpCX,eAAe,EAAEN,SAAS,CAACkB,IAAI,CAACD,UAAU;EAC1CZ,IAAI,EAAEL,SAAS,CAACmB,MAAM,CAACF;AACzB,CAAC;AAED,eAAed,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["TableActions"],"sources":["../../../../src/components/ListingTable/TableActions/index.js"],"sourcesContent":["import TableActions from './TableActions';\n\nexport default TableActions;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,eAAeA,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ListingTable"],"sources":["../../../src/components/ListingTable/index.js"],"sourcesContent":["import ListingTable from './ListingTable';\n\nexport default ListingTable;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,eAAeA,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
|
|
7
|
+
import TableActions from '../TableActions';
|
|
8
|
+
import { ACTIONS } from '../../../constants';
|
|
9
|
+
import InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';
|
|
10
|
+
import InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';
|
|
11
|
+
import InfoBoxTooltip from '../../InfoBoxes/InfoBoxTooltip';
|
|
12
|
+
const formatRows = ({
|
|
13
|
+
rows,
|
|
14
|
+
url,
|
|
15
|
+
toggleModal,
|
|
16
|
+
label,
|
|
17
|
+
firstColumn = 'name',
|
|
18
|
+
isEnquiry,
|
|
19
|
+
entitySchema
|
|
20
|
+
}) => rows.map(data => {
|
|
21
|
+
const editUrl = `${url}/update/${data.id}`;
|
|
22
|
+
const rowProps = _objectSpread(_objectSpread({}, data), {}, {
|
|
23
|
+
[firstColumn]: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Link, {
|
|
24
|
+
to: editUrl,
|
|
25
|
+
role: "button"
|
|
26
|
+
}, data[firstColumn]), /*#__PURE__*/React.createElement(RenderHook, {
|
|
27
|
+
hookKey: "entity:listing:table:row:column:after",
|
|
28
|
+
schema: entitySchema,
|
|
29
|
+
data: data,
|
|
30
|
+
value: data[firstColumn],
|
|
31
|
+
column: firstColumn
|
|
32
|
+
}))
|
|
33
|
+
});
|
|
34
|
+
if (!isEnquiry) rowProps.actions = /*#__PURE__*/React.createElement(TableActions, {
|
|
35
|
+
editUrl: editUrl,
|
|
36
|
+
data: data,
|
|
37
|
+
showDeleteModal: toggleModal
|
|
38
|
+
});
|
|
39
|
+
return rowProps;
|
|
40
|
+
});
|
|
41
|
+
const getSanitizedColumnLabel = columnProp => {
|
|
42
|
+
let sanitizedChar = '';
|
|
43
|
+
for (let index = 0; index < columnProp.length; index += 1) {
|
|
44
|
+
if (index && columnProp[index] === columnProp[index].toUpperCase()) sanitizedChar = `${sanitizedChar} ${columnProp[index].toLowerCase()}`;else sanitizedChar += columnProp[index];
|
|
45
|
+
}
|
|
46
|
+
return sanitizedChar;
|
|
47
|
+
};
|
|
48
|
+
const buildArrayRowContent = rowData => /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: "table-row-list"
|
|
50
|
+
}, rowData.map(rowGroup => {
|
|
51
|
+
if (!rowGroup.length) return null;
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: "table-row-list__group"
|
|
54
|
+
}, rowGroup.map(item => /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: "table-row-list__group__item"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
className: "table-row-list__group__item__label"
|
|
58
|
+
}, /*#__PURE__*/React.createElement(InfoBoxLabel, {
|
|
59
|
+
item: item
|
|
60
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
61
|
+
className: "table-row-list__group__item__value"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(InfoBoxValue, {
|
|
63
|
+
item: item
|
|
64
|
+
}), /*#__PURE__*/React.createElement(InfoBoxTooltip, {
|
|
65
|
+
info: item
|
|
66
|
+
})))));
|
|
67
|
+
}));
|
|
68
|
+
const buildArrayRowData = rowData => {
|
|
69
|
+
const groupSize = Math.ceil(rowData.length / 3);
|
|
70
|
+
const group1 = rowData.slice(0, groupSize);
|
|
71
|
+
const group2 = rowData.slice(groupSize, groupSize * 2);
|
|
72
|
+
const group3 = rowData.slice(groupSize * 2);
|
|
73
|
+
const dataGroups = [group1, group2, group3];
|
|
74
|
+
return buildArrayRowContent(dataGroups);
|
|
75
|
+
};
|
|
76
|
+
const getParsedRowData = rows => rows.map(rowData => Object.keys(rowData).reduce((acc, key) => {
|
|
77
|
+
const parsedData = Array.isArray(rowData[key]) ? buildArrayRowData(rowData[key]) : rowData[key];
|
|
78
|
+
return _objectSpread(_objectSpread({}, acc), {}, {
|
|
79
|
+
[key]: parsedData
|
|
80
|
+
});
|
|
81
|
+
}, {}));
|
|
82
|
+
const getColumnsAndLabels = (listingProperties, allProperties, rows) => {
|
|
83
|
+
const columns = [];
|
|
84
|
+
const labels = {};
|
|
85
|
+
listingProperties.forEach(listingProperty => {
|
|
86
|
+
const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;
|
|
87
|
+
const {
|
|
88
|
+
label
|
|
89
|
+
} = allProperties[propKey] || {};
|
|
90
|
+
columns.push(propKey);
|
|
91
|
+
labels[propKey] = label || getSanitizedColumnLabel(propKey);
|
|
92
|
+
});
|
|
93
|
+
const parsedRowData = getParsedRowData(rows);
|
|
94
|
+
return {
|
|
95
|
+
columns,
|
|
96
|
+
labels,
|
|
97
|
+
parsedRowData
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const populateRows = ({
|
|
101
|
+
toggleModal,
|
|
102
|
+
url,
|
|
103
|
+
entitySchema,
|
|
104
|
+
rows
|
|
105
|
+
}) => {
|
|
106
|
+
const {
|
|
107
|
+
id: schemaId,
|
|
108
|
+
listingProperties,
|
|
109
|
+
properties,
|
|
110
|
+
dynamicProperties = {},
|
|
111
|
+
formProperties
|
|
112
|
+
} = entitySchema;
|
|
113
|
+
const isEnquiry = schemaId === 'enquiry';
|
|
114
|
+
const columnOptions = !isEnquiry ? [...listingProperties, ACTIONS] : [...listingProperties];
|
|
115
|
+
const allProperties = _objectSpread(_objectSpread({}, properties), dynamicProperties);
|
|
116
|
+
const {
|
|
117
|
+
columns,
|
|
118
|
+
labels,
|
|
119
|
+
parsedRowData
|
|
120
|
+
} = getColumnsAndLabels(columnOptions, allProperties, rows);
|
|
121
|
+
const [firstColumn] = columns;
|
|
122
|
+
return {
|
|
123
|
+
identification: 'id',
|
|
124
|
+
sort: null,
|
|
125
|
+
columns,
|
|
126
|
+
labels,
|
|
127
|
+
orderBy: [...formProperties],
|
|
128
|
+
rows: formatRows({
|
|
129
|
+
firstColumn,
|
|
130
|
+
rows: parsedRowData,
|
|
131
|
+
url,
|
|
132
|
+
toggleModal,
|
|
133
|
+
isEnquiry,
|
|
134
|
+
entitySchema
|
|
135
|
+
}),
|
|
136
|
+
isEnquiry
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
export { populateRows, formatRows, getParsedRowData };
|
|
140
|
+
//# sourceMappingURL=populate-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"populate-rows.js","names":["React","Link","RenderHook","TableActions","ACTIONS","InfoBoxValue","InfoBoxLabel","InfoBoxTooltip","formatRows","rows","url","toggleModal","label","firstColumn","isEnquiry","entitySchema","map","data","editUrl","id","rowProps","_objectSpread","createElement","Fragment","to","role","hookKey","schema","value","column","actions","showDeleteModal","getSanitizedColumnLabel","columnProp","sanitizedChar","index","length","toUpperCase","toLowerCase","buildArrayRowContent","rowData","className","rowGroup","item","info","buildArrayRowData","groupSize","Math","ceil","group1","slice","group2","group3","dataGroups","getParsedRowData","Object","keys","reduce","acc","key","parsedData","Array","isArray","getColumnsAndLabels","listingProperties","allProperties","columns","labels","forEach","listingProperty","propKey","includes","split","push","parsedRowData","populateRows","schemaId","properties","dynamicProperties","formProperties","columnOptions","identification","sort","orderBy"],"sources":["../../../../src/components/ListingTable/mappers/populate-rows.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';\nimport TableActions from '../TableActions';\nimport { ACTIONS } from '../../../constants';\nimport InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';\nimport InfoBoxTooltip from '../../InfoBoxes/InfoBoxTooltip';\n\nconst formatRows = ({\n rows,\n url,\n toggleModal,\n label,\n firstColumn = 'name',\n isEnquiry,\n entitySchema\n}) =>\n rows.map(data => {\n const editUrl = `${url}/update/${data.id}`;\n\n const rowProps = {\n ...data,\n [firstColumn]: (\n <>\n <Link to={editUrl} role=\"button\">\n {data[firstColumn]}\n </Link>\n <RenderHook\n hookKey=\"entity:listing:table:row:column:after\"\n schema={entitySchema}\n data={data}\n value={data[firstColumn]}\n column={firstColumn}\n />\n </>\n )\n };\n if (!isEnquiry)\n rowProps.actions = (\n <TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />\n );\n return rowProps;\n });\n\nconst getSanitizedColumnLabel = columnProp => {\n let sanitizedChar = '';\n\n for (let index = 0; index < columnProp.length; index += 1) {\n if (index && columnProp[index] === columnProp[index].toUpperCase())\n sanitizedChar = `${sanitizedChar} ${columnProp[index].toLowerCase()}`;\n else sanitizedChar += columnProp[index];\n }\n return sanitizedChar;\n};\n\nconst buildArrayRowContent = rowData => (\n <div className=\"table-row-list\">\n {rowData.map(rowGroup => {\n if (!rowGroup.length) return null;\n return (\n <div className=\"table-row-list__group\">\n {rowGroup.map(item => (\n <div className=\"table-row-list__group__item\">\n <span className=\"table-row-list__group__item__label\">\n <InfoBoxLabel item={item} />\n </span>\n <span className=\"table-row-list__group__item__value\">\n <InfoBoxValue item={item} />\n <InfoBoxTooltip info={item} />\n </span>\n </div>\n ))}\n </div>\n );\n })}\n </div>\n);\n\nconst buildArrayRowData = rowData => {\n const groupSize = Math.ceil(rowData.length / 3);\n const group1 = rowData.slice(0, groupSize);\n const group2 = rowData.slice(groupSize, groupSize * 2);\n const group3 = rowData.slice(groupSize * 2);\n const dataGroups = [group1, group2, group3];\n\n return buildArrayRowContent(dataGroups);\n};\n\nconst getParsedRowData = rows =>\n rows.map(rowData =>\n Object.keys(rowData).reduce((acc, key) => {\n const parsedData = Array.isArray(rowData[key])\n ? buildArrayRowData(rowData[key])\n : rowData[key];\n return { ...acc, [key]: parsedData };\n }, {})\n );\n\nconst getColumnsAndLabels = (listingProperties, allProperties, rows) => {\n const columns = [];\n const labels = {};\n\n listingProperties.forEach(listingProperty => {\n const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;\n const { label } = allProperties[propKey] || {};\n columns.push(propKey);\n labels[propKey] = label || getSanitizedColumnLabel(propKey);\n });\n const parsedRowData = getParsedRowData(rows);\n\n return { columns, labels, parsedRowData };\n};\n\nconst populateRows = ({ toggleModal, url, entitySchema, rows }) => {\n const {\n id: schemaId,\n listingProperties,\n properties,\n dynamicProperties = {},\n formProperties\n } = entitySchema;\n\n const isEnquiry = schemaId === 'enquiry';\n const columnOptions = !isEnquiry ? [...listingProperties, ACTIONS] : [...listingProperties];\n\n const allProperties = { ...properties, ...dynamicProperties };\n const { columns, labels, parsedRowData } = getColumnsAndLabels(\n columnOptions,\n allProperties,\n rows\n );\n const [firstColumn] = columns;\n\n return {\n identification: 'id',\n sort: null,\n columns,\n labels,\n orderBy: [...formProperties],\n rows: formatRows({\n firstColumn,\n rows: parsedRowData,\n url,\n toggleModal,\n isEnquiry,\n entitySchema\n }),\n isEnquiry\n };\n};\n\nexport { populateRows, formatRows, getParsedRowData };\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,UAAU,QAAQ,mCAAmC;AAC9D,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,OAAOC,YAAY,MAAM,6CAA6C;AACtE,OAAOC,YAAY,MAAM,6CAA6C;AACtE,OAAOC,cAAc,MAAM,gCAAgC;AAE3D,MAAMC,UAAU,GAAGA,CAAC;EAClBC,IAAI;EACJC,GAAG;EACHC,WAAW;EACXC,KAAK;EACLC,WAAW,GAAG,MAAM;EACpBC,SAAS;EACTC;AACF,CAAC,KACCN,IAAI,CAACO,GAAG,CAACC,IAAI,IAAI;EACf,MAAMC,OAAO,GAAG,GAAGR,GAAG,WAAWO,IAAI,CAACE,EAAE,EAAE;EAE1C,MAAMC,QAAQ,GAAAC,aAAA,CAAAA,aAAA,KACTJ,IAAI;IACP,CAACJ,WAAW,gBACVb,KAAA,CAAAsB,aAAA,CAAAtB,KAAA,CAAAuB,QAAA,qBACEvB,KAAA,CAAAsB,aAAA,CAACrB,IAAI;MAACuB,EAAE,EAAEN,OAAQ;MAACO,IAAI,EAAC;IAAQ,GAC7BR,IAAI,CAACJ,WAAW,CACb,CAAC,eACPb,KAAA,CAAAsB,aAAA,CAACpB,UAAU;MACTwB,OAAO,EAAC,uCAAuC;MAC/CC,MAAM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AU,GAAKC,iBAAiB,CAAE;EAC7D,MAAM;IAAEZ,OAAO;IAAEC,MAAM;IAAEO;EAAc,CAAC,GAAGX,mBAAmB,CAC5DiB,aAAa,EACbf,aAAa,EACbxD,IACF,CAAC;EACD,MAAM,CAACI,WAAW,CAAC,GAAGqD,OAAO;EAE7B,OAAO;IACLe,cAAc,EAAE,IAAI;IACpBC,IAAI,EAAE,IAAI;IACVhB,OAAO;IACPC,MAAM;IACNgB,OAAO,EAAE,CAAC,GAAGJ,cAAc,CAAC;IAC5BtE,IAAI,EAAED,UAAU,CAAC;MACfK,WAAW;MACXJ,IAAI,EAAEiE,aAAa;MACnBhE,GAAG;MACHC,WAAW;MACXG,SAAS;MACTC;IACF,CAAC,CAAC;IACFD;EACF,CAAC;AACH,CAAC;AAED,SAAS6D,YAAY,EAAEnE,UAAU,EAAE8C,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import buildListingQuery from '../../../utils/build-listing-query';
|
|
5
|
+
function buildVariables({
|
|
6
|
+
entitySchema,
|
|
7
|
+
isSearchQuery,
|
|
8
|
+
listFilters = [],
|
|
9
|
+
queryParams = {}
|
|
10
|
+
}) {
|
|
11
|
+
const {
|
|
12
|
+
identifier
|
|
13
|
+
} = entitySchema;
|
|
14
|
+
const {
|
|
15
|
+
sort,
|
|
16
|
+
offset,
|
|
17
|
+
limit,
|
|
18
|
+
where
|
|
19
|
+
} = queryParams;
|
|
20
|
+
const [{
|
|
21
|
+
property,
|
|
22
|
+
direction
|
|
23
|
+
}] = sort;
|
|
24
|
+
const parsedOffset = `${property}:${direction}`;
|
|
25
|
+
if (!isSearchQuery) return _objectSpread(_objectSpread({}, queryParams), {}, {
|
|
26
|
+
where: !Array.isArray(listFilters) ? listFilters : where
|
|
27
|
+
});
|
|
28
|
+
const rawQuery = {
|
|
29
|
+
bool: {
|
|
30
|
+
must: listFilters || [],
|
|
31
|
+
filter: [{
|
|
32
|
+
term: {
|
|
33
|
+
entityIdentifier: identifier
|
|
34
|
+
}
|
|
35
|
+
}]
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
limit,
|
|
40
|
+
offset,
|
|
41
|
+
sort: parsedOffset,
|
|
42
|
+
where: JSON.stringify(rawQuery)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const fetchData = async ({
|
|
46
|
+
client,
|
|
47
|
+
querySettings: {
|
|
48
|
+
entitySchema,
|
|
49
|
+
queryParams
|
|
50
|
+
},
|
|
51
|
+
listFilters
|
|
52
|
+
}) => {
|
|
53
|
+
const {
|
|
54
|
+
displayProperties: {
|
|
55
|
+
adminListings: {
|
|
56
|
+
dataSource: {
|
|
57
|
+
source
|
|
58
|
+
} = {}
|
|
59
|
+
} = {}
|
|
60
|
+
} = {}
|
|
61
|
+
} = entitySchema;
|
|
62
|
+
const isSearchQuery = source === 'search';
|
|
63
|
+
const query = buildListingQuery(entitySchema, isSearchQuery);
|
|
64
|
+
const variables = buildVariables({
|
|
65
|
+
entitySchema,
|
|
66
|
+
listFilters,
|
|
67
|
+
queryParams,
|
|
68
|
+
isSearchQuery
|
|
69
|
+
});
|
|
70
|
+
const {
|
|
71
|
+
data = {}
|
|
72
|
+
} = await client.query({
|
|
73
|
+
query,
|
|
74
|
+
variables,
|
|
75
|
+
fetchPolicy: 'network-only'
|
|
76
|
+
});
|
|
77
|
+
if (data.searchResults) {
|
|
78
|
+
return {
|
|
79
|
+
listingData: data.searchResults.results,
|
|
80
|
+
totalRecords: data.searchResults.total
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return data;
|
|
84
|
+
};
|
|
85
|
+
export { fetchData };
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildListingQuery","buildVariables","entitySchema","isSearchQuery","listFilters","queryParams","identifier","sort","offset","limit","where","property","direction","parsedOffset","_objectSpread","Array","isArray","rawQuery","bool","must","filter","term","entityIdentifier","JSON","stringify","fetchData","client","querySettings","displayProperties","adminListings","dataSource","source","query","variables","data","fetchPolicy","searchResults","listingData","results","totalRecords","total"],"sources":["../../../../src/components/ListingTable/service/index.js"],"sourcesContent":["import buildListingQuery from '../../../utils/build-listing-query';\n\nfunction buildVariables({ entitySchema, isSearchQuery, listFilters = [], queryParams = {} }) {\n const { identifier } = entitySchema;\n const { sort, offset, limit, where } = queryParams;\n const [{ property, direction }] = sort;\n const parsedOffset = `${property}:${direction}`;\n\n if (!isSearchQuery)\n return {\n ...queryParams,\n where: !Array.isArray(listFilters) ? listFilters : where\n };\n\n const rawQuery = {\n bool: {\n must: listFilters || [],\n filter: [\n {\n term: {\n entityIdentifier: identifier\n }\n }\n ]\n }\n };\n\n return {\n limit,\n offset,\n sort: parsedOffset,\n where: JSON.stringify(rawQuery)\n };\n}\n\nconst fetchData = async ({ client, querySettings: { entitySchema, queryParams }, listFilters }) => {\n const { displayProperties: { adminListings: { dataSource: { source } = {} } = {} } = {} } =\n entitySchema;\n\n const isSearchQuery = source === 'search';\n const query = buildListingQuery(entitySchema, isSearchQuery);\n const variables = buildVariables({ entitySchema, listFilters, queryParams, isSearchQuery });\n\n const { data = {} } = await client.query({\n query,\n variables,\n fetchPolicy: 'network-only'\n });\n\n if (data.searchResults) {\n return {\n listingData: data.searchResults.results,\n totalRecords: data.searchResults.total\n };\n }\n return data;\n};\n\nexport { fetchData };\n"],"mappings":";;;AAAA,OAAOA,iBAAiB,MAAM,oCAAoC;AAElE,SAASC,cAAcA,CAAC;EAAEC,YAAY;EAAEC,aAAa;EAAEC,WAAW,GAAG,EAAE;EAAEC,WAAW,GAAG,CAAC;AAAE,CAAC,EAAE;EAC3F,MAAM;IAAEC;EAAW,CAAC,GAAGJ,YAAY;EACnC,MAAM;IAAEK,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGL,WAAW;EAClD,MAAM,CAAC;IAAEM,QAAQ;IAAEC;EAAU,CAAC,CAAC,GAAGL,IAAI;EACtC,MAAMM,YAAY,GAAG,GAAGF,QAAQ,IAAIC,SAAS,EAAE;EAE/C,IAAI,CAACT,aAAa,EAChB,OAAAW,aAAA,CAAAA,aAAA,KACKT,WAAW;IACdK,KAAK,EAAE,CAACK,KAAK,CAACC,OAAO,CAACZ,WAAW,CAAC,GAAGA,WAAW,GAAGM;EAAK;EAG5D,MAAMO,QAAQ,GAAG;IACfC,IAAI,EAAE;MACJC,IAAI,EAAEf,WAAW,IAAI,EAAE;MACvBgB,MAAM,EAAE,CACN;QACEC,IAAI,EAAE;UACJC,gBAAgB,EAAEhB;QACpB;MACF,CAAC;IAEL;EACF,CAAC;EAED,OAAO;IACLG,KAAK;IACLD,MAAM;IACND,IAAI,EAAEM,YAAY;IAClBH,KAAK,EAAEa,IAAI,CAACC,SAAS,CAACP,QAAQ;EAChC,CAAC;AACH;AAEA,MAAMQ,SAAS,GAAG,MAAAA,CAAO;EAAEC,MAAM;EAAEC,aAAa,EAAE;IAAEzB,YAAY;IAAEG;EAAY,CAAC;EAAED;AAAY,CAAC,KAAK;EACjG,MAAM;IAAEwB,iBAAiB,EAAE;MAAEC,aAAa,EAAE;QAAEC,UAAU,EAAE;UAAEC;QAAO,CAAC,GAAG,CAAC;MAAE,CAAC,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAAE,CAAC,GACvF7B,YAAY;EAEd,MAAMC,aAAa,GAAG4B,MAAM,KAAK,QAAQ;EACzC,MAAMC,KAAK,GAAGhC,iBAAiB,CAACE,YAAY,EAAEC,aAAa,CAAC;EAC5D,MAAM8B,SAAS,GAAGhC,cAAc,CAAC;IAAEC,YAAY;IAAEE,WAAW;IAAEC,WAAW;IAAEF;EAAc,CAAC,CAAC;EAE3F,MAAM;IAAE+B,IAAI,GAAG,CAAC;EAAE,CAAC,GAAG,MAAMR,MAAM,CAACM,KAAK,CAAC;IACvCA,KAAK;IACLC,SAAS;IACTE,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,IAAID,IAAI,CAACE,aAAa,EAAE;IACtB,OAAO;MACLC,WAAW,EAAEH,IAAI,CAACE,aAAa,CAACE,OAAO;MACvCC,YAAY,EAAEL,IAAI,CAACE,aAAa,CAACI;IACnC,CAAC;EACH;EACA,OAAON,IAAI;AACb,CAAC;AAED,SAAST,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Tab, TabItem } from '@blaze-react/tab';
|
|
4
|
+
import { useReadFromCache, GET_CURRENT_TAB_ID, TabsContextProvider } from '@blaze-cms/admin-ui-utils';
|
|
5
|
+
import { PAGE_BUILDER_TAB, PAGE_BUILDER_TAB_INDEX, EDITOR_VIEW_TAB, EDITOR_VIEW_TAB_INDEX } from '../../constants';
|
|
6
|
+
const Tabs = ({
|
|
7
|
+
children,
|
|
8
|
+
onTabChange,
|
|
9
|
+
enabled
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
currentTabId
|
|
13
|
+
} = useReadFromCache({
|
|
14
|
+
query: GET_CURRENT_TAB_ID
|
|
15
|
+
}) || EDITOR_VIEW_TAB_INDEX;
|
|
16
|
+
const [activeAccordions, setActiveAccordions] = useState([]);
|
|
17
|
+
if (!enabled) return children;
|
|
18
|
+
return /*#__PURE__*/React.createElement(TabsContextProvider, {
|
|
19
|
+
value: {
|
|
20
|
+
currentTabId,
|
|
21
|
+
activeAccordions,
|
|
22
|
+
setActiveAccordions
|
|
23
|
+
}
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Tab, {
|
|
25
|
+
selected: currentTabId
|
|
26
|
+
}, /*#__PURE__*/React.createElement(TabItem, {
|
|
27
|
+
title: EDITOR_VIEW_TAB,
|
|
28
|
+
action: () => onTabChange(EDITOR_VIEW_TAB_INDEX)
|
|
29
|
+
}, children), /*#__PURE__*/React.createElement(TabItem, {
|
|
30
|
+
title: PAGE_BUILDER_TAB,
|
|
31
|
+
action: () => onTabChange(PAGE_BUILDER_TAB_INDEX)
|
|
32
|
+
}, children)));
|
|
33
|
+
};
|
|
34
|
+
Tabs.propTypes = {
|
|
35
|
+
children: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]).isRequired,
|
|
36
|
+
onTabChange: PropTypes.func.isRequired,
|
|
37
|
+
enabled: PropTypes.bool.isRequired
|
|
38
|
+
};
|
|
39
|
+
export default Tabs;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","PropTypes","Tab","TabItem","useReadFromCache","GET_CURRENT_TAB_ID","TabsContextProvider","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","Tabs","children","onTabChange","enabled","currentTabId","query","activeAccordions","setActiveAccordions","createElement","value","selected","title","action","propTypes","oneOfType","object","arrayOf","isRequired","func","bool"],"sources":["../../../src/components/Tabs/index.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Tab, TabItem } from '@blaze-react/tab';\nimport {\n useReadFromCache,\n GET_CURRENT_TAB_ID,\n TabsContextProvider\n} from '@blaze-cms/admin-ui-utils';\nimport {\n PAGE_BUILDER_TAB,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB,\n EDITOR_VIEW_TAB_INDEX\n} from '../../constants';\n\nconst Tabs = ({ children, onTabChange, enabled }) => {\n const { currentTabId } = useReadFromCache({ query: GET_CURRENT_TAB_ID }) || EDITOR_VIEW_TAB_INDEX;\n const [activeAccordions, setActiveAccordions] = useState([]);\n\n if (!enabled) return children;\n\n return (\n <TabsContextProvider value={{ currentTabId, activeAccordions, setActiveAccordions }}>\n <Tab selected={currentTabId}>\n <TabItem title={EDITOR_VIEW_TAB} action={() => onTabChange(EDITOR_VIEW_TAB_INDEX)}>\n {children}\n </TabItem>\n <TabItem title={PAGE_BUILDER_TAB} action={() => onTabChange(PAGE_BUILDER_TAB_INDEX)}>\n {children}\n </TabItem>\n </Tab>\n </TabsContextProvider>\n );\n};\n\nTabs.propTypes = {\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]).isRequired,\n onTabChange: PropTypes.func.isRequired,\n enabled: PropTypes.bool.isRequired\n};\n\nexport default Tabs;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,GAAG,EAAEC,OAAO,QAAQ,kBAAkB;AAC/C,SACEC,gBAAgB,EAChBC,kBAAkB,EAClBC,mBAAmB,QACd,2BAA2B;AAClC,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,QAChB,iBAAiB;AAExB,MAAMC,IAAI,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,WAAW;EAAEC;AAAQ,CAAC,KAAK;EACnD,MAAM;IAAEC;EAAa,CAAC,GAAGX,gBAAgB,CAAC;IAAEY,KAAK,EAAEX;EAAmB,CAAC,CAAC,IAAIK,qBAAqB;EACjG,MAAM,CAACO,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGlB,QAAQ,CAAC,EAAE,CAAC;EAE5D,IAAI,CAACc,OAAO,EAAE,OAAOF,QAAQ;EAE7B,oBACEb,KAAA,CAAAoB,aAAA,CAACb,mBAAmB;IAACc,KAAK,EAAE;MAAEL,YAAY;MAAEE,gBAAgB;MAAEC;IAAoB;EAAE,gBAClFnB,KAAA,CAAAoB,aAAA,CAACjB,GAAG;IAACmB,QAAQ,EAAEN;EAAa,gBAC1BhB,KAAA,CAAAoB,aAAA,CAAChB,OAAO;IAACmB,KAAK,EAAEb,eAAgB;IAACc,MAAM,EAAEA,CAAA,KAAMV,WAAW,CAACH,qBAAqB;EAAE,GAC/EE,QACM,CAAC,eACVb,KAAA,CAAAoB,aAAA,CAAChB,OAAO;IAACmB,KAAK,EAAEf,gBAAiB;IAACgB,MAAM,EAAEA,CAAA,KAAMV,WAAW,CAACL,sBAAsB;EAAE,GACjFI,QACM,CACN,CACc,CAAC;AAE1B,CAAC;AAEDD,IAAI,CAACa,SAAS,GAAG;EACfZ,QAAQ,EAAEX,SAAS,CAACwB,SAAS,CAAC,CAACxB,SAAS,CAACyB,MAAM,EAAEzB,SAAS,CAAC0B,OAAO,CAAC1B,SAAS,CAACyB,MAAM,CAAC,CAAC,CAAC,CAACE,UAAU;EACjGf,WAAW,EAAEZ,SAAS,CAAC4B,IAAI,CAACD,UAAU;EACtCd,OAAO,EAAEb,SAAS,CAAC6B,IAAI,CAACF;AAC1B,CAAC;AAED,eAAejB,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
function useCallbackDebounce(callback, delay, dependencies, skip) {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
if (skip) return;
|
|
5
|
+
const timer = setTimeout(callback, delay);
|
|
6
|
+
return () => clearTimeout(timer);
|
|
7
|
+
},
|
|
8
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9
|
+
dependencies);
|
|
10
|
+
}
|
|
11
|
+
export default useCallbackDebounce;
|
|
12
|
+
//# sourceMappingURL=useCallbackDebounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCallbackDebounce.js","names":["useEffect","useCallbackDebounce","callback","delay","dependencies","skip","timer","setTimeout","clearTimeout"],"sources":["../../../src/components/hooks/useCallbackDebounce.js"],"sourcesContent":["import { useEffect } from 'react';\n\nfunction useCallbackDebounce(callback, delay, dependencies, skip) {\n useEffect(\n () => {\n if (skip) return;\n const timer = setTimeout(callback, delay);\n return () => clearTimeout(timer);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n dependencies\n );\n}\n\nexport default useCallbackDebounce;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,mBAAmBA,CAACC,QAAQ,EAAEC,KAAK,EAAEC,YAAY,EAAEC,IAAI,EAAE;EAChEL,SAAS,CACP,MAAM;IACJ,IAAIK,IAAI,EAAE;IACV,MAAMC,KAAK,GAAGC,UAAU,CAACL,QAAQ,EAAEC,KAAK,CAAC;IACzC,OAAO,MAAMK,YAAY,CAACF,KAAK,CAAC;EAClC,CAAC;EACD;EACAF,YACF,CAAC;AACH;AAEA,eAAeH,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const PLUGIN_NAME = 'data-ui';
|
|
2
|
+
const DATA_LISTING_PREFIX = '/data-listing';
|
|
3
|
+
const PAGE_BUILDER = 'pageBuilder';
|
|
4
|
+
const TEXT_CONTENT_TYPE = 'Publish';
|
|
5
|
+
const ENTITY_PUBLISHED = 'published';
|
|
6
|
+
const SELECT_DEFAULT_VALUE = 'Please Choose...';
|
|
7
|
+
const LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';
|
|
8
|
+
const KEY_TO_CHECK = 'values.slug';
|
|
9
|
+
const MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];
|
|
10
|
+
const PREVIEW_INTERFACE = 'preview/can-preview';
|
|
11
|
+
const PAGE_BUILDER_FIELD_ID = 'pageBuilder';
|
|
12
|
+
const PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';
|
|
13
|
+
const ERROR = 'error';
|
|
14
|
+
const SUCCESS = 'success';
|
|
15
|
+
const PUBLISHED = 'published';
|
|
16
|
+
const UNPUBLISHED = 'unpublished';
|
|
17
|
+
const SAVE_BUTTON_TEXTS = {
|
|
18
|
+
save: 'save',
|
|
19
|
+
saved: 'saved',
|
|
20
|
+
saving: 'saving'
|
|
21
|
+
};
|
|
22
|
+
const ACTIONS = 'actions';
|
|
23
|
+
const UNPUBLISHED_WARNING = 'Page already unpublished';
|
|
24
|
+
const PAGE_NOT_FOUND = 'Page not found';
|
|
25
|
+
const SAVE_BEFORE_PUBLISH_MESSAGE = 'You have to click save to create the record before you can publish';
|
|
26
|
+
const PAGE_BUILDER_TAB = 'Page builder';
|
|
27
|
+
const PAGE_BUILDER_TAB_INDEX = 1;
|
|
28
|
+
const EDITOR_VIEW_TAB = 'Editor view';
|
|
29
|
+
const EDITOR_VIEW_TAB_INDEX = 0;
|
|
30
|
+
const ICON_SIZE = {
|
|
31
|
+
WIDTH: '25px',
|
|
32
|
+
HEIGHT: '25px'
|
|
33
|
+
};
|
|
34
|
+
const ICON_COLOR = {
|
|
35
|
+
STROKE: '#63779C',
|
|
36
|
+
FILL: '#63779C'
|
|
37
|
+
};
|
|
38
|
+
export { DATA_LISTING_PREFIX, ENTITY_PUBLISHED, KEY_TO_CHECK, LEAVE_PAGE_MESSAGE, MENU_PERMISSIONS, PAGE_BUILDER, PLUGIN_NAME, PREVIEW_INTERFACE, SELECT_DEFAULT_VALUE, TEXT_CONTENT_TYPE, PAGE_BUILDER_FIELD_ID, PAGE_BUILDER_TEMPLATE_FIELD_ID, ERROR, SUCCESS, PUBLISHED, UNPUBLISHED, SAVE_BUTTON_TEXTS, ACTIONS, PAGE_BUILDER_TAB_INDEX, EDITOR_VIEW_TAB_INDEX, EDITOR_VIEW_TAB, PAGE_BUILDER_TAB, UNPUBLISHED_WARNING, SAVE_BEFORE_PUBLISH_MESSAGE, ICON_SIZE, ICON_COLOR, PAGE_NOT_FOUND };
|
|
39
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","DATA_LISTING_PREFIX","PAGE_BUILDER","TEXT_CONTENT_TYPE","ENTITY_PUBLISHED","SELECT_DEFAULT_VALUE","LEAVE_PAGE_MESSAGE","KEY_TO_CHECK","MENU_PERMISSIONS","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","PAGE_NOT_FOUND","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst PAGE_NOT_FOUND = 'Page not found';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nexport {\n DATA_LISTING_PREFIX,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB_INDEX,\n EDITOR_VIEW_TAB,\n PAGE_BUILDER_TAB,\n UNPUBLISHED_WARNING,\n SAVE_BEFORE_PUBLISH_MESSAGE,\n ICON_SIZE,\n ICON_COLOR,\n PAGE_NOT_FOUND\n};\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,SAAS;AAC7B,MAAMC,mBAAmB,GAAG,eAAe;AAC3C,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,iBAAiB,GAAG,SAAS;AACnC,MAAMC,gBAAgB,GAAG,WAAW;AACpC,MAAMC,oBAAoB,GAAG,kBAAkB;A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EACfF,gBAAgB,EAChBH,mBAAmB,EACnBE,2BAA2B,EAC3BK,SAAS,EACTG,UAAU,EACVT,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICON_COLOR } from '../constants';
|
|
3
|
+
function ContentIcon({
|
|
4
|
+
fill = ICON_COLOR.FILL,
|
|
5
|
+
stroke = ICON_COLOR.STROKE
|
|
6
|
+
}) {
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8
|
+
width: "19px",
|
|
9
|
+
height: "19px",
|
|
10
|
+
viewBox: "0 0 21 21",
|
|
11
|
+
version: "1.1",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("title", null, "content"), /*#__PURE__*/React.createElement("g", {
|
|
15
|
+
id: "Page-1",
|
|
16
|
+
stroke: "none",
|
|
17
|
+
strokeWidth: 1,
|
|
18
|
+
fill: "none",
|
|
19
|
+
fillRule: "evenodd"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
21
|
+
id: "content",
|
|
22
|
+
transform: "translate(1, 1)"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
24
|
+
id: "Group"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
26
|
+
d: "M0,8.70833334 L5.445875,3.26245834 C6.37331215,2.33530123 7.87668785,2.33530123 8.804125,3.26245834 L14.25,8.70833334",
|
|
27
|
+
id: "Shape-path",
|
|
28
|
+
stroke: stroke,
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round"
|
|
31
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
32
|
+
d: "M11.875,6.33333334 L13.758375,4.44995834 C14.6858122,3.52280123 16.1891878,3.52280123 17.116625,4.44995834 L19,6.33333334",
|
|
33
|
+
id: "Shape-path",
|
|
34
|
+
stroke: stroke,
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round"
|
|
37
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
d: "M2.375,19 L16.625,19 C17.9366763,19 19,17.9366763 19,16.625 L19,2.375 C19,1.06332371 17.9366763,0 16.625,0 L2.375,0 C1.06332371,0 0,1.06332371 0,2.375 L0,16.625 C0,17.9366763 1.06332371,19 2.375,19 Z",
|
|
39
|
+
id: "Shape-path",
|
|
40
|
+
stroke: stroke,
|
|
41
|
+
strokeLinecap: "round",
|
|
42
|
+
strokeLinejoin: "round"
|
|
43
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
44
|
+
id: "Oval",
|
|
45
|
+
fill: fill,
|
|
46
|
+
fillRule: "nonzero",
|
|
47
|
+
cx: "11.4791666",
|
|
48
|
+
cy: "2.77083334",
|
|
49
|
+
r: "1.1875"
|
|
50
|
+
})), /*#__PURE__*/React.createElement("line", {
|
|
51
|
+
x1: 0,
|
|
52
|
+
y1: "9.23611111",
|
|
53
|
+
x2: 19,
|
|
54
|
+
y2: "9.23611111",
|
|
55
|
+
id: "Path",
|
|
56
|
+
stroke: stroke,
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round"
|
|
59
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
60
|
+
x1: "3.95833334",
|
|
61
|
+
y1: "12.4027778",
|
|
62
|
+
x2: "15.3055553",
|
|
63
|
+
y2: "12.4027778",
|
|
64
|
+
id: "Path",
|
|
65
|
+
stroke: stroke,
|
|
66
|
+
strokeLinecap: "round",
|
|
67
|
+
strokeLinejoin: "round"
|
|
68
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
69
|
+
x1: "3.95833334",
|
|
70
|
+
y1: "15.5694445",
|
|
71
|
+
x2: "12.1388885",
|
|
72
|
+
y2: "15.5694445",
|
|
73
|
+
id: "Path",
|
|
74
|
+
stroke: stroke,
|
|
75
|
+
strokeLinecap: "round",
|
|
76
|
+
strokeLinejoin: "round"
|
|
77
|
+
}))));
|
|
78
|
+
}
|
|
79
|
+
export default ContentIcon;
|
|
80
|
+
//# sourceMappingURL=ContentIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentIcon.js","names":["React","ICON_COLOR","ContentIcon","fill","FILL","stroke","STROKE","createElement","width","height","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fillRule","transform","d","strokeLinecap","strokeLinejoin","cx","cy","r","x1","y1","x2","y2"],"sources":["../../src/icons/ContentIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_COLOR } from '../constants';\n\nfunction ContentIcon({ fill = ICON_COLOR.FILL, stroke = ICON_COLOR.STROKE }) {\n return (\n <svg\n width=\"19px\"\n height=\"19px\"\n viewBox=\"0 0 21 21\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\">\n <title>content</title>\n <g id=\"Page-1\" stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <g id=\"content\" transform=\"translate(1, 1)\">\n <g id=\"Group\">\n <path\n d=\"M0,8.70833334 L5.445875,3.26245834 C6.37331215,2.33530123 7.87668785,2.33530123 8.804125,3.26245834 L14.25,8.70833334\"\n id=\"Shape-path\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M11.875,6.33333334 L13.758375,4.44995834 C14.6858122,3.52280123 16.1891878,3.52280123 17.116625,4.44995834 L19,6.33333334\"\n id=\"Shape-path\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M2.375,19 L16.625,19 C17.9366763,19 19,17.9366763 19,16.625 L19,2.375 C19,1.06332371 17.9366763,0 16.625,0 L2.375,0 C1.06332371,0 0,1.06332371 0,2.375 L0,16.625 C0,17.9366763 1.06332371,19 2.375,19 Z\"\n id=\"Shape-path\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <circle\n id=\"Oval\"\n fill={fill}\n fillRule=\"nonzero\"\n cx=\"11.4791666\"\n cy=\"2.77083334\"\n r=\"1.1875\"\n />\n </g>\n <line\n x1={0}\n y1=\"9.23611111\"\n x2={19}\n y2=\"9.23611111\"\n id=\"Path\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"3.95833334\"\n y1=\"12.4027778\"\n x2=\"15.3055553\"\n y2=\"12.4027778\"\n id=\"Path\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"3.95833334\"\n y1=\"15.5694445\"\n x2=\"12.1388885\"\n y2=\"15.5694445\"\n id=\"Path\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </g>\n </svg>\n );\n}\n\nexport default ContentIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,WAAWA,CAAC;EAAEC,IAAI,GAAGF,UAAU,CAACG,IAAI;EAAEC,MAAM,GAAGJ,UAAU,CAACK;AAAO,CAAC,EAAE;EAC3E,oBACEN,KAAA,CAAAO,aAAA;IACEC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCb,KAAA,CAAAO,aAAA,gBAAO,SAAc,CAAC,eACtBP,KAAA,CAAAO,aAAA;IAAGO,EAAE,EAAC,QAAQ;IAACT,MAAM,EAAC,MAAM;IAACU,WAAW,EAAE,CAAE;IAACZ,IAAI,EAAC,MAAM;IAACa,QAAQ,EAAC;EAAS,gBACzEhB,KAAA,CAAAO,aAAA;IAAGO,EAAE,EAAC,SAAS;IAAC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AAC,eACFpB,KAAA,CAAAO,aAAA;IACEiB,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,YAAY;IACfb,EAAE,EAAC,MAAM;IACTT,MAAM,EAAEA,MAAO;IACfc,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,CACvB,CACA,CACF,CACA,CAAC;AAEV;AAEA,eAAelB,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICON_SIZE, ICON_COLOR } from '../constants';
|
|
3
|
+
function SettingsIcon({
|
|
4
|
+
width = ICON_SIZE.WIDTH,
|
|
5
|
+
height = ICON_SIZE.HEIGHT,
|
|
6
|
+
stroke = ICON_COLOR.STROKE
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
9
|
+
width: width,
|
|
10
|
+
height: height,
|
|
11
|
+
viewBox: "0 0 22 22",
|
|
12
|
+
version: "1.1",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("title", null, "setting"), /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "Page-1",
|
|
17
|
+
stroke: "none",
|
|
18
|
+
strokeWidth: 1,
|
|
19
|
+
fill: "none",
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
24
|
+
id: "Group",
|
|
25
|
+
transform: "translate(1, 1)",
|
|
26
|
+
stroke: stroke
|
|
27
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
28
|
+
d: "M8.13888889,1.46333333 C8.61222222,-0.487777777 11.3877778,-0.487777777 11.8611111,1.46333333 C12.0051589,2.05784356 12.4244819,2.54780471 12.9896128,2.78193979 C13.5547438,3.01607487 14.1977123,2.96622362 14.72,2.64777778 C16.4344444,1.60333333 18.3977778,3.56555556 17.3533333,5.28111111 C17.0353472,5.803171 16.9856162,6.44564563 17.2194755,7.0104213 C17.4533348,7.57519696 17.9426987,7.99444609 18.5366667,8.13888889 C20.4877778,8.61222222 20.4877778,11.3877778 18.5366667,11.8611111 C17.9421564,12.0051589 17.4521953,12.4244819 17.2180602,12.9896128 C16.9839251,13.5547438 17.0337764,14.1977123 17.3522222,14.72 C18.3966667,16.4344444 16.4344444,18.3977778 14.7188889,17.3533333 C14.196829,17.0353472 13.5543544,16.9856162 12.9895787,17.2194755 C12.424803,17.4533348 12.0055539,17.9426987 11.8611111,18.5366667 C11.3877778,20.4877778 8.61222222,20.4877778 8.13888889,18.5366667 C7.99484107,17.9421564 7.57551807,17.4521953 7.01038716,17.2180602 C6.44525624,16.9839251 5.80228769,17.0337764 5.28,17.3522222 C3.56555556,18.3966667 1.60222222,16.4344444 2.64666667,14.7188889 C2.96465281,14.196829 3.01438377,13.5543544 2.78052448,12.9895787 C2.5466652,12.424803 2.05730134,12.0055539 1.46333333,11.8611111 C-0.487777777,11.3877778 -0.487777777,8.61222222 1.46333333,8.13888889 C2.05784356,7.99484107 2.54780471,7.57551807 2.78193979,7.01038716 C3.01607487,6.44525624 2.96622362,5.80228769 2.64777778,5.28 C1.60333333,3.56555556 3.56555556,1.60222222 5.28111111,2.64666667 C6.38777778,3.32222222 7.83222222,2.72444444 8.13888889,1.46333333 Z",
|
|
29
|
+
id: "Path"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
31
|
+
d: "M13.6666666,10.3333333 C13.6666666,12.1742825 12.1742825,13.6666666 10.3333333,13.6666666 C8.49238416,13.6666666 7,12.1742825 7,10.3333333 C7,8.49238416 8.49238416,7 10.3333333,7 C12.1742825,7 13.6666666,8.49238416 13.6666666,10.3333333 L13.6666666,10.3333333 Z",
|
|
32
|
+
id: "Path"
|
|
33
|
+
}))));
|
|
34
|
+
}
|
|
35
|
+
export default SettingsIcon;
|
|
36
|
+
//# sourceMappingURL=SettingsIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsIcon.js","names":["React","ICON_SIZE","ICON_COLOR","SettingsIcon","width","WIDTH","height","HEIGHT","stroke","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","strokeLinecap","strokeLinejoin","transform","d"],"sources":["../../src/icons/SettingsIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_SIZE, ICON_COLOR } from '../constants';\n\nfunction SettingsIcon({\n width = ICON_SIZE.WIDTH,\n height = ICON_SIZE.HEIGHT,\n stroke = ICON_COLOR.STROKE\n}) {\n return (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 22 22\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\">\n <title>setting</title>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth={1}\n fill=\"none\"\n fillRule=\"evenodd\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\">\n <g id=\"Group\" transform=\"translate(1, 1)\" stroke={stroke}>\n <path\n d=\"M8.13888889,1.46333333 C8.61222222,-0.487777777 11.3877778,-0.487777777 11.8611111,1.46333333 C12.0051589,2.05784356 12.4244819,2.54780471 12.9896128,2.78193979 C13.5547438,3.01607487 14.1977123,2.96622362 14.72,2.64777778 C16.4344444,1.60333333 18.3977778,3.56555556 17.3533333,5.28111111 C17.0353472,5.803171 16.9856162,6.44564563 17.2194755,7.0104213 C17.4533348,7.57519696 17.9426987,7.99444609 18.5366667,8.13888889 C20.4877778,8.61222222 20.4877778,11.3877778 18.5366667,11.8611111 C17.9421564,12.0051589 17.4521953,12.4244819 17.2180602,12.9896128 C16.9839251,13.5547438 17.0337764,14.1977123 17.3522222,14.72 C18.3966667,16.4344444 16.4344444,18.3977778 14.7188889,17.3533333 C14.196829,17.0353472 13.5543544,16.9856162 12.9895787,17.2194755 C12.424803,17.4533348 12.0055539,17.9426987 11.8611111,18.5366667 C11.3877778,20.4877778 8.61222222,20.4877778 8.13888889,18.5366667 C7.99484107,17.9421564 7.57551807,17.4521953 7.01038716,17.2180602 C6.44525624,16.9839251 5.80228769,17.0337764 5.28,17.3522222 C3.56555556,18.3966667 1.60222222,16.4344444 2.64666667,14.7188889 C2.96465281,14.196829 3.01438377,13.5543544 2.78052448,12.9895787 C2.5466652,12.424803 2.05730134,12.0055539 1.46333333,11.8611111 C-0.487777777,11.3877778 -0.487777777,8.61222222 1.46333333,8.13888889 C2.05784356,7.99484107 2.54780471,7.57551807 2.78193979,7.01038716 C3.01607487,6.44525624 2.96622362,5.80228769 2.64777778,5.28 C1.60333333,3.56555556 3.56555556,1.60222222 5.28111111,2.64666667 C6.38777778,3.32222222 7.83222222,2.72444444 8.13888889,1.46333333 Z\"\n id=\"Path\"\n />\n <path\n d=\"M13.6666666,10.3333333 C13.6666666,12.1742825 12.1742825,13.6666666 10.3333333,13.6666666 C8.49238416,13.6666666 7,12.1742825 7,10.3333333 C7,8.49238416 8.49238416,7 10.3333333,7 C12.1742825,7 13.6666666,8.49238416 13.6666666,10.3333333 L13.6666666,10.3333333 Z\"\n id=\"Path\"\n />\n </g>\n </g>\n </svg>\n );\n}\n\nexport default SettingsIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEpD,SAASC,YAAYA,CAAC;EACpBC,KAAK,GAAGH,SAAS,CAACI,KAAK;EACvBC,MAAM,GAAGL,SAAS,CAACM,MAAM;EACzBC,MAAM,GAAGN,UAAU,CAACO;AACtB,CAAC,EAAE;EACD,oBACET,KAAA,CAAAU,aAAA;IACEN,KAAK,EAAEA,KAAM;IACbE,MAAM,EAAEA,MAAO;IACfK,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCd,KAAA,CAAAU,aAAA,gBAAO,SAAc,CAAC,eACtBV,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,QAAQ;IACXP,MAAM,EAAC,MAAM;IACbQ,WAAW,EAAE,CAAE;IACfC,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAC,SAAS;IAClBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,gBACtBpB,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,OAAO;IAACM,SAAS,EAAC,iBAAiB;IAACb,MAAM,EAAEA;EAAO,gBACvDR,KAAA,CAAAU,aAAA;IACEY,CAAC,EAAC,ygDAAygD;IAC3gDP,EAAE,EAAC;EAAM,CACV,CAAC,eACFf,KAAA,CAAAU,aAAA;IACEY,CAAC,EAAC,uQAAuQ;IACzQP,EAAE,EAAC;EAAM,CACV,CACA,CACF,CACA,CAAC;AAEV;AAEA,eAAeZ,YAAY","ignoreList":[]}
|