{"version":3,"file":"node-content.mjs","names":["Comment","defineComponent","inject","createVNode","_createVNode","useNamespace","isArray","CASCADER_PANEL_INJECTION_KEY","isVNodeEmpty","vnodes","every","type","name","props","node","Object","required","setup","ns","renderLabelFn","data","label","nodeLabel","renderLabel","e"],"sources":["../../../../../../packages/components/cascader-panel/src/node-content.tsx"],"sourcesContent":["import { Comment, defineComponent, inject } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isArray } from '@element-plus/utils'\nimport { CASCADER_PANEL_INJECTION_KEY } from './types'\n\nimport type { PropType, VNode } from 'vue'\nimport type { CascaderNode } from './types'\n\nfunction isVNodeEmpty(vnodes?: VNode[] | VNode) {\n  return !!(isArray(vnodes)\n    ? vnodes.every(({ type }) => type === Comment)\n    : vnodes?.type === Comment)\n}\n\nexport default defineComponent({\n  name: 'NodeContent',\n  props: {\n    node: {\n      type: Object as PropType<CascaderNode>,\n      required: true,\n    },\n  },\n  setup(props) {\n    const ns = useNamespace('cascader-node')\n    const { renderLabelFn } = inject(CASCADER_PANEL_INJECTION_KEY)!\n    const { node } = props\n    const { data, label: nodeLabel } = node\n\n    const label = () => {\n      const renderLabel = renderLabelFn?.({ node, data })\n      return isVNodeEmpty(renderLabel) ? nodeLabel : (renderLabel ?? nodeLabel)\n    }\n    return () => <span class={ns.e('label')}>{label()}</span>\n  },\n})\n"],"mappings":";;;;;;AAQA,SAASQ,aAAaC,QAA0B;AAC9C,QAAO,CAAC,EAAEH,QAAQG,OAAO,GACrBA,OAAOC,OAAO,EAAEC,WAAWA,SAASX,QAAQ,GAC5CS,QAAQE,SAASX;;AAGvB,2BAAeC,gCAAgB;CAC7BW,MAAM;CACNC,OAAO,EACLC,MAAM;EACJH,MAAMI;EACNC,UAAU;EACZ,EACD;CACDC,MAAMJ,OAAO;EACX,MAAMK,KAAKb,aAAa,gBAAgB;EACxC,MAAM,EAAEc,kBAAkBjB,OAAOK,6BAA8B;EAC/D,MAAM,EAAEO,SAASD;EACjB,MAAM,EAAEO,MAAMC,OAAOC,cAAcR;EAEnC,MAAMO,cAAc;GAClB,MAAME,cAAcJ,gBAAgB;IAAEL;IAAMM;IAAM,CAAC;AACnD,UAAOZ,aAAae,YAAY,GAAGD,YAAaC,eAAeD;;AAEjE,eAAOlB,YAAA,QAAA,EAAA,SAAmBc,GAAGM,EAAE,QAAO,EAAC,EAAA,CAAGH,OAAO,CAAA,CAAQ;;CAE5D,CAAC"}