@akemona-org/strapi-plugin-content-type-builder 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +19 -0
- package/admin/src/InjectedComponents/ContentManager/EditSettingViewButton.js +76 -0
- package/admin/src/InjectedComponents/ContentManager/EditViewLink.js +44 -0
- package/admin/src/assets/images/logo.svg +1 -0
- package/admin/src/components/AllowedTypesSelect/MenuList.js +115 -0
- package/admin/src/components/AllowedTypesSelect/Text.js +26 -0
- package/admin/src/components/AllowedTypesSelect/index.js +55 -0
- package/admin/src/components/AttributeOption/Button.js +50 -0
- package/admin/src/components/AttributeOption/Card.js +26 -0
- package/admin/src/components/AttributeOption/index.js +127 -0
- package/admin/src/components/BooleanBox/CT.js +21 -0
- package/admin/src/components/BooleanBox/Enumeration.js +10 -0
- package/admin/src/components/BooleanBox/EnumerationWrapper.js +14 -0
- package/admin/src/components/BooleanBox/Label.js +9 -0
- package/admin/src/components/BooleanBox/ST.js +21 -0
- package/admin/src/components/BooleanBox/Wrapper.js +75 -0
- package/admin/src/components/BooleanBox/icons/CTSelected.js +136 -0
- package/admin/src/components/BooleanBox/icons/CTUnselected.js +136 -0
- package/admin/src/components/BooleanBox/icons/STSelected.js +80 -0
- package/admin/src/components/BooleanBox/icons/STUnselected.js +76 -0
- package/admin/src/components/BooleanBox/index.js +103 -0
- package/admin/src/components/CheckboxWithDescription/Wrapper.js +12 -0
- package/admin/src/components/CheckboxWithDescription/index.js +40 -0
- package/admin/src/components/ComponentCard/Close.js +12 -0
- package/admin/src/components/ComponentCard/Wrapper.js +84 -0
- package/admin/src/components/ComponentCard/index.js +62 -0
- package/admin/src/components/ComponentIconPicker/Cell.js +40 -0
- package/admin/src/components/ComponentIconPicker/CellRenderer.js +36 -0
- package/admin/src/components/ComponentIconPicker/Search.js +12 -0
- package/admin/src/components/ComponentIconPicker/SearchWrapper.js +34 -0
- package/admin/src/components/ComponentIconPicker/Wrapper.js +60 -0
- package/admin/src/components/ComponentIconPicker/index.js +143 -0
- package/admin/src/components/ComponentList/index.js +78 -0
- package/admin/src/components/ComponentSelect/Category.js +20 -0
- package/admin/src/components/ComponentSelect/CategoryName.js +11 -0
- package/admin/src/components/ComponentSelect/MenuList.js +110 -0
- package/admin/src/components/ComponentSelect/MultipleMenuList.js +271 -0
- package/admin/src/components/ComponentSelect/Value.js +83 -0
- package/admin/src/components/ComponentSelect/index.js +83 -0
- package/admin/src/components/ComponentSelect/utils/HasSomeSubArray.js +5 -0
- package/admin/src/components/ComponentSelect/utils/hasSubArray.js +5 -0
- package/admin/src/components/CreatableSelect/index.js +58 -0
- package/admin/src/components/CustomCheckbox/StyledCustomCheckbox.js +25 -0
- package/admin/src/components/CustomCheckbox/index.js +71 -0
- package/admin/src/components/CustomLink/P.js +17 -0
- package/admin/src/components/CustomLink/StyledCustomLink.js +20 -0
- package/admin/src/components/CustomLink/index.js +31 -0
- package/admin/src/components/DynamicZoneList/ComponentButton.js +39 -0
- package/admin/src/components/DynamicZoneList/index.js +124 -0
- package/admin/src/components/HeaderModalNavContainer/index.js +25 -0
- package/admin/src/components/HeaderNavLink/Wrapper.js +21 -0
- package/admin/src/components/HeaderNavLink/index.js +50 -0
- package/admin/src/components/List/List.js +131 -0
- package/admin/src/components/List/index.js +295 -0
- package/admin/src/components/ListButton/index.js +9 -0
- package/admin/src/components/ListHeader/Title.js +19 -0
- package/admin/src/components/ListHeader/Wrapper.js +24 -0
- package/admin/src/components/ListHeader/index.js +37 -0
- package/admin/src/components/ListRow/Wrapper.js +76 -0
- package/admin/src/components/ListRow/index.js +334 -0
- package/admin/src/components/ModalHeader/ComponentIcon.js +21 -0
- package/admin/src/components/ModalHeader/ComponentInfos.js +22 -0
- package/admin/src/components/ModalHeader/ComponentInfosWrapper.js +9 -0
- package/admin/src/components/ModalHeader/DropdownInfos.js +50 -0
- package/admin/src/components/ModalHeader/Icon.js +26 -0
- package/admin/src/components/ModalHeader/IconWrapper.js +11 -0
- package/admin/src/components/ModalHeader/Item.js +19 -0
- package/admin/src/components/ModalHeader/Menu.js +8 -0
- package/admin/src/components/ModalHeader/Toggle.js +14 -0
- package/admin/src/components/ModalHeader/Wrapper.js +12 -0
- package/admin/src/components/ModalHeader/index.js +105 -0
- package/admin/src/components/RelationForm/Wrapper.js +9 -0
- package/admin/src/components/RelationForm/index.js +66 -0
- package/admin/src/components/RelationFormBox/Wrapper.js +34 -0
- package/admin/src/components/RelationFormBox/index.js +85 -0
- package/admin/src/components/RelationFormNaturePicker/Wrapper.js +53 -0
- package/admin/src/components/RelationFormNaturePicker/index.js +112 -0
- package/admin/src/components/RelationTargetPicker/Item.js +62 -0
- package/admin/src/components/RelationTargetPicker/Wrapper.js +89 -0
- package/admin/src/components/RelationTargetPicker/index.js +88 -0
- package/admin/src/components/SelectCheckbox/index.js +8 -0
- package/admin/src/components/SelectMenuSubUl/ToggleUl.js +23 -0
- package/admin/src/components/SelectMenuSubUl/index.js +23 -0
- package/admin/src/components/SelectMenuUl/index.js +66 -0
- package/admin/src/components/Td/index.js +37 -0
- package/admin/src/components/UpperFirst/index.js +14 -0
- package/admin/src/components/WrapperSelect/index.js +89 -0
- package/admin/src/containers/App/Wrapper.js +14 -0
- package/admin/src/containers/App/index.js +39 -0
- package/admin/src/containers/App/utils/icons.json +962 -0
- package/admin/src/containers/DataManagerProvider/constants.js +15 -0
- package/admin/src/containers/DataManagerProvider/index.js +610 -0
- package/admin/src/containers/DataManagerProvider/reducer.js +461 -0
- package/admin/src/containers/DataManagerProvider/selectors.js +25 -0
- package/admin/src/containers/DataManagerProvider/utils/cleanData.js +167 -0
- package/admin/src/containers/DataManagerProvider/utils/createDataObject.js +8 -0
- package/admin/src/containers/DataManagerProvider/utils/createModifiedDataSchema.js +91 -0
- package/admin/src/containers/DataManagerProvider/utils/retrieveComponentsFromSchema.js +55 -0
- package/admin/src/containers/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.js +35 -0
- package/admin/src/containers/DataManagerProvider/utils/retrieveNestedComponents.js +34 -0
- package/admin/src/containers/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.js +12 -0
- package/admin/src/containers/FormModal/CustomButton.js +12 -0
- package/admin/src/containers/FormModal/attributes/advancedForm.js +269 -0
- package/admin/src/containers/FormModal/attributes/attributeOptions.js +99 -0
- package/admin/src/containers/FormModal/attributes/baseForm.js +322 -0
- package/admin/src/containers/FormModal/attributes/commonBaseForm.js +7 -0
- package/admin/src/containers/FormModal/attributes/form.js +9 -0
- package/admin/src/containers/FormModal/attributes/index.js +4 -0
- package/admin/src/containers/FormModal/attributes/nameField.js +19 -0
- package/admin/src/containers/FormModal/attributes/types.js +309 -0
- package/admin/src/containers/FormModal/attributes/uiHelpers.js +11 -0
- package/admin/src/containers/FormModal/attributes/validation/common.js +151 -0
- package/admin/src/containers/FormModal/category/createCategorySchema.js +28 -0
- package/admin/src/containers/FormModal/category/form.js +27 -0
- package/admin/src/containers/FormModal/category/index.js +3 -0
- package/admin/src/containers/FormModal/category/regex.js +3 -0
- package/admin/src/containers/FormModal/component/componentField.js +25 -0
- package/admin/src/containers/FormModal/component/createComponentSchema.js +49 -0
- package/admin/src/containers/FormModal/component/form.js +67 -0
- package/admin/src/containers/FormModal/component/index.js +4 -0
- package/admin/src/containers/FormModal/constants.js +11 -0
- package/admin/src/containers/FormModal/contentType/createContentTypeSchema.js +44 -0
- package/admin/src/containers/FormModal/contentType/form.js +116 -0
- package/admin/src/containers/FormModal/contentType/index.js +2 -0
- package/admin/src/containers/FormModal/dynamicZone/form.js +45 -0
- package/admin/src/containers/FormModal/dynamicZone/index.js +2 -0
- package/admin/src/containers/FormModal/forms/index.js +164 -0
- package/admin/src/containers/FormModal/index.js +1552 -0
- package/admin/src/containers/FormModal/reducer.js +293 -0
- package/admin/src/containers/FormModal/selectors.js +24 -0
- package/admin/src/containers/FormModal/utils/canEditContentType.js +19 -0
- package/admin/src/containers/FormModal/utils/createHeadersArray.js +37 -0
- package/admin/src/containers/FormModal/utils/createHeadersObjectFromArray.js +27 -0
- package/admin/src/containers/FormModal/utils/createUid.js +17 -0
- package/admin/src/containers/FormModal/utils/getAttributesToDisplay.js +35 -0
- package/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js +25 -0
- package/admin/src/containers/FormModal/utils/getNextSearch.js +17 -0
- package/admin/src/containers/FormModal/utils/index.js +6 -0
- package/admin/src/containers/FormModal/utils/relations.js +9 -0
- package/admin/src/containers/FormModal/utils/staticData.js +43 -0
- package/admin/src/containers/Initializer/index.js +26 -0
- package/admin/src/containers/LeftMenu/Wrapper.js +14 -0
- package/admin/src/containers/LeftMenu/index.js +220 -0
- package/admin/src/containers/ListView/Wrapper.js +16 -0
- package/admin/src/containers/ListView/index.js +322 -0
- package/admin/src/containers/NotFoundPage/index.js +20 -0
- package/admin/src/containers/RecursivePath/index.js +22 -0
- package/admin/src/contexts/DataManagerContext.js +5 -0
- package/admin/src/contexts/ListViewContext.js +5 -0
- package/admin/src/hooks/useDataManager.js +6 -0
- package/admin/src/hooks/useListView.js +6 -0
- package/admin/src/icons/Curve.js +26 -0
- package/admin/src/icons/ManyToMany.js +98 -0
- package/admin/src/icons/ManyToOne.js +64 -0
- package/admin/src/icons/ManyWay.js +36 -0
- package/admin/src/icons/OneToMany.js +65 -0
- package/admin/src/icons/OneToOne.js +47 -0
- package/admin/src/icons/OneWay.js +38 -0
- package/admin/src/index.js +83 -0
- package/admin/src/lifecycles.js +13 -0
- package/admin/src/permissions.js +9 -0
- package/admin/src/pluginId.js +5 -0
- package/admin/src/reducers.js +10 -0
- package/admin/src/translations/ar.json +48 -0
- package/admin/src/translations/cs.json +151 -0
- package/admin/src/translations/de.json +187 -0
- package/admin/src/translations/dk.json +181 -0
- package/admin/src/translations/en.json +188 -0
- package/admin/src/translations/es.json +188 -0
- package/admin/src/translations/fr.json +87 -0
- package/admin/src/translations/id.json +187 -0
- package/admin/src/translations/index.js +51 -0
- package/admin/src/translations/it.json +187 -0
- package/admin/src/translations/ja.json +50 -0
- package/admin/src/translations/ko.json +57 -0
- package/admin/src/translations/ms.json +179 -0
- package/admin/src/translations/nl.json +171 -0
- package/admin/src/translations/pl.json +152 -0
- package/admin/src/translations/pt-BR.json +51 -0
- package/admin/src/translations/pt.json +51 -0
- package/admin/src/translations/ru.json +188 -0
- package/admin/src/translations/sk.json +186 -0
- package/admin/src/translations/th.json +181 -0
- package/admin/src/translations/tr.json +51 -0
- package/admin/src/translations/uk.json +180 -0
- package/admin/src/translations/zh-Hans.json +188 -0
- package/admin/src/translations/zh.json +178 -0
- package/admin/src/utils/convertAttrObjToArray.js +7 -0
- package/admin/src/utils/formAPI.js +112 -0
- package/admin/src/utils/getAttributeDisplayedType.js +31 -0
- package/admin/src/utils/getComponents.js +31 -0
- package/admin/src/utils/getTrad.js +5 -0
- package/admin/src/utils/makeSearch.js +15 -0
- package/admin/src/utils/makeUnique.js +3 -0
- package/config/functions/bootstrap.js +14 -0
- package/config/routes.json +144 -0
- package/controllers/Builder.js +7 -0
- package/controllers/ComponentCategories.js +43 -0
- package/controllers/Components.js +152 -0
- package/controllers/Connections.js +9 -0
- package/controllers/ContentTypes.js +143 -0
- package/controllers/validation/common.js +118 -0
- package/controllers/validation/component-category.js +21 -0
- package/controllers/validation/component.js +89 -0
- package/controllers/validation/content-type.js +161 -0
- package/controllers/validation/data-transform.js +32 -0
- package/controllers/validation/model-schema.js +91 -0
- package/controllers/validation/relations.js +56 -0
- package/controllers/validation/types.js +277 -0
- package/package.json +63 -0
- package/services/Builder.js +7 -0
- package/services/ComponentCategories.js +88 -0
- package/services/Components.js +103 -0
- package/services/ContentTypes.js +263 -0
- package/services/api-handler.js +158 -0
- package/services/constants.js +59 -0
- package/services/schema-builder/component-builder.js +137 -0
- package/services/schema-builder/content-type-builder.js +256 -0
- package/services/schema-builder/index.js +196 -0
- package/services/schema-builder/schema-handler.js +297 -0
- package/utils/attributes.js +154 -0
- package/utils/helpers.js +31 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* CustomCheckbox
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { isEmpty, isNumber } from 'lodash';
|
|
10
|
+
import { Inputs } from '@buffetjs/custom';
|
|
11
|
+
import { Checkbox } from '@buffetjs/core';
|
|
12
|
+
import StyledCustomCheckbox from './StyledCustomCheckbox';
|
|
13
|
+
|
|
14
|
+
const CustomCheckbox = ({ label, modifiedData, name, onChange, value, ...rest }) => {
|
|
15
|
+
const [checked, setChecked] = useState(isNumber(value) || !isEmpty(value));
|
|
16
|
+
const type = modifiedData.type === 'biginteger' ? 'text' : 'number';
|
|
17
|
+
const step = ['decimal', 'float'].includes(modifiedData.type) ? 'any' : '1';
|
|
18
|
+
const disabled = !modifiedData.type;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<StyledCustomCheckbox>
|
|
22
|
+
<Checkbox
|
|
23
|
+
message={label}
|
|
24
|
+
name={name}
|
|
25
|
+
type="checkbox"
|
|
26
|
+
value={checked}
|
|
27
|
+
onChange={() => {
|
|
28
|
+
if (checked) {
|
|
29
|
+
onChange({
|
|
30
|
+
target: {
|
|
31
|
+
name,
|
|
32
|
+
value: null,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
setChecked(prev => !prev);
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
{checked && (
|
|
40
|
+
<div className="no-label col-6">
|
|
41
|
+
<Inputs
|
|
42
|
+
{...rest}
|
|
43
|
+
name={name}
|
|
44
|
+
onChange={onChange}
|
|
45
|
+
step={step}
|
|
46
|
+
disabled={disabled}
|
|
47
|
+
value={value}
|
|
48
|
+
type={type}
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
52
|
+
</StyledCustomCheckbox>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
CustomCheckbox.defaultProps = {
|
|
57
|
+
label: null,
|
|
58
|
+
modifiedData: {},
|
|
59
|
+
name: '',
|
|
60
|
+
value: null,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
CustomCheckbox.propTypes = {
|
|
64
|
+
label: PropTypes.string,
|
|
65
|
+
modifiedData: PropTypes.object,
|
|
66
|
+
name: PropTypes.string,
|
|
67
|
+
onChange: PropTypes.func.isRequired,
|
|
68
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default CustomCheckbox;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { colors } from 'strapi-helper-plugin';
|
|
3
|
+
|
|
4
|
+
const P = styled.p`
|
|
5
|
+
color: ${colors.blue};
|
|
6
|
+
font-size: 13px;
|
|
7
|
+
font-weight: 500;
|
|
8
|
+
line-height: 18px;
|
|
9
|
+
text-align: left;
|
|
10
|
+
> svg {
|
|
11
|
+
margin-right: 7px;
|
|
12
|
+
vertical-align: initial;
|
|
13
|
+
-webkit-font-smoothing: subpixel-antialiased;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export default P;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* StyledCustomLink
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
|
|
9
|
+
const StyledCustomLink = styled.div`
|
|
10
|
+
padding-left: 15px;
|
|
11
|
+
padding-top: 6px;
|
|
12
|
+
margin-left: -3px;
|
|
13
|
+
button {
|
|
14
|
+
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
15
|
+
padding: 0;
|
|
16
|
+
line-height: 16px;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export default StyledCustomLink;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Plus } from '@buffetjs/icons';
|
|
5
|
+
import P from './P';
|
|
6
|
+
import StyledCustomLink from './StyledCustomLink';
|
|
7
|
+
|
|
8
|
+
const CustomLink = ({ disabled, id, onClick }) => (
|
|
9
|
+
<StyledCustomLink disabled={disabled}>
|
|
10
|
+
<button onClick={onClick} disabled={disabled} type="button">
|
|
11
|
+
<P>
|
|
12
|
+
<Plus fill="#007EFF" width="11px" height="11px" />
|
|
13
|
+
{id && <FormattedMessage id={id} />}
|
|
14
|
+
</P>
|
|
15
|
+
</button>
|
|
16
|
+
</StyledCustomLink>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CustomLink.defaultProps = {
|
|
20
|
+
disabled: false,
|
|
21
|
+
id: null,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
CustomLink.propTypes = {
|
|
25
|
+
disabled: PropTypes.bool,
|
|
26
|
+
id: PropTypes.string,
|
|
27
|
+
onClick: PropTypes.func.isRequired,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default memo(CustomLink);
|
|
31
|
+
export { CustomLink };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ComponentButton
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
|
|
9
|
+
const ComponentButton = styled.button`
|
|
10
|
+
width: 139px;
|
|
11
|
+
height: 90px;
|
|
12
|
+
padding-top: 7px;
|
|
13
|
+
&:focus {
|
|
14
|
+
outline: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
div {
|
|
18
|
+
width: 35px;
|
|
19
|
+
height: 35px;
|
|
20
|
+
border-radius: 18px;
|
|
21
|
+
background-color: #2c3138;
|
|
22
|
+
display: flex;
|
|
23
|
+
margin: auto;
|
|
24
|
+
svg {
|
|
25
|
+
margin: auto;
|
|
26
|
+
width: 11px;
|
|
27
|
+
height: 11px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
p {
|
|
31
|
+
margin-top: 5px;
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
color: #2c3138;
|
|
35
|
+
line-height: normal;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export default ComponentButton;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* DynamicZoneList
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* eslint-disable import/no-cycle */
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { FormattedMessage } from 'react-intl';
|
|
11
|
+
import { TabContent, TabPane, Nav } from 'reactstrap';
|
|
12
|
+
import { Plus } from '@buffetjs/icons';
|
|
13
|
+
import useDataManager from '../../hooks/useDataManager';
|
|
14
|
+
import getTrad from '../../utils/getTrad';
|
|
15
|
+
import ComponentList from '../ComponentList';
|
|
16
|
+
import ComponentCard from '../ComponentCard';
|
|
17
|
+
import Td from '../Td';
|
|
18
|
+
import ComponentButton from './ComponentButton';
|
|
19
|
+
|
|
20
|
+
function DynamicZoneList({
|
|
21
|
+
customRowComponent,
|
|
22
|
+
components,
|
|
23
|
+
addComponent,
|
|
24
|
+
mainTypeName,
|
|
25
|
+
name,
|
|
26
|
+
targetUid,
|
|
27
|
+
}) {
|
|
28
|
+
const { isInDevelopmentMode } = useDataManager();
|
|
29
|
+
const [activeTab, setActiveTab] = useState('0');
|
|
30
|
+
|
|
31
|
+
const toggle = tab => {
|
|
32
|
+
if (activeTab !== tab) {
|
|
33
|
+
setActiveTab(tab);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleClickAdd = () => {
|
|
38
|
+
addComponent(name);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<tr className="dynamiczone-row">
|
|
43
|
+
<Td colSpan={12} isFromDynamicZone>
|
|
44
|
+
<div>
|
|
45
|
+
<div className="tabs-wrapper">
|
|
46
|
+
<Nav tabs>
|
|
47
|
+
{isInDevelopmentMode && (
|
|
48
|
+
<li>
|
|
49
|
+
<ComponentButton onClick={handleClickAdd}>
|
|
50
|
+
<div>
|
|
51
|
+
<Plus style={{ height: 15, width: 15 }} />
|
|
52
|
+
</div>
|
|
53
|
+
<p>
|
|
54
|
+
<FormattedMessage id={getTrad('button.component.add')} />
|
|
55
|
+
</p>
|
|
56
|
+
</ComponentButton>
|
|
57
|
+
</li>
|
|
58
|
+
)}
|
|
59
|
+
{components.map((component, index) => {
|
|
60
|
+
return (
|
|
61
|
+
<li key={component}>
|
|
62
|
+
<ComponentCard
|
|
63
|
+
dzName={name}
|
|
64
|
+
index={index}
|
|
65
|
+
component={component}
|
|
66
|
+
isActive={activeTab === `${index}`}
|
|
67
|
+
isInDevelopmentMode={isInDevelopmentMode}
|
|
68
|
+
onClick={() => {
|
|
69
|
+
toggle(`${index}`);
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
</li>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</Nav>
|
|
76
|
+
</div>
|
|
77
|
+
<TabContent activeTab={activeTab}>
|
|
78
|
+
{components.map((component, index) => {
|
|
79
|
+
const props = {
|
|
80
|
+
customRowComponent,
|
|
81
|
+
component,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<TabPane tabId={`${index}`} key={component}>
|
|
86
|
+
<table>
|
|
87
|
+
<tbody>
|
|
88
|
+
<ComponentList
|
|
89
|
+
{...props}
|
|
90
|
+
isFromDynamicZone
|
|
91
|
+
dzName={name}
|
|
92
|
+
mainTypeName={mainTypeName}
|
|
93
|
+
targetUid={targetUid}
|
|
94
|
+
key={component}
|
|
95
|
+
/>
|
|
96
|
+
</tbody>
|
|
97
|
+
</table>
|
|
98
|
+
</TabPane>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
</TabContent>
|
|
102
|
+
</div>
|
|
103
|
+
</Td>
|
|
104
|
+
</tr>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
DynamicZoneList.defaultProps = {
|
|
109
|
+
addComponent: () => {},
|
|
110
|
+
components: [],
|
|
111
|
+
customRowComponent: null,
|
|
112
|
+
name: null,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
DynamicZoneList.propTypes = {
|
|
116
|
+
addComponent: PropTypes.func,
|
|
117
|
+
components: PropTypes.instanceOf(Array),
|
|
118
|
+
customRowComponent: PropTypes.func,
|
|
119
|
+
mainTypeName: PropTypes.string.isRequired,
|
|
120
|
+
name: PropTypes.string,
|
|
121
|
+
targetUid: PropTypes.string.isRequired,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default DynamicZoneList;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* HeaderModalNavContainer
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
|
|
9
|
+
const HeaderModalNavContainer = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 3.8rem;
|
|
12
|
+
margin-left: 5rem;
|
|
13
|
+
padding-top: 0.6rem;
|
|
14
|
+
color: #9ea7b8;
|
|
15
|
+
font-size: 1.2rem;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
letter-spacing: 0.7px;
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
|
|
20
|
+
> div:last-child {
|
|
21
|
+
margin-left: 3rem;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export default HeaderModalNavContainer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable indent */
|
|
4
|
+
|
|
5
|
+
const Wrapper = styled.div`
|
|
6
|
+
${({ isActive }) => {
|
|
7
|
+
if (isActive) {
|
|
8
|
+
return `
|
|
9
|
+
height: 3rem;
|
|
10
|
+
color: #007eff;
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
border-bottom: 2px solid #007eff;
|
|
13
|
+
z-index: 99;
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return '';
|
|
18
|
+
}}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export default Wrapper;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* HeaderNavLink
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { FormattedMessage } from 'react-intl';
|
|
10
|
+
import pluginId from '../../pluginId';
|
|
11
|
+
import Wrapper from './Wrapper';
|
|
12
|
+
|
|
13
|
+
/* istanbul ignore next */
|
|
14
|
+
function HeaderNavLink({ custom, isDisabled, id, isActive, onClick }) {
|
|
15
|
+
return (
|
|
16
|
+
<Wrapper
|
|
17
|
+
isActive={isActive}
|
|
18
|
+
style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }}
|
|
19
|
+
onClick={e => {
|
|
20
|
+
if (isDisabled) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
onClick(id);
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<FormattedMessage
|
|
29
|
+
id={`${pluginId}.popUpForm.navContainer.${custom || id}`}
|
|
30
|
+
/>
|
|
31
|
+
</Wrapper>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
HeaderNavLink.defaultProps = {
|
|
36
|
+
custom: null,
|
|
37
|
+
id: 'base',
|
|
38
|
+
isActive: false,
|
|
39
|
+
isDisabled: false,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
HeaderNavLink.propTypes = {
|
|
43
|
+
custom: PropTypes.string,
|
|
44
|
+
id: PropTypes.string,
|
|
45
|
+
isActive: PropTypes.bool,
|
|
46
|
+
isDisabled: PropTypes.bool,
|
|
47
|
+
onClick: PropTypes.func.isRequired,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default HeaderNavLink;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Wrapper
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { List } from '@buffetjs/styles';
|
|
9
|
+
|
|
10
|
+
const Wrapper = styled(List)`
|
|
11
|
+
table-layout: fixed;
|
|
12
|
+
|
|
13
|
+
tbody {
|
|
14
|
+
td:first-of-type:not(:last-of-type) {
|
|
15
|
+
width: 73px;
|
|
16
|
+
padding-left: 30px;
|
|
17
|
+
> svg {
|
|
18
|
+
width: auto;
|
|
19
|
+
height: 16px;
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: -4px;
|
|
22
|
+
top: 16px;
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
td[colspan='12'] {
|
|
27
|
+
position: relative;
|
|
28
|
+
padding: 0 0 0 50px;
|
|
29
|
+
> div {
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
tr.component-row {
|
|
34
|
+
&:not(:first-of-type) {
|
|
35
|
+
&::before {
|
|
36
|
+
background-color: transparent;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
table tr td:first-of-type:not(:last-of-type) {
|
|
40
|
+
width: 79px;
|
|
41
|
+
padding-left: 36px;
|
|
42
|
+
svg {
|
|
43
|
+
display: block;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
table + div button {
|
|
48
|
+
position: relative;
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
text-transform: initial;
|
|
51
|
+
color: #9ea7b8;
|
|
52
|
+
text-align: left;
|
|
53
|
+
padding-left: 35px;
|
|
54
|
+
border-color: transparent;
|
|
55
|
+
svg {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
tr.dynamiczone-row {
|
|
62
|
+
&:not(:first-of-type) {
|
|
63
|
+
&::before {
|
|
64
|
+
background-color: transparent;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
> td[colspan='12'] {
|
|
68
|
+
padding-left: 0;
|
|
69
|
+
padding-right: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.tabs-wrapper {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
width: 100%;
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
z-index: 2;
|
|
81
|
+
padding-top: 18px;
|
|
82
|
+
padding-left: 86px;
|
|
83
|
+
padding-right: 30px;
|
|
84
|
+
.nav-tabs {
|
|
85
|
+
border-bottom: 0;
|
|
86
|
+
}
|
|
87
|
+
ul.nav {
|
|
88
|
+
width: 100%;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-wrap: nowrap;
|
|
91
|
+
overflow-x: auto;
|
|
92
|
+
overflow-y: hidden;
|
|
93
|
+
li {
|
|
94
|
+
margin-right: 9px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
& + .tab-content {
|
|
98
|
+
padding-top: 126px;
|
|
99
|
+
position: relative;
|
|
100
|
+
z-index: 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
& + .plus-icon {
|
|
106
|
+
width: 27px;
|
|
107
|
+
height: 27px;
|
|
108
|
+
border-radius: 18px;
|
|
109
|
+
position: absolute;
|
|
110
|
+
bottom: 14px;
|
|
111
|
+
left: 34px;
|
|
112
|
+
background-color: ${({ isFromDynamicZone }) => (isFromDynamicZone ? '#AED4FB' : '#f3f4f4')};
|
|
113
|
+
|
|
114
|
+
color: transparent;
|
|
115
|
+
text-align: center;
|
|
116
|
+
line-height: 27px;
|
|
117
|
+
display: flex;
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
svg {
|
|
120
|
+
margin: auto;
|
|
121
|
+
width: 11px;
|
|
122
|
+
height: 11px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
Wrapper.defaultProps = {
|
|
128
|
+
isFromDynamicZone: false,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export default Wrapper;
|