If you want to interact with the attributes of a datasource (e.g. filtering or sorting) you need to provide an attribute in the XML so that the system knows the context with what attribute you want to work with.
ObjectItems does not provide you direct access to any data attributes.
You can then use the ListAttributeValue to get the attribute value of an object as specified in the docs.
Below you can find an example:
</property>
<property key="itemsAll" type="datasource" isList="true" required="true">
<caption>Datasource</caption>
<description></description>
</property>
<property key="enumeration" type="attribute" dataSource="itemsAll"
required="false">
<caption>Columns</caption>
<description></description>
<attributeTypes>
<attributeType name="Enum" />
</attributeTypes>
</property>
export default function Sample({enumeration, itemsAll} : SampleProps) : void {
const attributeValueOfFirstObject = enumeration?.get(itemsAll.items![0])
}
That is the direction I found the answer as well eventually.:
//myCollection is the the ListValue collection
const items = myCollection.items;
if (items) {
list = items.map((item: any) => item[Object.getOwnPropertySymbols(item)[0]].jsonData.attributes);
// rest of code
}