@akemona-org/strapi-plugin-content-manager 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 +27 -0
- package/admin/src/InjectedComponents/ContentTypeBuilder/ConfigureViewButton/index.js +78 -0
- package/admin/src/assets/images/background_input.svg +1 -0
- package/admin/src/assets/images/icon-cross-blue.svg +1 -0
- package/admin/src/assets/images/icon_remove.svg +19 -0
- package/admin/src/assets/images/logo.svg +1 -0
- package/admin/src/components/AddDropdown/components.js +113 -0
- package/admin/src/components/AddDropdown/index.js +76 -0
- package/admin/src/components/Block/components.js +28 -0
- package/admin/src/components/Block/index.js +45 -0
- package/admin/src/components/ComponentInitializer/P.js +9 -0
- package/admin/src/components/ComponentInitializer/index.js +43 -0
- package/admin/src/components/Container/index.js +7 -0
- package/admin/src/components/CustomInputCheckbox/components.js +77 -0
- package/admin/src/components/CustomInputCheckbox/index.js +53 -0
- package/admin/src/components/CustomTable/ActionCollapse/Delete.js +14 -0
- package/admin/src/components/CustomTable/ActionCollapse/DeleteAll.js +18 -0
- package/admin/src/components/CustomTable/ActionCollapse/Wrapper.js +20 -0
- package/admin/src/components/CustomTable/ActionCollapse/index.js +38 -0
- package/admin/src/components/CustomTable/Headers/Header.js +59 -0
- package/admin/src/components/CustomTable/Headers/Thead.js +35 -0
- package/admin/src/components/CustomTable/Headers/index.js +46 -0
- package/admin/src/components/CustomTable/Row/ActionContainer.js +19 -0
- package/admin/src/components/CustomTable/Row/Cell.js +55 -0
- package/admin/src/components/CustomTable/Row/index.js +112 -0
- package/admin/src/components/CustomTable/index.js +162 -0
- package/admin/src/components/CustomTable/styledComponents.js +85 -0
- package/admin/src/components/DragLayer/index.js +102 -0
- package/admin/src/components/DraggedField/Close/index.js +10 -0
- package/admin/src/components/DraggedField/GrabWrapper.js +38 -0
- package/admin/src/components/DraggedField/Link.js +17 -0
- package/admin/src/components/DraggedField/NameWrapper.js +29 -0
- package/admin/src/components/DraggedField/RemoveWrapper.js +32 -0
- package/admin/src/components/DraggedField/SubWrapper.js +36 -0
- package/admin/src/components/DraggedField/Wrapper.js +134 -0
- package/admin/src/components/DraggedField/index.js +196 -0
- package/admin/src/components/DraggedField/utils/getColor.js +12 -0
- package/admin/src/components/DraggedField/utils/getHeight.js +3 -0
- package/admin/src/components/DraggedFieldWithPreview/Carret.js +24 -0
- package/admin/src/components/DraggedFieldWithPreview/DynamicComponent.js +70 -0
- package/admin/src/components/DraggedFieldWithPreview/DynamicZoneWrapper.js +10 -0
- package/admin/src/components/DraggedFieldWithPreview/Tooltip.js +19 -0
- package/admin/src/components/DraggedFieldWithPreview/Wrapper.js +24 -0
- package/admin/src/components/DraggedFieldWithPreview/index.js +194 -0
- package/admin/src/components/DynamicComponentCard/Wrapper.js +63 -0
- package/admin/src/components/DynamicComponentCard/index.js +49 -0
- package/admin/src/components/DynamicZone/BaselineAlignement.js +11 -0
- package/admin/src/components/DynamicZone/Button.js +31 -0
- package/admin/src/components/DynamicZone/Component/RoundCTA.js +45 -0
- package/admin/src/components/DynamicZone/Component/index.js +79 -0
- package/admin/src/components/DynamicZone/ComponentWrapper.js +44 -0
- package/admin/src/components/DynamicZone/DynamicZoneWrapper.js +12 -0
- package/admin/src/components/DynamicZone/Label.js +42 -0
- package/admin/src/components/DynamicZone/Picker/Category/Banner/Wrapper.js +78 -0
- package/admin/src/components/DynamicZone/Picker/Category/Banner/index.js +33 -0
- package/admin/src/components/DynamicZone/Picker/Category/index.js +53 -0
- package/admin/src/components/DynamicZone/Picker/Wrapper.js +32 -0
- package/admin/src/components/DynamicZone/Picker/index.js +88 -0
- package/admin/src/components/DynamicZone/Wrapper.js +34 -0
- package/admin/src/components/DynamicZone/index.js +238 -0
- package/admin/src/components/DynamicZone/utils/connect.js +12 -0
- package/admin/src/components/DynamicZone/utils/select.js +49 -0
- package/admin/src/components/FieldComponent/ComponentIcon.js +44 -0
- package/admin/src/components/FieldComponent/EmptyComponent.js +19 -0
- package/admin/src/components/FieldComponent/Label.js +10 -0
- package/admin/src/components/FieldComponent/ResetComponent.js +41 -0
- package/admin/src/components/FieldComponent/Wrapper.js +18 -0
- package/admin/src/components/FieldComponent/index.js +171 -0
- package/admin/src/components/FieldComponent/utils/connect.js +12 -0
- package/admin/src/components/FieldComponent/utils/select.js +123 -0
- package/admin/src/components/FieldsReorder/Item.js +249 -0
- package/admin/src/components/FieldsReorder/components.js +8 -0
- package/admin/src/components/FieldsReorder/index.js +102 -0
- package/admin/src/components/FilterOptionsCTA/index.js +14 -0
- package/admin/src/components/FilterPicker/components.js +56 -0
- package/admin/src/components/FilterPicker/index.js +258 -0
- package/admin/src/components/FilterPicker/init.js +25 -0
- package/admin/src/components/FilterPicker/reducer.js +58 -0
- package/admin/src/components/FilterPickerOption/Input.js +58 -0
- package/admin/src/components/FilterPickerOption/Option.js +18 -0
- package/admin/src/components/FilterPickerOption/components.js +60 -0
- package/admin/src/components/FilterPickerOption/index.js +101 -0
- package/admin/src/components/FormTitle/index.js +26 -0
- package/admin/src/components/FormWrapper/index.js +20 -0
- package/admin/src/components/InputJSON/components.js +30 -0
- package/admin/src/components/InputJSON/index.js +184 -0
- package/admin/src/components/InputJSON/jsonlint.js +424 -0
- package/admin/src/components/InputJSONWithErrors/Wrapper.js +32 -0
- package/admin/src/components/InputJSONWithErrors/index.js +168 -0
- package/admin/src/components/InputUID/InputUID.js +26 -0
- package/admin/src/components/InputUID/Options/Option.js +22 -0
- package/admin/src/components/InputUID/Options/OptionsTitle.js +12 -0
- package/admin/src/components/InputUID/Options/RightOptionLabel.js +10 -0
- package/admin/src/components/InputUID/Options/index.js +34 -0
- package/admin/src/components/InputUID/Options/wrapper.js +13 -0
- package/admin/src/components/InputUID/RegenerateButton.js +18 -0
- package/admin/src/components/InputUID/RightContent.js +14 -0
- package/admin/src/components/InputUID/RightContentLabel.js +10 -0
- package/admin/src/components/InputUID/RightLabel.js +42 -0
- package/admin/src/components/InputUID/SubLabel.js +9 -0
- package/admin/src/components/InputUID/Wrapper.js +8 -0
- package/admin/src/components/InputUID/index.js +325 -0
- package/admin/src/components/InputUID/regex.js +3 -0
- package/admin/src/components/Inputs/index.js +283 -0
- package/admin/src/components/Inputs/utils/VALIDATIONS_TO_OMIT.js +12 -0
- package/admin/src/components/Inputs/utils/connect.js +12 -0
- package/admin/src/components/Inputs/utils/generateOptions.js +19 -0
- package/admin/src/components/Inputs/utils/getInputType.js +44 -0
- package/admin/src/components/Inputs/utils/getStep.js +15 -0
- package/admin/src/components/Inputs/utils/index.js +6 -0
- package/admin/src/components/Inputs/utils/select.js +38 -0
- package/admin/src/components/LayoutTitle/index.js +19 -0
- package/admin/src/components/MediaPreviewList/StyledMediaPreviewList.js +171 -0
- package/admin/src/components/MediaPreviewList/index.js +110 -0
- package/admin/src/components/NonRepeatableComponent/index.js +73 -0
- package/admin/src/components/NonRepeatableWrapper/index.js +73 -0
- package/admin/src/components/PlusButton/index.js +52 -0
- package/admin/src/components/PopupForm/index.js +93 -0
- package/admin/src/components/PreviewCarret/components.js +27 -0
- package/admin/src/components/PreviewCarret/index.js +22 -0
- package/admin/src/components/PreviewWysiwyg/Wrapper.js +133 -0
- package/admin/src/components/PreviewWysiwyg/index.js +34 -0
- package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.js +72 -0
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +16 -0
- package/admin/src/components/RelationPreviewList/CountWrapper.js +7 -0
- package/admin/src/components/RelationPreviewList/RelationPreviewTooltip.js +117 -0
- package/admin/src/components/RelationPreviewList/index.js +111 -0
- package/admin/src/components/RepeatableComponent/AddFieldButton.js +64 -0
- package/admin/src/components/RepeatableComponent/Banner.js +112 -0
- package/admin/src/components/RepeatableComponent/BannerWrapper.js +194 -0
- package/admin/src/components/RepeatableComponent/CarretTop.js +14 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/index.js +245 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/utils/connect.js +11 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/utils/index.js +2 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/utils/select.js +30 -0
- package/admin/src/components/RepeatableComponent/EmptyComponent.js +27 -0
- package/admin/src/components/RepeatableComponent/FormWrapper.js +27 -0
- package/admin/src/components/RepeatableComponent/index.js +187 -0
- package/admin/src/components/RepeatableComponent/reducer.js +73 -0
- package/admin/src/components/RepeatableComponent/utils/connect.js +11 -0
- package/admin/src/components/RepeatableComponent/utils/select.js +12 -0
- package/admin/src/components/Search/index.js +88 -0
- package/admin/src/components/SectionTitle/Title.js +11 -0
- package/admin/src/components/SectionTitle/index.js +29 -0
- package/admin/src/components/SelectMany/ListItem.js +107 -0
- package/admin/src/components/SelectMany/Relation.js +106 -0
- package/admin/src/components/SelectMany/components.js +153 -0
- package/admin/src/components/SelectMany/index.js +159 -0
- package/admin/src/components/SelectOne/SingleValue.js +58 -0
- package/admin/src/components/SelectOne/index.js +71 -0
- package/admin/src/components/SelectWrapper/ClearIndicator.js +15 -0
- package/admin/src/components/SelectWrapper/IndicatorSeparator.js +3 -0
- package/admin/src/components/SelectWrapper/Option.js +76 -0
- package/admin/src/components/SelectWrapper/components.js +14 -0
- package/admin/src/components/SelectWrapper/index.js +393 -0
- package/admin/src/components/SelectWrapper/utils/connect.js +12 -0
- package/admin/src/components/SelectWrapper/utils/index.js +3 -0
- package/admin/src/components/SelectWrapper/utils/select.js +45 -0
- package/admin/src/components/SelectWrapper/utils/styles.js +105 -0
- package/admin/src/components/Separator/index.js +9 -0
- package/admin/src/components/SettingFormWrapper/index.js +9 -0
- package/admin/src/components/SettingsViewWrapper/index.js +283 -0
- package/admin/src/components/SortWrapper/index.js +9 -0
- package/admin/src/components/SortableList/Item.js +126 -0
- package/admin/src/components/SortableList/index.js +60 -0
- package/admin/src/components/State/Wrapper.js +30 -0
- package/admin/src/components/State/index.js +26 -0
- package/admin/src/components/Truncate/index.js +5 -0
- package/admin/src/components/Truncated/index.js +10 -0
- package/admin/src/components/Wysiwyg/EditorWrapper.js +122 -0
- package/admin/src/components/Wysiwyg/MediaLib.js +71 -0
- package/admin/src/components/Wysiwyg/PreviewControlWrapper.js +30 -0
- package/admin/src/components/Wysiwyg/SelectWrapper.js +24 -0
- package/admin/src/components/Wysiwyg/ToggleModeWrapper.js +30 -0
- package/admin/src/components/Wysiwyg/constants.js +98 -0
- package/admin/src/components/Wysiwyg/customSelect.js +39 -0
- package/admin/src/components/Wysiwyg/helpers.js +116 -0
- package/admin/src/components/Wysiwyg/index.js +819 -0
- package/admin/src/components/Wysiwyg/previewControl.js +29 -0
- package/admin/src/components/Wysiwyg/toggleMode.js +44 -0
- package/admin/src/components/Wysiwyg/utils.js +70 -0
- package/admin/src/components/WysiwygBottomControls/components.js +44 -0
- package/admin/src/components/WysiwygBottomControls/index.js +33 -0
- package/admin/src/components/WysiwygDropUpload/Label.js +16 -0
- package/admin/src/components/WysiwygDropUpload/index.js +18 -0
- package/admin/src/components/WysiwygEditor/index.js +26 -0
- package/admin/src/components/WysiwygInlineControls/Button.js +77 -0
- package/admin/src/components/WysiwygInlineControls/StyledButton.js +54 -0
- package/admin/src/components/WysiwygInlineControls/Wrapper.js +25 -0
- package/admin/src/components/WysiwygInlineControls/index.js +66 -0
- package/admin/src/components/WysiwygWithErrors/Wrapper.js +38 -0
- package/admin/src/components/WysiwygWithErrors/index.js +158 -0
- package/admin/src/containers/CollectionTypeFormWrapper/index.js +376 -0
- package/admin/src/containers/CollectionTypeFormWrapper/utils/getRequestUrl.js +5 -0
- package/admin/src/containers/CollectionTypeFormWrapper/utils/index.js +2 -0
- package/admin/src/containers/CollectionTypeRecursivePath/index.js +125 -0
- package/admin/src/containers/ComponentSetttingsView/index.js +55 -0
- package/admin/src/containers/EditSettingsView/index.js +408 -0
- package/admin/src/containers/EditSettingsView/init.js +18 -0
- package/admin/src/containers/EditSettingsView/reducer.js +126 -0
- package/admin/src/containers/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +26 -0
- package/admin/src/containers/EditSettingsView/utils/getInputProps.js +30 -0
- package/admin/src/containers/EditSettingsView/utils/index.js +2 -0
- package/admin/src/containers/EditSettingsView/utils/layout.js +98 -0
- package/admin/src/containers/EditView/DeleteLink/index.js +94 -0
- package/admin/src/containers/EditView/DeleteLink/utils/connect.js +12 -0
- package/admin/src/containers/EditView/DeleteLink/utils/index.js +2 -0
- package/admin/src/containers/EditView/DeleteLink/utils/select.js +21 -0
- package/admin/src/containers/EditView/Header/index.js +258 -0
- package/admin/src/containers/EditView/Header/utils/connect.js +12 -0
- package/admin/src/containers/EditView/Header/utils/getDraftRelations.js +62 -0
- package/admin/src/containers/EditView/Header/utils/index.js +3 -0
- package/admin/src/containers/EditView/Header/utils/select.js +31 -0
- package/admin/src/containers/EditView/InformationCard.js +100 -0
- package/admin/src/containers/EditView/components.js +74 -0
- package/admin/src/containers/EditView/index.js +297 -0
- package/admin/src/containers/EditView/utils/createAttributesLayout.js +39 -0
- package/admin/src/containers/EditView/utils/getFieldsActionMatchingPermissions.js +23 -0
- package/admin/src/containers/EditView/utils/index.js +3 -0
- package/admin/src/containers/EditViewDataManagerProvider/index.js +519 -0
- package/admin/src/containers/EditViewDataManagerProvider/reducer.js +218 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/cleanData.js +88 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/getYupInnerErrors.js +17 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/index.js +3 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/schema.js +368 -0
- package/admin/src/containers/EditViewLayoutManager/Permissions.js +30 -0
- package/admin/src/containers/EditViewLayoutManager/actions.js +9 -0
- package/admin/src/containers/EditViewLayoutManager/constants.js +2 -0
- package/admin/src/containers/EditViewLayoutManager/index.js +44 -0
- package/admin/src/containers/EditViewLayoutManager/reducer.js +30 -0
- package/admin/src/containers/EditViewLayoutManager/selectors.js +5 -0
- package/admin/src/containers/LayoutDndProvider/index.js +75 -0
- package/admin/src/containers/ListSettingsView/DragWrapper.js +21 -0
- package/admin/src/containers/ListSettingsView/DropdownButton.js +8 -0
- package/admin/src/containers/ListSettingsView/Label.js +91 -0
- package/admin/src/containers/ListSettingsView/MenuDropdown.js +41 -0
- package/admin/src/containers/ListSettingsView/Toggle.js +51 -0
- package/admin/src/containers/ListSettingsView/forms.json +64 -0
- package/admin/src/containers/ListSettingsView/index.js +298 -0
- package/admin/src/containers/ListSettingsView/init.js +11 -0
- package/admin/src/containers/ListSettingsView/reducer.js +77 -0
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/StyledLink.js +28 -0
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/Wrapper.js +8 -0
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/index.js +29 -0
- package/admin/src/containers/ListView/FieldPicker/Field/Wrapper.js +15 -0
- package/admin/src/containers/ListView/FieldPicker/Field/index.js +24 -0
- package/admin/src/containers/ListView/FieldPicker/Fields/Wrapper.js +18 -0
- package/admin/src/containers/ListView/FieldPicker/Fields/index.js +27 -0
- package/admin/src/containers/ListView/FieldPicker/Header/Reset.js +8 -0
- package/admin/src/containers/ListView/FieldPicker/Header/index.js +42 -0
- package/admin/src/containers/ListView/FieldPicker/Wrapper.js +9 -0
- package/admin/src/containers/ListView/FieldPicker/index.js +46 -0
- package/admin/src/containers/ListView/Filter.js +83 -0
- package/admin/src/containers/ListView/Footer.js +60 -0
- package/admin/src/containers/ListView/actions.js +91 -0
- package/admin/src/containers/ListView/components.js +138 -0
- package/admin/src/containers/ListView/constants.js +16 -0
- package/admin/src/containers/ListView/index.js +573 -0
- package/admin/src/containers/ListView/reducer.js +182 -0
- package/admin/src/containers/ListView/selectors.js +24 -0
- package/admin/src/containers/ListView/utils/buildQueryString.js +26 -0
- package/admin/src/containers/ListView/utils/createPluginsFilter.js +13 -0
- package/admin/src/containers/ListView/utils/getAllAllowedHeaders.js +17 -0
- package/admin/src/containers/ListView/utils/getFirstSortableHeader.js +14 -0
- package/admin/src/containers/ListView/utils/index.js +3 -0
- package/admin/src/containers/ListViewLayoutManager/Permissions.js +29 -0
- package/admin/src/containers/ListViewLayoutManager/index.js +60 -0
- package/admin/src/containers/ListViewProvider/index.js +16 -0
- package/admin/src/containers/Main/actions.js +13 -0
- package/admin/src/containers/Main/constants.js +3 -0
- package/admin/src/containers/Main/index.js +100 -0
- package/admin/src/containers/Main/reducer.js +37 -0
- package/admin/src/containers/Main/selectors.js +20 -0
- package/admin/src/containers/RBACManager/actions.js +14 -0
- package/admin/src/containers/RBACManager/constants.js +2 -0
- package/admin/src/containers/RBACManager/reducer.js +32 -0
- package/admin/src/containers/RBACManager/useSyncRbac.js +28 -0
- package/admin/src/containers/SingleTypeFormWrapper/index.js +317 -0
- package/admin/src/containers/SingleTypeFormWrapper/utils/getRequestUrl.js +5 -0
- package/admin/src/containers/SingleTypeFormWrapper/utils/index.js +2 -0
- package/admin/src/containers/SingleTypeRecursivePath/index.js +84 -0
- package/admin/src/containers/WysiwygProvider/index.js +16 -0
- package/admin/src/contexts/ContentTypeLayout.js +5 -0
- package/admin/src/contexts/LayoutDnd.js +5 -0
- package/admin/src/contexts/ListView.js +5 -0
- package/admin/src/contexts/Wysiwyg.js +5 -0
- package/admin/src/contexts/index.js +4 -0
- package/admin/src/hooks/index.js +6 -0
- package/admin/src/hooks/useContentTypeLayout/index.js +19 -0
- package/admin/src/hooks/useFetchContentTypeLayout/index.js +83 -0
- package/admin/src/hooks/useFetchContentTypeLayout/reducer.js +56 -0
- package/admin/src/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +235 -0
- package/admin/src/hooks/useFindRedirectionLink/index.js +14 -0
- package/admin/src/hooks/useFindRedirectionLink/selectors.js +7 -0
- package/admin/src/hooks/useFindRedirectionLink/utils/getRedirectionLink.js +45 -0
- package/admin/src/hooks/useLayoutDnd.js +6 -0
- package/admin/src/hooks/useListView.js +6 -0
- package/admin/src/hooks/useWysiwyg.js +6 -0
- package/admin/src/icons/Bold/index.js +22 -0
- package/admin/src/icons/Code/index.js +13 -0
- package/admin/src/icons/Cross/index.js +33 -0
- package/admin/src/icons/Italic/index.js +23 -0
- package/admin/src/icons/Link/index.js +21 -0
- package/admin/src/icons/Media/index.js +14 -0
- package/admin/src/icons/Na/index.js +58 -0
- package/admin/src/icons/Ol/index.js +13 -0
- package/admin/src/icons/Quote/index.js +13 -0
- package/admin/src/icons/Striked/index.js +24 -0
- package/admin/src/icons/Ul/index.js +15 -0
- package/admin/src/icons/Underline/index.js +22 -0
- package/admin/src/index.js +52 -0
- package/admin/src/lifecycles.js +19 -0
- package/admin/src/permissions.js +27 -0
- package/admin/src/pluginId.js +5 -0
- package/admin/src/reducers.js +16 -0
- package/admin/src/selectors.js +6 -0
- package/admin/src/sharedReducers/crudReducer/actions.js +44 -0
- package/admin/src/sharedReducers/crudReducer/constants.js +7 -0
- package/admin/src/sharedReducers/crudReducer/reducer.js +75 -0
- package/admin/src/sharedReducers/crudReducer/selectors.js +5 -0
- package/admin/src/testUtils/data.js +305 -0
- package/admin/src/testUtils/index.js +4 -0
- package/admin/src/translations/ar.json +94 -0
- package/admin/src/translations/cs.json +130 -0
- package/admin/src/translations/de.json +177 -0
- package/admin/src/translations/dk.json +180 -0
- package/admin/src/translations/en.json +177 -0
- package/admin/src/translations/es.json +177 -0
- package/admin/src/translations/fr.json +162 -0
- package/admin/src/translations/id.json +175 -0
- package/admin/src/translations/index.js +53 -0
- package/admin/src/translations/it.json +177 -0
- package/admin/src/translations/ja.json +94 -0
- package/admin/src/translations/ko.json +110 -0
- package/admin/src/translations/ms.json +148 -0
- package/admin/src/translations/nl.json +94 -0
- package/admin/src/translations/pl.json +142 -0
- package/admin/src/translations/pt-BR.json +94 -0
- package/admin/src/translations/pt.json +94 -0
- package/admin/src/translations/ru.json +177 -0
- package/admin/src/translations/sk.json +172 -0
- package/admin/src/translations/th.json +155 -0
- package/admin/src/translations/tr.json +177 -0
- package/admin/src/translations/uk.json +148 -0
- package/admin/src/translations/vi.json +110 -0
- package/admin/src/translations/zh-Hans.json +177 -0
- package/admin/src/translations/zh.json +94 -0
- package/admin/src/utils/ItemTypes.js +7 -0
- package/admin/src/utils/checkIfAttributeIsDisplayable.js +13 -0
- package/admin/src/utils/createDefaultForm.js +50 -0
- package/admin/src/utils/dateFormats.js +18 -0
- package/admin/src/utils/formatFiltersFromQuery.js +55 -0
- package/admin/src/utils/formatFiltersToQuery.js +27 -0
- package/admin/src/utils/formatLayoutToApi.js +44 -0
- package/admin/src/utils/generatePermissionsObject.js +20 -0
- package/admin/src/utils/getComponents.js +50 -0
- package/admin/src/utils/getDisplayedValue.js +61 -0
- package/admin/src/utils/getFieldName.js +6 -0
- package/admin/src/utils/getMaxTempKey.js +12 -0
- package/admin/src/utils/getRequestUrl.js +5 -0
- package/admin/src/utils/getTrad.js +5 -0
- package/admin/src/utils/index.js +17 -0
- package/admin/src/utils/mergeMetasWithSchema.js +20 -0
- package/admin/src/utils/removeKeyInObject.js +45 -0
- package/admin/src/utils/removePasswordFieldsFromData.js +54 -0
- package/config/admin.json +5 -0
- package/config/functions/bootstrap.js +9 -0
- package/config/policies/has-draft-and-publish.js +19 -0
- package/config/policies/hasPermissions.js +34 -0
- package/config/policies/routing.js +27 -0
- package/config/routes.json +275 -0
- package/controllers/collection-types.js +282 -0
- package/controllers/components.js +66 -0
- package/controllers/content-types.js +112 -0
- package/controllers/relations.js +63 -0
- package/controllers/single-types.js +170 -0
- package/controllers/uid.js +41 -0
- package/controllers/validation/index.js +104 -0
- package/controllers/validation/model-configuration.js +114 -0
- package/oas.yml +757 -0
- package/package.json +77 -0
- package/services/components.js +92 -0
- package/services/configuration.js +79 -0
- package/services/content-types.js +73 -0
- package/services/data-mapper.js +98 -0
- package/services/entity-manager.js +140 -0
- package/services/metrics.js +34 -0
- package/services/permission-checker.js +69 -0
- package/services/permission.js +95 -0
- package/services/uid.js +63 -0
- package/services/utils/configuration/attributes.js +175 -0
- package/services/utils/configuration/index.js +43 -0
- package/services/utils/configuration/layouts.js +185 -0
- package/services/utils/configuration/metadatas.js +142 -0
- package/services/utils/configuration/settings.js +52 -0
- package/services/utils/store.js +93 -0
- package/utils/index.js +16 -0
- package/utils/pick-writable-attributes.js +6 -0
- package/utils/wrap-bad-request.js +15 -0
- package/validation/policies/hasPermissions.js +17 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback, useRef, useLayoutEffect } from 'react';
|
|
2
|
+
import { Text, Padded } from '@buffetjs/core';
|
|
3
|
+
import { request } from 'strapi-helper-plugin';
|
|
4
|
+
import { LoadingIndicator, Tooltip } from '@buffetjs/styles';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { getDisplayedValue, getRequestUrl } from '../../utils';
|
|
7
|
+
|
|
8
|
+
const RelationPreviewTooltip = ({
|
|
9
|
+
tooltipId,
|
|
10
|
+
rowId,
|
|
11
|
+
mainField,
|
|
12
|
+
name,
|
|
13
|
+
queryInfos: { endPoint },
|
|
14
|
+
size,
|
|
15
|
+
}) => {
|
|
16
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
17
|
+
const [relationData, setRelationData] = useState([]);
|
|
18
|
+
const tooltipRef = useRef();
|
|
19
|
+
|
|
20
|
+
const fetchRelationData = useCallback(
|
|
21
|
+
async signal => {
|
|
22
|
+
const requestURL = getRequestUrl(`${endPoint}/${rowId}/${name}`);
|
|
23
|
+
try {
|
|
24
|
+
const { results } = await request(requestURL, {
|
|
25
|
+
method: 'GET',
|
|
26
|
+
signal,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
setRelationData(results);
|
|
30
|
+
setIsLoading(false);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error({ err });
|
|
33
|
+
setIsLoading(false);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
[endPoint, name, rowId]
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const abortController = new AbortController();
|
|
41
|
+
const { signal } = abortController;
|
|
42
|
+
|
|
43
|
+
const timeout = setTimeout(() => {
|
|
44
|
+
fetchRelationData(signal);
|
|
45
|
+
}, 500);
|
|
46
|
+
|
|
47
|
+
return () => {
|
|
48
|
+
clearTimeout(timeout);
|
|
49
|
+
abortController.abort();
|
|
50
|
+
};
|
|
51
|
+
}, [fetchRelationData]);
|
|
52
|
+
|
|
53
|
+
const getValueToDisplay = useCallback(
|
|
54
|
+
item => {
|
|
55
|
+
return getDisplayedValue(mainField.schema.type, item[mainField.name], mainField.name);
|
|
56
|
+
},
|
|
57
|
+
[mainField]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// Used to update the position after the loader
|
|
61
|
+
useLayoutEffect(() => {
|
|
62
|
+
if (!isLoading && tooltipRef.current) {
|
|
63
|
+
// A react-tooltip uncaught error is triggered when updatePosition is called in firefox.
|
|
64
|
+
// https://github.com/wwayne/react-tooltip/issues/619
|
|
65
|
+
try {
|
|
66
|
+
tooltipRef.current.updatePosition();
|
|
67
|
+
} catch (err) {
|
|
68
|
+
console.log(err);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, [isLoading]);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<Tooltip ref={tooltipRef} id={tooltipId}>
|
|
75
|
+
<div>
|
|
76
|
+
{isLoading ? (
|
|
77
|
+
<Padded left right size="sm">
|
|
78
|
+
<LoadingIndicator borderWidth="3px" size="2rem" />
|
|
79
|
+
</Padded>
|
|
80
|
+
) : (
|
|
81
|
+
<>
|
|
82
|
+
{relationData.map(item => (
|
|
83
|
+
<Padded key={item.id} top bottom size="xs">
|
|
84
|
+
<Text ellipsis color="white">
|
|
85
|
+
{getValueToDisplay(item)}
|
|
86
|
+
</Text>
|
|
87
|
+
</Padded>
|
|
88
|
+
))}
|
|
89
|
+
{size > 10 && (
|
|
90
|
+
<Padded top size="xs">
|
|
91
|
+
<Text color="white">[...]</Text>
|
|
92
|
+
</Padded>
|
|
93
|
+
)}
|
|
94
|
+
</>
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
</Tooltip>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
RelationPreviewTooltip.propTypes = {
|
|
102
|
+
tooltipId: PropTypes.string.isRequired,
|
|
103
|
+
mainField: PropTypes.exact({
|
|
104
|
+
name: PropTypes.string.isRequired,
|
|
105
|
+
schema: PropTypes.shape({
|
|
106
|
+
type: PropTypes.string.isRequired,
|
|
107
|
+
}).isRequired,
|
|
108
|
+
}).isRequired,
|
|
109
|
+
name: PropTypes.string.isRequired,
|
|
110
|
+
size: PropTypes.number.isRequired,
|
|
111
|
+
rowId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
112
|
+
queryInfos: PropTypes.shape({
|
|
113
|
+
endPoint: PropTypes.string.isRequired,
|
|
114
|
+
}).isRequired,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default RelationPreviewTooltip;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React, { memo, useState, useMemo } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Flex, Padded, Count } from '@buffetjs/core';
|
|
4
|
+
import { Tooltip } from '@buffetjs/styles';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
|
|
7
|
+
import { getTrad } from '../../utils';
|
|
8
|
+
import Truncate from '../Truncate';
|
|
9
|
+
import Truncated from '../Truncated';
|
|
10
|
+
import CountWrapper from './CountWrapper';
|
|
11
|
+
import RelationPreviewTooltip from './RelationPreviewTooltip';
|
|
12
|
+
|
|
13
|
+
const RelationPreviewList = ({
|
|
14
|
+
options: {
|
|
15
|
+
metadatas: { mainField },
|
|
16
|
+
relationType,
|
|
17
|
+
value,
|
|
18
|
+
rowId,
|
|
19
|
+
cellId,
|
|
20
|
+
name,
|
|
21
|
+
queryInfos,
|
|
22
|
+
},
|
|
23
|
+
}) => {
|
|
24
|
+
const { formatMessage } = useIntl();
|
|
25
|
+
const [tooltipIsDisplayed, setDisplayTooltip] = useState(false);
|
|
26
|
+
const isSingle = ['oneWay', 'oneToOne', 'manyToOne'].includes(relationType);
|
|
27
|
+
const tooltipId = useMemo(() => `${rowId}-${cellId}`, [rowId, cellId]);
|
|
28
|
+
const valueToDisplay = value ? value[mainField.name] : '-';
|
|
29
|
+
|
|
30
|
+
if (value === undefined) {
|
|
31
|
+
return (
|
|
32
|
+
<Truncate>
|
|
33
|
+
<Truncated>-</Truncated>
|
|
34
|
+
</Truncate>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (isSingle) {
|
|
39
|
+
return (
|
|
40
|
+
<Truncate>
|
|
41
|
+
<Truncated>
|
|
42
|
+
<span data-for={tooltipId} data-tip={valueToDisplay}>
|
|
43
|
+
{valueToDisplay}
|
|
44
|
+
</span>
|
|
45
|
+
</Truncated>
|
|
46
|
+
<Tooltip id={tooltipId} />
|
|
47
|
+
</Truncate>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const size = value ? value.count : 0;
|
|
52
|
+
|
|
53
|
+
const handleTooltipToggle = () => {
|
|
54
|
+
setDisplayTooltip(prev => !prev);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Truncate style={{ maxWidth: 'fit-content' }}>
|
|
59
|
+
<Flex
|
|
60
|
+
// This is useful to avoid the render of every tooltips of the list at the same time.
|
|
61
|
+
// https://github.com/wwayne/react-tooltip/issues/524
|
|
62
|
+
onMouseEnter={handleTooltipToggle}
|
|
63
|
+
onMouseLeave={handleTooltipToggle}
|
|
64
|
+
data-for={tooltipId}
|
|
65
|
+
data-tip={JSON.stringify(value)}
|
|
66
|
+
>
|
|
67
|
+
<CountWrapper>
|
|
68
|
+
<Count count={size} />
|
|
69
|
+
</CountWrapper>
|
|
70
|
+
<Padded left size="xs" />
|
|
71
|
+
<Truncated>
|
|
72
|
+
{formatMessage({
|
|
73
|
+
id: getTrad(
|
|
74
|
+
size > 1 ? 'containers.ListPage.items.plural' : 'containers.ListPage.items.singular'
|
|
75
|
+
),
|
|
76
|
+
})}
|
|
77
|
+
</Truncated>
|
|
78
|
+
</Flex>
|
|
79
|
+
{size > 0 && tooltipIsDisplayed && (
|
|
80
|
+
<RelationPreviewTooltip
|
|
81
|
+
name={name}
|
|
82
|
+
rowId={rowId}
|
|
83
|
+
tooltipId={tooltipId}
|
|
84
|
+
value={value}
|
|
85
|
+
mainField={mainField}
|
|
86
|
+
queryInfos={queryInfos}
|
|
87
|
+
size={size}
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
90
|
+
</Truncate>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
RelationPreviewList.propTypes = {
|
|
95
|
+
options: PropTypes.shape({
|
|
96
|
+
cellId: PropTypes.string.isRequired,
|
|
97
|
+
metadatas: PropTypes.shape({
|
|
98
|
+
mainField: PropTypes.object.isRequired,
|
|
99
|
+
}).isRequired,
|
|
100
|
+
name: PropTypes.string.isRequired,
|
|
101
|
+
relationType: PropTypes.string,
|
|
102
|
+
rowId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
103
|
+
type: PropTypes.string,
|
|
104
|
+
queryInfos: PropTypes.shape({
|
|
105
|
+
endPoint: PropTypes.string.isRequired,
|
|
106
|
+
}).isRequired,
|
|
107
|
+
value: PropTypes.any,
|
|
108
|
+
}).isRequired,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default memo(RelationPreviewList);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable indent */
|
|
4
|
+
const Button = styled.button`
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 37px;
|
|
7
|
+
margin-bottom: 25px;
|
|
8
|
+
padding: 0 0 3px 0;
|
|
9
|
+
text-align: center;
|
|
10
|
+
border: 1px solid rgba(227, 233, 243, 0.75);
|
|
11
|
+
border-top: 1px solid
|
|
12
|
+
${({ doesPreviousFieldContainErrorsAndIsClosed }) =>
|
|
13
|
+
doesPreviousFieldContainErrorsAndIsClosed ? '#FFA784' : 'rgba(227, 233, 243, 0.75)'};
|
|
14
|
+
|
|
15
|
+
border-bottom-left-radius: 2px;
|
|
16
|
+
border-bottom-right-radius: 2px;
|
|
17
|
+
${({ withBorderRadius }) => {
|
|
18
|
+
if (withBorderRadius) {
|
|
19
|
+
return css`
|
|
20
|
+
border-radius: 2px;
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return '';
|
|
25
|
+
}}
|
|
26
|
+
|
|
27
|
+
${({ hasMinError }) => {
|
|
28
|
+
if (hasMinError) {
|
|
29
|
+
return `
|
|
30
|
+
border-color: #FAA684;
|
|
31
|
+
border-top-color: rgba(227, 233, 243, 0.75);
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return '';
|
|
36
|
+
}}
|
|
37
|
+
|
|
38
|
+
color: ${({ disabled }) => (disabled ? '#9EA7B8' : ' #007eff')};
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
-webkit-font-smoothing: antialiased;
|
|
42
|
+
line-height: normal;
|
|
43
|
+
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
44
|
+
text-transform: uppercase;
|
|
45
|
+
letter-spacing: 0.5px;
|
|
46
|
+
background-color: #fff;
|
|
47
|
+
&:focus {
|
|
48
|
+
outline: 0;
|
|
49
|
+
}
|
|
50
|
+
> i,
|
|
51
|
+
svg {
|
|
52
|
+
margin-right: 10px;
|
|
53
|
+
}
|
|
54
|
+
& + p {
|
|
55
|
+
margin-bottom: 17px;
|
|
56
|
+
margin-top: -18px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
Button.defaultProps = {
|
|
61
|
+
disabled: false,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Button;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { Carret, Grab } from '@buffetjs/icons';
|
|
6
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import pluginId from '../../pluginId';
|
|
8
|
+
import PreviewCarret from '../PreviewCarret';
|
|
9
|
+
import BannerWrapper from './BannerWrapper';
|
|
10
|
+
|
|
11
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
12
|
+
|
|
13
|
+
const Banner = forwardRef(
|
|
14
|
+
(
|
|
15
|
+
{
|
|
16
|
+
displayedValue,
|
|
17
|
+
doesPreviousFieldContainErrorsAndIsOpen,
|
|
18
|
+
hasErrors,
|
|
19
|
+
hasMinError,
|
|
20
|
+
isFirst,
|
|
21
|
+
isReadOnly,
|
|
22
|
+
isDragging,
|
|
23
|
+
isOpen,
|
|
24
|
+
onClickToggle,
|
|
25
|
+
onClickRemove,
|
|
26
|
+
style,
|
|
27
|
+
},
|
|
28
|
+
refs
|
|
29
|
+
) => {
|
|
30
|
+
const display = isDragging ? 'none' : '';
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<BannerWrapper
|
|
34
|
+
doesPreviousFieldContainErrorsAndIsOpen={doesPreviousFieldContainErrorsAndIsOpen}
|
|
35
|
+
type="button"
|
|
36
|
+
hasMinError={hasMinError}
|
|
37
|
+
hasErrors={hasErrors}
|
|
38
|
+
isFirst={isFirst}
|
|
39
|
+
isOpen={isOpen}
|
|
40
|
+
isReadOnly={isReadOnly}
|
|
41
|
+
onClick={onClickToggle}
|
|
42
|
+
ref={refs ? refs.dropRef : null}
|
|
43
|
+
style={style}
|
|
44
|
+
>
|
|
45
|
+
{isDragging && <PreviewCarret isComponent />}
|
|
46
|
+
<>
|
|
47
|
+
<div className="img-wrapper" style={{ display }}>
|
|
48
|
+
<Carret />
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<FormattedMessage id={`${pluginId}.containers.Edit.pluginHeader.title.new`}>
|
|
52
|
+
{msg => {
|
|
53
|
+
// The displayed value may be "falsey" when the main field is a number or boolean
|
|
54
|
+
return <div style={{ display }}>{displayedValue ?? msg}</div>;
|
|
55
|
+
}}
|
|
56
|
+
</FormattedMessage>
|
|
57
|
+
<div className="cta-wrapper" style={{ display }}>
|
|
58
|
+
{!isReadOnly && (
|
|
59
|
+
<>
|
|
60
|
+
<div
|
|
61
|
+
className="trash-icon"
|
|
62
|
+
style={{ marginRight: 10, padding: '0 5px' }}
|
|
63
|
+
onClick={e => {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
onClickRemove();
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<FontAwesomeIcon icon="trash-alt" />
|
|
70
|
+
</div>
|
|
71
|
+
<div className="grab" ref={refs ? refs.dragRef : null}>
|
|
72
|
+
<Grab />
|
|
73
|
+
</div>
|
|
74
|
+
</>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
</>
|
|
78
|
+
</BannerWrapper>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
Banner.defaultProps = {
|
|
84
|
+
displayedValue: null,
|
|
85
|
+
doesPreviousFieldContainErrorsAndIsOpen: false,
|
|
86
|
+
hasErrors: false,
|
|
87
|
+
hasMinError: false,
|
|
88
|
+
isDragging: false,
|
|
89
|
+
isFirst: false,
|
|
90
|
+
isOpen: false,
|
|
91
|
+
onClickRemove: () => {},
|
|
92
|
+
onClickToggle: () => {},
|
|
93
|
+
style: {},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
Banner.propTypes = {
|
|
97
|
+
displayedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
|
|
98
|
+
doesPreviousFieldContainErrorsAndIsOpen: PropTypes.bool,
|
|
99
|
+
hasErrors: PropTypes.bool,
|
|
100
|
+
hasMinError: PropTypes.bool,
|
|
101
|
+
isDragging: PropTypes.bool,
|
|
102
|
+
isFirst: PropTypes.bool,
|
|
103
|
+
isOpen: PropTypes.bool,
|
|
104
|
+
isReadOnly: PropTypes.bool.isRequired,
|
|
105
|
+
onClickToggle: PropTypes.func,
|
|
106
|
+
onClickRemove: PropTypes.func,
|
|
107
|
+
style: PropTypes.object,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
Banner.displayName = 'Banner';
|
|
111
|
+
|
|
112
|
+
export default Banner;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
const BannerWrapper = styled.button`
|
|
6
|
+
display: flex;
|
|
7
|
+
height: 36px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding: 0 15px;
|
|
10
|
+
border: 1px solid
|
|
11
|
+
${({ hasErrors, isOpen, isReadOnly }) => {
|
|
12
|
+
if (hasErrors) {
|
|
13
|
+
return '#FFA784';
|
|
14
|
+
} else if (isOpen && !isReadOnly) {
|
|
15
|
+
return '#AED4FB';
|
|
16
|
+
} else {
|
|
17
|
+
return 'rgba(227, 233, 243, 0.75)';
|
|
18
|
+
}
|
|
19
|
+
}};
|
|
20
|
+
|
|
21
|
+
${({ doesPreviousFieldContainErrorsAndIsOpen }) => {
|
|
22
|
+
if (doesPreviousFieldContainErrorsAndIsOpen) {
|
|
23
|
+
return `
|
|
24
|
+
border-top: 1px solid #ffa784;
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
}}
|
|
28
|
+
|
|
29
|
+
${({ isFirst }) => {
|
|
30
|
+
if (isFirst) {
|
|
31
|
+
return `
|
|
32
|
+
border-top-right-radius: 2px;
|
|
33
|
+
border-top-left-radius: 2px;
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
}}
|
|
37
|
+
|
|
38
|
+
${({ hasMinError, isFirst }) => {
|
|
39
|
+
if (hasMinError) {
|
|
40
|
+
return `
|
|
41
|
+
border-color: #FAA684;
|
|
42
|
+
border-top-color: ${isFirst ? '#FAA684' : 'rgba(227, 233, 243, 0.75)'};
|
|
43
|
+
border-bottom-color: rgba(227, 233, 243, 0.75);
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
}}
|
|
47
|
+
|
|
48
|
+
border-bottom: 0;
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
|
|
53
|
+
background-color: ${({ hasErrors, isOpen, isReadOnly }) => {
|
|
54
|
+
if (isReadOnly) {
|
|
55
|
+
return '#fafafb';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (hasErrors && isOpen) {
|
|
59
|
+
return '#FFE9E0';
|
|
60
|
+
} else if (isOpen) {
|
|
61
|
+
return '#E6F0FB';
|
|
62
|
+
} else {
|
|
63
|
+
return '#ffffff';
|
|
64
|
+
}
|
|
65
|
+
}};
|
|
66
|
+
|
|
67
|
+
${({ hasErrors, isOpen, isReadOnly }) => {
|
|
68
|
+
if (hasErrors) {
|
|
69
|
+
return `
|
|
70
|
+
color: #f64d0a;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (isReadOnly) {
|
|
76
|
+
return `
|
|
77
|
+
color: #9EA7B8;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (isOpen) {
|
|
83
|
+
return `
|
|
84
|
+
color: #007eff;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
|
|
90
|
+
${({ isOpen }) => {
|
|
91
|
+
if (isOpen) {
|
|
92
|
+
return `
|
|
93
|
+
&.trash-icon {
|
|
94
|
+
svg {
|
|
95
|
+
path {
|
|
96
|
+
fill: #007eff;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
}}
|
|
103
|
+
|
|
104
|
+
&:focus {
|
|
105
|
+
outline: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
.img-wrapper {
|
|
110
|
+
width: 19px;
|
|
111
|
+
height: 19px;
|
|
112
|
+
margin-right: 19px;
|
|
113
|
+
border-radius: 50%;
|
|
114
|
+
background-color: ${({ hasErrors, isOpen, isReadOnly }) => {
|
|
115
|
+
if (hasErrors) {
|
|
116
|
+
return '#FAA684';
|
|
117
|
+
} else if (isOpen && !isReadOnly) {
|
|
118
|
+
return '#AED4FB';
|
|
119
|
+
} else {
|
|
120
|
+
return '#F3F4F4';
|
|
121
|
+
}
|
|
122
|
+
}};
|
|
123
|
+
text-align: center;
|
|
124
|
+
|
|
125
|
+
${({ isOpen }) => !isOpen && 'transform: rotate(180deg)'};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.cta-wrapper {
|
|
129
|
+
display: flex;
|
|
130
|
+
margin-left: auto;
|
|
131
|
+
> button {
|
|
132
|
+
padding: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.trash-icon {
|
|
136
|
+
svg {
|
|
137
|
+
font-size: 10px;
|
|
138
|
+
path {
|
|
139
|
+
fill: #4B515A;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.grab {
|
|
145
|
+
cursor: move;
|
|
146
|
+
svg {
|
|
147
|
+
vertical-align: initial;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
${({ hasErrors, isOpen, isReadOnly }) => {
|
|
153
|
+
let fill = '#ABB3C2';
|
|
154
|
+
let trashFill = '#4B515A';
|
|
155
|
+
|
|
156
|
+
if (isOpen && !isReadOnly) {
|
|
157
|
+
fill = '#007EFF';
|
|
158
|
+
trashFill = '#007EFF';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (hasErrors) {
|
|
162
|
+
fill = '#F64D0A';
|
|
163
|
+
trashFill = '#F64D0A';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return `
|
|
167
|
+
svg {
|
|
168
|
+
path {
|
|
169
|
+
fill: ${fill} !important;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
.trash-icon {
|
|
173
|
+
svg {
|
|
174
|
+
path {
|
|
175
|
+
fill: ${trashFill} !important;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
`;
|
|
180
|
+
}}
|
|
181
|
+
|
|
182
|
+
-webkit-font-smoothing: antialiased;
|
|
183
|
+
|
|
184
|
+
> div {
|
|
185
|
+
align-self: center;
|
|
186
|
+
margin-top: -2px;
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
|
|
190
|
+
BannerWrapper.defaultProps = {
|
|
191
|
+
isReadOnly: false,
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export default BannerWrapper;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const CarretTop = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg width="7" height="5" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path
|
|
7
|
+
d="M0 .469c0 .127.043.237.13.33l3.062 3.28a.407.407 0 0 0 .616 0L6.87.8A.467.467 0 0 0 7 .468a.467.467 0 0 0-.13-.33A.407.407 0 0 0 6.563 0H.438A.407.407 0 0 0 .13.14.467.467 0 0 0 0 .468z"
|
|
8
|
+
fillRule="nonzero"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default CarretTop;
|