VStepperActions.mjs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { createVNode as _createVNode } from "vue";
  2. // Components
  3. import { VBtn } from "../../components/VBtn/VBtn.mjs"; // Composables
  4. import { useLocale } from "../../composables/locale.mjs"; // Utilities
  5. import { genericComponent, propsFactory, useRender } from "../../util/index.mjs"; // Types
  6. export const makeVStepperActionsProps = propsFactory({
  7. color: String,
  8. disabled: {
  9. type: [Boolean, String],
  10. default: false
  11. },
  12. prevText: {
  13. type: String,
  14. default: '$vuetify.stepper.prev'
  15. },
  16. nextText: {
  17. type: String,
  18. default: '$vuetify.stepper.next'
  19. }
  20. }, 'VStepperActions');
  21. export const VStepperActions = genericComponent()({
  22. name: 'VStepperActions',
  23. props: makeVStepperActionsProps(),
  24. emits: {
  25. 'click:prev': () => true,
  26. 'click:next': () => true
  27. },
  28. setup(props, _ref) {
  29. let {
  30. emit,
  31. slots
  32. } = _ref;
  33. const {
  34. t
  35. } = useLocale();
  36. function onClickPrev() {
  37. emit('click:prev');
  38. }
  39. function onClickNext() {
  40. emit('click:next');
  41. }
  42. useRender(() => {
  43. return _createVNode("div", {
  44. "class": "v-stepper-actions"
  45. }, [_createVNode(VBtn, {
  46. "disabled": ['prev', true].includes(props.disabled),
  47. "text": t(props.prevText),
  48. "variant": "text",
  49. "onClick": onClickPrev
  50. }, null), _createVNode(VBtn, {
  51. "disabled": ['next', true].includes(props.disabled),
  52. "color": props.color,
  53. "text": t(props.nextText),
  54. "variant": "tonal",
  55. "onClick": onClickNext
  56. }, null)]);
  57. });
  58. return {};
  59. }
  60. });
  61. //# sourceMappingURL=VStepperActions.mjs.map