VExpansionPanelText.mjs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode } from "vue";
  2. // Components
  3. import { VExpansionPanelSymbol } from "./VExpansionPanels.mjs";
  4. import { VExpandTransition } from "../transitions/index.mjs"; // Composables
  5. import { makeComponentProps } from "../../composables/component.mjs";
  6. import { makeLazyProps, useLazy } from "../../composables/lazy.mjs"; // Utilities
  7. import { inject } from 'vue';
  8. import { genericComponent, propsFactory, useRender } from "../../util/index.mjs";
  9. export const makeVExpansionPanelTextProps = propsFactory({
  10. ...makeComponentProps(),
  11. ...makeLazyProps()
  12. }, 'VExpansionPanelText');
  13. export const VExpansionPanelText = genericComponent()({
  14. name: 'VExpansionPanelText',
  15. props: makeVExpansionPanelTextProps(),
  16. setup(props, _ref) {
  17. let {
  18. slots
  19. } = _ref;
  20. const expansionPanel = inject(VExpansionPanelSymbol);
  21. if (!expansionPanel) throw new Error('[Vuetify] v-expansion-panel-text needs to be placed inside v-expansion-panel');
  22. const {
  23. hasContent,
  24. onAfterLeave
  25. } = useLazy(props, expansionPanel.isSelected);
  26. useRender(() => _createVNode(VExpandTransition, {
  27. "onAfterLeave": onAfterLeave
  28. }, {
  29. default: () => [_withDirectives(_createVNode("div", {
  30. "class": ['v-expansion-panel-text', props.class],
  31. "style": props.style
  32. }, [slots.default && hasContent.value && _createVNode("div", {
  33. "class": "v-expansion-panel-text__wrapper"
  34. }, [slots.default?.()])]), [[_vShow, expansionPanel.isSelected.value]])]
  35. }));
  36. return {};
  37. }
  38. });
  39. //# sourceMappingURL=VExpansionPanelText.mjs.map