Skip to content

Commit

Permalink
Pre release fixes (#902)
Browse files Browse the repository at this point in the history
* fix: accordion item animation

* fix: combo box animation

* fix: data table toolbar animation

Co-authored-by: Lee Chase <[email protected]>
  • Loading branch information
lee-chase and lee-chase authored May 20, 2020
1 parent 9d5a5dc commit 6cd7dce
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
20 changes: 19 additions & 1 deletion packages/core/src/components/cv-accordion/cv-accordion-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<li
data-accordion-item
class="cv-accordion-item bx--accordion__item"
:class="{ 'bx--accordion__item--active': dataOpen }"
:class="itemClasses"
@animationend="onAnimationEnd"
>
<button
type="button"
Expand Down Expand Up @@ -50,6 +51,7 @@ export default {
},
data() {
return {
animation: '',
dataOpen: false,
};
},
Expand All @@ -58,6 +60,7 @@ export default {
},
methods: {
toggle(force) {
this.animation = this.dataOpen ? 'collapsing' : 'expanding';
const newValue = typeof force === 'boolean' ? !!force : !this.dataOpen;
const change = this.dataOpen !== undefined && newValue !== this.dataOpen;

Expand All @@ -66,6 +69,21 @@ export default {
this.$parent.$emit('cv:change', this);
}
},
onAnimationEnd() {
this.animation = '';
},
},
computed: {
itemClasses() {
const classes = [];
if (this.dataOpen) {
classes.push('bx--accordion__item--active');
}
if (this.animation) {
classes.push(`bx--accordion__item--${this.animation}`);
}
return classes.join(' ');
},
},
};
</script>
1 change: 1 addition & 0 deletions packages/core/src/components/cv-combo-box/cv-combo-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:class="{
'bx--list-box--light': theme === 'light',
'bx--combo-box--expanded': open,
'bx--list-box--expanded': open,
'bx--combo-box--disabled bx--list-box--disabled': $attrs.disabled,
}"
:data-invalid="isInvalid"
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/components/cv-data-table/cv-data-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
</div>

<section v-if="hasToolbar" class="bx--table-toolbar">
<div v-if="batchActive" :style="{ minHeight: '48px', maxWidth: '0' }" />

<div
v-if="hasBatchActions"
v-show="hasBatchActions"
class="bx--batch-actions"
:class="{ 'bx--batch-actions--active': batchActive }"
:aria-label="actionBarAriaLabel"
Expand All @@ -34,7 +32,7 @@
</div>
</div>

<div v-if="(hasActions || $listeners.search) && !batchActive" class="bx--toolbar-content">
<div class="bx--toolbar-content">
<div
v-if="$listeners.search"
:class="{
Expand Down
2 changes: 1 addition & 1 deletion storybook/_storybook/utils/knobs-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const parsePreKnobs = (variant, preKnobs) => {
} else if (preKnob.slot) {
// slot
if (preKnob.slot !== 'default') {
knobs.props[`use_${key}`] = { default: boolean(`use-sloted-content:${preKnob.slot}`, true) };
knobs.props[`use_${key}`] = { default: boolean(`use-slotted-content:${preKnob.slot}`, true) };
// knobs.data[key] = boolean(`slot:${preKnob.slot}`, false);
knobs.group[
preKnob.group
Expand Down
20 changes: 20 additions & 0 deletions storybook/stories/cv-data-table-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,26 @@ let variants = [
'hasExpandAll',
],
},
{
name: 'batch-no-toolbar',
excludes: [
'actions',
'search',
'search2',
'columns2',
'columns3',
'slottedHeadings',
'slottedData',
'htmlData',
'helperTextSlot',
'basicPagination',
'hasExpandingRows',
'expandingSlottedData',
'rowExpanded',
'scopedSlots',
'hasExpandAll',
],
},
{
name: 'name-only-sortable',
includes: ['columns3', 'data', 'sortable', 'sort'],
Expand Down

0 comments on commit 6cd7dce

Please sign in to comment.