{"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;CAC9C,OAAO,CAAC,EAAEH,QAAQG,MAAM,IACpBA,OAAOC,OAAO,EAAEC,WAAWA,SAASX,OAAO,IAC3CS,QAAQE,SAASX;AACvB;AAEA,IAAA,uBAAeC,gCAAgB;CAC7BW,MAAM;CACNC,OAAO,EACLC,MAAM;EACJH,MAAMI;EACNC,UAAU;CACZ,EACF;CACAC,MAAMJ,OAAO;EACX,MAAMK,KAAKb,aAAa,eAAe;EACvC,MAAM,EAAEc,kBAAkBjB,OAAOK,4BAA4B;EAC7D,MAAM,EAAEO,SAASD;EACjB,MAAM,EAAEO,MAAMC,OAAOC,cAAcR;EAEnC,MAAMO,cAAc;GAClB,MAAME,cAAcJ,gBAAgB;IAAEL;IAAMM;GAAK,CAAC;GAClD,OAAOZ,aAAae,WAAW,IAAID,YAAaC,eAAeD;EACjE;EACA,aAAOlB,YAAA,QAAA,EAAA,SAAmBc,GAAGM,EAAE,OAAO,EAAC,GAAA,CAAGH,MAAM,CAAC,CAAA;CACnD;AACF,CAAC"}