Skip to content

Commit

Permalink
1.1.8 - Add rounded prop
Browse files Browse the repository at this point in the history
  • Loading branch information
vaban-ru committed Feb 8, 2021
1 parent 6c8d53b commit c5df315
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Vue.use(VueBottomSheet);
| max-width | String | Set max-width of component card | `max-width="640px"` |
| max-height | String | Set max-height of component card | `max-height="90%"` |
| effect | String | Set effect for component card | `effect="fx-fadein-scale"` |
| rounded | Boolean | Round the top two corners of the sheet | `:rounded="false"` |

## Events

Expand Down
1 change: 1 addition & 0 deletions README_RU.MD
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Vue.use(VueBottomSheet);
| max-width | String | Устанавливает максимальную ширину карточки компонента | `max-width="640px"` |
| max-height | String | Устанавливает максимальную высоту карточки компонента | `max-height="90%"` |
| effect | String | Устанавливает эффект появление карточки компонента | `effect="fx-fadein-scale"` |
| rounded | Boolean | Включает скругление 2 верхних углов компонента | `:rounded="false"` |

## События

Expand Down
20 changes: 18 additions & 2 deletions dev/dev.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
Vue Bottom Sheet
</h1>
<p>
A nice clean and touch-friendly bottom sheet component based on <a target="_blank" href="https://vuejs.org/">Vue.js</a> and <a target="_blank" href="https://hammerjs.github.io/">Hammer.js</a>
A nice clean and touch-friendly bottom sheet component based on
<a target="_blank" href="https://vuejs.org/">Vue.js</a> and
<a target="_blank" href="https://hammerjs.github.io/">Hammer.js</a>
</p>
<h3 class="mb-3">Settings</h3>

Expand Down Expand Up @@ -35,6 +37,18 @@
>Click outside card to close</label
>
</div>
<div class="form-check form-switch mb-3">
<input
class="form-check-input"
type="checkbox"
id="roundedCheckChecked"
v-model="rounded"
checked
/>
<label class="form-check-label" for="roundedCheckChecked"
>Rounded top corners</label
>
</div>
<div class="form-group mb-3">
<label for="maxWidthInput" class="form-label">Max width:</label>
<input
Expand Down Expand Up @@ -84,6 +98,7 @@
:overlay="overlay"
:click-to-close="clickToClose"
:effect="effect"
:rounded="rounded"
ref="myBottomSheet"
>
<div class="sheet-content">
Expand Down Expand Up @@ -122,7 +137,8 @@ export default {
maxWidth: "640px",
maxHeight: "90%",
clickToClose: true,
effect: "fx-default"
effect: "fx-default",
rounded: true
};
},
components: {
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": "@webzlodimir/vue-bottom-sheet",
"version": "1.1.7",
"version": "1.1.8",
"description": "",
"main": "dist/vue-bottom-sheet.js",
"scripts": {
Expand Down
13 changes: 9 additions & 4 deletions src/components/VueBottomSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div v-if="overlay" class="bottom-sheet__backdrop"></div>
<div
:style="{ bottom: cardP, maxWidth: maxWidth, maxHeight: maxHeight }"
:class="[{ stripe: stripe }, effect]"
:class="[{ stripe: stripe, square: !rounded }, effect]"
ref="bottomSheetCard"
class="bottom-sheet__card"
>
Expand Down Expand Up @@ -71,6 +71,10 @@ export default {
effect: {
type: String,
default: "fx-default"
},
rounded: {
type: Boolean,
default: true
}
},
mounted() {
Expand Down Expand Up @@ -116,9 +120,6 @@ export default {
this.opened = false;
this.cardP = `-${this.cardH + this.stripe}px`;
document.querySelector("body").style.overflow = "";
if (evt.isFinal) {
console.log("closed");
}
this.mc.off("panend");
this.$emit("closed");
}
Expand Down Expand Up @@ -195,6 +196,10 @@ export default {
z-index: 9999;
margin: 0 auto;
&.square {
border-radius: 0;
}
&.stripe {
padding-bottom: 20px;
}
Expand Down

0 comments on commit c5df315

Please sign in to comment.