{"version":3,"file":"table-icon.vue2.mjs","sources":["../../../components/table/table-icon.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Icon } from '@/components/icon'\nimport { Renderer } from '@/components/renderer'\n\nimport { computed, inject } from 'vue'\n\nimport { isFunction } from '@vexip-ui/utils'\nimport { TABLE_ACTIONS, TABLE_SLOTS } from './symbol'\n\nimport type { PropType } from 'vue'\nimport type { TableIconName } from './symbol'\n\ndefineOptions({ name: 'TableIcon' })\n\nconst props = defineProps({\n  name: {\n    type: String as PropType<TableIconName>,\n    required: true\n  },\n  origin: {\n    type: Object,\n    default: null\n  }\n})\n\nconst tableActions = inject(TABLE_ACTIONS)!\nconst tableSlots = inject(TABLE_SLOTS)!\n\nconst customIcon = computed(() => tableActions.getIcon(props.name))\n</script>\n\n<template>\n  <Renderer\n    v-if=\"isFunction(tableSlots[`icon-${name}`])\"\n    :renderer=\"tableActions.renderTableSlot\"\n    :data=\"{ name: `icon-${name}` }\"\n  ></Renderer>\n  <Icon v-else-if=\"tableActions.hasIcon(name)\" :icon=\"customIcon\"></Icon>\n  <Icon v-else v-bind=\"origin\"></Icon>\n</template>\n"],"names":["props","__props","tableActions","inject","TABLE_ACTIONS","tableSlots","TABLE_SLOTS","customIcon","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAWRC,IAAeC,EAAOC,CAAa,GACnCC,IAAaF,EAAOG,CAAW,GAE/BC,IAAaC,EAAS,MAAMN,EAAa,QAAQF,EAAM,IAAI,CAAC;;;;;;;;;;;"}