Skip to content

Commit

Permalink
allow disclosure show to be controlled within v-for
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboud committed May 30, 2024
1 parent 72ee69d commit 281691f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions houston-common-ui/lib/components/Disclosure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const elementHeight = computed<number>(() => {
const observer = new ResizeObserver((entries) => {
entries.forEach((entry) => {
console.log("updating internal height:", entry.contentRect.height);
internalHeight.value = entry.contentRect.height;
});
});
Expand Down Expand Up @@ -109,7 +108,7 @@ onUnmounted(() => {
]"
>
<div ref="internalWrapperElement">
<slot :visible="visible" />
<slot :visible="visible" :show="show" />
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions houston-common-ui/lib/components/DisclosureController.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
import { defineModel } from "vue";
const show = defineModel("show", { default: false });
const setShow = (value: boolean) => show.value = value;
</script>

<template>
<slot :show :setShow />
</template>
1 change: 1 addition & 0 deletions houston-common-ui/lib/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export { default as ToggleSwitch } from "./ToggleSwitch.vue";
export { default as ToggleSwitchGroup } from "./ToggleSwitchGroup.vue";
export { default as ToolTip } from "./ToolTip.vue";
export { default as Disclosure } from "./Disclosure.vue";
export { default as DisclosureController } from "./DisclosureController.vue";
export { default as SelectMenu } from "./SelectMenu.vue";
export * from "./SelectMenu.vue";
export { default as InputLabelWrapper } from "./InputLabelWrapper.vue";
Expand Down

0 comments on commit 281691f

Please sign in to comment.