File

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

Index

Methods

Methods

Static clearPropertyValue
clearPropertyValue(value: PropertyValue)
Parameters :
Name Type Optional
value PropertyValue No
Returns : void
Static cutOffFormattedUnit
cutOffFormattedUnit(doubleWithUnit: string)
Parameters :
Name Type Optional
doubleWithUnit string No
Returns : string
Static formEncodedDoubleParamsString
formEncodedDoubleParamsString(value: number, min: number, max: number, unitId: number, precision: number, doubleFormatType: DoubleFormatType)
Parameters :
Name Type Optional
value number No
min number No
max number No
unitId number No
precision number No
doubleFormatType DoubleFormatType No
Returns : string
Static formValueHash
formValueHash(value: PropertyValue)

Hashing

Parameters :
Name Type Optional
value PropertyValue No
Returns : string
Static getEncodedPrecision
getEncodedPrecision(encodedDouble: string)
Parameters :
Name Type Optional
encodedDouble string No
Returns : number
Static getEncodedUnitId
getEncodedUnitId(encodedDouble: string)
Parameters :
Name Type Optional
encodedDouble string No
Returns : number
Static getFormattedLink
getFormattedLink(displayName: string, href?: string)
Parameters :
Name Type Optional
displayName string No
href string Yes
Returns : string
Static getFormattedUnit
getFormattedUnit(unit?: MeasurementUnit)

Formatted values (HTML wrappers)

Parameters :
Name Type Optional
unit MeasurementUnit Yes
Returns : string
Static getMaxPrecision
getMaxPrecision(values: number[])

Double precision

Parameters :
Name Type Optional
values number[] No
Returns : number
Static getValuePrecision
getValuePrecision(value: number | string)
Parameters :
Name Type Optional
value number | string No
Returns : number
Static isPropertyValueEmpty
isPropertyValueEmpty(value: PropertyValue, analyzeValueData?: boolean)
Parameters :
Name Type Optional
value PropertyValue No
analyzeValueData boolean Yes
Returns : boolean
Static isValueEmpty
isValueEmpty(value: any)
Parameters :
Name Type Optional
value any No
Returns : boolean
Static parseEncodedDoubleParamsString
parseEncodedDoubleParamsString(doubleParams: string)

Double encoded string

Parameters :
Name Type Optional
doubleParams string No
Returns : DoubleParams
Static readUnitIdFromEncodedString
readUnitIdFromEncodedString(value: PropertyValue)
Parameters :
Name Type Optional
value PropertyValue No
Returns : number
Static sortByCells
sortByCells(items: T[], cellGetterFn: (item: T) => void, skipIdCheck?: boolean)
Type parameters :
  • T
Parameters :
Name Type Optional
items T[] No
cellGetterFn function No
skipIdCheck boolean Yes
Returns : T[]
Static sortByValues
sortByValues(items: T[], valueGetterFn: (item: T) => void, skipIdCheck?: boolean)
Type parameters :
  • T
Parameters :
Name Type Optional
items T[] No
valueGetterFn function No
skipIdCheck boolean Yes
Returns : void
Static sortCells
sortCells(cells: ConstraintTableCell[], skipIdCheck?: boolean)
Parameters :
Name Type Optional
cells ConstraintTableCell[] No
skipIdCheck boolean Yes
Static sortValues
sortValues(values: PropertyValue[], skipIdCheck?: boolean)

Sorting

Parameters :
Name Type Optional
values PropertyValue[] No
skipIdCheck boolean Yes
Returns : void
Static toBool
toBool(value: any)

[true, true] ,['true', true] ,[false, false] ,['false', false] ,['да', true] ,['Истина', true] ,['0', false] ,['-0', false] ,['1', true] ,['ИСТИНА', true] ,['ЛОжь', false] ,['ложь', false] ,['', false] ,[' ', false] ,[NaN, false] ,[null, false] ,[undefined, false] ,[0, false] ,[1, true] ,[2, true] ,['да', true] ,['дА', true] ,['ДА', true] ,['ДА ', true] ,['ложь ', false]

Parameters :
Name Type Optional
value any No
Returns : boolean

results matching ""

    No results matching ""