<!--
 * @Author: ChenChanghua
 * @Date: 2022-05-10 15:21:24
 * @LastEditors: ZhengYi
 * @LastEditTime: 2022-05-04
 * @Description: file content
-->
<script setup>
import ButtonBlock from "./ButtonBlock.vue";
import { shallowRef } from "vue";
import { useFocusHub } from "jsview";

const props = defineProps({
  userData: Object,
  widgetData: Object,
  onAction: Object,
});
const focusHub = useFocusHub();
const button = shallowRef(null);
const onFocus = () => {
  focusHub.setFocus(props.widgetData.gridIndex + "_item");
};
const onBlur = () => {};
props.onAction.register("onFocus", onFocus);
props.onAction.register("onBlur", onBlur);
</script>

<template>
  <button-block
    ref="button"
    :name="widgetData.gridIndex + '_item'"
    :userData="userData"
  ></button-block>
</template>