player-ui / player

Home Page:https://player-ui.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add sort and filter expressions to CommonExpressionsPlugin

hborawski opened this issue · comments

Is your feature request related to a problem? Please describe.

When working with templates, and assets that can have multi-node children, developers should be able to sort or filter the data being used to produce those collections easily

Describe the solution you'd like

Add expressions to CommonExpressionsPlugin to filter and sort arrays in data.

The sort expression should use an expression to determine the sort order, providing implicit objects to the expression to represent the two elements being compared

example

{{data}} = sort({{rawData}}, 'L["count"] < R["count"]')'

The filter expression should use an expression to determine if the element should be included, providing an implicit object to the expression to represent the element.

example:

{{data}} = filter({{rawData}}, 'E["status"] == "incomplete"')

Additional context