File

projects/m2-core/src/lib/core/utils/card.utils.ts

Index

Methods

Methods

Static doForAll
doForAll(rows: CardRow[], fn: (row: CardRow) => void, selfFirst)
Parameters :
Name Type Optional Default value
rows CardRow[] No
fn function No
selfFirst No true
Returns : void
Static doForTop
doForTop(rows: CardRow[], fn: (row: CardRow) => void)

FIXME multiple aggregations/attribute values nested in Categories are skipped!

Parameters :
Name Type Optional
rows CardRow[] No
fn function No
Returns : void
Static findCardItemIds
findCardItemIds(rows: CardRow[], rootItemId?: number)
Parameters :
Name Type Optional
rows CardRow[] No
rootItemId number Yes
Returns : Set<number>
Static findCardRow
findCardRow(rows: CardRow[], predicate: (row: CardRow) => void)

{CardRow} The first row that matches the predicate (recursively)

Parameters :
Name Type Optional
rows CardRow[] No
predicate function No
Returns : CardRow
Static findCardRows
findCardRows(rows: CardRow[], predicate: (row: CardRow) => void)
Parameters :
Name Type Optional
rows CardRow[] No
predicate function No
Returns : CardRow[]
Static findDeclarationByPropertyId
findDeclarationByPropertyId(propertyId: number, declarationsToValues: DeclarationToValues[])
Parameters :
Name Type Optional
propertyId number No
declarationsToValues DeclarationToValues[] No
Static findFirstRowWithInput
findFirstRowWithInput(rows: CardRow[])
Parameters :
Name Type Optional
rows CardRow[] No
Returns : AttributeValueRow
Static findItemRowsSets
findItemRowsSets(rootRows: CardRow[], targetItemId: number, rootItemId?: number)

Find item's rows sets (recursively)

Parameters :
Name Type Optional
rootRows CardRow[] No
targetItemId number No
rootItemId number Yes
Returns : [][]
Static findNearestRowEntity
findNearestRowEntity(rows: CardRow[], targetRow: CardRow, getEntityFn: (r: CardRow) => void)
Type parameters :
  • E

Only root rows are analyzed. Rows after are checked first, then - rows before.

Parameters :
Name Type Optional
rows CardRow[] No
targetRow CardRow No
getEntityFn function No
Returns : literal type
Static getDesirableUnitId
getDesirableUnitId(cardRow: CardRow)

refs #16119 By default we take unit in which the value was input. In case there is no value or its unit is not presented in the double encoded string - use the desirable one (from declaration, constraint column, application attribute, etc.).

TODO refactoring: use polymorphism

Parameters :
Name Type Optional
cardRow CardRow No
Returns : number
Static reassignRowsIds
reassignRowsIds(oldRows: CardRow[], newRows: CardRow[])

#21558 We preserve card row ids when possible to let previous card row components to be reused for better performance.

Parameters :
Name Type Optional
oldRows CardRow[] No
newRows CardRow[] No
Returns : void
Static scrollTabIntoViewIfNeeded
scrollTabIntoViewIfNeeded(accordionComponent: Accordion, index: number)

Scroll into view

Parameters :
Name Type Optional
accordionComponent Accordion No
index number No
Returns : void
Static updateRowUnitIfNeeded
updateRowUnitIfNeeded(row: CardRow, request: UpdatePropertyValueRequest)
Parameters :
Name Type Optional
row CardRow No
request UpdatePropertyValueRequest No
Returns : void

results matching ""

    No results matching ""