@webiny/app-headless-cms 5.21.0 → 5.22.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/components/ContentEntryForm/useContentEntryForm.js +113 -15
- package/admin/components/ContentModelEditor/Context.js +3 -1
- package/admin/components/ContentModelEditor/Editor.d.ts +1 -1
- package/admin/components/ContentModelEditor/Editor.js +1 -1
- package/admin/components/Draggable.d.ts +3 -2
- package/admin/components/Draggable.js +5 -3
- package/admin/components/Droppable.d.ts +3 -2
- package/admin/components/Droppable.js +5 -3
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +10 -5
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +9 -5
- package/admin/components/FieldEditor/Field.js +4 -4
- package/admin/components/FieldEditor/FieldEditor.js +1 -1
- package/admin/components/FieldEditor/Styled.d.ts +2 -2
- package/admin/elements/ContentGroupMenuElement.js +2 -1
- package/admin/elements/ContentModelMenuElement.js +2 -1
- package/admin/elements/NothingToShowElement.js +1 -1
- package/admin/graphql/contentModels.d.ts +1 -1
- package/admin/graphql/contentModels.js +1 -1
- package/admin/menus/CmsMenuLoader.js +1 -1
- package/admin/plugins/editor/defaultBar/BackButton.js +1 -1
- package/admin/plugins/editor/defaultBar/CreateContentButton.js +1 -1
- package/admin/plugins/editor/defaultBar/Divider.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +3 -3
- package/admin/plugins/editor/formSettings/index.js +1 -1
- package/admin/plugins/fieldRenderers/DynamicSection.js +1 -1
- package/admin/plugins/fieldRenderers/checkboxes.js +18 -15
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.d.ts +9 -0
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.js +39 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +2 -3
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +61 -59
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +4 -4
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +52 -51
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +6 -7
- package/admin/plugins/fieldRenderers/dateTime/Input.js +2 -5
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +10 -3
- package/admin/plugins/fieldRenderers/dateTime/Select.js +2 -5
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +3 -3
- package/admin/plugins/fieldRenderers/dateTime/Time.js +33 -9
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +8 -13
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js +9 -13
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +7 -6
- package/admin/plugins/fieldRenderers/dateTime/utils.js +51 -9
- package/admin/plugins/fieldRenderers/file/fileField.js +1 -2
- package/admin/plugins/fieldRenderers/file/utils.js +1 -1
- package/admin/plugins/fieldRenderers/longText/longTexts.js +1 -1
- package/admin/plugins/fieldRenderers/number/numberInputs.js +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjects.js +1 -1
- package/admin/plugins/fieldRenderers/radioButtons.js +4 -3
- package/admin/plugins/fieldRenderers/ref/components/MissingEntryHelpText.d.ts +5 -0
- package/admin/plugins/fieldRenderers/ref/components/MissingEntryHelpText.js +30 -0
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.d.ts +9 -0
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.js +147 -0
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.d.ts +1 -0
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.js +3 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.d.ts +11 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.js +30 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.d.ts +10 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.js +28 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +1 -1
- package/admin/plugins/fieldRenderers/text/textInputs.js +1 -1
- package/admin/plugins/fieldValidators/date/createDateInputField.js +8 -13
- package/admin/plugins/fieldValidators/unique.d.ts +3 -0
- package/admin/plugins/fieldValidators/unique.js +12 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +7 -4
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js +88 -53
- package/admin/plugins/fields/boolean.js +19 -2
- package/admin/plugins/fields/dateTime.js +17 -6
- package/admin/plugins/fields/file.js +1 -1
- package/admin/plugins/fields/longText.js +1 -1
- package/admin/plugins/fields/number.js +1 -1
- package/admin/plugins/fields/object.js +1 -1
- package/admin/plugins/fields/ref.js +1 -1
- package/admin/plugins/fields/richText.js +1 -1
- package/admin/plugins/fields/text.js +2 -2
- package/admin/plugins/index.d.ts +1 -1
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
- package/admin/plugins/permissionRenderer/index.js +1 -1
- package/admin/plugins/transformers/dateTransformer.js +5 -7
- package/admin/plugins/validators/unique.d.ts +7 -0
- package/admin/plugins/validators/unique.js +38 -0
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +7 -7
- package/admin/views/contentEntries/ContentEntriesContext.js +3 -1
- package/admin/views/contentEntries/ContentEntriesList.js +2 -2
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +10 -3
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +27 -7
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +9 -9
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js +2 -2
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.js +1 -1
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.js +1 -1
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js +1 -1
- package/admin/views/contentEntries/ContentEntry.js +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +2 -2
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +1 -1
- package/admin/views/contentModels/ContentModelEditor.js +1 -1
- package/admin/views/contentModels/ContentModelsDataList.js +4 -4
- package/package.json +31 -37
- package/types.d.ts +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export declare const listStyle: string;
|
|
3
3
|
export declare const listItem: string;
|
|
4
|
-
export declare const ListItemTitle: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
4
|
+
export declare const ListItemTitle: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "slot" | "title" | "onError" | "color" | "translate" | "hidden" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, object>;
|
|
5
5
|
export declare const Title: JSX.Element;
|
|
6
|
-
export declare const TitleContent: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
6
|
+
export declare const TitleContent: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "slot" | "title" | "onError" | "color" | "translate" | "hidden" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, object>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const NameInputWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
3
|
-
export declare const NameWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
4
|
-
export declare const FormName: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
2
|
+
export declare const NameInputWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "slot" | "title" | "onError" | "color" | "translate" | "hidden" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, object>;
|
|
3
|
+
export declare const NameWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "slot" | "title" | "onError" | "color" | "translate" | "hidden" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, object>;
|
|
4
|
+
export declare const FormName: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "slot" | "title" | "onError" | "color" | "translate" | "hidden" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, object>;
|
|
5
5
|
export declare const formNameWrapper: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import GeneralSettings from "./components/GeneralSettings";
|
|
3
|
-
import { ReactComponent as SettingsIcon } from "
|
|
3
|
+
import { ReactComponent as SettingsIcon } from "./icons/round-settings-24px.svg";
|
|
4
4
|
var plugin = {
|
|
5
5
|
name: "cms-editor-form-settings-general",
|
|
6
6
|
type: "cms-editor-form-settings",
|
|
@@ -8,7 +8,7 @@ import { i18n } from "@webiny/app/i18n";
|
|
|
8
8
|
import { Cell, Grid } from "@webiny/ui/Grid";
|
|
9
9
|
import { ButtonDefault, ButtonIcon } from "@webiny/ui/Button";
|
|
10
10
|
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
11
|
-
import { ReactComponent as AddIcon } from "@
|
|
11
|
+
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
12
12
|
var t = i18n.ns("app-headless-cms/admin/fields/text");
|
|
13
13
|
var style = {
|
|
14
14
|
addButton: /*#__PURE__*/css({
|
|
@@ -23,22 +23,25 @@ var plugin = {
|
|
|
23
23
|
getBind = _ref2.getBind;
|
|
24
24
|
var Bind = getBind();
|
|
25
25
|
var options = field.predefinedValues.values;
|
|
26
|
-
return /*#__PURE__*/React.createElement(Bind, null,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/React.createElement(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
return /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(CheckboxGroup, Object.assign({}, bind, {
|
|
28
|
+
label: field.label,
|
|
29
|
+
description: field.helpText
|
|
30
|
+
}), function (_ref3) {
|
|
31
|
+
var onChange = _ref3.onChange,
|
|
32
|
+
getValue = _ref3.getValue;
|
|
33
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, options.map(function (option, index) {
|
|
34
|
+
var value = field.type === "number" ? Number(option.value) : option.value;
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
key: String(option.value) + index
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
38
|
+
label: option.label,
|
|
39
|
+
value: getValue(value),
|
|
40
|
+
onChange: onChange(value)
|
|
41
|
+
}));
|
|
39
42
|
}));
|
|
40
|
-
})
|
|
41
|
-
})
|
|
43
|
+
});
|
|
44
|
+
});
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TrailingIcon } from "./Input";
|
|
3
|
+
import { CmsEditorField } from "../../../../types";
|
|
4
|
+
export interface Props {
|
|
5
|
+
field: CmsEditorField;
|
|
6
|
+
bind: any;
|
|
7
|
+
trailingIcon?: TrailingIcon;
|
|
8
|
+
}
|
|
9
|
+
export declare const DateOnly: React.FC<Props>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import React, { useEffect } from "react";
|
|
3
|
+
import { Input } from "./Input";
|
|
4
|
+
import { getCurrentDate, getDefaultFieldValue } from "./utils";
|
|
5
|
+
export var DateOnly = function DateOnly(props) {
|
|
6
|
+
var field = props.field,
|
|
7
|
+
bind = props.bind,
|
|
8
|
+
trailingIcon = props.trailingIcon;
|
|
9
|
+
var date = getDefaultFieldValue(field, bind, function () {
|
|
10
|
+
return getCurrentDate(new Date());
|
|
11
|
+
});
|
|
12
|
+
var bindValue = bind.value || "";
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
if (!date || bindValue === date) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
bind.onChange(date);
|
|
19
|
+
}, [bindValue]);
|
|
20
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
21
|
+
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
22
|
+
value: date,
|
|
23
|
+
onChange: function onChange(value) {
|
|
24
|
+
if (!value) {
|
|
25
|
+
if (!bindValue) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return bind.onChange("");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return bind.onChange(value);
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
field: field,
|
|
36
|
+
type: field.settings.type,
|
|
37
|
+
trailingIcon: trailingIcon
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CmsEditorField } from "../../../../types";
|
|
3
|
-
interface
|
|
3
|
+
export interface Props {
|
|
4
4
|
bind: any;
|
|
5
5
|
trailingIcon?: any;
|
|
6
6
|
field: CmsEditorField;
|
|
7
7
|
}
|
|
8
|
-
declare const DateTimeWithTimezone: React.FunctionComponent<
|
|
9
|
-
export default DateTimeWithTimezone;
|
|
8
|
+
export declare const DateTimeWithTimezone: React.FunctionComponent<Props>;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import React, {
|
|
4
|
-
import Input from "./Input";
|
|
5
|
-
import Select from "./Select";
|
|
3
|
+
import React, { useEffect } from "react";
|
|
4
|
+
import { Input } from "./Input";
|
|
5
|
+
import { Select } from "./Select";
|
|
6
6
|
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
7
|
-
import { UTC_TIMEZONES,
|
|
7
|
+
import { UTC_TIMEZONES, RemoveFieldButton, getDefaultFieldValue, DEFAULT_TIMEZONE, getCurrentDate, getCurrentLocalTime, getCurrentTimeZone } from "./utils";
|
|
8
8
|
|
|
9
9
|
var parseDateTime = function parseDateTime(value) {
|
|
10
10
|
if (!value || typeof value !== "string") {
|
|
11
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
date: "",
|
|
13
|
+
rest: ""
|
|
14
|
+
};
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
var _value$split = value.split("T"),
|
|
@@ -21,14 +24,17 @@ var parseDateTime = function parseDateTime(value) {
|
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
return {
|
|
24
|
-
|
|
27
|
+
date: formattedDate,
|
|
25
28
|
rest: rest
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
var parseTime = function parseTime(value) {
|
|
30
33
|
if (!value) {
|
|
31
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
time: "",
|
|
36
|
+
timezone: ""
|
|
37
|
+
};
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
var sign = value.includes("+") ? "+" : "-";
|
|
@@ -39,50 +45,39 @@ var parseTime = function parseTime(value) {
|
|
|
39
45
|
zone = _value$split4[1];
|
|
40
46
|
|
|
41
47
|
return {
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
time: fullTime,
|
|
49
|
+
timezone: sign + zone
|
|
44
50
|
};
|
|
45
51
|
};
|
|
46
52
|
|
|
47
|
-
var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
53
|
+
export var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
48
54
|
var bind = _ref.bind,
|
|
49
55
|
trailingIcon = _ref.trailingIcon,
|
|
50
56
|
field = _ref.field;
|
|
57
|
+
var defaultTimeZone = getCurrentTimeZone() || DEFAULT_TIMEZONE; // "2020-05-18T09:00+10:00"
|
|
51
58
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
var initialValue = getDefaultFieldValue(field, bind, function () {
|
|
60
|
+
var date = new Date();
|
|
61
|
+
return "".concat(getCurrentDate(date), "T").concat(getCurrentLocalTime(date)).concat(defaultTimeZone);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
var _parseDateTime = parseDateTime(initialValue),
|
|
65
|
+
date = _parseDateTime.date,
|
|
55
66
|
rest = _parseDateTime.rest;
|
|
56
67
|
|
|
57
68
|
var _parseTime = parseTime(rest),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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;
|
|
69
|
+
time = _parseTime.time,
|
|
70
|
+
_parseTime$timezone = _parseTime.timezone,
|
|
71
|
+
timezone = _parseTime$timezone === void 0 ? defaultTimeZone : _parseTime$timezone;
|
|
72
|
+
|
|
73
|
+
var bindValue = bind.value || "";
|
|
73
74
|
useEffect(function () {
|
|
74
|
-
if (!
|
|
75
|
+
if (!date || !time || !timezone || bindValue === initialValue) {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
date: formattedDate,
|
|
81
|
-
time: formattedTime,
|
|
82
|
-
timezone: formattedTimezone
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
}, [formattedDate, formattedTime, formattedTimezone]);
|
|
79
|
+
bind.onChange(initialValue);
|
|
80
|
+
}, [bindValue]);
|
|
86
81
|
var cellSize = trailingIcon ? 3 : 4;
|
|
87
82
|
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
88
83
|
span: 4
|
|
@@ -90,12 +85,15 @@ var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
|
90
85
|
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
91
86
|
value: date,
|
|
92
87
|
onChange: function onChange(value) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
if (!value) {
|
|
89
|
+
if (!bind.value) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return bind.onChange("");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return bind.onChange("".concat(value, "T").concat(time || getCurrentLocalTime()).concat(timezone || defaultTimeZone));
|
|
99
97
|
}
|
|
100
98
|
}),
|
|
101
99
|
field: _objectSpread(_objectSpread({}, field), {}, {
|
|
@@ -108,12 +106,15 @@ var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
|
108
106
|
bind: _objectSpread(_objectSpread({}, bind), {}, {
|
|
109
107
|
value: time,
|
|
110
108
|
onChange: function onChange(value) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
if (!value) {
|
|
110
|
+
if (!bind.value) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return bind.onChange("");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return bind.onChange("".concat(date || getCurrentDate(), "T").concat(value).concat(timezone || defaultTimeZone));
|
|
117
118
|
}
|
|
118
119
|
}),
|
|
119
120
|
field: _objectSpread(_objectSpread({}, field), {}, {
|
|
@@ -125,14 +126,17 @@ var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
|
125
126
|
span: cellSize
|
|
126
127
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
127
128
|
label: "Timezone",
|
|
128
|
-
value: timezone,
|
|
129
|
+
value: timezone || defaultTimeZone,
|
|
129
130
|
onChange: function onChange(value) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
if (!value) {
|
|
132
|
+
if (!bind.value) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return bind.onChange("");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return bind.onChange("".concat(date || getCurrentDate(), "T").concat(time || getCurrentLocalTime()).concat(value));
|
|
136
140
|
},
|
|
137
141
|
options: UTC_TIMEZONES.map(function (t) {
|
|
138
142
|
return {
|
|
@@ -143,6 +147,4 @@ var DateTimeWithTimezone = function DateTimeWithTimezone(_ref) {
|
|
|
143
147
|
})), /*#__PURE__*/React.createElement(RemoveFieldButton, {
|
|
144
148
|
trailingIcon: trailingIcon
|
|
145
149
|
}));
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export default DateTimeWithTimezone;
|
|
150
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { CmsEditorField } from "../../../../types";
|
|
3
|
+
export interface Props {
|
|
3
4
|
bind: any;
|
|
4
5
|
trailingIcon?: any;
|
|
5
|
-
field:
|
|
6
|
+
field: CmsEditorField;
|
|
6
7
|
}
|
|
7
|
-
declare const DateTimeWithoutTimezone: React.FunctionComponent<
|
|
8
|
-
export default DateTimeWithoutTimezone;
|
|
8
|
+
export declare const DateTimeWithoutTimezone: React.FunctionComponent<Props>;
|