@os-design/core
Advanced tools
Comparing version 0.0.30 to 0.0.31
@@ -9,2 +9,3 @@ import React from 'react'; | ||
onOk?: () => void; | ||
footer?: React.ReactNode; | ||
} | ||
@@ -11,0 +12,0 @@ declare const Modal: React.FC<ModalProps>; |
@@ -28,2 +28,8 @@ "use strict"; | ||
react_1.useEffect(props.visible ? bodyScroll_1.default.disable : bodyScroll_1.default.enable, [props.visible]); | ||
const hasFooter = props.footer !== undefined; | ||
const renderFooter = () => { | ||
if (hasFooter) | ||
return props.footer; | ||
return (react_1.default.createElement(ModalFooter_1.default, { okText: props.okText, onOk: props.onOk })); | ||
}; | ||
return (react_1.default.createElement(Portal_1.default, null, | ||
@@ -34,6 +40,6 @@ react_1.default.createElement(ModalMask, { visible: props.visible }), | ||
react_1.default.createElement(ModalHeader_1.default, { title: props.title, onCancel: props.onCancel }), | ||
react_1.default.createElement(ModalBody_1.default, null, props.children), | ||
react_1.default.createElement(ModalFooter_1.default, { okText: props.okText, onOk: props.onOk }))))); | ||
props.children && react_1.default.createElement(ModalBody_1.default, { hasFooter: hasFooter }, props.children), | ||
renderFooter())))); | ||
}; | ||
exports.default = Modal; | ||
//# sourceMappingURL=index.js.map |
@@ -6,3 +6,6 @@ /// <reference types="react" /> | ||
export declare const MODAL_BODY_PADDING_HORIZONTAL_MD_EM = 1.5; | ||
declare const ModalBody: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "children" | "translate" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "onError" | "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" | "css">, { | ||
interface ModalBodyProps { | ||
hasFooter: boolean; | ||
} | ||
declare const ModalBody: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ModalBodyProps, { | ||
colorPrimary: string; | ||
@@ -9,0 +12,0 @@ colorBorder: string; |
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.MODAL_BODY_PADDING_HORIZONTAL_MD_EM = 1.5; | ||
const ModalBody = styled_1.default.div ` | ||
const ModalBody = styled_1.default('div', utils_1.omitProps(['hasFooter'])) ` | ||
padding: ${exports.MODAL_BODY_PADDING_VERTICAL_EM}em ${exports.MODAL_BODY_PADDING_HORIZONTAL_EM}em; | ||
@@ -18,4 +18,7 @@ | ||
} | ||
border-top: 1px solid rgb(${p => p.theme.colorBorder}); | ||
border-bottom: 1px solid rgb(${p => p.theme.colorBorder}); | ||
`; | ||
exports.default = ModalBody; | ||
//# sourceMappingURL=ModalBody.js.map |
@@ -22,3 +22,2 @@ "use strict"; | ||
padding: 0 ${ModalBody_1.MODAL_BODY_PADDING_HORIZONTAL_MD_EM}em; | ||
border-top: 1px solid rgb(${p => p.theme.colorBorder}); | ||
} | ||
@@ -25,0 +24,0 @@ `; |
@@ -33,3 +33,2 @@ "use strict"; | ||
height: ${exports.MODAL_HEADER_HEIGHT_EM}em; | ||
border-bottom: 1px solid rgb(${p => p.theme.colorBorder}); | ||
@@ -36,0 +35,0 @@ // Centering the header content vertically |
{ | ||
"name": "@os-design/core", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"license": "MIT", | ||
@@ -32,3 +32,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "2c8cce9797cfdf90be17679cee8da2567770c3ef" | ||
"gitHead": "e12d9ab48a8579c2bd82e4dc392a6f40acdd3f77" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
113800
1442