{"version":3,"file":"useListItems.mjs","sources":["../../../../components/list/hooks/useListItems.ts"],"sourcesContent":["import { computed } from 'vue';\nimport { isArray } from 'lodash-es';\n\nimport { useChildComponentSlots } from '@tdesign/shared-hooks';\n\nexport const useListItems = () => {\n  const getChildComponentSlots = useChildComponentSlots();\n\n  const listItems = computed(() => {\n    const computedListItems = [];\n    // 处理 slots\n    const listItemSlots = getChildComponentSlots('ListItem');\n\n    if (isArray(listItemSlots)) {\n      for (const child of listItemSlots) {\n        computedListItems.push({\n          ...child.props,\n          slots: child.children,\n        } as any);\n      }\n    }\n    return computedListItems;\n  });\n\n  return {\n    listItems,\n  };\n};\n"],"names":["useListItems","getChildComponentSlots","useChildComponentSlots","listItems","computed","computedListItems","listItemSlots","isArray","_iterator","_createForOfIteratorHelper","_step","s","n","done","child","push","_objectSpread","props","slots","children","err","e","f"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKaA,eAAe,SAAfA,eAAqB;AAChC,EAAA,IAAMC,yBAAyBC,sBAAuB,EAAA,CAAA;AAEhD,EAAA,IAAAC,SAAA,GAAYC,SAAS,YAAM;IAC/B,IAAMC,oBAAoB,EAAC,CAAA;AAErB,IAAA,IAAAC,aAAA,GAAgBL,uBAAuB,UAAU,CAAA,CAAA;AAEnD,IAAA,IAAAM,OAAA,CAAQD,aAAa,CAAG,EAAA;AAAA,MAAA,IAAAE,SAAA,GAAAC,0BAAA,CACNH,aAAe,CAAA;QAAAI,KAAA,CAAA;AAAA,MAAA,IAAA;QAAnC,KAAAF,SAAA,CAAAG,CAAA,EAAAD,EAAAA,CAAAA,CAAAA,KAAA,GAAAF,SAAA,CAAAI,CAAA,EAAAC,EAAAA,IAAA,GAAmC;AAAA,UAAA,IAAxBC;UACTT,iBAAA,CAAkBU,IAAK,CAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EAClBF,KAAM,CAAAG,KAAA,CAAA,EAAA,EAAA,EAAA;YACTC,OAAOJ,KAAM,CAAAK,QAAAA;AAAA,WAAA,CACP,CAAA,CAAA;AACV,SAAA;AAAA,OAAA,CAAA,OAAAC,GAAA,EAAA;QAAAZ,SAAA,CAAAa,CAAA,CAAAD,GAAA,CAAA,CAAA;AAAA,OAAA,SAAA;AAAAZ,QAAAA,SAAA,CAAAc,CAAA,EAAA,CAAA;AAAA,OAAA;AACF,KAAA;AACO,IAAA,OAAAjB,iBAAA,CAAA;AACT,GAAC,CAAA,CAAA;EAEM,OAAA;AACLF,IAAAA,SAAA,EAAAA,SAAAA;GACF,CAAA;AACF;;;;"}