<template>
  <collapse-item name="属性" :expanded="true">
    <setting-item-box name="路径" :alone="true">
      <setting-item>
        <n-input v-model:value="optionData.dataset" size="small"></n-input>
      </setting-item>
    </setting-item-box>
    <setting-item-box name="样式">
      <setting-item name="类型">
        <n-select
          v-model:value="optionData.fit"
          size="small"
          :options="fitList"
        ></n-select>
      </setting-item>
      <setting-item name="圆角">
        <n-input-number
          v-model:value="optionData.borderRadius"
          size="small"
          :min="0"
          placeholder="圆角"
        ></n-input-number>
      </setting-item>
    </setting-item-box>
    <setting-item-box name="鼠标样式" :alone="true">
      <setting-item>
        <n-select
          v-model:value="optionData.mouseCursor"
          size="small"
          :options="mouseCursor"
        ></n-select>
      </setting-item>
    </setting-item-box>
    <setting-item-box name="是否禁止选中属性" :alone="true">
      <setting-item>
        <n-space>
          <n-switch v-model:value="optionData.mouseSelectClose" size="small" />
          <n-text>是否禁用</n-text>
        </n-space>
      </setting-item>
    </setting-item-box>
    <setting-item-box name="是否允许鼠标穿透事件" :alone="true">
      <setting-item>
        <n-space>
          <n-switch v-model:value="optionData.photoMouseEventClose" size="small" />
          <n-text>是否允许</n-text>
        </n-space>
      </setting-item>
    </setting-item-box>
  </collapse-item>
</template>

<script setup lang="ts">
import { PropType } from 'vue'
import { option } from './config'
import {
  CollapseItem,
  SettingItemBox,
  SettingItem,
} from '@/components/Pages/ChartItemSetting'

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

// 适应类型
const fitList = [
  {
    value: 'fill',
    label: 'fill'
  },
  {
    value: 'contain',
    label: 'contain'
  },
  {
    value: 'cover',
    label: 'cover'
  },
  {
    value: 'scale-down',
    label: 'scale-down'
  },
  {
    value: 'none',
    label: 'none'
  },
]
const mouseCursor = [
  { value: 'default', label: 'default', },
  { value: 'none', label: 'none', },
  { value: 'context-menu', label: 'context-menu', },
  { value: 'pointer', label: 'pointer', },
  { value: 'help', label: 'help', },
  { value: 'wait', label: 'wait', },
  { value: 'progress', label: 'progress', },
  { value: 'text', label: 'text', },
  { value: 'vertical-text', label: 'vertical-text', },
  { value: 'move', label: 'move', },
  { value: 'grab', label: 'grab', },
  { value: 'grabbing', label: 'grabbing', },
  { value: 'move', label: 'move', },
  { value: 'move', label: 'move', },
  { value: 'move', label: 'move', },
  { value: 'move', label: 'move', },
]
</script>
