Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The date format used is DD/MM/YYYY.


## [1.0.4] - 30/05/2021
### Fixed
* Fixing draggable on mobile

## [1.0.3] - 04/04/2021
### Fixed
* Removing overriding styles from body
Expand Down
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"homepage": "https://denkschuldt.github.io/react-dialog",
"dependencies": {
"@denkschuldt/react-dialog": "^1.0.3",
"@denkschuldt/react-dialog": "^1.0.4",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
Expand Down
264 changes: 132 additions & 132 deletions examples/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,138 @@ function App() {
</i>
</code>
</article>
<article>
<h1>Props</h1>
<div className='app-body-table'>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>width</td>
<td>Number</td>
<td></td>
<td>Dialog width</td>
<td></td>
</tr>
<tr>
<td>height</td>
<td>Number</td>
<td></td>
<td>Dialog height</td>
<td></td>
</tr>
<tr>
<td>title</td>
<td>String</td>
<td></td>
<td>Dialog title</td>
<td></td>
</tr>
<tr>
<td>draggable</td>
<td>Boolean</td>
<td></td>
<td>Allows dialog drag</td>
<td>true</td>
</tr>
<tr>
<td>className</td>
<td>String</td>
<td></td>
<td>Component class to override styles</td>
<td></td>
</tr>
<tr>
<td>slideIn</td>
<td>String</td>
<td></td>
<td>Initial animation: top, bottom, left, right</td>
<td></td>
</tr>
<tr>
<td>cancelableOutside</td>
<td>Boolean</td>
<td></td>
<td>Whether the dialogs closes by clicking outside or not</td>
<td>false</td>
</tr>
<tr>
<td>closeOnEscPress</td>
<td>Boolean</td>
<td></td>
<td>Whether the dialogs closes by pressing escape</td>
<td>false</td>
</tr>
<tr>
<td>hideCloseButton</td>
<td>Boolean</td>
<td></td>
<td>Hides the close button</td>
<td>false</td>
</tr>
<tr>
<td>onCloseClick</td>
<td>function</td>
<td style={{ textAlign: 'center' }}>
<p>&#9989;</p>
</td>
<td>Close button click function</td>
<td></td>
</tr>
<tr>
<td>cancelText</td>
<td>String</td>
<td></td>
<td>Negative button text</td>
<td>'CANCEL'</td>
</tr>
<tr>
<td>onCancelClick</td>
<td>function</td>
<td></td>
<td>Negative button click function</td>
<td></td>
</tr>
<tr>
<td>cancelDisabled</td>
<td>Boolean</td>
<td></td>
<td>Negative button disabled prop</td>
<td>false</td>
</tr>
<tr>
<td>confirmText</td>
<td>String</td>
<td></td>
<td>Positive button text</td>
<td>'OK'</td>
</tr>
<tr>
<td>onConfirmClick</td>
<td>function</td>
<td></td>
<td>Positive button click function</td>
<td></td>
</tr>
<tr>
<td>confirmDisabled</td>
<td>Boolean</td>
<td></td>
<td>Positive button disabled prop</td>
<td>false</td>
</tr>
</tbody>
</table>
</div>
</article>
<article>
<h1>Usage</h1>
<h2>
Expand Down Expand Up @@ -331,138 +463,6 @@ function App() {
<i className="fas fa-external-link-square-alt"></i>
</a>
</article>
<article>
<h1>Props</h1>
<div className='app-body-table'>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>width</td>
<td>Number</td>
<td></td>
<td>Dialog width</td>
<td></td>
</tr>
<tr>
<td>height</td>
<td>Number</td>
<td></td>
<td>Dialog height</td>
<td></td>
</tr>
<tr>
<td>title</td>
<td>String</td>
<td></td>
<td>Dialog title</td>
<td></td>
</tr>
<tr>
<td>draggable</td>
<td>Boolean</td>
<td></td>
<td>Allows dialog drag</td>
<td>true</td>
</tr>
<tr>
<td>className</td>
<td>String</td>
<td></td>
<td>Component class to override styles</td>
<td></td>
</tr>
<tr>
<td>slideIn</td>
<td>String</td>
<td></td>
<td>Initial animation: top, bottom, left, right</td>
<td></td>
</tr>
<tr>
<td>cancelableOutside</td>
<td>Boolean</td>
<td></td>
<td>Whether the dialogs closes by clicking outside or not</td>
<td>false</td>
</tr>
<tr>
<td>closeOnEscPress</td>
<td>Boolean</td>
<td></td>
<td>Whether the dialogs closes by pressing escape</td>
<td>false</td>
</tr>
<tr>
<td>hideCloseButton</td>
<td>Boolean</td>
<td></td>
<td>Hides the close button</td>
<td>false</td>
</tr>
<tr>
<td>onCloseClick</td>
<td>function</td>
<td style={{ textAlign: 'center' }}>
<p>&#9989;</p>
</td>
<td>Close button click function</td>
<td></td>
</tr>
<tr>
<td>cancelText</td>
<td>String</td>
<td></td>
<td>Negative button text</td>
<td>'CANCEL'</td>
</tr>
<tr>
<td>onCancelClick</td>
<td>function</td>
<td></td>
<td>Negative button click function</td>
<td></td>
</tr>
<tr>
<td>cancelDisabled</td>
<td>Boolean</td>
<td></td>
<td>Negative button disabled prop</td>
<td>false</td>
</tr>
<tr>
<td>confirmText</td>
<td>String</td>
<td></td>
<td>Positive button text</td>
<td>'OK'</td>
</tr>
<tr>
<td>onConfirmClick</td>
<td>function</td>
<td></td>
<td>Positive button click function</td>
<td></td>
</tr>
<tr>
<td>confirmDisabled</td>
<td>Boolean</td>
<td></td>
<td>Positive button disabled prop</td>
<td>false</td>
</tr>
</tbody>
</table>
</div>
</article>
<article>
<h1>License</h1>
<h2>MIT</h2>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@denkschuldt/react-dialog",
"version": "1.0.3",
"version": "1.0.4",
"private": false,
"description": "A simple to use and customizable react dialog implementation.",
"main": "dist/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/components/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const Dialog = (props) => {
onClick={cancelableOutside ? handleCloseClick : undefined}>
<div style={{ margin: 'auto' }}>
<Draggable
disabled={!draggable}>
disabled={!draggable}
cancel='.dnk-dialog-close, .dnk-dialog-body'>
<div
style={
['top', 'bottom', 'left', 'right'].includes(slideIn) ?
Expand Down