@webiny/app-headless-cms 0.0.0-mt-1
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 +21 -0
- package/README.md +18 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +8 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.js +68 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +7 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js +43 -0
- package/admin/components/ContentEntryForm/Fields.d.ts +12 -0
- package/admin/components/ContentEntryForm/Fields.js +33 -0
- package/admin/components/ContentEntryForm/Label.d.ts +5 -0
- package/admin/components/ContentEntryForm/Label.js +20 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +8 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.js +40 -0
- package/admin/components/ContentEntryForm/functions/createValidators.d.ts +1 -0
- package/admin/components/ContentEntryForm/functions/createValidators.js +58 -0
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +5 -0
- package/admin/components/ContentEntryForm/functions/getValue.js +20 -0
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +6 -0
- package/admin/components/ContentEntryForm/functions/setValue.js +20 -0
- package/admin/components/ContentEntryForm/useBind.d.ts +10 -0
- package/admin/components/ContentEntryForm/useBind.js +76 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.d.ts +22 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.js +338 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.d.ts +2 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.js +7 -0
- package/admin/components/ContentModelEditor/Context.d.ts +23 -0
- package/admin/components/ContentModelEditor/Context.js +218 -0
- package/admin/components/ContentModelEditor/Editor.d.ts +3 -0
- package/admin/components/ContentModelEditor/Editor.js +138 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +4 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.js +91 -0
- package/admin/components/ContentModelEditor/Header.d.ts +2 -0
- package/admin/components/ContentModelEditor/Header.js +24 -0
- package/admin/components/ContentModelEditor/PreviewTab.d.ts +2 -0
- package/admin/components/ContentModelEditor/PreviewTab.js +36 -0
- package/admin/components/ContentModelEditor/icons/round-assignment-24px.svg +4 -0
- package/admin/components/ContentModelEditor/icons/round-drag_indicator-24px.svg +4 -0
- package/admin/components/ContentModelEditor/useContentModelEditor.d.ts +1 -0
- package/admin/components/ContentModelEditor/useContentModelEditor.js +11 -0
- package/admin/components/DragPreview.d.ts +2 -0
- package/admin/components/DragPreview.js +98 -0
- package/admin/components/Draggable.d.ts +14 -0
- package/admin/components/Draggable.js +49 -0
- package/admin/components/DropZone/Center.d.ts +12 -0
- package/admin/components/DropZone/Center.js +60 -0
- package/admin/components/DropZone/Horizontal.d.ts +9 -0
- package/admin/components/DropZone/Horizontal.js +83 -0
- package/admin/components/DropZone/Vertical.d.ts +10 -0
- package/admin/components/DropZone/Vertical.js +79 -0
- package/admin/components/DropZone/index.d.ts +4 -0
- package/admin/components/DropZone/index.js +4 -0
- package/admin/components/Droppable.d.ts +23 -0
- package/admin/components/Droppable.js +45 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.d.ts +3 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +83 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js +120 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +5 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +55 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.js +121 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +6 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js +16 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +7 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js +21 -0
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +9 -0
- package/admin/components/FieldEditor/EditFieldDialog.js +231 -0
- package/admin/components/FieldEditor/Field.d.ts +3 -0
- package/admin/components/FieldEditor/Field.js +179 -0
- package/admin/components/FieldEditor/FieldEditor.d.ts +12 -0
- package/admin/components/FieldEditor/FieldEditor.js +166 -0
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +53 -0
- package/admin/components/FieldEditor/FieldEditorContext.js +330 -0
- package/admin/components/FieldEditor/Styled.d.ts +6 -0
- package/admin/components/FieldEditor/Styled.js +54 -0
- package/admin/components/FieldEditor/index.d.ts +2 -0
- package/admin/components/FieldEditor/index.js +2 -0
- package/admin/components/FieldEditor/useFieldEditor.d.ts +1 -0
- package/admin/components/FieldEditor/useFieldEditor.js +5 -0
- package/admin/components/FieldEditor/utils/deleteField.d.ts +10 -0
- package/admin/components/FieldEditor/utils/deleteField.js +34 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +6 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.js +20 -0
- package/admin/components/FieldEditor/utils/index.d.ts +4 -0
- package/admin/components/FieldEditor/utils/index.js +4 -0
- package/admin/components/FieldEditor/utils/moveField.d.ts +7 -0
- package/admin/components/FieldEditor/utils/moveField.js +51 -0
- package/admin/components/FieldEditor/utils/moveRow.d.ts +9 -0
- package/admin/components/FieldEditor/utils/moveRow.js +10 -0
- package/admin/constants/statusLabels.d.ts +8 -0
- package/admin/constants/statusLabels.js +13 -0
- package/admin/contexts/Cms/NetworkError.d.ts +2 -0
- package/admin/contexts/Cms/NetworkError.js +7 -0
- package/admin/contexts/Cms/index.d.ts +16 -0
- package/admin/contexts/Cms/index.js +43 -0
- package/admin/elements/ContentGroupMenuElement.d.ts +3 -0
- package/admin/elements/ContentGroupMenuElement.js +17 -0
- package/admin/elements/ContentModelMenuElement.d.ts +3 -0
- package/admin/elements/ContentModelMenuElement.js +17 -0
- package/admin/elements/NothingToShowElement.d.ts +15 -0
- package/admin/elements/NothingToShowElement.js +88 -0
- package/admin/graphql/contentEntries.d.ts +12 -0
- package/admin/graphql/contentEntries.js +68 -0
- package/admin/graphql/contentModels.d.ts +4 -0
- package/admin/graphql/contentModels.js +9 -0
- package/admin/graphql/createFieldsList.d.ts +2 -0
- package/admin/graphql/createFieldsList.js +21 -0
- package/admin/hooks/index.d.ts +5 -0
- package/admin/hooks/index.js +5 -0
- package/admin/hooks/useApolloClient.d.ts +2 -0
- package/admin/hooks/useApolloClient.js +10 -0
- package/admin/hooks/useCms.d.ts +3 -0
- package/admin/hooks/useCms.js +14 -0
- package/admin/hooks/useLazyQuery.d.ts +2 -0
- package/admin/hooks/useLazyQuery.js +16 -0
- package/admin/hooks/useMutation.d.ts +2 -0
- package/admin/hooks/useMutation.js +16 -0
- package/admin/hooks/usePermission.d.ts +27 -0
- package/admin/hooks/usePermission.js +218 -0
- package/admin/hooks/useQuery.d.ts +2 -0
- package/admin/hooks/useQuery.js +17 -0
- package/admin/icons/add.svg +5 -0
- package/admin/icons/arrow_forward-24px.svg +1 -0
- package/admin/icons/baseline-autorenew-24px.svg +4 -0
- package/admin/icons/beenhere.svg +1 -0
- package/admin/icons/call_split-24px.svg +4 -0
- package/admin/icons/close.svg +13 -0
- package/admin/icons/delete.svg +12 -0
- package/admin/icons/devices_other-black-24px.svg +1 -0
- package/admin/icons/done-24px.svg +1 -0
- package/admin/icons/edit.svg +17 -0
- package/admin/icons/emoji_people-24px.svg +1 -0
- package/admin/icons/gesture.svg +1 -0
- package/admin/icons/help_outline.svg +1 -0
- package/admin/icons/how_to_vote-24px.svg +4 -0
- package/admin/icons/info.svg +1 -0
- package/admin/icons/lock.svg +1 -0
- package/admin/icons/more_vert.svg +12 -0
- package/admin/icons/publish.svg +1 -0
- package/admin/icons/round-arrow_drop_down-24px.svg +12 -0
- package/admin/icons/round-drag_indicator-24px.svg +4 -0
- package/admin/icons/round-translate-24px.svg +4 -0
- package/admin/icons/rule-24px.svg +1 -0
- package/admin/icons/title-24px.svg +1 -0
- package/admin/icons/unpublish.svg +4 -0
- package/admin/icons/view_list.svg +1 -0
- package/admin/icons/visibility.svg +16 -0
- package/admin/plugins/apiInformation/index.d.ts +3 -0
- package/admin/plugins/apiInformation/index.js +59 -0
- package/admin/plugins/apiInformation/placeholder.manage.graphql +18 -0
- package/admin/plugins/apiInformation/placeholder.preview.graphql +15 -0
- package/admin/plugins/apiInformation/placeholder.read.graphql +16 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.d.ts +21 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +61 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.d.ts +10 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +36 -0
- package/admin/plugins/editor/defaultBar/BackButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/BackButton.js +21 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.js +46 -0
- package/admin/plugins/editor/defaultBar/Divider.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/Divider.js +11 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.d.ts +6 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js +90 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js +27 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +6 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js +42 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.d.ts +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.js +1 -0
- package/admin/plugins/editor/defaultBar/Name/Name.d.ts +7 -0
- package/admin/plugins/editor/defaultBar/Name/Name.js +80 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +5 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.js +48 -0
- package/admin/plugins/editor/defaultBar/Name/index.d.ts +1 -0
- package/admin/plugins/editor/defaultBar/Name/index.js +1 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js +63 -0
- package/admin/plugins/editor/defaultBar/icons/more_vert.svg +12 -0
- package/admin/plugins/editor/defaultBar/icons/round-arrow_back-24px.svg +13 -0
- package/admin/plugins/editor/defaultBar/icons/round-arrow_drop_down-24px.svg +12 -0
- package/admin/plugins/editor/defaultBar/icons/settings.svg +25 -0
- package/admin/plugins/editor/defaultBar/index.d.ts +7 -0
- package/admin/plugins/editor/defaultBar/index.js +44 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.d.ts +7 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js +37 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.d.ts +3 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.js +30 -0
- package/admin/plugins/editor/formSettings/icons/round-settings-24px.svg +1 -0
- package/admin/plugins/editor/formSettings/index.d.ts +3 -0
- package/admin/plugins/editor/formSettings/index.js +14 -0
- package/admin/plugins/fieldRenderers/Accordion.d.ts +10 -0
- package/admin/plugins/fieldRenderers/Accordion.js +125 -0
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +14 -0
- package/admin/plugins/fieldRenderers/DynamicSection.js +103 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.d.ts +3 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js +34 -0
- package/admin/plugins/fieldRenderers/boolean/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/boolean/index.js +2 -0
- package/admin/plugins/fieldRenderers/checkboxes.d.ts +3 -0
- package/admin/plugins/fieldRenderers/checkboxes.js +45 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +9 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +148 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +8 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +115 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +16 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.js +26 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.js +13 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.js +13 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +59 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js +84 -0
- package/admin/plugins/fieldRenderers/dateTime/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/dateTime/index.js +3 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +15 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.js +153 -0
- package/admin/plugins/fieldRenderers/file/File.d.ts +15 -0
- package/admin/plugins/fieldRenderers/file/File.js +79 -0
- package/admin/plugins/fieldRenderers/file/fileField.d.ts +3 -0
- package/admin/plugins/fieldRenderers/file/fileField.js +64 -0
- package/admin/plugins/fieldRenderers/file/fileFields.d.ts +3 -0
- package/admin/plugins/fieldRenderers/file/fileFields.js +125 -0
- package/admin/plugins/fieldRenderers/file/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/file/index.js +3 -0
- package/admin/plugins/fieldRenderers/file/utils.d.ts +7 -0
- package/admin/plugins/fieldRenderers/file/utils.js +51 -0
- package/admin/plugins/fieldRenderers/longText/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/longText/index.js +3 -0
- package/admin/plugins/fieldRenderers/longText/longText.d.ts +3 -0
- package/admin/plugins/fieldRenderers/longText/longText.js +36 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.d.ts +3 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.js +43 -0
- package/admin/plugins/fieldRenderers/number/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/number/index.js +3 -0
- package/admin/plugins/fieldRenderers/number/numberInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/number/numberInput.js +39 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.js +50 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.d.ts +4 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.js +5 -0
- package/admin/plugins/fieldRenderers/object/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/object/index.js +3 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.js +72 -0
- package/admin/plugins/fieldRenderers/object/singleObject.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/singleObject.js +45 -0
- package/admin/plugins/fieldRenderers/radioButtons.d.ts +3 -0
- package/admin/plugins/fieldRenderers/radioButtons.js +45 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +54 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js +65 -0
- package/admin/plugins/fieldRenderers/ref/components/getOptions.d.ts +1 -0
- package/admin/plugins/fieldRenderers/ref/components/getOptions.js +21 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +4 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +10 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +2 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js +14 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +22 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.js +240 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +19 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +180 -0
- package/admin/plugins/fieldRenderers/ref/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/ref/index.js +3 -0
- package/admin/plugins/fieldRenderers/ref/refInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/refInput.js +30 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.js +37 -0
- package/admin/plugins/fieldRenderers/richText/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/richText/index.js +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +50 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +79 -0
- package/admin/plugins/fieldRenderers/select.d.ts +3 -0
- package/admin/plugins/fieldRenderers/select.js +34 -0
- package/admin/plugins/fieldRenderers/text/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/text/index.js +3 -0
- package/admin/plugins/fieldRenderers/text/textInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/text/textInput.js +35 -0
- package/admin/plugins/fieldRenderers/text/textInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/text/textInputs.js +46 -0
- package/admin/plugins/fieldValidators/date/availableValidators.d.ts +1 -0
- package/admin/plugins/fieldValidators/date/availableValidators.js +11 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +3 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.js +33 -0
- package/admin/plugins/fieldValidators/dateGte.d.ts +3 -0
- package/admin/plugins/fieldValidators/dateGte.js +40 -0
- package/admin/plugins/fieldValidators/dateLte.d.ts +3 -0
- package/admin/plugins/fieldValidators/dateLte.js +40 -0
- package/admin/plugins/fieldValidators/gte.d.ts +3 -0
- package/admin/plugins/fieldValidators/gte.js +27 -0
- package/admin/plugins/fieldValidators/in.d.ts +3 -0
- package/admin/plugins/fieldValidators/in.js +26 -0
- package/admin/plugins/fieldValidators/lte.d.ts +3 -0
- package/admin/plugins/fieldValidators/lte.js +27 -0
- package/admin/plugins/fieldValidators/maxLength.d.ts +3 -0
- package/admin/plugins/fieldValidators/maxLength.js +27 -0
- package/admin/plugins/fieldValidators/minLength.d.ts +3 -0
- package/admin/plugins/fieldValidators/minLength.js +27 -0
- package/admin/plugins/fieldValidators/pattern.d.ts +3 -0
- package/admin/plugins/fieldValidators/pattern.js +74 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.js +9 -0
- package/admin/plugins/fieldValidators/required.d.ts +3 -0
- package/admin/plugins/fieldValidators/required.js +10 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +6 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js +108 -0
- package/admin/plugins/fields/boolean.d.ts +3 -0
- package/admin/plugins/fields/boolean.js +31 -0
- package/admin/plugins/fields/dateTime.d.ts +3 -0
- package/admin/plugins/fields/dateTime.js +77 -0
- package/admin/plugins/fields/file.d.ts +3 -0
- package/admin/plugins/fields/file.js +46 -0
- package/admin/plugins/fields/icons/ballot_black_24dp.svg +1 -0
- package/admin/plugins/fields/icons/dropdown-icon.svg +16 -0
- package/admin/plugins/fields/icons/notes-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/round-check_box-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-link-24px.svg +1 -0
- package/admin/plugins/fields/icons/round-looks_3-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-notes.svg +1 -0
- package/admin/plugins/fields/icons/round-radio_button_checked-24px.svg +5 -0
- package/admin/plugins/fields/icons/round-short_text.svg +1 -0
- package/admin/plugins/fields/icons/round-subject.svg +1 -0
- package/admin/plugins/fields/icons/round-text_fields-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-visibility_off-24px.svg +4 -0
- package/admin/plugins/fields/icons/round_insert_drive_file-24px.svg +1 -0
- package/admin/plugins/fields/icons/schedule-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/title-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/toggle_on-black-24px.svg +1 -0
- package/admin/plugins/fields/longText.d.ts +3 -0
- package/admin/plugins/fields/longText.js +46 -0
- package/admin/plugins/fields/number.d.ts +3 -0
- package/admin/plugins/fields/number.js +63 -0
- package/admin/plugins/fields/object/ObjectFields.d.ts +4 -0
- package/admin/plugins/fields/object/ObjectFields.js +32 -0
- package/admin/plugins/fields/object.d.ts +3 -0
- package/admin/plugins/fields/object.js +46 -0
- package/admin/plugins/fields/ref.d.ts +3 -0
- package/admin/plugins/fields/ref.js +144 -0
- package/admin/plugins/fields/richText.d.ts +3 -0
- package/admin/plugins/fields/richText.js +45 -0
- package/admin/plugins/fields/text.d.ts +3 -0
- package/admin/plugins/fields/text.js +51 -0
- package/admin/plugins/getObjectId.d.ts +3 -0
- package/admin/plugins/getObjectId.js +13 -0
- package/admin/plugins/icons.d.ts +3 -0
- package/admin/plugins/icons.js +40 -0
- package/admin/plugins/index.d.ts +13 -0
- package/admin/plugins/index.js +14 -0
- package/admin/plugins/install.d.ts +3 -0
- package/admin/plugins/install.js +127 -0
- package/admin/plugins/menus/CmsMenuLoader.d.ts +7 -0
- package/admin/plugins/menus/CmsMenuLoader.js +76 -0
- package/admin/plugins/menus/ContentGroupsMenuItems.d.ts +6 -0
- package/admin/plugins/menus/ContentGroupsMenuItems.js +154 -0
- package/admin/plugins/menus/GlobalSearchPlugins.d.ts +8 -0
- package/admin/plugins/menus/GlobalSearchPlugins.js +53 -0
- package/admin/plugins/menus.d.ts +4 -0
- package/admin/plugins/menus.js +19 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +5 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.js +340 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +8 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js +117 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +9 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js +77 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +7 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.js +53 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +10 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +104 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.d.ts +5 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js +28 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +34 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js +66 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +2 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.js +10 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.d.ts +1 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.js +79 -0
- package/admin/plugins/permissionRenderer/index.d.ts +3 -0
- package/admin/plugins/permissionRenderer/index.js +16 -0
- package/admin/plugins/routes.d.ts +3 -0
- package/admin/plugins/routes.js +88 -0
- package/admin/plugins/transformers/dateTransformer.d.ts +3 -0
- package/admin/plugins/transformers/dateTransformer.js +44 -0
- package/admin/plugins/transformers/index.d.ts +3 -0
- package/admin/plugins/transformers/index.js +5 -0
- package/admin/plugins/transformers/numberTransformer.d.ts +3 -0
- package/admin/plugins/transformers/numberTransformer.js +14 -0
- package/admin/plugins/upgrades/v5.0.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.0.0.js +85 -0
- package/admin/plugins/upgrades/v5.5.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.5.0.js +85 -0
- package/admin/plugins/upgrades/v5.8.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.8.0.js +85 -0
- package/admin/plugins/validators/dateGte.d.ts +3 -0
- package/admin/plugins/validators/dateGte.js +23 -0
- package/admin/plugins/validators/dateLte.d.ts +3 -0
- package/admin/plugins/validators/dateLte.js +23 -0
- package/admin/plugins/validators/gte.d.ts +3 -0
- package/admin/plugins/validators/gte.js +15 -0
- package/admin/plugins/validators/in.d.ts +3 -0
- package/admin/plugins/validators/in.js +15 -0
- package/admin/plugins/validators/lte.d.ts +3 -0
- package/admin/plugins/validators/lte.js +15 -0
- package/admin/plugins/validators/maxLength.d.ts +3 -0
- package/admin/plugins/validators/maxLength.js +15 -0
- package/admin/plugins/validators/minLength.d.ts +3 -0
- package/admin/plugins/validators/minLength.js +15 -0
- package/admin/plugins/validators/pattern.d.ts +9 -0
- package/admin/plugins/validators/pattern.js +34 -0
- package/admin/plugins/validators/patternPlugins/email.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/email.js +9 -0
- package/admin/plugins/validators/patternPlugins/lowerCase.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/lowerCase.js +9 -0
- package/admin/plugins/validators/patternPlugins/upperCase.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/upperCase.js +9 -0
- package/admin/plugins/validators/patternPlugins/url.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/url.js +9 -0
- package/admin/plugins/validators/required.d.ts +3 -0
- package/admin/plugins/validators/required.js +11 -0
- package/admin/plugins/validators/timeGte.d.ts +3 -0
- package/admin/plugins/validators/timeGte.js +19 -0
- package/admin/plugins/validators/timeLte.d.ts +3 -0
- package/admin/plugins/validators/timeLte.js +19 -0
- package/admin/plugins/welcomeScreenWidget.d.ts +3 -0
- package/admin/plugins/welcomeScreenWidget.js +29 -0
- package/admin/views/contentEntries/ContentEntries.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntries.js +73 -0
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +24 -0
- package/admin/views/contentEntries/ContentEntriesContext.js +78 -0
- package/admin/views/contentEntries/ContentEntriesList.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntriesList.js +180 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +28 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +113 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +7 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +152 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.js +59 -0
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +7 -0
- package/admin/views/contentEntries/ContentEntry/cache.js +183 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.js +32 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js +141 -0
- package/admin/views/contentEntries/ContentEntry/header/index.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/index.js +45 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.js +67 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/rule-24px.svg +1 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.js +69 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/emoji_people-24px.svg +1 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js +75 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js +84 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.js +32 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.d.ts +2 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.js +79 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +13 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.js +335 -0
- package/admin/views/contentEntries/ContentEntry.d.ts +12 -0
- package/admin/views/contentEntries/ContentEntry.js +99 -0
- package/admin/views/contentEntries/hooks/useContentEntries.d.ts +1 -0
- package/admin/views/contentEntries/hooks/useContentEntries.js +5 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +21 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +152 -0
- package/admin/views/contentEntries/hooks/useContentEntry.d.ts +1 -0
- package/admin/views/contentEntries/hooks/useContentEntry.js +5 -0
- package/admin/views/contentModelGroups/ContentModelGroups.d.ts +3 -0
- package/admin/views/contentModelGroups/ContentModelGroups.js +35 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.d.ts +6 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +242 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.d.ts +6 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +231 -0
- package/admin/views/contentModelGroups/DelayedOnChange.d.ts +25 -0
- package/admin/views/contentModelGroups/DelayedOnChange.js +134 -0
- package/admin/views/contentModelGroups/IconPicker.d.ts +7 -0
- package/admin/views/contentModelGroups/IconPicker.js +204 -0
- package/admin/views/contentModelGroups/graphql.d.ts +5 -0
- package/admin/views/contentModelGroups/graphql.js +11 -0
- package/admin/views/contentModels/ContentModelEditor.d.ts +2 -0
- package/admin/views/contentModels/ContentModelEditor.js +35 -0
- package/admin/views/contentModels/ContentModels.d.ts +3 -0
- package/admin/views/contentModels/ContentModels.js +82 -0
- package/admin/views/contentModels/ContentModelsDataList.d.ts +7 -0
- package/admin/views/contentModels/ContentModelsDataList.js +281 -0
- package/admin/views/contentModels/NewContentModelDialog.d.ts +8 -0
- package/admin/views/contentModels/NewContentModelDialog.js +196 -0
- package/admin/views/contentModels/cache.d.ts +5 -0
- package/admin/views/contentModels/cache.js +68 -0
- package/admin/views/utils.d.ts +2 -0
- package/admin/views/utils.js +27 -0
- package/admin/viewsGraphql.d.ts +4 -0
- package/admin/viewsGraphql.js +12 -0
- package/package.json +109 -0
- package/types.d.ts +484 -0
- package/types.js +1 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import React, { useState, useEffect } from "react";
|
|
4
|
+
import Input from "./Input";
|
|
5
|
+
import Select from "./Select";
|
|
6
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
7
|
+
import { UTC_TIMEZONES, DEFAULT_TIME, DEFAULT_DATE, DEFAULT_TIMEZONE, RemoveFieldButton } from "./utils";
|
|
8
|
+
|
|
9
|
+
var parseDateTime = function parseDateTime(value) {
|
|
10
|
+
if (!value || typeof value !== "string") {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var _value$split = value.split("T"),
|
|
15
|
+
_value$split2 = _slicedToArray(_value$split, 2),
|
|
16
|
+
formattedDate = _value$split2[0],
|
|
17
|
+
rest = _value$split2[1];
|
|
18
|
+
|
|
19
|
+
if (!formattedDate || !rest) {
|
|
20
|
+
throw new Error("Could not extract date and time from \"".concat(value, "\"."));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
formattedDate: formattedDate,
|
|
25
|
+
rest: rest
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var parseTime = function parseTime(value) {
|
|
30
|
+
if (!value) {
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var sign = value.includes("+") ? "+" : "-";
|
|
35
|
+
|
|
36
|
+
var _value$split3 = value.split(sign),
|
|
37
|
+
_value$split4 = _slicedToArray(_value$split3, 2),
|
|
38
|
+
fullTime = _value$split4[0],
|
|
39
|
+
zone = _value$split4[1];
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
formattedTime: fullTime,
|
|
43
|
+
formattedTimezone: sign + zone
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
48
|
+
var bind = _ref.bind,
|
|
49
|
+
trailingIcon = _ref.trailingIcon,
|
|
50
|
+
field = _ref.field;
|
|
51
|
+
|
|
52
|
+
// "2020-05-18T09:00+10:00"
|
|
53
|
+
var _parseDateTime = parseDateTime(bind.value),
|
|
54
|
+
formattedDate = _parseDateTime.formattedDate,
|
|
55
|
+
rest = _parseDateTime.rest;
|
|
56
|
+
|
|
57
|
+
var _parseTime = parseTime(rest),
|
|
58
|
+
formattedTime = _parseTime.formattedTime,
|
|
59
|
+
formattedTimezone = _parseTime.formattedTimezone;
|
|
60
|
+
|
|
61
|
+
var _useState = useState({
|
|
62
|
+
date: formattedDate || DEFAULT_DATE,
|
|
63
|
+
time: formattedTime || DEFAULT_TIME,
|
|
64
|
+
timezone: formattedTimezone || DEFAULT_TIMEZONE
|
|
65
|
+
}),
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
state = _useState2[0],
|
|
68
|
+
setState = _useState2[1];
|
|
69
|
+
|
|
70
|
+
var date = state.date,
|
|
71
|
+
time = state.time,
|
|
72
|
+
timezone = state.timezone;
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
if (!formattedDate || !formattedTime || !formattedTimezone) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
setState(function () {
|
|
79
|
+
return {
|
|
80
|
+
date: formattedDate,
|
|
81
|
+
time: formattedTime,
|
|
82
|
+
timezone: formattedTimezone
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
}, [formattedDate, formattedTime, formattedTimezone]);
|
|
86
|
+
var cellSize = trailingIcon ? 3 : 4;
|
|
87
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
88
|
+
span: 4
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
90
|
+
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
91
|
+
value: date,
|
|
92
|
+
onChange: function onChange(value) {
|
|
93
|
+
setState(function (prev) {
|
|
94
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
95
|
+
date: value
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
return bind.onChange("".concat(value, "T").concat(time).concat(timezone));
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
field: _objectSpread(_objectSpread({}, field), {}, {
|
|
102
|
+
label: "".concat(field.label, " date")
|
|
103
|
+
}),
|
|
104
|
+
type: "date"
|
|
105
|
+
})), /*#__PURE__*/React.createElement(Cell, {
|
|
106
|
+
span: 4
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
108
|
+
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
109
|
+
value: time,
|
|
110
|
+
onChange: function onChange(value) {
|
|
111
|
+
setState(function (prev) {
|
|
112
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
113
|
+
time: value
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
return bind.onChange("".concat(date, "T").concat(value).concat(timezone));
|
|
117
|
+
}
|
|
118
|
+
}),
|
|
119
|
+
field: _objectSpread(_objectSpread({}, field), {}, {
|
|
120
|
+
label: "".concat(field.label, " time")
|
|
121
|
+
}),
|
|
122
|
+
type: "time",
|
|
123
|
+
step: 5
|
|
124
|
+
})), /*#__PURE__*/React.createElement(Cell, {
|
|
125
|
+
span: cellSize
|
|
126
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
127
|
+
label: "Timezone",
|
|
128
|
+
value: timezone,
|
|
129
|
+
onChange: function onChange(value) {
|
|
130
|
+
setState(function (prev) {
|
|
131
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
132
|
+
timezone: value
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
return bind.onChange("".concat(date, "T").concat(time).concat(value));
|
|
136
|
+
},
|
|
137
|
+
options: UTC_TIMEZONES.map(function (t) {
|
|
138
|
+
return {
|
|
139
|
+
value: t.value,
|
|
140
|
+
label: t.label
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
})), /*#__PURE__*/React.createElement(RemoveFieldButton, {
|
|
144
|
+
trailingIcon: trailingIcon
|
|
145
|
+
}));
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export default DateTimeWithTimezone;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import React, { useEffect, useState } from "react";
|
|
4
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
5
|
+
import { DEFAULT_DATE, DEFAULT_TIME, RemoveFieldButton } from "./utils";
|
|
6
|
+
import Input from "./Input";
|
|
7
|
+
|
|
8
|
+
var parseDateTime = function parseDateTime(value) {
|
|
9
|
+
if (!value) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (value.includes("T")) {
|
|
14
|
+
var _value$split$0$split = value.split(".")[0].split("T"),
|
|
15
|
+
_value$split$0$split2 = _slicedToArray(_value$split$0$split, 2),
|
|
16
|
+
_formattedDate = _value$split$0$split2[0],
|
|
17
|
+
_formattedTime = _value$split$0$split2[1];
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
formattedDate: _formattedDate,
|
|
21
|
+
formattedTime: _formattedTime
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var _value$split = value.split(" "),
|
|
26
|
+
_value$split2 = _slicedToArray(_value$split, 2),
|
|
27
|
+
formattedDate = _value$split2[0],
|
|
28
|
+
formattedTime = _value$split2[1];
|
|
29
|
+
|
|
30
|
+
if (!formattedDate || !formattedTime) {
|
|
31
|
+
throw new Error("Could not extract date and time from \"".concat(value, "\"."));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
formattedDate: formattedDate,
|
|
36
|
+
formattedTime: formattedTime
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var DateTimeWithoutTimezone = function DateTimeWithoutTimezone(_ref) {
|
|
41
|
+
var field = _ref.field,
|
|
42
|
+
bind = _ref.bind,
|
|
43
|
+
trailingIcon = _ref.trailingIcon;
|
|
44
|
+
|
|
45
|
+
// "2020-05-18 09:00:00"
|
|
46
|
+
var _parseDateTime = parseDateTime(bind.value),
|
|
47
|
+
formattedDate = _parseDateTime.formattedDate,
|
|
48
|
+
formattedTime = _parseDateTime.formattedTime;
|
|
49
|
+
|
|
50
|
+
var _useState = useState({
|
|
51
|
+
date: formattedDate || DEFAULT_DATE,
|
|
52
|
+
time: formattedTime || DEFAULT_TIME
|
|
53
|
+
}),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
state = _useState2[0],
|
|
56
|
+
setState = _useState2[1];
|
|
57
|
+
|
|
58
|
+
var date = state.date,
|
|
59
|
+
time = state.time;
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
if (!formattedDate || !formattedTime) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
setState(function () {
|
|
66
|
+
return {
|
|
67
|
+
date: formattedDate,
|
|
68
|
+
time: formattedTime
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}, [formattedDate, formattedTime]);
|
|
72
|
+
var cellSize = trailingIcon ? 5 : 6;
|
|
73
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
74
|
+
span: 6
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
76
|
+
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
77
|
+
value: date,
|
|
78
|
+
onChange: function onChange(value) {
|
|
79
|
+
setState(function (prev) {
|
|
80
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
81
|
+
date: value
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return bind.onChange("".concat(value, " ").concat(time));
|
|
85
|
+
}
|
|
86
|
+
}),
|
|
87
|
+
field: _objectSpread(_objectSpread({}, field), {}, {
|
|
88
|
+
label: "".concat(field.label, " date")
|
|
89
|
+
}),
|
|
90
|
+
type: "date"
|
|
91
|
+
})), /*#__PURE__*/React.createElement(Cell, {
|
|
92
|
+
span: cellSize
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
94
|
+
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
95
|
+
value: time,
|
|
96
|
+
onChange: function onChange(value) {
|
|
97
|
+
setState(function (prev) {
|
|
98
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
99
|
+
time: value
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
return bind.onChange("".concat(date, " ").concat(value));
|
|
103
|
+
}
|
|
104
|
+
}),
|
|
105
|
+
field: _objectSpread(_objectSpread({}, field), {}, {
|
|
106
|
+
label: "".concat(field.label, " time")
|
|
107
|
+
}),
|
|
108
|
+
type: "time",
|
|
109
|
+
step: 5
|
|
110
|
+
})), /*#__PURE__*/React.createElement(RemoveFieldButton, {
|
|
111
|
+
trailingIcon: trailingIcon
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default DateTimeWithoutTimezone;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CmsEditorField } from "../../../../types";
|
|
3
|
+
import { BindComponentRenderProp } from "@webiny/form";
|
|
4
|
+
declare type TrailingIconType = {
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
onClick: any;
|
|
7
|
+
};
|
|
8
|
+
declare type Props = {
|
|
9
|
+
step?: number;
|
|
10
|
+
type?: string;
|
|
11
|
+
bind: BindComponentRenderProp;
|
|
12
|
+
field: CmsEditorField;
|
|
13
|
+
trailingIcon?: TrailingIconType;
|
|
14
|
+
};
|
|
15
|
+
declare const Input: ({ bind, ...props }: Props) => JSX.Element;
|
|
16
|
+
export default Input;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["bind"];
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Input as UiInput } from "@webiny/ui/Input";
|
|
5
|
+
|
|
6
|
+
var Input = function Input(_ref) {
|
|
7
|
+
var bind = _ref.bind,
|
|
8
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
|
|
10
|
+
return /*#__PURE__*/React.createElement(UiInput, Object.assign({}, props, bind, {
|
|
11
|
+
onChange: function onChange(value) {
|
|
12
|
+
if (props.type === "number") {
|
|
13
|
+
value = parseFloat(value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return bind.onChange(value);
|
|
17
|
+
},
|
|
18
|
+
label: props.field.label,
|
|
19
|
+
placeholder: props.field.placeholderText,
|
|
20
|
+
description: props.field.helpText,
|
|
21
|
+
type: props.type,
|
|
22
|
+
trailingIcon: props.trailingIcon
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default Input;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Select as UiSelect } from "@webiny/ui/Select";
|
|
3
|
+
|
|
4
|
+
var Select = function Select(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement(UiSelect, props, props.options.map(function (t) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
7
|
+
key: t.value,
|
|
8
|
+
value: t.value
|
|
9
|
+
}, t.label);
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default Select;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Input from "./Input";
|
|
3
|
+
|
|
4
|
+
var Time = function Time(props) {
|
|
5
|
+
// "09:00:00"
|
|
6
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({}, props, {
|
|
7
|
+
type: "time",
|
|
8
|
+
step: 5,
|
|
9
|
+
trailingIcon: props.trailingIcon
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default Time;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import get from "lodash/get";
|
|
7
|
+
import { i18n } from "@webiny/app/i18n";
|
|
8
|
+
import DateTimeWithoutTimezone from "./DateTimeWithoutTimezone";
|
|
9
|
+
import DateTimeWithTimezone from "./DateTimeWithTimezone";
|
|
10
|
+
import Time from "./Time";
|
|
11
|
+
import Input from "./Input";
|
|
12
|
+
var t = i18n.ns("app-headless-cms/admin/fields/date-time");
|
|
13
|
+
var plugin = {
|
|
14
|
+
type: "cms-editor-field-renderer",
|
|
15
|
+
name: "cms-editor-field-renderer-date-time",
|
|
16
|
+
renderer: {
|
|
17
|
+
rendererName: "date-time-input",
|
|
18
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Date/Time Input"]))),
|
|
19
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Renders input for various formats of date and time."]))),
|
|
20
|
+
canUse: function canUse(_ref) {
|
|
21
|
+
var field = _ref.field;
|
|
22
|
+
return field.type === "datetime" && !field.multipleValues && !get(field, "predefinedValues.enabled");
|
|
23
|
+
},
|
|
24
|
+
render: function render(_ref2) {
|
|
25
|
+
var field = _ref2.field,
|
|
26
|
+
getBind = _ref2.getBind;
|
|
27
|
+
var Bind = getBind();
|
|
28
|
+
return /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
29
|
+
if (field.settings.type === "dateTimeWithoutTimezone") {
|
|
30
|
+
return /*#__PURE__*/React.createElement(DateTimeWithoutTimezone, {
|
|
31
|
+
field: field,
|
|
32
|
+
bind: bind
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (field.settings.type === "dateTimeWithTimezone") {
|
|
37
|
+
return /*#__PURE__*/React.createElement(DateTimeWithTimezone, {
|
|
38
|
+
field: field,
|
|
39
|
+
bind: bind
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (field.settings.type === "time") {
|
|
44
|
+
return /*#__PURE__*/React.createElement(Time, {
|
|
45
|
+
field: field,
|
|
46
|
+
bind: bind
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
51
|
+
bind: bind,
|
|
52
|
+
field: field,
|
|
53
|
+
type: field.settings.type
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
export default plugin;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import get from "lodash/get";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../../icons/close.svg";
|
|
10
|
+
import DynamicSection from "../DynamicSection";
|
|
11
|
+
import DateTimeWithoutTimezone from "./DateTimeWithoutTimezone";
|
|
12
|
+
import DateTimeWithTimezone from "./DateTimeWithTimezone";
|
|
13
|
+
import Time from "./Time";
|
|
14
|
+
import Input from "./Input";
|
|
15
|
+
var t = i18n.ns("app-headless-cms/admin/fields/date-time");
|
|
16
|
+
var plugin = {
|
|
17
|
+
type: "cms-editor-field-renderer",
|
|
18
|
+
name: "cms-editor-field-renderer-date-times",
|
|
19
|
+
renderer: {
|
|
20
|
+
rendererName: "date-time-inputs",
|
|
21
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Date/Time Inputs"]))),
|
|
22
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Renders inputs for various formats of dates and times."]))),
|
|
23
|
+
canUse: function canUse(_ref) {
|
|
24
|
+
var field = _ref.field;
|
|
25
|
+
return field.type === "datetime" && field.multipleValues && !get(field, "predefinedValues.enabled");
|
|
26
|
+
},
|
|
27
|
+
render: function render(props) {
|
|
28
|
+
var field = props.field;
|
|
29
|
+
return /*#__PURE__*/React.createElement(DynamicSection, props, function (_ref2) {
|
|
30
|
+
var bind = _ref2.bind,
|
|
31
|
+
index = _ref2.index;
|
|
32
|
+
var trailingIcon = index > 0 && {
|
|
33
|
+
icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
|
|
34
|
+
onClick: function onClick() {
|
|
35
|
+
return bind.field.removeValue(index);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
if (field.settings.type === "dateTimeWithoutTimezone") {
|
|
40
|
+
return /*#__PURE__*/React.createElement(DateTimeWithoutTimezone, {
|
|
41
|
+
field: field,
|
|
42
|
+
bind: bind.index,
|
|
43
|
+
trailingIcon: trailingIcon
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (field.settings.type === "dateTimeWithTimezone") {
|
|
48
|
+
return /*#__PURE__*/React.createElement(DateTimeWithTimezone, {
|
|
49
|
+
field: field,
|
|
50
|
+
bind: bind.index,
|
|
51
|
+
trailingIcon: trailingIcon
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (field.settings.type === "time") {
|
|
56
|
+
return /*#__PURE__*/React.createElement(Time, {
|
|
57
|
+
field: _objectSpread(_objectSpread({}, props.field), {}, {
|
|
58
|
+
label: props.field.label + t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([" Value {number}"])))({
|
|
59
|
+
number: index + 1
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
bind: bind.index,
|
|
63
|
+
label: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Value {number}"])))({
|
|
64
|
+
number: index + 1
|
|
65
|
+
}),
|
|
66
|
+
trailingIcon: trailingIcon
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
71
|
+
bind: bind.index,
|
|
72
|
+
field: _objectSpread(_objectSpread({}, props.field), {}, {
|
|
73
|
+
label: props.field.label + t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral([" Value {number}"])))({
|
|
74
|
+
number: index + 1
|
|
75
|
+
})
|
|
76
|
+
}),
|
|
77
|
+
type: field.settings.type,
|
|
78
|
+
trailingIcon: trailingIcon
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export default plugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const UTC_TIMEZONES: {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}[];
|
|
6
|
+
/**
|
|
7
|
+
* @returns Current date string in format `YYYY-MM-DD`
|
|
8
|
+
*/
|
|
9
|
+
export declare const getCurrentDateString: () => string;
|
|
10
|
+
export declare const DEFAULT_TIME = "00:00:00";
|
|
11
|
+
export declare const DEFAULT_DATE: string;
|
|
12
|
+
export declare const DEFAULT_TIMEZONE = "+01:00";
|
|
13
|
+
export declare const RemoveFieldButton: ({ trailingIcon }: {
|
|
14
|
+
trailingIcon: any;
|
|
15
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { css } from "emotion";
|
|
3
|
+
import { Cell } from "@webiny/ui/Grid";
|
|
4
|
+
import { IconButton } from "@webiny/ui/Button";
|
|
5
|
+
export var UTC_TIMEZONES = [{
|
|
6
|
+
value: "-12:00",
|
|
7
|
+
label: "UTC-12:00"
|
|
8
|
+
}, {
|
|
9
|
+
value: "-11:00",
|
|
10
|
+
label: "UTC-11:00"
|
|
11
|
+
}, {
|
|
12
|
+
value: "-10:00",
|
|
13
|
+
label: "UTC-10:00"
|
|
14
|
+
}, {
|
|
15
|
+
value: "-09:30",
|
|
16
|
+
label: "UTC-09:30"
|
|
17
|
+
}, {
|
|
18
|
+
value: "-09:00",
|
|
19
|
+
label: "UTC-09:00"
|
|
20
|
+
}, {
|
|
21
|
+
value: "-08:00",
|
|
22
|
+
label: "UTC-08:00"
|
|
23
|
+
}, {
|
|
24
|
+
value: "-07:00",
|
|
25
|
+
label: "UTC-07:00"
|
|
26
|
+
}, {
|
|
27
|
+
value: "-06:00",
|
|
28
|
+
label: "UTC-06:00"
|
|
29
|
+
}, {
|
|
30
|
+
value: "-05:00",
|
|
31
|
+
label: "UTC-05:00"
|
|
32
|
+
}, {
|
|
33
|
+
value: "-04:30",
|
|
34
|
+
label: "UTC-04:30"
|
|
35
|
+
}, {
|
|
36
|
+
value: "-04:00",
|
|
37
|
+
label: "UTC-04:00"
|
|
38
|
+
}, {
|
|
39
|
+
value: "-03:30",
|
|
40
|
+
label: "UTC-03:30"
|
|
41
|
+
}, {
|
|
42
|
+
value: "-03:00",
|
|
43
|
+
label: "UTC-03:00"
|
|
44
|
+
}, {
|
|
45
|
+
value: "-02:00",
|
|
46
|
+
label: "UTC-02:00"
|
|
47
|
+
}, {
|
|
48
|
+
value: "-01:00",
|
|
49
|
+
label: "UTC-01:00"
|
|
50
|
+
}, {
|
|
51
|
+
value: "+00:00",
|
|
52
|
+
label: "UTC+00:00"
|
|
53
|
+
}, {
|
|
54
|
+
value: "+01:00",
|
|
55
|
+
label: "UTC+01:00"
|
|
56
|
+
}, {
|
|
57
|
+
value: "+02:00",
|
|
58
|
+
label: "UTC+02:00"
|
|
59
|
+
}, {
|
|
60
|
+
value: "+03:00",
|
|
61
|
+
label: "UTC+03:00"
|
|
62
|
+
}, {
|
|
63
|
+
value: "+03:30",
|
|
64
|
+
label: "UTC+03:30"
|
|
65
|
+
}, {
|
|
66
|
+
value: "+04:00",
|
|
67
|
+
label: "UTC+04:00"
|
|
68
|
+
}, {
|
|
69
|
+
value: "+04:30",
|
|
70
|
+
label: "UTC+04:30"
|
|
71
|
+
}, {
|
|
72
|
+
value: "+05:30",
|
|
73
|
+
label: "UTC+05:30"
|
|
74
|
+
}, {
|
|
75
|
+
value: "+05:45",
|
|
76
|
+
label: "UTC+05:45"
|
|
77
|
+
}, {
|
|
78
|
+
value: "+06:00",
|
|
79
|
+
label: "UTC+06:00"
|
|
80
|
+
}, {
|
|
81
|
+
value: "+06:30",
|
|
82
|
+
label: "UTC+06:30"
|
|
83
|
+
}, {
|
|
84
|
+
value: "+07:00",
|
|
85
|
+
label: "UTC+07:00"
|
|
86
|
+
}, {
|
|
87
|
+
value: "+08:00",
|
|
88
|
+
label: "UTC+08:00"
|
|
89
|
+
}, {
|
|
90
|
+
value: "+08:45",
|
|
91
|
+
label: "UTC+08:45"
|
|
92
|
+
}, {
|
|
93
|
+
value: "+09:00",
|
|
94
|
+
label: "UTC+09:00"
|
|
95
|
+
}, {
|
|
96
|
+
value: "+09:30",
|
|
97
|
+
label: "UTC+09:30"
|
|
98
|
+
}, {
|
|
99
|
+
value: "+10:00",
|
|
100
|
+
label: "UTC+10:00"
|
|
101
|
+
}, {
|
|
102
|
+
value: "+10:30",
|
|
103
|
+
label: "UTC+10:30"
|
|
104
|
+
}, {
|
|
105
|
+
value: "+11:00",
|
|
106
|
+
label: "UTC+11:00"
|
|
107
|
+
}, {
|
|
108
|
+
value: "+11:30",
|
|
109
|
+
label: "UTC+11:30"
|
|
110
|
+
}, {
|
|
111
|
+
value: "+12:00",
|
|
112
|
+
label: "UTC+12:00"
|
|
113
|
+
}, {
|
|
114
|
+
value: "+12:45",
|
|
115
|
+
label: "UTC+12:45"
|
|
116
|
+
}, {
|
|
117
|
+
value: "+13:00",
|
|
118
|
+
label: "UTC+13:00"
|
|
119
|
+
}, {
|
|
120
|
+
value: "+14:00",
|
|
121
|
+
label: "UTC+14:00"
|
|
122
|
+
}];
|
|
123
|
+
/**
|
|
124
|
+
* @returns Current date string in format `YYYY-MM-DD`
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
export var getCurrentDateString = function getCurrentDateString() {
|
|
128
|
+
var today = new Date().toISOString();
|
|
129
|
+
return today.substr(0, 10);
|
|
130
|
+
};
|
|
131
|
+
export var DEFAULT_TIME = "00:00:00";
|
|
132
|
+
export var DEFAULT_DATE = getCurrentDateString();
|
|
133
|
+
export var DEFAULT_TIMEZONE = "+01:00";
|
|
134
|
+
var deleteIconStyles = /*#__PURE__*/css({
|
|
135
|
+
width: "100% !important",
|
|
136
|
+
height: "100% !important",
|
|
137
|
+
color: "var(--mdc-theme-text-secondary-on-background) !important"
|
|
138
|
+
}, "label:deleteIconStyles;");
|
|
139
|
+
export var RemoveFieldButton = function RemoveFieldButton(_ref) {
|
|
140
|
+
var trailingIcon = _ref.trailingIcon;
|
|
141
|
+
|
|
142
|
+
if (!trailingIcon) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return /*#__PURE__*/React.createElement(Cell, {
|
|
147
|
+
span: 1
|
|
148
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
149
|
+
className: deleteIconStyles,
|
|
150
|
+
onClick: trailingIcon.onClick,
|
|
151
|
+
icon: trailingIcon.icon
|
|
152
|
+
}));
|
|
153
|
+
};
|