Skip to content

Commit

Permalink
add action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
pmpc94 committed Nov 2, 2023
1 parent 58ea1a9 commit 737f130
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ storiesOf("Components/Organisms/Details Expandable", module)
<details-expandable-ripe
v-bind:data="data"
v-bind:label-font-size="fontSize"
v-bind:style="'margin-top: 25px'"
>
<template v-slot:customer-address>
<input-ripe v-bind:style="'width: 50%'" v-bind:value="data.customer.address.city"></input-ripe>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
</div>
<icon class="details-expandable-caret" v-bind:icon="isExpanded[sectionName] ? 'chevron-up' : 'chevron-down'" />
</div>
<div class="details-expandable-btn-container">
<button-color
class="details-expandable-btn-discard"
v-bind:size="'small'"
v-bind:text="'Discard changes'"
v-bind:secondary="true"
v-bind:icon="'close'"
v-on:click="event => onDiscardHandler(event)"
/>
<button-color
class="details-expandable-btn-save"
v-bind:size="'small'"
v-bind:text="'Save changes'"
v-bind:icon="'save'"
v-on:click="event => onSaveHandler(event)"
/>
</div>
</div>
</template>

Expand All @@ -28,16 +45,34 @@
width: 24px;
}
.details-expandable-btn-container {
height: 25px;
float: right;
margin-top: 50px;
}
.details-expandable-btn-discard {
margin-right: 6px;
}
.button-color.button-color-small {
min-width: 125px;
}
.details-expandable-section-hide {
height: 25px;
overflow: hidden;
position: relative;
padding-bottom: 25px;
border-top: 1px solid var(--dividers-border-bottom-header, #E4E8F0);
}
.details-expandable-section-show {
height: auto;
overflow: visible;
position: relative;
margin-bottom: 35px;
transition: opacity 0.1s ease-in-out;
}
.details-expandable-header {
Expand Down Expand Up @@ -91,6 +126,12 @@ export const DetailsExpandable = {
},
toggleSection(sectionName) {
this.isExpanded[sectionName] = !this.isExpanded[sectionName];
},
onSaveHandler(event) {
this.$emit("save-button:click", event);
},
onDiscardHandler(event) {
this.$emit("discard-button:click", event);
}
}
};
Expand Down

0 comments on commit 737f130

Please sign in to comment.