@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 1.93 kB
Source Map (JSON)
{"version":3,"file":"table-icon.vue2.mjs","sources":["../../../components/table/table-icon.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { Icon } from '@/components/icon'\r\nimport { Renderer } from '@/components/renderer'\r\n\r\nimport { computed, inject } from 'vue'\r\n\r\nimport { isFunction } from '@vexip-ui/utils'\r\nimport { TABLE_ACTIONS, TABLE_SLOTS } from './symbol'\r\n\r\nimport type { PropType } from 'vue'\r\nimport type { TableIconName } from './symbol'\r\n\r\ndefineOptions({ name: 'TableIcon' })\r\n\r\nconst props = defineProps({\r\n name: {\r\n type: String as PropType<TableIconName>,\r\n required: true,\r\n },\r\n origin: {\r\n type: Object,\r\n default: null,\r\n },\r\n})\r\n\r\nconst tableActions = inject(TABLE_ACTIONS)!\r\nconst tableSlots = inject(TABLE_SLOTS)!\r\n\r\nconst customIcon = computed(() => tableActions.getIcon(props.name))\r\n</script>\r\n\r\n<template>\r\n <Renderer\r\n v-if=\"isFunction(tableSlots[`icon-${name}`])\"\r\n :renderer=\"tableActions.renderTableSlot\"\r\n :data=\"{ name: `icon-${name}` }\"\r\n ></Renderer>\r\n <Icon v-else-if=\"tableActions.hasIcon(name)\" :icon=\"customIcon\"></Icon>\r\n <Icon v-else v-bind=\"origin\"></Icon>\r\n</template>\r\n"],"names":["props","__props","tableActions","inject","TABLE_ACTIONS","tableSlots","TABLE_SLOTS","customIcon","computed","_unref","isFunction","_createBlock","Renderer","Icon","_openBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAWRC,IAAeC,EAAOC,CAAa,GACnCC,IAAaF,EAAOG,CAAW,GAE/BC,IAAaC,EAAS,MAAMN,EAAa,QAAQF,EAAM,IAAI,CAAC;qBAKxDS,EAAUC,CAAA,EAACD,EAAUJ,CAAA,EAAA,QAASJ,EAAI,IAAA,EAAA,CAAA,UAD1CU,EAIYF,EAAAG,CAAA,GAAA;AAAA;MAFT,UAAUH,EAAYP,CAAA,EAAC;AAAA,MACvB,sBAAsBD,EAAI,IAAA,GAAA;AAAA,IAAA,qCAEZQ,EAAYP,CAAA,EAAC,QAAQD,EAAI,IAAA,UAA1CU,EAAuEF,EAAAI,CAAA,GAAA;AAAA;MAAzB,MAAMN,EAAU;AAAA,IAAA,0BAC9DO,KAAAH,EAAoCF,sBAAfR,EAAM,MAAA,CAAA,GAAA,MAAA,EAAA;AAAA;;"}