<template>
  <CollapseItem name="按钮设置" :expanded="true">
    <SettingItemBox :alone="true" name="按钮内容">
      <SettingItem :alone="true">
        <n-input v-model:value="optionData.dataset.value" type="text" size="small" />
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox name="字体设置">
      <SettingItem name="字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.color"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.fontSize"
          type="text"
          :min="0"
          size="small"
        />
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox name="图标样式">
      <SettingItem name="文字与图标的间隔">
        <n-input-number
          v-model:value="optionData.dataStyle.iconMarginLeft"
          type="text"
          :min="0"
          size="small"
        />
      </SettingItem>
      <SettingItem>
        <n-checkbox v-model:checked="optionData.dataStyle.iconFlag" size="small">
          是否展示图标
        </n-checkbox>
      </SettingItem>
      <SettingItem name="图标宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.iconWidth"
          type="text"
          :min="0"
          size="small"
        />
      </SettingItem>
      <!-- <SettingItem name="图标长度">
        <n-input-number
          v-model:value="optionData.dataStyle.iconHeight"
          type="text"
          :min="0"
          size="small"
        />
      </SettingItem> -->
      <SettingItem name="图标颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.iconColor"
        ></n-color-picker>
      </SettingItem>
    </SettingItemBox>
  </CollapseItem>
</template>

<script setup lang="ts">
  import { PropType, watch, ref } from 'vue';
  import { option } from './config';
  import { cloneDeep } from 'lodash-es';
  import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting';

  const props = defineProps({
    optionData: {
      type: Object as PropType<typeof option>,
      required: true,
    },
  });
</script>
