Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@qrvey/utils

Package Overview
Dependencies
Maintainers
13
Versions
454
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qrvey/utils

Helper, Utils for all Qrvey Projects

latest
release-8.6
npmnpm
Version
1.14.0
Version published
Weekly downloads
1.5K
-28.44%
Maintainers
13
Weekly downloads
 
Created
Source

@qrvey/utils 1.12.0

Helper, Utils for all Qrvey Projects

dist/format/format.js

isValidDateString(bytes)

Apply to the given date format to a date value

Parameters
NameTypeDescription
bytestype number 
Returns
  • Void

formatFileSize(bytes)

Set convert Bytes into MB

Parameters
NameTypeDescription
bytestype number 
Returns
  • Void

isValidTimeString([timeString])

It returns true if the given string is a valid time string, and false otherwise

Parameters
NameTypeDescription
timeStringstring- The time string to validate.Optional
Returns
  • A boolean value.

formatTime(timeString, format)

It takes a time string and a format string and returns a formatted time string

Parameters
NameTypeDescription
timeStringany- The time string to be formatted. 
formatstring- The format of the time string. 
Returns
  • Void

dist/tokens/getCleanCustomTokens.js

getCleanCustomTokens(customTokens)

The function getCleanCustomTokens takes an object customTokens and returns a new object cleanTokens with filtered values based on certain conditions.

Parameters
NameTypeDescription
customTokensICustomTokensComplex- The customTokens parameter is an object of type ICustomTokensComplex. 
Returns
  • a cleaned version of the customTokens object.

dist/tokens/getCustomTokenBoxParse.js

getCustomTokenBoxParse(customTokens)

The function getCustomTokenBoxParse takes in an object of custom tokens and returns a formatted list of tokens with aliases and labels.

Parameters
NameTypeDescription
customTokensICustomTokensComplex- The customTokens parameter is an object that contains custom token groups and their corresponding tokens. Each custom token group is represented by a key
in the object, and the value is an array of tokens within that group.
 
Returns
  • an object called tokensList.

dist/tokens/getCustomtonTokens.js

getCustomtonTokens(customtonTokensConfig)

The function getCustomtonTokens takes a configuration object and returns a parsed version of the custom tokens, with keys and values appropriately formatted.

Parameters
NameTypeDescription
customtonTokensConfigICustomTokensSimple ICustomTokensComplex- The customtonTokensConfig parameter is an object that can have two possible types:
ICustomTokensSimple or ICustomTokensComplex.
 
Returns
  • an object of type ICustomTokensComplex.

dist/tokens/getCustomtonTokensWithKeys.js

getCustomtonTokensWithKeys(customTokens)

The function getCustomtonTokensWithKeys takes an array of CustomTokens objects and returns a new array with each object having a key property that is the camelized version of either the key or label property.

Parameters
NameTypeDescription
customTokensArray.<CustomTokens>- An array of objects representing custom tokens. Each object should have properties such as "key" and "label". 
Returns
  • an array of CustomTokens objects. Each object in the array has an additional key property, which is generated by camelizing the key or label property of the original CustomTokens object.

dist/tokens/isTokenLabel.js

isTokenLabel(label)

Get a text and evaluate if it matchs with a token box label.

Parameters
NameTypeDescription
labelstring to evaluate 
Returns
  • True is label matchs; otherwise false

dist/charts/adapters/RequestAdapterMetric.js

getFilterLogic(filters)

If data is truthy, return data.logic, otherwise return an empty array.

Parameters
NameTypeDescription
filters- The data object that is passed to the component. 
Returns
  • Void

metricMakeValue(data)

It takes a data object and returns a MetricValue object

Parameters
NameTypeDescription
data- The data object that is passed to the component. 
Returns
  • A metric value object

isComparison(data)

If data is truthy and data.dateColumn is truthy, return true, otherwise return false.

Parameters
NameTypeDescription
data- The data object that is passed to the component. 
Returns
  • Void

getConfigRelativeObjectBytimeLabel(timeLabel, range)

Given a time label and a custom range, return a relative date config or a metric custom range.

Parameters
NameTypeDescription
timeLabelTIME_PERIOD- TIME_PERIOD.CUSTOM_RANGE 
rangeCustomRangeConfig- CustomRangeConfig 
Returns
  • A relative date config or a metric custom range

makeCustomRangeConfig(customRangeData)

It takes in a custom range config object and returns a custom range object

Parameters
NameTypeDescription
customRangeDataCustomRangeConfig- CustomRangeConfig 
Returns
  • A function that takes in a customRangeData object and returns a customRange object.

getRangeDataPeriod(metricData)

It takes in a metricData object and returns a CustomRangeConfig object

Parameters
NameTypeDescription
metricData- The metric data object that is returned from the API. 
Returns
  • An object with the following properties: startingDate: metricData?.timePeriodDate, endDate: metricData?.timePeriodEndDate, label: metricData?.timePeriodCustomRange?.label,

getRangeDataComparison(metricData)

It takes in a metricData object and returns a CustomRangeConfig object

Parameters
NameTypeDescription
metricData- The metric data object that is returned from the API. 
Returns
  • An object with the following properties: startingDate: metricData?.comparisonDate, endDate: metricData?.comparisonEndDate, label: metricData?.comparisonCustomRange?.label,

dist/filters/classes/FilterInputErrorHandler.js

new FilterInputErrorHandler()

Returns
  • Void

dist/columns/helpers/getColumnsLabel.js

getColumnLabels(column)

[TODO: Finish the function] Get an string of the properties of the given column.

Parameters
NameTypeDescription
columnThe column 
Returns
  • an string with the property, aggregate or calculation label.

dist/columns/helpers/getDatasetColumn.js

getDatasetColumn(column, dataset, getIndex)

Gets the column from the dataset object Recieves a partial column object and returns a full column object from the Dataset

Parameters
NameTypeDescription
columnIColumna partial column info 
datasetIDatasetthe dataset info to look for the column 
getIndexbooleanflag to get the index of the column array or the complete column info 
Returns
  • the dataset column index or the dataset column object

isValidArguments(column, dataset)

Validates the arguments

Parameters
NameTypeDescription
columnIColumna partial column info 
datasetIDatasetthe dataset info 
Returns
  • true: the arguments are valid.

getDatasetColumns(dataset)

Gets the column array

Parameters
NameTypeDescription
datasetIDatasetthe dataset info 
Returns
  • the column array

dist/columns/helpers/getModelColumn.js

getModelColumn(column, model)

Get a model column by a partial column info.

Parameters
NameTypeDescription
columnIColumnThe partial column info 
modelIModelThe model object 
Returns
  • the model column

dist/columns/helpers/getDatasetColumnByDatasets.js

getDatasetColumnByDatasets(column, datasets, getIndex)

Gets a column from a datasets collection. Recieves a partial column object and returns a full column object from the Dataset

Parameters
NameTypeDescription
columnIColumna partial column object 
datasetsIDatasetthe datasets collection to look for the column 
getIndexbooleanflag to get the index of the column array or the complete column info 
Returns
  • the Column object

isValidArguments(column, dataset)

Validates the arguments

Parameters
NameTypeDescription
columnIColumna partial column info 
datasetIDatasetthe datasets collection 
Returns
  • true: the arguments are valid.

dist/filters/services/Filters.api.js

getModel(qrveyid)

Get the model by Qrvey ID

Parameters
NameTypeDescription
qrveyidThe Qrvey ID 
Returns
  • a promise with the resulting model

getDatasets(qrveyids)

Get a dataset list from a collection of Qrvey IDs

Parameters
NameTypeDescription
qrveyidsCollection of Qrvey IDs 
Returns
  • a promise

getDataValues(uFilter, filterLogic, chartSettings, resetApi)

Get a promise with a preview of resulting data. Depending on the validator, the endpoint will change.

Parameters
NameTypeDescription
uFilterThe Filter Builder Filter 
filterLogicAdditional filter logic to apply in the preview 
chartSettings 
resetApiflag to determine when the api should be reseted. 
Returns
  • a promise with a preview of resulting data.

getAvailableScopeIds()

Gets the available scopes and scope IDs

Returns
  • a collection of the pair Scopes and Scope IDs

setConfig(config)

Set the config into the Filter Builder Api class

Parameters
NameTypeDescription
configthe config. 
Returns
  • Void

dist/filters/services/UChartApi.js

this.getChartResult(config, uFilter, filterLogic, chartSettings)

Gets a promise with a resulting data

Parameters
NameTypeDescription
configthe config 
uFilterThe filter Builder filter 
filterLogicAdditional filter logic to apply in the preview 
chartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • a promise with a resulting data

this._getDataFromResponse(response, uFilter)

Gets the Data from preview Response

Parameters
NameTypeDescription
responseThe preview presponse 
uFilterThe filter Builder filter 
Returns
  • The resulting data

this._getResponseSummaries(records, values)

Gets summaries from preview response

Parameters
NameTypeDescription
recordsThe data from preview response 
valuesThe values from the preview response 
Returns
  • the sumaries

_getSearchLogic(uFilter)

Gets the filter object structure for the searching text

Parameters
NameTypeDescription
uFilterIFUFlattenedFilterThe filter object 
Returns
  • the filter object structure

_getFilterCharts(uFilter, searchLogic, chartSettings)

Gets the filters from the chart settings

Parameters
NameTypeDescription
uFilterIFUFlattenedFilterThe filter object 
searchLogicOLD_IFilterDataAdditional filter object for the searching text 
chartSettingsIFUChartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • the filters from the chart settings

_getResponse(records)

Tranform response in array of object with value key Null or undefined values are avoided

Parameters
NameTypeDescription
recordsThe data from preview response 
Returns
  • the sumaries

UChartApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings)

Gets request body structure

Parameters
NameTypeDescription
uFilterIFUFlattenedFilterThe filter object 
filterLogicArray.<IFBLogic>Additional filter logic to apply in the preview 
chartSettingsIFUChartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • the request body structure

UChartApi._getChartBody(uFilter, chartSettings)

Gets chart body structure

Parameters
NameTypeDescription
uFilterThe filter Builder filter 
chartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • the chart body structure

UChartApi._getDimensionsBody(uFilter, chartSettings)

Gets dimension body structure

Parameters
NameTypeDescription
uFilterThe filter Builder filter 
chartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • the dimension body structure

UChartApi._getMaxDataPoints(column, chartSettings)

Gets max data point number

Parameters
NameTypeDescription
columnThe column to filter 
chartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • max data point number

UChartApi._getSortOption(column)

Gets sort option structure

Parameters
NameTypeDescription
columnThe column to filter 
Returns
  • sort option structure

UChartApi._getSummariesBody(uFilter)

Gets summaries body structure

Parameters
NameTypeDescription
uFilterThe filter Builder filter 
Returns
  • summaries body structure

UChartApi._refineBodies(bodies, uFilter)

Refines the body structure

Parameters
NameTypeDescription
bodiesThe body structure 
uFilterThe filter Builder filter 
Returns
  • the body structure

UChartApi._getValidationType(column, vaildator)

Gets the validation type for the preview request

Parameters
NameTypeDescription
columnThe column to filter 
vaildatorValidator Type 
Returns
  • the validator type for the preview request

dist/filters/services/UChartPaginationApi.js

this.getAfterKey()

Gets afterKey object

Returns
  • the afterKey object

this.getChartResult(config, uFilter, filterLogic, chartSettings)

Gets a promise with a resulting data

Parameters
NameTypeDescription
configthe config 
uFilterThe filter Builder filter 
filterLogicAdditional filter logic to apply in the preview 
chartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • a promise with a resulting data

this._getDataFromResponse(response, uFilter)

Gets the Data from preview Response

Parameters
NameTypeDescription
responseThe preview presponse 
uFilterThe filter Builder filter 
Returns
  • The resulting data

this.refineAfterkey(props)

Refines the afterKey object

Parameters
NameTypeDescription
props 
Returns
  • Void

this.setAfterKey(afterKey)

Sets the afterKey object

Parameters
NameTypeDescription
afterKeythe afterKey object 
Returns
  • Void

this.setProps(uFilter)

Sets the Filter Builder Filter

Parameters
NameTypeDescription
uFilter 
Returns
  • Void

_getSearchLogic(uFilter)

Gets the filter object structure for the searching text

Parameters
NameTypeDescription
uFilterIFUFlattenedFilterThe filter object 
Returns
  • the filter object structure

_getFilterCharts(uFilter, searchLogic, chartSettings)

Gets the filters from the chart settings

Parameters
NameTypeDescription
uFilterIFUFlattenedFilterThe filter object 
searchLogicOLD_IFilterDataAdditional filter object for the searching text 
chartSettingsIFUChartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • the filters from the chart settings

_getResponse(records)

Tranform response in array of object with value key Null or undefined values are avoided

Parameters
NameTypeDescription
recordsThe data from preview response 
Returns
  • the sumaries

UChartPaginationApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings)

Gets request body structure

Parameters
NameTypeDescription
uFilterIFUFlattenedFilterThe filter object 
filterLogicArray.<IFBLogic>Additional filter logic to apply in the preview 
chartSettingsIFUChartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • the request body structure

UChartPaginationApi._getDimensionsBody(uFilter)

Gets dimension body structure

Parameters
NameTypeDescription
uFilterThe filter Builder filter 
Returns
  • the dimension body structure

UChartPaginationApi._getDimensionsBodyAdapter(dimensions)

Get a dimension body structure foor pagination endpoint

Parameters
NameTypeDescription
dimensions 
Returns
  • the dimension body structure

UChartPaginationApi._getMaxDataPoints(column, chartSettings)

Gets max data point number

Parameters
NameTypeDescription
columnThe column to filter 
chartSettingsThe settings of the chart. For Aggregate Columns. 
Returns
  • max data point number

UChartPaginationApi._getSortOption(column)

Gets sort option structure

Parameters
NameTypeDescription
columnThe column to filter 
Returns
  • sort option structure

UChartPaginationApi._getSummariesBody(uFilter)

Gets summaries body structure

Parameters
NameTypeDescription
uFilterThe filter Builder filter 
Returns
  • summaries body structure

UChartPaginationApi._refineBodies(bodies, uFilter)

Refines the body structure

Parameters
NameTypeDescription
bodiesThe body structure 
uFilterThe filter Builder filter 
Returns
  • the body structure

UChartPaginationApi._getValidationType(column, vaildator)

Gets the validation type for the preview request

Parameters
NameTypeDescription
columnThe column to filter 
vaildatorValidator Type 
Returns
  • the validator type for the preview request

UChartPaginationApi._getResponseSummaries(records, values)

Gets summaries from preview response

Parameters
NameTypeDescription
recordsThe data from preview response 
valuesThe values from the preview response 
Returns
  • the sumaries

UChartPaginationApi.areColumnsEquals(column1, column2)

Checks if two filter columns are the same.

Parameters
NameTypeDescription
column1 
column2 
Returns
  • True: Columns are equal; False: Columns are not equal

dist/dates/adapters/ISOToNumericOffset.js

ISOToNumericOffset(offset)

Gets the numeric offset (minutes) from the ISO offset (string)

Parameters
NameTypeDescription
offsetnumber stringthe timezone offset 
Returns
  • number the offset in minutes

dist/dates/adapters/dateToHms.js

dateToHms(date, settings)

  • Transform a Date to [HH:mm:ss] date format.
Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
settingsIDFDateToHmsSettingsthe settings of the dateToHms function 
Returns
  • string string of [HH:mm:ss] date format

getDefaultSettings(settings)

Gets the settings for this function.

Parameters
NameTypeDescription
settingsIDFDateToHmsSettingsthe settings of the dateToHms function 
Returns
  • IDFDateToHmsSettings a new object for the settings

getHours(date, settings)

Gets the Hours

Parameters
NameTypeDescription
dateDatethe date object 
settingsIDFDateToHmsSettingsthe settings of the dateToHms function 
Returns
  • string the hour string

getMinutes(date, settings)

Gets the Minutes

Parameters
NameTypeDescription
dateDatethe date object 
settingsIDFDateToHmsSettingsthe settings of the dateToHms function 
Returns
  • string the minute string

getSeconds(date, settings)

Gets the Seconds

Parameters
NameTypeDescription
dateDatethe date object 
settingsIDFDateToHmsSettingsthe settings of the dateToHms function 
Returns
  • string the seconds string

dist/dates/adapters/dateToMdyDate.js

dateToMdyDate(date, settings)

Transform a Date to [mm/dd/yyyy] date format.

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
settingsIDateSettingsthe configuration of dates 
Returns
  • string string of [mm/dd/yyyy] date format

dist/dates/adapters/dateToMonthYear.js

dateToMonthYear(date, settings)

Transform a Date to [Month Year] date format.

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
settingsIDateSettingsthe configuration of dates 
Returns
  • string string of [Month Year] date format

dist/dates/adapters/dateToQuarterYear.js

dateToQuarterYear(date, settings)

Transform a valid Date to [Quarter Year] date format.

Parameters
NameTypeDescription
dateIDateString of a valid date, date object or millisencond number of the date 
settingsIDateSettingsthe configuration of dates 
Returns
  • string string of [Quarter Year] date format

dist/dates/adapters/dateToWeekYear.js

dateToWeekYear(date, settings)

Transform a Date to [W# Year] date format.

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
settingsIDateSettingsthe configuration of dates 
Returns
  • string string of [W# Year] date format

dist/dates/adapters/dateToYear.js

dateToYear(date, settings)

Transform a Date to [Year] date format.

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
settingsIDateSettingsthe configuration of dates 
Returns
  • string string of [Year] date format

dist/dates/adapters/hmsToDate.js

hmsToDate(monthYearDate, settings)

Transforms String time from a [H:m:s] format to Date object.

Parameters
NameTypeDescription
monthYearDatestringString of [H:m:s] time 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate The date object or the date in milliseconds. If the argument is an unexpected time, the function will return the same value

dist/dates/adapters/mdyDateToDate.js

mdyDateToDate({string}monthYearDate, settings)

Transforms String Date from a [mm/dd/yyyy] format to Date object.

Parameters
NameTypeDescription
{string}monthYearDateString of [mm/dd/yyyy] date 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value

dist/dates/adapters/monthYearToDate.js

monthYearToDate(monthYearDate, settings)

Transforms String Date from a [Month Year] format to Date object.

Parameters
NameTypeDescription
monthYearDatestringString of [Month Year] date 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value

dist/dates/adapters/numericOffsetToISO.js

numericOffsetToISO(offset)

Gets the ISO offset From the numeric offset (minutes)

Parameters
NameTypeDescription
offsetnumber stringthe timezone offset 
Returns
  • string the offset in minutes

dist/dates/adapters/quarterYearToDate.js

quarterYearToDate(quarterYearDate, settings)

Transforms String Date from a [Quarter Year] format to Date object.

Parameters
NameTypeDescription
quarterYearDatestringString of [Quarter Year] date 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.

dist/dates/adapters/weekYearToDate.js

weekYearToDate(date, settings)

Transforms String Date from a [Week Year] format to Date object.

Parameters
NameTypeDescription
datestringString of [Week Year] date 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.

dist/dates/adapters/yearToDate.js

yearToDate(yearDate, settings)

Transforms String Date from a [Year] format to Date object.

Parameters
NameTypeDescription
yearDatestringString of [Year] date 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.

dist/dates/helpers/areIncludedDateTokens.js

areIncludedDateTokens({string }date, format)

Determines if the given date has tokens. The date is splitted depending on date format. Undefined date is returning false.

Parameters
NameTypeDescription
{string }dateThe string of the date. It may contain tokens. 
formatIDateFormatThe date format 
Returns
  • boolean true: include tokens; false: otherwise

dist/dates/helpers/getDateByDateFormat.js

getDateByDateFormat(date, format, settings)

Gets a Date Object instance by a Date format

Parameters
NameTypeDescription
datestringString with a formatted date 
formatIDateFormatThe date format 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate a Date object, milisecond time or the same value if date format does not match.

dist/dates/helpers/getDateByTimezone.js

getDateByTimezone(date, timezone)

Gets a date value in the given timezone

Parameters
NameTypeDescription
dateIDatethe date 
timezoneIDTimezonethe timezone object 
Returns
  • IDate A transformed value

dist/dates/helpers/getDateByTimezoneOffset.js

getDateByTimezoneOffset(date, offset)

Gets a Date with the given offset of the Timezone. No given an offset the default is going to be set by the browser

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
offsetIDTimezoneOffsetthe timezone offset 
Returns
  • IDate the updated Date object

dist/dates/helpers/getDateFormatByProperty.js

getDateFormatByProperty(property)

Gets the date format by the given property

Parameters
NameTypeDescription
propertyIColumnPropertyTypeThe Column Property 
Returns
  • IDateFormat The date format

dist/dates/helpers/getDateFormatRegularExpressionInArray.js

getDateFormatRegularExpressionInArray(dateFormat)

Gets an array of regular expressions by the given date format. Day format is the default date format

Parameters
NameTypeDescription
dateFormatIDateFormatan string of the format 
Returns
  • Array.&lt;string&gt; an array of regular expressions

dist/dates/helpers/getDatePickerPickLevel.js

getDatePickerPickLevel(format)

Gets the pick level number related to the Date picker element

Parameters
NameTypeDescription
formatIDateFormatThe date format 
Returns
  • number A number of the pick level setting

dist/dates/helpers/getDateRange.js

getDateRange(value, dateGroupProperty, withTime)

Get date range object from a string date value

Parameters
NameTypeDescription
valueStringstring date value 
dateGroupPropertyStringcould be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' 
withTimeBooleandetermines if the date range will include time. Default is true 
Examples
// 1) Year:
getDateRange('2020', 'YEAR');
// Will return:
{
   from: '01/01/2020 00:00:00',
   to: '12/31/2020 23:59:59'
}

// 2) Quarter:
getDateRange('Q3 2020', 'QUARTER');
// Will return:
{
   from: '07/01/2020 00:00:00',
   to: '09/30/2020 23:59:59'
}

// 3) Month:
getDateRange('Oct 2020', 'MONTH');
// Will return:
{
   from: '10/01/2020 00:00:00',
   to: '10/31/2020 23:59:59'
}
Returns
  • Object an object with the date range with two string date properties: from and to

getStringDate(dt)

It takes a Date object as an argument and returns a string in the format of MM/DD/YYYY

Parameters
NameTypeDescription
dtDate- Date - The date object to convert to a string 
Returns
  • A string in the format of MM/DD/YYYY

dist/dates/helpers/getDefaultDateSettings.js

getDefaultDateSettings(settings)

Gets the default properties for Date Settings object

Parameters
NameTypeDescription
settingsIDateSettingsthe configuration of dates 
Returns
  • IDateSettings a new object with the date settings.

dist/dates/helpers/getFormattedDateByFormat.js

getFormattedDateByFormat(date, format, settings)

A Date object, string or millisecond number are gotten in order to convert it in an formatted string date

  • Some strings are valid
Parameters
NameTypeDescription
dateIDateString with a formatted date 
formatIDateFormatThe date format 
settingsIDateSettingsthe configuration of dates 
Returns
  • IDate a formmatted date or the same value if format does not match

dist/dates/helpers/getSeparatorByDateFormat.js

getSeparatorByDateFormat(format)

Gets the separator of the date format

Parameters
NameTypeDescription
formatIDateFormatthe date format 
Returns
  • string a separator string

dist/dates/helpers/getTimezoneObject.js

getTimezoneObject(timezone, model)

Gets the timezone object by the given argument or the model object

  • In any case, the offset is prioritized. It means, offset overrides other properties.
  • If the offset is undefined, the type is used to calculate the offset
Parameters
NameTypeDescription
timezoneIDTimezonethe timezone object 
modelIModel IDatasetthe info of the dataset (model) 
Returns
  • IDTimezone a new timezone object

getOffset(timezone, model)

Gets the offset of the timezone by the given objects

  • Searchs the first argument
  • If the timezone is empty, in the model timezone is searched
  • If it does not exist in any, a default one is set.
Parameters
NameTypeDescription
timezoneIDTimezoneThe timezone object 
modelIModel IDatasetThe model info 
Returns
  • IDTimezoneOffset the offset of the objects

getType(timezone, model, offset)

Gets the type of the timezone

  • Searchs the first argument
  • If it does not exist, asking for the timezone offset in order to prioritized the offset above all.
  • If the timezone is empty, in the model timezone is searched.
  • If it does not exist in any, a default one is set.
Parameters
NameTypeDescription
timezoneIDTimezoneThe timezone object 
modelIModel IDatasetThe model info 
offsetIDTimezoneOffseta default offset if the validation are not satisfied 
Returns
  • IDTimezoneType the rigth type of the timezone

getTypeByOffset(offset)

Gets the type by a offset

  • For a offset=0 the type is default
  • For a offset="browser" the type is browser
  • For a valid offset different to previous ones, the type is fixed;
  • Anything else, it is considered default.
Parameters
NameTypeDescription
offsetIDTimezoneOffseta given offset 
Returns
  • IDTimezoneType the right timezone type for the offset

getUTC(timezone)

Gets the UTC string by the timezone object

Parameters
NameTypeDescription
timezoneIDTimezonethe timezone object 
Returns
  • string the label of the UTC value

dist/dates/helpers/getTimezoneOffsetByType.js

getTimezoneOffsetByType(type, timezone)

Gets the timezone offset by the timezone type. For browser types, it is calculated by a Date instance Default types is UTC-0 Undefined or Fixed types is gotten by the offset property

Parameters
NameTypeDescription
typeIDTimezoneTypethe timezone type 
timezoneIDTimezone IBTimezonethe timezone object 
Returns
  • IDTimezoneOffset the offset of the timezone

dist/dates/helpers/getWeek.js

getWeek(date)

Gets the week number of the year Additionally, the month and the year

Parameters
NameTypeDescription
dateDatethe date object 
Returns
  • IDateWeek an object with the week, month and year or undefined if the date is not valid.

dist/dates/helpers/getUTCFormatByOffset.js

getUTCFormatByOffset(timezone, minified)

Gets the UTC format dependeing on the given offset

Parameters
NameTypeDescription
timezoneIDTimezonethe timezone object 
minifiedbooleanFlag to reduce the Zeros 
Returns
  • string an string with the UTC format

dist/dates/helpers/isValidDateObject.js

isValidDateObject(date)

If the date is a valid Date object, return true, otherwise return false.

Parameters
NameTypeDescription
dateDate- The date object to check. 
Returns
  • boolean True: The Date object is valid

dist/dates/helpers/isValidISOOffset.js

isValidISOOffset(offset)

Validate if offset uses a valid ISO 8601 offset specification

  • If the given offset is a numeric, returns an invalid flag.
Parameters
NameTypeDescription
offsetIDTimezoneOffsetthe timezone offset 
Returns
  • boolean true if the given offset is valid

dist/dates/helpers/isValidPotentialDate.js

isValidPotentialDate(date)

Checks if the given date is allowed to continue the process for adapting dates

  • If the string is a token or a combination of tokens is not valid
Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
Returns
  • true: the date is valid.

includingDateTokens(date)

Validates if the given date has tokens

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
Returns
  • boolean true: the date has tokens

isDateInstance(date)

Validates if the given date is a date instance

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
Returns
  • boolean true: the date is a date instance

isStringDate(date)

Validates if the given date is a string date

Parameters
NameTypeDescription
dateIDateString, object or millisencond number of the date 
Returns
  • boolean true: the date is a string date

dist/dates/helpers/isValidTimezoneOffset.js

isValidTimezoneOffset(offset)

Validates if the given param is a valid timezone offset

Parameters
NameTypeDescription
offsetIDTimezoneOffsetthe timezone offset 
Returns
  • boolean true: is valid timezone offset.

isValidOffsetRange(offset)

Validates if the given offset is in the timezone range

Parameters
NameTypeDescription
offsetIDTimezoneOffsetthe timezone offset 
Returns
  • boolean true: the offset is in the timezone range

dist/dates/helpers/validateDate.js

validateDate(date, format)

Validate a string date depending on giving format

  • If the string is a token label, the function lets it pass.
  • Otherwise depends of the format
  • Some escenarios the string is a mix of token labels and dates
Parameters
NameTypeDescription
datestringString of date 
formatIDateFormatString of the format to validate 
Returns
  • boolean True if it is valid or not. Undefined if date is undefined

dist/filters/adapters/FDToFlatUI.js

FDToFlatUI(filterData, datasetsInfo)

Generates a Flattened UI filter structure from Filter Data structure.

Parameters
NameTypeDescription
filterDataThe filter data object. 
datasetsInfoCollection of datasets information 
Returns
  • a flattened UI filters array

FD21ToFlatUI(scopes, datasetsInfo)

Generates a Filter Builder Structure from the Filter Data structure v2.1

Parameters
NameTypeDescription
scopesThe filter scope section 
datasetsInfoCollection of datasets information 
Returns
  • a flattened UI filters array

dist/filters/adapters/FDToLogic.js

FDToLogic(filterData)

Generates a Filter Logic structure from Filter Data structure.

Parameters
NameTypeDescription
filterDataThe filter data object. 
Returns
  • a filter logic array

getLogicBodyFromFD21(filterData)

Gets the logic body

Parameters
NameTypeDescription
filterDataThe filter data object 
Returns
  • a filter logic array

dist/filters/adapters/FDToUI.js

FDToUI(filterData, datasetsInfo)

Generates a UI filter structure from Filter Data structure.

Parameters
NameTypeDescription
filterDataThe filter data object. 
datasetsInfoCollection of datasets information 
Returns
  • a UI Filters structure

FD21ToUI(scopes, section, version, datasetsInfo)

Generates a UI filter Structure from the Filter Data structure v2.1

Parameters
NameTypeDescription
scopesThe filter scope section 
sectionThe filter section. 
versionThe version of the filter structure 
datasetsInfoCollection of datasets information 
Returns
  • a UI filter Structure

dist/filters/adapters/UIToFD.js

UIToFD(filterData)

Generates a Filter Data Structure structure from UI Filter Data structure.

Parameters
NameTypeDescription
filterDataThe UI filter data object. 
Returns
  • a Filter Data structure

UI21ToFD(uFilterData, version) private method

Builds the Fitler Data structure from UI filter data

Parameters
NameTypeDescription
uFilterDataThe UI filter Data object 
versionthe version of the structure 
Returns
  • a Filter Data structure

dist/filters/adapters/UIToFlatUI.js

UIToFlatUI(filterData, datasetsInfo)

Generates a Flattened UI filter structure from UI Filter Data structure.

Parameters
NameTypeDescription
filterDataThe UI filter data object. 
datasetsInfoCollection of datasets information. Optional for updating the datasets info 
Returns
  • a flattened UI filters array

UI21ToFlatUI(scopes)

Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1

Parameters
NameTypeDescription
scopesThe filter scope section 
Returns
  • a flattened UI filters array

dist/filters/adapters/adaptDateGroupingProperty.js

adaptDateGroupingProperty(property)

[TODO: For 2022, eliminate this adapter] Get the new property base on the old date grouping properties

Parameters
NameTypeDescription
propertythe property to be adapted 
Returns
  • a adapted property

dist/filters/adapters/adaptFilterData.js

adaptFilterData(filterData, getUIFilterData, datasetsInfo)

Checks and adapts the v2.0 Filter Data Structure to the v2.1

Parameters
NameTypeDescription
filterDataThe filter data structure. Accepts both v2.1 or v2.0 
getUIFilterDataFlag to get a Filter Data (False) or the UI Filter Data (True) 
datasetsInfoCollection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory 
Returns
  • A new filter data structure v2.1

dist/filters/adapters/adaptFilterValues.js

adaptFilterValues(filter)

[TODO: For 2022, eliminate this adapter] Gets an adapted filter value array. Validates the enabled property and sets

Parameters
NameTypeDescription
filterThe filter 
Returns
  • A new value array with the filled properties.

dist/filters/adapters/flatUIToFD.js

flatUIToFD(uFilters, version)

Generates a filter data structure from the flatttened UI filters.

Parameters
NameTypeDescription
uFiltersArray of flattened filters from UI 
versionTag for the version of the filter data structure 
Returns
  • a Filter Data.

buildScopes(fbFilters)

Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs Also, adds and organizes filters by datasets

Parameters
NameTypeDescription
fbFiltersArray of flat filters from UI 
Returns
  • an array of scopes structure.

buildScope(uFilter)

Gets an scope structure for the filter data

Parameters
NameTypeDescription
uFilterUI structure filter 
Returns
  • an scope structure

buildDataset(uFilter)

Gets an dataset structure for the filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an dataset structure

buildFilter(uFilter)

Gets an filter structure for the filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an filter structure

dist/filters/adapters/flatUIToLogic.js

flatUIToLogic(uFilter)

Generates a Logic structure from flattened UI filters

Parameters
NameTypeDescription
uFilterArray of flat filters from UI 
Returns
  • The logic structure

dist/filters/adapters/flatUIToOldLogic.js

flatUIToOldLogic(uFilters)

Generates a Logic structure from flattened UI filters

Parameters
NameTypeDescription
uFiltersArray of flat filters from UI 
Returns
  • The logic structure

dist/filters/adapters/flatUIToUI.js

flatUIToUI(uFilters, version)

Generates a UI filter data structure from the flatttened UI filters.

Parameters
NameTypeDescription
uFiltersArray of flattened filters from UI 
versionTag for the version of the filter data structure 
Returns
  • a UI Filter Data.

buildScopes(fbFilters)

Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs Also, adds and organizes filters by datasets

Parameters
NameTypeDescription
fbFiltersArray of flat filters from UI 
Returns
  • an array of scopes structure.

buildScope(uFilter)

Gets an scope structure for the UI filter data

Parameters
NameTypeDescription
uFilterUI structure filter 
Returns
  • an scope structure

buildDataset(uFilter)

Gets an dataset structure for the UI filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an dataset structure

buildFilter(uFilter)

Gets an filter structure for the UI filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an filter structure

dist/filters/adapters/logicToFD.js

logicToFD(filterData, version)

Generates a filter data structure from the old logic structure (v2.0).

Parameters
NameTypeDescription
filterDataThe old filter data structure with logic (v2.0) 
versionTag for the version of the filter data structure 
Returns
  • a Filter Data.

dist/filters/adapters/logicToFlatUI.js

logicToFlatUI(logics)

Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.

Parameters
NameTypeDescription
logicsThe old logic structure (v2.0) 
Returns
  • The Flattened UI Filters array

getFilter(filters, filter, getIndex)

Get the filter or the index of the given array, validating an old filter structure.

Parameters
NameTypeDescription
filtersThe array of UI filters 
filterThe old logic structure filter 
getIndexDetermines if the index or returns the UI filter object 
Returns
  • the index or the UI filter object

refineRankingValues(values, uiValues)

Refines the values of the Ranking column type.

Parameters
NameTypeDescription
valuesthe Array of Ranking values 
uiValuesObject with additional info about the values of the filter. 
Returns
  • the array of Ranking values

dist/filters/adapters/logicToUI.js

logicToUI(uFilters, datasetsInfo)

Generates a UI filter structure from the old logic structure (v2.0).

Parameters
NameTypeDescription
uFiltersArray of filters from old logic structure 
datasetsInfoCollection of datasets information 
Returns
  • a UI Filter Data.

dist/filters/adapters/modelAnswerToFilterValue.js

modelAnswerToFilterValue(answers)

Adapter for model answer to convert to recognizable values for Filter Builder

Parameters
NameTypeDescription
answersArray of the qrvey model answers 
Returns
  • Array of values

dist/dates/relative/RelativeStatementAdapter.js

value()

Resolves statement and returns statement value

Returns
  • AbsoluteRange string

valueAsAnchor()

Resolves statement as an anchor

Returns
  • string

_statementToRange() private method

Convert verbal statement to range value

Returns
  • AbsoluteRange

_resolveAsThis() private method

Apply 'this' cursor logic to statement

Returns
  • AbsoluteStatement

_resolveAsTheLast() private method

Apply 'the last' cursor logic to statement

Returns
  • AbsoluteStatement

_resolveAsTheNext() private method

Apply 'the next' cursor logic to statement

Returns
  • AbsoluteStatement

replaceNowToken(value, now)

Replace '@now' token inside a string

Parameters
NameTypeDescription
valuestring 
nowDate 
Returns
  • string

convertRelativeToAbsolute(args)

Returns a range object (date) from a group of statement params

Parameters
NameTypeDescription
argsRelativeToAbsoluteStruct 
Examples
pivot = '2021-03-03T12:30:40'
unit = month
steps = 2
setTo = END
resolverAsCalendar: true
=> Returns  '2021-05-31T23:59:59'
pivot = '2021-03-03T12:30:40'
unit = month
steps = -2
setTo = START
resolverAsCalendar: false
=> Returns '2021-01-03T00:00:00'
Returns
  • string

dist/dates/relative/relative.js

resolveRelative(statements, clock)

Resolve a list of relative statements according to operator

Parameters
NameTypeDescription
statements- Raw statements/values 
clock- Clock/time reference for relative date resolution 
Examples
Input:
{
 "cursor": "the_next",
 "unit": "year",
 "number": 1,
 "includeCurrent": false,
 "isCalendarDate": false,
 "anchor": "03/05/2021"
}

Output:
{ gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
Returns

dist/filters/helpers/OLD_getAggFilters.js

getAggFilters(logics, summaries)

Parameters
NameTypeDescription
logics 
summaries 
Returns
  • the filter aggregate structure

getAggregateFilters(logics, formatToFilters)

Filters and gets the filters used for aggregate values.

Parameters
NameTypeDescription
logicsThe filter logic structure 
formatToFiltersFlag to change de way of returning the filter structure. 
Returns
  • the aggregate filters in the IFilterFilters way or as logic structure.

dist/filters/helpers/applyHierarchyForAggFilters.js

applyHierarchyForAggFilters(chartSettings, scopes, currentScope)

[TODO: Make a proper description for this function]

Parameters
NameTypeDescription
chartSettingsChart Settings for the Filter Builder 
scopesthe pair id/label scopes 
currentScopethe scope to be validated 
Returns
  • the chart settings

dist/filters/helpers/filtersTokensToString.js

filtersTokensToString(tokens)

It takes an array of tokens and returns a string

Parameters
NameTypeDescription
tokensArray.<IFFilterTokens>- IFFilterTokens[] - the tokens to convert to a string 
Returns
  • A string

dist/filters/helpers/getAggFiltersFromFilterData.js

getAggFiltersFromFilterData(filterData, _summaries) private method

Parameters
NameTypeDescription
filterData 
_summaries 
Returns
  • the aggFilters structure

dist/filters/helpers/getAvailableScopesIDsByConfig.js

getAvailableScopesIDsByConfig(config)

Gets the Scopes IDS for the Available Scope function by any config

Parameters
NameTypeDescription
configany config 
Returns
  • a Available Scope IDS config

dist/filters/helpers/getScopesByHierarchy.js

getScopesByHierarchy(scopes, currentScope)

[TODO: Make a description for this]

Parameters
NameTypeDescription
scopesthe collection of Scopes/Scope IDs 
currentScopeCurrent scope type 
Returns
  • A new array of Scopes/Scope IDs

dist/filters/helpers/getTokensFromFilters.js

getTokensFromFilters(filters, options)

It takes a filter object and returns an array of tokens that represent the filter

Parameters
NameTypeDescription
filtersIFUData- The filters object. 
optionsIFTokensFromFiltersSettings- IFTokensFromFiltersSettings 
Returns
  • Array.&lt;IFFilterTokens&gt; An array of tokens that represents the filters object

dist/filters/helpers/getVerboseFilter.js

getVerboseFilter(filters, options)

It takes a set of filters and returns a string that describes the filters

Parameters
NameTypeDescription
filtersIFUData- The filters object that you want to convert to a string. 
optionsIFTokensFromFiltersSettings- IFTokensFromFiltersSettings 
Returns
  • A string

dist/filters/helpers/getAvailableScopes.js

getAvailableScopes(config)

Gets Scopes/Scope IDs by given IDs

Parameters
NameTypeDescription
configgiven Differnts IDs in order set a available scope 
Returns
  • a Scopes/Scope IDs array

dist/format/duration/addDurationFormat.js

addDurationFormat(number, format[, locale, fractionDigits])

[TODO: The decimals dots are not working correctly, we need to reviewing (fractionDigits)] "Convert a number of seconds to a human readable string."

addDurationFormat is a function that takes a number, a format, an optional locale, and an optional number of fraction digits, and returns a string

Parameters
NameTypeDescription
numbernumber- The number of milliseconds to format. 
formatstring- The format string. 
localestring- The locale to use for formatting. If not specified, the default locale is used.Optional
fractionDigitsnumber- The number of digits to show after the decimal point.Optional
Returns
  • A string

dist/format/duration/durationFormatter.js

setLocaleFormatter()

It sets the locale formatter for the number.

Returns
  • Void

getNewNumberFormat(locale)

It returns a new instance of the Intl.NumberFormat class, which is a built-in JavaScript class that formats numbers

Parameters
NameTypeDescription
localestring Array.<string>- stringstring[]
Returns
  • A new instance of the Intl.NumberFormat class.

setParts(template)

It takes a template string and sets the parts property to the result of calling the parseFormatTemplate function with the template string as an argument

Parameters
NameTypeDescription
templatestring- The format template string. 
Returns
  • Void

matchFormatsReplace(template)

It replaces the H and D characters in the template with h and d respectively

Parameters
NameTypeDescription
templatestring- The template string to be used for the date format. 
Returns
  • The template string with all instances of H replaced with h and all instances of D replaced with d.

setNumberFactor()

It sets the numberFactor to the value of the duration part that matches the unit.

Returns
  • Void

parseFormatTemplate(template)

It takes a string, splits it into an array of strings, then maps each string to a config object, then filters out any falsy values, then reverses the array

Parameters
NameTypeDescription
templatestring- string - the template string that we want to parse 
Returns
  • An array of objects that have the order and the name of the part of the duration.

format(number)

It takes a number, multiplies it by a factor, then uses the parts array to calculate the number of each part in the number, then uses the template to format the number

Parameters
NameTypeDescription
numbernumber- The number of milliseconds to format. 
Returns
  • The template string with the values replaced.

formatValue(parts, part)

It takes a dictionary of values and a list of keys, and returns a formatted string

Parameters
NameTypeDescription
parts- { [x: string]: any; } 
partstring `Array.<stringnumber>`- This is the part of the date that we're formatting.
Returns
  • The value of the part of the date that is being formatted.

dist/globalization/service/i18nextBuilder.js

new I18nService()

This class allows to use the translation service of the i18next library

Returns
  • Void

dist/qrvey/helpers/areStaticColumnValues.js

areStaticColumnValues(column)

Determines if the given column is belonging to static values questions. Static values questions are questions that do not need request an info from backend, instead the info is got from Model, Question/List object.

Parameters
NameTypeDescription
columnThe question column 
Returns
  • true if the column belongs to a static values question; otherwise, false

dist/qrvey/helpers/getCategorizableExpression.js

getCategorizableExpression(column, dataset)

Special function for Expression Columns. This function allows validating if expression columns have active category option. This is esential in order to display the asigned property for expression.

Parameters
NameTypeDescription
columnThe column with info 
datasetthe dataset object to search the column 
Returns
  • true if expression column is categorizable; otherwise not. If does not exist, undefined is sent.

dist/qrvey/helpers/getDataAnswersByColumn.js

getDataAnswersByColumn(column, model, property)

Get answers located in model object. If column exists in the model, answers will be gotten depending on column type. For Rating columns, needs a number sequence (From 1 to 5). For Expression columns, needs a property type attribute for categorizable ones; for non-categorizable expressions is not required this attribute. For the others columns, answers is located in the property of the same name.

Parameters
NameTypeDescription
columnInfo of the column 
modelThe model object 
propertyOptional Attribute, especially for expression columns. 
Returns
  • Formatted answers inside of answer property.

dist/qrvey/helpers/getDatasetByColumn.js

getDatasetByColumn(column, datasets)

Gets a dataset by a given partial column

Parameters
NameTypeDescription
columnthe partial column 
datasetsthe collection of dataset to look for one. 
Returns
  • the found dataset or undefined

dist/qrvey/helpers/getExpressionAnswers.js

getExpressionAnswers(column, property)

Get the answers of expression columns. Depends of the property attribute and if the column is categorizable.

Parameters
NameTypeDescription
columnThe column located inside the model object. 
propertyOptional Attribute, especially for expression columns. 
Returns
  • Formatted answers inside of an answer property.

dist/qrvey/helpers/getDropdownAnswers.js

getDropdownAnswers(question)

Get the answers of dropdown columns. Answers is a direct array of strings so it is necessary to format them.

Parameters
NameTypeDescription
questionThe column located inside the model object. 
Returns
  • Formatted answers inside of an answer property.

dist/qrvey/helpers/getImageAnswers.js

getImageAnswers(column)

Get the answers of image columns.

Parameters
NameTypeDescription
columnThe column located inside the model object. 
Returns
  • Formatted answers inside of an answer property.

dist/qrvey/helpers/getImageUploadHasAnalysis.js

getImageUploadHasAnalysis(column, model)

Special function for Image Upload This function returns if the current column has object or text analysis as property.

Parameters
NameTypeDescription
columnThe column with info 
modelThe model object 
Returns
  • true if this column has analysis. Otherwise false.

dist/qrvey/helpers/getRatingAnswers.js

getRatingAnswers(_question)

Get the answers of rating columns.

Parameters
NameTypeDescription
_questionThe column located inside the model object. 
Returns
  • Formatted answers inside of an answer property

dist/qrvey/helpers/getSlidebarAnswers.js

getSlidebarAnswers(_question)

Get the answers of slidebar columns. The quantity of answers depend on the steps chosen in maker.

Parameters
NameTypeDescription
_questionThe column located inside the model object. 
Returns
  • Formatted answers inside of an answer property

dist/qrvey/helpers/getSuffixTranslateByColumn.js

getSuffixTranslateByColumn(column)

Gets a string of the translate structure by the given column

Parameters
NameTypeDescription
columnthe Info of the column 
Returns
  • a string of the translation structure where the label is located.

dist/qrvey/helpers/getValueWithSuffixes.js

getValueWithSuffixes(value, suffixes)

Get a string value with suffixes if available. Add suffix into the value string. Prioritized for numeric values.

Parameters
NameTypeDescription
valuea number or string 
suffixesAn object with singular or plural suffix string. 
Returns
  • a string value with suffix

dist/qrvey/helpers/getYesNoAnswers.js

getYesNoAnswers(column)

Get the answers of Yes/No columns. Yes/No answers from model object are capitalized but the filters need values in lowercase.

Parameters
NameTypeDescription
columnThe column located inside the model object. 
Returns
  • Formatted answers inside of an answer property

dist/qrvey/helpers/transformValue.js

transformValue(value, settings)

Transforms a value depending of localization/globalization and extras settings.

Parameters
NameTypeDescription
valueA value to transform 
settingsThe settings of the transformValue function 
Returns
  • A transformed value

getDefaultSettings(settings)

Gets the default settings properties

Parameters
NameTypeDescription
settingsITransformValueSettingsthe given settings 
Returns
  • ITransformValueSettings the settings with default properties

getOutputFormat(settings)

Gets the outputformat settings

Parameters
NameTypeDescription
settingsThe settings of the transformValue function 
Returns
  • the outputformat settings

getFormatConfig(settings)

Gets the format config if the locale exists in i18n settings

Parameters
NameTypeDescription
settingsThe settings of the transformValue function 
Returns
  • the format config

getOutputFormatByPoperty(settings)

If the property is a day, return the date format without the time, otherwise return the original format.

Parameters
NameTypeDescription
settingsITransformValueSettings- ITransformValueSettings 
Returns
  • The outputFormat of the column.

isDateWithTime(property)

Get the format related to the columnn property. If the property is hour, minute, second, or undefined, return true.

Parameters
NameTypeDescription
propertyIColumnPropertyType- The property of the date to group by. 
Returns
  • boolean A boolean value.

dist/general/mix/compareDeep.js

compareDeep(object1, object2)

Compares two objects to know if they are equals. Go across nested objects. Includes arrays in the comparison.

Parameters
NameTypeDescription
object1First Object to compare 
object2Second Object to compare 
Returns
  • True: objects are equal. False: Objects are not equal. Undefined: invalid

dist/general/mix/getTag.js

getTag(value)

Gets the toStringTag of value.

Parameters
NameTypeDescription
valueThe value to query. 
Returns
  • string Returns the toStringTag.

dist/general/mix/importScripts.js

importScripts(scripts)

Import a set of external Scripts given the URL in both serie and cascade way

Parameters
NameTypeDescription
scriptsArray.<String> Array.<Object>can be an array of string or an array of object with the follow structure: 
scripts.urlStringCDN URL 
scripts.namespaceString Function(Optional) if is a String, that name is evaluated on Window[namespace] object otherwise the Function is invoked expecting a Thrutly value 
scripts.typeString(Optional) it could be module of text/javascript. Default text/javascript 
scripts.noModuleBoolean(Optional) add momodule attribute to script tag. Default false 
scripts.dependenciesArray.<Object>an array with the same structure to load in cascade mode 
Examples
// 1) Simple script (paralell loading)
importScripts(['http://myscript.js', 'http://another.js']);

// 2) Loading `.js` and `.esm.js` script (parallel loading)
importScripts([
  { url: 'http://myscript.esm.js', type: 'module' },
  { url: 'http://myscript.js', noModule: true }
]);

// 3) import dependent scripts (cascade)
importScripts([
  { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
]);

// 4) mix
importScripts([
  { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
  { url: 'http://another.esm.js', type: 'module' },
  { url: 'http://another.js', noModule: true },
  'http://simplescript.js'
]);
Returns
  • Promise Promise when all script have been loaded

loadScript(url, type, noModule)

Creates the script element and appends to document.head return a Promise that is resolved when the script is loaded

Parameters
NameTypeDescription
urlStringCdn Url 
typeString(Optional) it could be module of text/javascript. Default text/javascript 
noModuleboolean(Optional) add momodule attribute to script tag. Default false 
Returns
  • Void

dist/general/mix/isEmpty.js

isEmpty(variable, includeFalsy)

Validates if the given argument is empty

Parameters
NameTypeDescription
variablethe given variable 
includeFalsyflag to determine include the falsy variables into the validation 
Returns
  • true: the given argument is empty; false: is not.

dist/general/mix/isNaNV2.js

isNaNV2(variable)

Validates if the recieved number is NaN type.

Conditions:

  • This function recieves any variable but will return true if it is different to number.
  • Empty variables as undefined, null, empty string will return true.

Special case for isNaN

  • The isNaN('') is considered as false statement. The empty string is converted to 0 which is not NaN.
  • Boolean variables is considered as false statement.
  • Date objects is considered as true.
Parameters
NameTypeDescription
variablethe variable to validate 
Returns
  • True: variable is a NaN; False: The variable is a number

dist/general/mix/isNull.js

isNull(arg)

return if a given variable is either null or undefined useful to avoid falsify validating Number Zero (0)

Parameters
NameTypeDescription
argany 
Returns
  • Boolean

dist/general/mix/randomId.js

randomId(length, exclude)

Creates a random string

  • If the first given argument is different than a length number, the variable is replaced by a default number
  • If the optional second given argument is passed the random string is permutated.
Parameters
NameTypeDescription
lengthNumbersize of the generated string. Default 8 
excludeArraycollection of strings that is going to be excluded of the random string. 
Returns
  • String Random string

dist/general/mix/size.js

size(obj)

Gets the length of the given array.

  • Useful for Object, Array and string type.
  • For null or undefined or else argument the returned value will be 0.
Parameters
NameTypeDescription
objAnyAny object-type variable 
Returns
  • Number the size of the given variable

dist/general/numeric/getSign.js

getSign(num)

Gets the numeric sign of a given number

Parameters
NameTypeDescription
numnumberthe number 
Returns
  • string an string with the sign

dist/general/string/capitalize.js

capitalize(text)

Upper case the first letter of a given text

Parameters
NameTypeDescription
textString 
Returns
  • String a capitalized text

dist/general/string/padLeadingZeros.js

padLeadingZeros(num, size, padding)

Sets an amount of zeros as prefix of the given number by its length

Parameters
NameTypeDescription
numnumber stringthe number 
sizenumberthe quantity of zeros to add 
paddingnumberTrue: to pad with missing zeros; depending on the num length. False: to fill zeros by the amount. 
Examples
num = 100
size = 2
padding = true
=> Returns  "100"
num = 100
size = 5
padding = true
=> Returns  "00100"
num = 100
size = 2
padding = false
=> Returns  "00100"
num = 100
size = 5
padding = false
=> Returns  "00000100"
Returns
  • the string of the number with the prefixed zeros

getAbsoluteNum(num, sign)

Gets the absolute number of the giving parameters

Parameters
NameTypeDescription
numnumber stringthe number 
signstringthe sign of the number 
Returns
  • string the absolute number

getNumSign(num)

Gets the number sign

Parameters
NameTypeDescription
numnumber stringthe number 
Returns
  • string the number sign

dist/general/array/addPropertyToArrayOfObjects.js

addPropertyToArrayOfObjects(info)

It takes an array of objects, adds a property to each object, and returns the new array.

Parameters
NameTypeDescription
infoObject- Information needed to add property to the array of objects. 
info.arrayArray- The array of objects you want to add a property to. 
info.propertystring- The property you want to add to the object. 
info.valueany- - The value to be added to the array of objects. ---------------------------------------------------------------------------------------------- 
Examples
<caption>Example usage of addPropertyToArrayOfObjects.</caption> addPropertyToArrayOfObjects({
	array: [{ name: "John", lastName: "Doe" }, { name: "Chris", lastName: "Musk" }],
	property: "lastName",
	value: 'Peck'
});
Returns
  • the new array created.

dist/general/array/delete.js

ArrayDelete(array, index)

Inmutable Array Item deletion

Parameters
NameTypeDescription
arrayArraya collection of items to delete 
indexNumberthe position of the item to delete 
Returns
  • a new Array or the given parameter when is empty or not an array

dist/general/array/filterNestedTree.js

filterNestedTree(arr, childArrKey, condition)

Filters a nested tree array by a custom condition on the last child node

  • If the given arguments are not valid, the function returns the first argument.
  • If the childArrKey is not matched in the object, the condition tries to resolve the filter anyway and returns an empty array.
  • If the condition is not fulfilled, the function returns a filtered array, probably a empty array inside of the child array
Parameters
NameTypeDescription
arrnested tree array 
childArrKeyproperty representing the children array on the nested tree 
conditionfunction callback that determines if the filter is applied on the last child node of the nested tree 
Returns
  • array filtered

dist/general/array/flattenDeep.js

flattenDeep(arr)

Flat deeply an array

Parameters
NameTypeDescription
arrArray to flat deeply 
Returns
  • flatten array

dist/general/array/getArrayByProperty.js

getArrayByProperty(arr, property)

Gets a collection of object values by the given property

Parameters
NameTypeDescription
arrAn array 
propertythe property to get the value collection 
Returns
  • a collection of values by property

dist/general/array/getFirstIndexFromArray.js

getFirstIndexFromArray(array, callback)

Gets the first index from the array by a callback condition

Parameters
NameTypeDescription
array 
callbackfunction callback 
Returns
  • the first index of the array. -1 when the condition is not satisfied

dist/general/array/getLastIndexFromArray.js

getLastIndexFromArray(array, callback)

Gets the last index from the array by a callback condition

Parameters
NameTypeDescription
array 
callbackfunction callback 
Returns
  • the last index of the array. -1 when the condition is not satisfied

dist/general/array/getUniqueArray.js

getUniqueArray(arr, prop)

Remove duplicated items from a given array by property name // 1. Store the keys of the unique objects // 2. Eliminate the dead keys & store unique objects

Parameters
NameTypeDescription
arrThe array 
propProperty name to search duplicated values 
Returns
  • Array without duplicated items.

dist/general/object/applyTimezoneDeep.js

applyTimezoneDeep(obj, timezone)

Transforms the date+times propertiesof the given object by the Timezone object

Parameters
NameTypeDescription
objanythe object 
timezoneIDTimezonethe timezone object 
Returns
  • IFSData IFUData the new filter data with the transformed datetime values

dist/general/object/cloneDeep.js

cloneDeep(obj)

A simple Deep Cloning function. Valid only for primivite values and object with primitive values. Not to use this function with inner objects and functions

Parameters
NameTypeDescription
objThe object 
Returns
  • The new reference object or the given object if the parsing is incorrect or empty

dist/general/object/get.js

_get(baseObject, path, defaultValue)

Like lodash _.get. Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.

Empty arrays and empty objects are returned but the defaultValue is not Undefined and null values will return the defaultValue.

Parameters
NameTypeDescription
baseObjectThe object to query 
pathThe string path or collection of string paths of the property to get. 
defaultValueThe value returned for undefined resolved values. 
Examples
// returns 'Hello'
_get({ item1: 'Hello', item2: 'World' }, 'item1')
// returns 'A simple Hello'
_get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
// returns 'Hello Again'
_get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
// returns 'Hello 2'
_get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
// returns 'Hello Again'
_get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
Returns
  • the resolved value.

dist/general/object/getAttribute.js

getAttribute(obj, key)

Searchs for properties in different case styles such as: lower, upper, camel and pascal

  • To optimize the searching, it is required a key in a snake_case style
  • List of cases that do not match -- From lower to snake case -- From upper to snake case -- From lower to camel case -- From upper to camel case -- From lower to pascal case -- From upper to pascal case
Parameters
NameTypeDescription
objobjectobject to look for 
keystringString attribute in snake_case style 
Examples
getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
Returns
  • Void

dist/general/object/hasProperty.js

_hasProperty(obj, property)

Use the hasOwnProperty in order to verify if the given property exists in the object.

Parameters
NameTypeDescription
objobjectan object 
propertystringString to verify if exists in the object as property 
Examples
const prop = 'prop2'
const obj1 = { prop1: 'hello', prop2: 'world'}
_hasProperty(ob1, prop1) // true

const obj2 = { prop1: 'hello world' }
_hasProperty(ob1, prop2) // false
Returns
  • True if the object has the given property; otherwise, false.

dist/general/object/isObject.js

isObject(obj)

Checks if the given argument is an object type

Parameters
NameTypeDescription
objthe variable to check 
Returns
  • True: It is an object; False: It is not.

dist/general/object/mapValues.js

mapValues(baseObject, iteratee)

Invoke iteratee (function) for each object key-value pair and return a mapped object

Parameters
NameTypeDescription
baseObjectObjectBase object. 
iterateeFunctionThe executed per iteration. 
Returns
  • Object New mapped object.

dist/general/object/mergeDeep.js

mergeDeep(obj1, obj2, settings)

Merges two objects into a new one. The second given argument to the first given argument.

Parameters
NameTypeDescription
obj1The target object 
obj2The object to be merged 
settingsObject settings for this function 
Returns
  • a new merged object

isValid(obj1, obj2)

Validates if the two arguments are objects

Parameters
NameTypeDescription
obj1The target object 
obj2The object to be merged 
Returns
  • true: they are valid; false: they are not

getParamsToMergeDeep(settings)

Validates and gets the settings with all set parameters.

Parameters
NameTypeDescription
settingsthe settings object 
Returns
  • a new settings object with all set parameters.

dist/general/object/objectCopy.js

objectCopy(entity, cache)

Created a new reference of the given argument

Parameters
NameTypeDescription
entityThe variable to be copied 
cache 
Returns
  • A new reference of the given argument

dist/general/object/omit.js

omit(obj, props)

return a new Object excluding attributes in props list

Parameters
NameTypeDescription
objObjectbase object 
propsArray.<String>list of attribute to exclude 
Returns
  • Object clean object

dist/general/object/removeUndefinedDeep.js

removeUndefinedDeep(obj)

Removes and returns the given object cleaning the undefined values

Parameters
NameTypeDescription
objan object 
Returns
  • the new object with no undefined values

dist/general/object/pick.js

pick(baseObject, keys)

return a new object just with attributes in keys list

Parameters
NameTypeDescription
baseObjectObjectbase object 
keysArray.<String>list of attributes to preserve 
Returns
  • Object new object just with desired attributes

dist/general/object/serialize.js

serialize(obj)

serialize object to url param

Parameters
NameTypeDescription
obj- Object to be serialized 
Returns
  • Void

dist/services/adapters/BBranchesMapToUIBranchesMap.adapter.js

BBranchesMapToUIBranchesMap(branchesMap)

Adapts the branches map from backend to the UI branches map

Parameters
NameTypeDescription
branchesMapthe backend branches map 
Returns
  • The Branches map array

dist/services/adapters/BTimezoneToUITimezone.js

BTimezoneToUITimezone(timezone)

Transforms the backenc timezone structure to UI timezone structure

Parameters
NameTypeDescription
timezoneIBTimezonethe backend timezone object 
Returns
  • IDTimezone the UI timezone object

dist/services/api/getAllDatasets.api.js

getAllDatasets(config, qrveyids)

Get a dataset list from a collection of Qrvey IDs Considerations for qrveyids second argument:

  • If it is a undefined argument, the function will return all available datasets of the app
  • If it is a empty array argument, the function will return an empty dataset list. (A request will not be executed)
  • If it is a non-empty array argument, the function will return a set of available datasets
Parameters
NameTypeDescription
configthe widget config. Includes general configuration properties 
qrveyidsCollection of Qrvey IDs for returning a set of available datasets 
Returns
  • a promise that if it is resolved displays a collection of dataset info.

dist/services/api/getAllQrveys.api.js

getAllQrveys(config, params)

Request function for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data

Parameters
NameTypeDescription
configConfiguration 
paramsObject for getting precise data 
Returns
  • Void

dist/services/api/getDatasetColumns.api.js

getDatasetColumns(qrveyid)

Get a dataset by Qrvey ID

Parameters
NameTypeDescription
qrveyidThe Qrvey ID 
Returns
  • a promise

dist/services/api/getDatasetsByIds.api.js

getDatasetsByIds(qrveyid)

Get a dataset by Qrvey ID

Parameters
NameTypeDescription
qrveyidThe Qrvey ID 
Returns
  • a promise

dist/general/function/debounce.js

debounce(fn, time)

Delays invoking fn until after time milliseconds have elapsed since the last time the debounced function was invoked.

Parameters
NameTypeDescription
fnFunctionoriginal Function 
timeNumberdefault 500ms 
Returns
  • Function debounced functions

dist/general/function/throttled.js

throttled(fn, time)

Make sure to only invokes fn at most once per every time milliseconds

Parameters
NameTypeDescription
fnFunctionoriginal Function 
timeNumberdefault 500ms 
Returns
  • Function throttled function

dist/themes/helpers/calculateHSP.js

calculateHSP(rgbaChannel)

Calculates the HSP Color Mode from the RGBA channels

  • If the calculation are wrong or the given parameter is undefined, the function will return a default for light colors
Parameters
NameTypeDescription
rgbaChannelthe rgba channel object 
Returns
  • a HSP color number

dist/themes/helpers/getCSSVariablesByDestination.js

getCSSVariablesByDestination(destination)

Gets CSS variables depending on the destination of them.

  • Destination is the place where the CSS variables are going to be applied. With this, the right CSS variables are searched and set.
Parameters
NameTypeDescription
destinationthe string of the destination. 
Returns
  • the CSS variables and their values.

dist/themes/helpers/getChannelsByHexadecimalColor.js

getChannelsByHexadecimalColor(color)

Gets the RGBA channels based on the given string Hexadecimal color

  • If the given argument is undefined or invalid, the function will return a channel related to white color
Parameters
NameTypeDescription
colorthe Hexadecimal color 
Returns
  • the RGBA channels

dist/themes/helpers/getChannelsByNameColor.js

getChannelsByNameColor(color)

Gets the RGBA channels based on the given string name color

  • If the given argument is undefined or invalid, the function will return a channel related to white color
Parameters
NameTypeDescription
colorthe name color 
Returns
  • the RGBA channels

dist/themes/helpers/getChannelsByRgbaColor.js

getChannelsByRgbaColor(color)

Gets the RGBA channels based on the given string RGBA color

  • If the given argument is undefined or invalid, the function will return a channel related to white color
Parameters
NameTypeDescription
colorthe RGBA color 
Returns
  • the RGBA channels

dist/themes/helpers/getHexadecimalOpacity.js

getHexadecimalOpacity(hexadecimal)

Gets the Alpha channel (opacity) base on the hexadecimal color

  • If the alpha channel is not set into the given parameter or the calculation is NaN, the function will return 1
Parameters
NameTypeDescription
hexadecimalhexadecimal color 
Returns
  • the Alpha channel (opacity)

dist/themes/helpers/getRgbaOpacity.js

getRgbaOpacity(hexadecimal)

Gets the Alpha channel (opacity) base on the RGBA color

    • If the alpha channel is not set into the given parameter or the calculation is NaN, the function will return 1
Parameters
NameTypeDescription
hexadecimalRGBA color 
Returns
  • the Alpha channel (opacity)

dist/themes/helpers/isDarkColor.js

isDarkColor(color)

Determines if the Color is dark or light. Uses the lightOrDark module.

Parameters
NameTypeDescription
colorthe string of the color (RGBA, or Hexadecimal) 
Returns
  • true: the color is dark.

dist/themes/helpers/isHexadecimalColor.js

isHexadecimalColor(color)

Validates if the given color is an hexadecimal structure

Parameters
NameTypeDescription
colorthe string of the color 
Returns
  • true: the color is an hexadecimal type

dist/themes/helpers/isRGBAColor.js

isRGBAColor(color)

Validates if the given color is an RGBA structure

Parameters
NameTypeDescription
colorthe string of the color 
Returns
  • true: the color is an RGBA type

dist/themes/helpers/lightOrDark.js

lightOrDark(color)

Validates if the given color is light or dark The module extracts the rgba channels and calculate the brightness or darkness by a threshold

  • If there is not color provided, the returning will be Light
Parameters
NameTypeDescription
colorthe string of the color. 
Returns
  • the color type (Dark or Light)

dist/themes/helpers/setAutomaticCSSVariablesForDark.js

setAutomaticCSSVariablesForDark(colorType, wrapperTags)

Sets CSS Variables into a given wrapper collection. For the Dark Theme feature.

Parameters
NameTypeDescription
colorTypethe color type 
wrapperTagsthe html elements to set the CSS variables 
Returns
  • Void

setCSSVariable(colorType, wrapper, cssVariables)

Sets CSS Variables into a given wrapper collection. For the Dark Theme feature.

Parameters
NameTypeDescription
colorTypethe color type 
wrapperthe html element to set the CSS variables 
cssVariablesthe CSS variables name to apply the style property 
Returns
  • Void

dist/typescript/decorators/Debounce.js

Debounce(time)

(Method Decorator) Debounce Class Method

Parameters
NameTypeDescription
time(optional) deafult 500 
Returns
  • Void

dist/typescript/decorators/Throttled.js

Throttled(time)

(Method Decorator) Throttled Class Method

Parameters
NameTypeDescription
time(optional) deafult 500 
Returns
  • Void

dist/stencil/decorators/Config.js

Config()

Stencil.js - Prop Decorator Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal But for this, is required ask for a property in snake_case style

Examples
\ @Config() @Prop() settings;

someMethod() {
 this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
}
Returns
  • Void

dist/stencil/util/createRef.js

createRef()

lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)

Returns
  • function - Function to use in ref prop in html elements

dist/stencil/util/getConfig.js

getConfig(cfg)

verify the Config object type and try to return a parsed Object

  • In case cfg is a string, first try to make a JSON parse in other case try to find this string as a variable on Windows object
  • If cfg is a fuction, tis is invoked and parsed
  • Finally, if is an object, cfg is inmediatly returned
Parameters
NameTypeDescription
cfg 
Returns
  • Void

dist/filters/helpers/common/areFiltersEquals.js

areFiltersEquals(filter1, filter2)

Validates if both filters are the same

Parameters
NameTypeDescription
filter1filter 1 
filter2filter 2 
Returns
  • true: the filters are equal; false: the filters are NOT equal

dist/filters/helpers/common/excludeFiltersByAggregateColumn.js

excludeFiltersByAggregateColumn(filterData)

Excludes Aggregate Filters in the Filter Data. Excluding filters when the column.aggregate is included.

Parameters
NameTypeDescription
filterDataThe filter data object 
Returns
  • The new filter data object that were excluded the aggregate filters

dist/filters/helpers/common/excludeFiltersByParams.js

excludeFiltersByParams(filterData, params)

Excludes filters from the given Filters. The validation to filter the stored filter is depending on:

  • Column
  • Qrvey ID
  • Scope type
  • Scope ID
  • Panel ID
  • Validator type
  • Property type
  • Enabled flags
Parameters
NameTypeDescription
filterDataThe Filter Data or the UI Filter Data 
paramsgiven parameters to validate the filter data 
Returns
  • a new Filter object structure

dist/filters/helpers/common/excludeFiltersByScopes.js

excludeFiltersByScopes(filterData, scopes)

Excludes and returns a filter data without filters by the given scopes

Parameters
NameTypeDescription
filterDataThe Filter Data 
scopescollection of scopes to be as filtering parameters 
Returns
  • The new Filter Data without filters by the given scopes.

dist/filters/helpers/common/getFilterColumnLabel.js

getFilterColumnLabel(column)

Get an string of the properties of the given filter column.

Parameters
NameTypeDescription
columnThe filter column 
Returns
  • an string with the property, aggregate or calculation label.

dist/filters/helpers/common/getFilterLabel.js

getFilterLabel(filter)

Gets the Filter Label + Column label

Parameters
NameTypeDescription
filterthe UI filter 
Returns
  • a sring label

dist/filters/helpers/common/getFilterid.js

getFilterid(filter)

Get the Filter ID by the filter structure The order of the epression ID is:

  • Scope Type
  • scopeid
  • qrveyid
  • panelid
  • columnid
  • validator
  • property
  • Column Aggregate
  • Column Calculation
  • Optional Index
Parameters
NameTypeDescription
filterthe filter structure 
Returns
  • a text to identify the filter

dist/filters/helpers/common/getFiltersByAggregateColumn.js

getFiltersByAggregateColumn(filterData)

Gets Aggregate Filters in the Filter Data. Gets the filters when the column.aggregate is included.

Parameters
NameTypeDescription
filterDataThe filter data object 
Returns
  • The new filter data object that were get the aggregate filters

dist/filters/helpers/common/getFiltersByDatasetsColumns.js

getFiltersByDatasetsColumns(data, datasets)

Filtering the filters by the columns of datasets. Module specially for CLS.

Parameters
NameTypeDescription
datathe filter data 
datasetsthe collection of datasets and their columns 
Returns
  • A new filter data with the filtered filters by columns

dist/filters/helpers/common/getFiltersByParams.js

getFiltersByParams(filterData, params)

Gets filters from the given params. The validation to filter the stored filter is depending on:

  • Column
  • Qrvey ID
  • Scope type
  • Scope ID
  • Panel ID
  • Validator type
  • Property type
  • Enabled flags
Parameters
NameTypeDescription
filterDataThe Filter Data or the UI Filter Data 
paramsgiven parameters to validate the dataset 
Returns
  • a new Filter object structure

dist/filters/helpers/common/getFiltersByScopes.js

getFiltersByScopes(filterData, scopes)

Filters and gets a Filter Data by the given scopes

Parameters
NameTypeDescription
filterDataThe Filter Data 
scopescollection of scopes types 
Returns
  • The new Filter Data

dist/filters/helpers/common/getFiltersByTimezone.js

getFiltersByTimezone(filterData, timezone)

Gets and transforms the Filter Data by the Timezone object

Parameters
NameTypeDescription
filterDataIFSData IFUDatathe filter data 
timezoneIDTimezonethe timezone object 
Returns
  • IFSData IFUData the new filter data with the transformed datetime values

dist/filters/helpers/common/getFiltersByVisibility.js

getFiltersByVisibility(filterData, scopes)

Get a new Filter Data by filtering scopes/scope IDs and enabled flags

Parameters
NameTypeDescription
filterDataa Filter Data or UI Filter Data 
scopesa Scopes/Scope IDs array 
Returns
  • a new Filter Data

dist/filters/helpers/common/getFiltersByScopesIds.js

getFiltersByScopesIds(filterData, scopes)

Gets filters from Filter Data by Scopes/Scope IDs.

Parameters
NameTypeDescription
filterDataThe filter data 
scopesThe collection of Scopes/Scope IDs 
Returns
  • a new Filter Data

dist/filters/helpers/common/getMergeFiltersSettings.js

getMergeFiltersSettings(settings)

Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.

Parameters
NameTypeDescription
settingsan object to the MergeFilters settings 
Returns
  • a new MergeFilters settings object.

dist/filters/helpers/common/getParamsToGetFilterSettings.js

getParamsToGetFilterSettings(settings)

Transforms the given ParamsToGetFilter settings object. Adds the missing properties if they do not exist.

Parameters
NameTypeDescription
settingsan object to the ParamsToGetFilter settings 
Returns
  • a new ParamsToGetFilter settings object.

dist/filters/helpers/common/getMergeValuesSettings.js

getMergeValuesSettings(settings)

Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.

Parameters
NameTypeDescription
settingsan object to the MergeFilters settings 
Returns
  • a new MergeFilters settings object.

dist/filters/helpers/common/getValuesFromDataset.js

getValuesFromDataset(props)

Gets the values from the model object that will be used to filter. Static values are values to belong from static values questions. Static values questions are questions that do not need request an info from backend, instead the info is got from Model object.

Parameters
NameTypeDescription
propsConfiguration to get static values from the given dataset. 
Returns
  • The values.

dist/filters/helpers/common/getValuesFromModel.js

getValuesFromModel(props)

Gets the values from the model object that will be used to filter. Static values are values to belong from static values questions. Static values questions are questions that do not need request an info from backend, instead the info is got from Model object.

Parameters
NameTypeDescription
propsConfiguration to get static values from the given model. 
Returns
  • The values.

dist/filters/helpers/common/getVerboseFilterDatasets.js

getVerboseFilterDatasets(filters, settings)

Gets an string that describes the filter datasets content

Parameters
NameTypeDescription
filtersArray.<IFUDataset>The filter datasets to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • the description of the datasets array

getDatasets(filters, settings)

Gets the datasets by some conditions

Parameters
NameTypeDescription
filtersArray.<IFUDataset>The filtered datasets to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • Array.&lt;IFUDataset&gt; the collection of the datasets

getTitle(dataset, settings)

Gets the title of the filter dataset

Parameters
NameTypeDescription
datasetIFUDatasetthe filter dataset object 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • string the title of the filter dataset

getTitleSeparator(settings)

Gets the separators for the title. It would be

  • New Line
  • An string from argument
Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the separator

getSeparator(settings)

Gets the separators of each filter. It would be

  • New Line
  • The operator
  • An string from argument
Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the separator

dist/filters/helpers/common/getVerboseFilterFilters.js

getVerboseFilterFilters(filters, settings)

Gets an string that describes the filter filters content

Parameters
NameTypeDescription
filtersArray.<IFUFilter>The filter filters to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • the description of the filters array

getFilters(filters, settings)

Gets the filters by some conditions

Parameters
NameTypeDescription
filtersArray.<IFUFilter>The filtered filters to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • Array.&lt;IFUFilter&gt; the collection of the filters

getTitle(filter, settings)

Gets the title of the filter

Parameters
NameTypeDescription
filterIFUFilterthe filter object 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • string the title of the filter

getSeparator(currentIndex, filter, settings)

Gets the separators of each filter. It would be

  • New Line
  • The operator
  • An string from argument
Parameters
NameTypeDescription
currentIndexnumberthe iteration index of the value 
filterIFUFilterthe filter object 
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the separator

getTitleSeparator(settings)

Gets the separators for the title. It would be

  • New Line
  • An string from argument
Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the separator

dist/filters/helpers/common/getVerboseFilterValues.js

getVerboseFilterValues(filters, settings)

Gets an string that describes the filter values content

Parameters
NameTypeDescription
filtersArray.<IFValue>The filter values to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • the description of the filter values

getValues(filter, settings)

Gets the value collection of the filter by some conditions

Parameters
NameTypeDescription
filterIFValueThe filter to get the values 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • Array.&lt;string&gt; the collection of the filter values

getSeparator(currentIndex, values, settings)

Gets the separators of each values. It would be

  • New Line
  • The operator
  • An string from argument
Parameters
NameTypeDescription
currentIndexnumberthe iteration index of the value 
valuesArray.<IFUValue>the collection of values 
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the separator

getValue(filter, value)

Gets the value according to the filter info

  • When the filter column type is image the URL should be returned in case value is undefined.
Parameters
NameTypeDescription
filterIFUFilterthe filter object 
valueIFUValuethe value item 
Returns
  • string the resulting value

dist/filters/helpers/common/getVerboseFilters.js

getVerboseFilters(filters, settings)

Gets an string that describes the filter data content

Parameters
NameTypeDescription
filtersIFUDataThe filters object to verbose 
settingsIFFGetVerboseFiltersthe settings for the function 
Returns
  • A string

getVerboseFilterDatasetsSettings(settings)

Gets the dataset settings by the given settings

Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings for the function 
Returns
  • the dataset settings

getVerboseFilterFiltersSettings(settings)

Gets the filter settings by the given settings

Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings for the function 
Returns
  • the filter settings

getVerboseFilterScopesSettings(settings)

Gets the scope settings by the given settings

Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings for the function 
Returns
  • the scope settings

getVerboseFilterValuesSettings(settings)

Gets the value settings by the given settings

Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings for the function 
Returns
  • the value settings

dist/filters/helpers/common/haveFiltersByDataset.js

haveFiltersByDataset(filterData, qrveyid)

Validates if the filter data has filters by a dataset ID (Qrvey ID).

Parameters
NameTypeDescription
filterDatathe filter data or the UI filter data. 
qrveyidThe Qrvey ID 
Returns
  • true: the filter data has filters by the Qrvey ID

dist/filters/helpers/common/isBetweenValidator.js

isBetweenValidator(validator)

Validates if the given validator is a Between type

Parameters
NameTypeDescription
validatorThe validator 
Returns
  • true: it is a between validator; false: it is not a between validator

dist/filters/helpers/common/getVerboseFilterScopes.js

getVerboseFilterScopes(filters, settings)

Gets an string that describes the filter scopes content

Parameters
NameTypeDescription
filtersArray.<IFUScope>The filters scopes to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • A string

getScopes(filters, settings)

Gets the scopes by some conditions

Parameters
NameTypeDescription
filtersArray.<IFUScope>The filtered scopes to verbose 
settingsIFFGetVerboseFiltersthe settings to the function 
Returns
  • Array.&lt;IFUScope&gt; the collection of the scopes

getTitle(scope, settings)

Gets the title of the filter scope

Parameters
NameTypeDescription
scopeIFUScopethe filter scope info 
settingsIFFGetVerboseFiltersthe settings of the function 
Returns
  • string the title of the filter scope

getTitleSeparator(settings)

Gets the separators for the title. It would be

  • New Line
  • An string from argument
Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the title separator

getSeparator(settings)

Gets the separators of each filter. It would be

  • New Line
  • The operator
  • An string from argument
Parameters
NameTypeDescription
settingsIFFGetVerboseFiltersthe settings of the module 
Returns
  • string the string of the separator

dist/filters/helpers/common/isDateDistinctProperty.js

isDateDistinctProperty(column, property)

Determines if the filter column and property is a distinct group dates type

Parameters
NameTypeDescription
columnThe filter column 
propertyThe filter property 
Returns
  • True if the given property is included from distinct group dates type

dist/filters/helpers/common/isInValidator.js

isInValidator(validator)

Validates if the given validator is a In type

Parameters
NameTypeDescription
validatorThe validator 
Returns
  • true: it is a In validator; false: it is not a In validator

dist/filters/helpers/common/isRangeValidator.js

isRangeValidator(validator)

Validates if the given validator is a Range type. Range type means the value has min and max values to filter

Parameters
NameTypeDescription
validatorThe filter validator 
Returns
  • true: it is a range validator

dist/filters/helpers/common/isRankingFilter.js

isRankingFilter(filter)

Validates if the given filter is considering a ranking filter type.

  • Filters with Null and Is Not Null for ranking column are not considering as Ranking Filters.
Parameters
NameTypeDescription
filterThe filter object 
Returns
  • a true if the filter is a ranking filter.

dist/filters/helpers/common/isNullValidator.js

isNullValidator(validator)

Checks if the given validator is a Null type.

Parameters
NameTypeDescription
validatorThe Filter Validator 
Returns
  • True: It is a Null Validator; False: It is not a Null Validator.

dist/filters/helpers/common/isRegularValidator.js

isRegularValidator(validator)

Validates if the given validator is a regular type. Regular type means the filter object has a value as string to filter

Parameters
NameTypeDescription
validatorThe filter validator 
Returns
  • true: it is a range validator

dist/filters/helpers/common/mergeValues.js

mergeValues(filter1, filter2, settings)

Gets a new value structure array by merging two value structures

Parameters
NameTypeDescription
filter1the target filter structure 
filter2the filter to be used to merge the values 
settingsconfiguration of the mergeFilter 
Returns
  • a new value structure array

dist/filters/helpers/common/mergeFilters.js

mergeFilters(filterData1, filterData2, settings)

Merges the second filter data into the first one; the first Filter Data passed in the argument has the priority. Conditions:

  • If the info in the second filter data does not exist in the first one, the info will be added
  • If the info in the second filter data exists in the first one, the info will be merged
Parameters
NameTypeDescription
filterData1IFUDataThe target filter data 
filterData2IFUDatathe filter data to be merged 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilters 
Returns
  • IFUData a new filter data structure

mergeScopes(scopes1, scopes2, settings)

Gets a new scope array structure by merging both scope structures

  • If the info in the second scope does not exist in the first one, the scope will be added
  • If the info in the second scope exists in the first one, the scope will be merged
Parameters
NameTypeDescription
scopes1Array.<IFUScope>the target scope structure 
scopes2Array.<IFUScope>the scope to be merged 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilters 
Returns
  • Array.&lt;IFUScope&gt; a new scope array structure

mergeDatasets(datasets1, datasets2, settings)

Gets a new dataset structure array by merging both dataset structures

  • If the info in the second dataset does not exist in the first one, the dataset will be added
  • If the info in the second dataset exists in the first one, the dataset will be merged
Parameters
NameTypeDescription
datasets1Array.<IFUDataset>the target dataset structure 
datasets2Array.<IFUDataset>the dataset to be merged 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilter 
Returns
  • Array.&lt;IFUDataset&gt; a new dataset structure array

mergeFilterss(filters1, filters2, settings)

Gets a new filter structure array by merging two filter structures

Parameters
NameTypeDescription
filters1Array.<IFUFilter>the target filter structure 
filters2Array.<IFUFilter>the filter to be merged 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilters 
Returns
  • Array.&lt;IFUFilter&gt; a new filter structure array

mergeScopeProps(scope1, scope2, settings)

Gets a new scope structure for the configured settings

Parameters
NameTypeDescription
scope1IFUScopethe target scope structure 
scope2IFUScopethe scope to be used to merge the values 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilters 
Returns
  • IFUScope a new filter structure with overwritted props

mergeDatasetProps(dataset1, dataset2, settings)

Gets a new dataset structure for the configured settings

Parameters
NameTypeDescription
dataset1IFUDatasetthe target dataset structure 
dataset2IFUDatasetthe dataset to be used to merge the values 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilters 
Returns
  • IFUDataset a new filter structure with overwritted props

mergeFilterProps(filter1, filter2, settings)

Gets a new filter structure for the configured settings

Parameters
NameTypeDescription
filter1IFUFilterthe target filter structure 
filter2IFUFilterthe filter to be used to merge the values 
settingsIFFiltersMergeFiltersconfiguration of the mergeFilters 
Returns
  • a new filter structure with overwritted props

dist/filters/helpers/common/resolveDatasetConditions.js

resolveDatasetConditions(filter, params, letPassUndefinedProperties, letPassUndefinedParams)

Resolves the conditions by given params

Parameters
NameTypeDescription
filterThe dataset structure 
paramsgiven parameters to validate the dataset 
letPassUndefinedPropertiesFlag to avoid applying the condition when the filter properties are undefined 
letPassUndefinedParamsFlag to avoid applying the condition when the param properties are explicit undefined. 
Returns
  • true: the condition is satisfied

dist/filters/helpers/common/resolveFilterConditions.js

resolveFilterConditions(filter, params, letPassUndefinedProperties, letPassUndefinedParams)

Resolves the conditions by given params

Parameters
NameTypeDescription
filterThe filter 
paramsgiven parameters to validate the filter 
letPassUndefinedPropertiesFlag to avoid applying the condition when the filter properties are undefined 
letPassUndefinedParamsFlag to avoid applying the condition when the param properties are explicit undefined. 
Returns
  • true: the condition is satisfied

dist/filters/helpers/common/resolveScopeConditions.js

resolveScopeConditions(filter, params, letPassUndefinedProperties, letPassUndefinedParams)

Resolves the conditions by given params

Parameters
NameTypeDescription
filterThe filter scope structure 
paramsgiven parameters to validate the filter 
letPassUndefinedPropertiesFlag to avoid applying the condition when the properties of the properties are undefined 
letPassUndefinedParamsFlag to avoid applying the condition when the properties of the params are explicit undefined. 
Returns
  • true: the condition is satisfied

dist/dates/relative/helpers/formatStatement.js

formatStatement(statement)

Build a proper relative date statement type

Parameters
NameTypeDescription
statementRelativeStatement 
Returns
  • RelativeStatement

dist/dates/relative/helpers/getStatementCase.js

getStatementCase(includeCurrent, isCalendarDate)

Returns a number/constant that identifies a relative date case

Parameters
NameTypeDescription
includeCurrentboolean 
isCalendarDateboolean 
Returns
  • number

dist/dates/relative/helpers/parseDate.js

parseDate(date)

Parses a string date and returns a dayjs date

Parameters
NameTypeDescription
datestring Dayjs Date 
Returns
  • Dayjs A dayjs date

dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js

getFilterBuilderGeneralConfig(config)

Returns a filter builder config object by a any given config

Parameters
NameTypeDescription
configany config object 
Returns
  • The filter builder config object

dist/filters/helpers/backend/buildExpression.js

buildExpression(filter)

Builds filter expression by the filter data.

  • If the resulting value array is empty the enabled property will be false.
Parameters
NameTypeDescription
filterThe filter to transform 
Returns
  • a filter expression

dist/filters/helpers/backend/buildUserFilters.js

buildUserFilters(userFilters)

Transform user Filters array into Filter Logic structure

Parameters
NameTypeDescription
userFiltersThe filters that the user defined. 
Returns
  • The filter logic for the given user filters. if No a given object is recieved, it will return an empty array.

dist/filters/helpers/backend/getAggFiltersBySummaryIndex.js

getAggFiltersBySummaryIndex(aggFilters, summaryIndex)

Parameters
NameTypeDescription
aggFiltersThe aggFilter Structure 
summaryIndexan index 
Returns
  • a new aggFilters structure

dist/filters/helpers/backend/getBackendGroupValue.js

getBackendGroupValue(filter)

Gets a group value for the backend logic structure

Parameters
NameTypeDescription
filterThe filter 
Returns
  • a property

dist/filters/helpers/backend/getBackendProperty.js

getBackendProperty(filter)

Gets a property for the logic structure

Parameters
NameTypeDescription
filterThe filter 
Returns
  • a property

dist/filters/helpers/backend/getBackendValidator.js

getBackendValidator(validator)

Gets the Validator that is used in requests

Parameters
NameTypeDescription
validatorFilter Validator used in UI 
Returns
  • Filter Validator used in Backend

dist/filters/helpers/backend/getBackendValues.js

getBackendValues(filter)

Gets the expresion values in the logic format

Parameters
NameTypeDescription
filterThe filter structure 
Returns
  • A collection of backend expression value

getResultValues(values, filter) private method

Gets the expression values. Depending on the column type

Parameters
NameTypeDescription
valuesa collection of filter values 
filterThe filter structure 
Returns
  • Expression values

getRankingValues(values, rankingGroupIndex) private method

Gets the Ranking values.

Parameters
NameTypeDescription
valuesa collection of filter values in the ranking structure 
rankingGroupIndexdetermine the value by this index to build and return it 
Returns
  • Expression values for ranking

dist/filters/helpers/backend/getLogicByDatasets.js

getLogicByDatasets(logic, datasets)

[TODO: Add filterEmptyArrays to the filterNestedTree filter condition. Firstly, that function should accept this argument] Filters the logic by a qrveyids array If an qrveyid is not provided in the expression the filter passes normally

Parameters
NameTypeDescription
logicThe logic of the filter 
datasetsThe collection of qrveyids 
Returns
  • a new filtered logic

dist/filters/helpers/backend/getLogicByDatasetsColumns.js

getLogicByDatasetsColumns(logic, datasets)

Parameters
NameTypeDescription
logicArray.<IFBLogic>The logic of the filters 
datasetsArray.<IDataset>The collection of datasets 
Returns
  • a new filtered logic

filterCallback(settings, datasets)

Runs the function for the callback

Parameters
NameTypeDescription
settingsIFFGetLogicByDatasetsColumnsthe settings for the helper 
datasetsArray.<IDataset>The dataset collection 
Returns

getLetQrveyidPass(expression, settings)

Gets the letQrveyidPass flag

Parameters
NameTypeDescription
expressionIFBExpressionthe logic expression of the filter 
settingsIFFGetLogicByDatasetsColumnsthe settings for the helper 
Returns
  • boolean true: the qrveyid will be passed

getLetQuestionidPass(expression, settings)

Gets the letQuestionidPass flag

Parameters
NameTypeDescription
expressionIFBExpressionthe logic expression of the filter 
settingsIFFGetLogicByDatasetsColumnsthe settings for the helper 
Returns
  • boolean true: the questionid will be passed

getDataset(expression, letQrveyidPass, datasets)

Gets the dataset related to the expression

Parameters
NameTypeDescription
expressionIFBExpressionthe logic expression of the filter 
letQrveyidPassbooleanflag that allows perform the condition to compare the qrveyid with the datasets 
datasetsArray.<IDataset>The dataset collection 
Returns
  • IDataset the dataset object

getGetLogicByDatasetsSettings(settings)

Gets the default settings for the getLogicByDatasetsColumn function

Parameters
NameTypeDescription
settingsIFFGetLogicByDatasetsColumnsthe settings for the helper given by the implementer 
Returns
  • IFFGetLogicByDatasetsColumns an object with all properties set

dist/filters/helpers/backend/getLogicByScopes.js

getLogicByScopes(logics, scopes)

Gets the filters from logic data by Scopes/Scope IDs.

Parameters
NameTypeDescription
logicsThe logic array 
scopesThe collection of Scopes/Scope IDs 
Returns
  • a new Logic array

dist/filters/helpers/backend/getLogicByScopesHierarchy.js

getLogicByScopesHierarchy(filterData, scopes, currentScope)

Gets filters from the logic by the scopes hierarchy.

Parameters
NameTypeDescription
filterData 
scopes 
currentScope 
Returns
  • a new array of Logic

dist/filters/helpers/settings/areMultipleScopesByProperties.js

areMultipleScopesByProperties(settings, scopeProperties, condition)

Validates if the scope settings is satisfied by properties in multiple scopes

Parameters
NameTypeDescription
settingsIFSettingsthe filter setting 
scopePropertiesstringthe property or the string path of the scope settings 
conditionstringvalidate with AND or OR condition 
Returns
  • true iif there are scopes to be satisfied; false: one or none scopes to be satisfied

dist/filters/helpers/settings/areMultipleScopesByProperty.js

areMultipleScopesByProperty(settings, property)

Validates if the scope settings is satisfied the property in multiple scopes

Parameters
NameTypeDescription
settingsIFSettingsthe filter setting 
propertystringthe property or the string path of the scope settings 
Returns
  • true if there are scopes to be satisfied; false: one or none scopes to be satisfied

dist/filters/helpers/settings/getFilterSettings.js

getFilterSettings(filterSettings, allowedScopes, otherSettings)

Gets a new filter settings object according to various conditions

  • By allowed scopes. Different implementation could accept some scopes, so the forbidden scopes into the filter settings will be skipped
  • If there is not filter settings provived, a default one is returned
  • The returned filter settings depend on the coexisting scopes
Parameters
NameTypeDescription
filterSettingsIFSettingsthe given filter settings 
allowedScopesArray.<IFScope>a collection of scope types that are permitted 
otherSettingsIFSettingsanother filter settings object to be merged with the filterSettings param 
Returns
  • a new filter settings object

getFilterSettingsByMultipleScopes(settings, allowedScopes)

Gets the filter settings by multiple scopes conditions

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
allowedScopesArray.<IFScope>a collection of scope types that are permitted 
Returns
  • a new filter settings object

getFilterSettingsByOnlyScope(settings, allowedScopes)

Gets the filter settings when a single scope is permitted

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
allowedScopesArray.<IFScope>a collection of scope types that are permitted 
Returns
  • a new filter settings object

getFilterSettingsByNoScopes(settings)

Gets the filter settings when there is not scope to accept

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByGeneralOnlyScope(settings)

Gets the filter settings when a general scope are only permitted The general scopes could be the GLOBAL, PAGE, TAB and PANEL types.

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByNoDefaultScope(settings)

Gets the filter settings when there is not a default scope type

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByOnlyDefaultScope(settings)

Gets the filter settings when there is only a default scope type

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByDefaultWithOneAdditionalScope(settings)

Gets the filter settings when there are a default scope and other single scope

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByOnlyPanelScope(settings)

Gets the filter settings when there is only the panel scope

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByOnlyDataScope(settings)

Gets the filter settings when there is only the data scope

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsBySkippingGeneralScopes(settings)

Gets the filter settings when there are not general scopes allowed The general scopes could be the GLOBAL, PAGE, TAB and PANEL types.

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByMultipleNoPanelGlobalScopes(settings)

Gets the filter settings when there are no panel scopes and multiple scopes allowed.

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

getFilterSettingsByMultipleNoPanelScopes(settings)

Gets the filter settings when there are no panel scopes and multiple scopes allowed.

Parameters
NameTypeDescription
settingsIFSettingsthe given filter settings 
Returns
  • a new filter settings object

dist/filters/helpers/settings/getScopeSettings.js

getScopeSettings(settings, scope)

Gets the scope settings by the scope type

Parameters
NameTypeDescription
settingsIFSettingsthe filter settings 
scopeIFScopethe scope type 
Returns
  • the scope settings

dist/filters/helpers/settings/getScopeColorSetting.js

getScopeColorSetting(settings, scope)

Gets the color of the scope in the settings object

Parameters
NameTypeDescription
settingsIFSettingsthe filter settings 
scopeIFScopethe scope type 
Returns
  • an string with the color.

dist/filters/helpers/settings/getScopesSettings.js

getScopesSettings(scopes)

Gets the scopes settings as array

Parameters
NameTypeDescription
scopesIFSettingsScopesthe scopes settings 
Returns
  • an array of the scopes settings

dist/filters/helpers/settings/getScopesToDisplay.js

getScopesToDisplay(settings)

Gets the scope allowed to display

Parameters
NameTypeDescription
settingsIFSettingsthe filter settings 
Returns
  • an array of the scopes settings

dist/filters/helpers/settings/isLeastSingleScopeByProperties.js

isLeastSingleScopeByProperties(settings, scopeProperties, condition)

Validates if the scope settings is satisfied by properties at least in one scope

Parameters
NameTypeDescription
settingsIFSettingsthe filter setting 
scopePropertiesstringthe property or the string path of the scope settings 
conditionstringvalidate with AND or OR condition 
Returns
  • true if there is one scope to be satisfied; false: none scopes to be satisfied

dist/filters/helpers/settings/isLeastSingleScopeByProperty.js

isLeastSingleScopeByProperty(settings, property)

Validates if the scope settings is satisfied by a property at least in one scope

Parameters
NameTypeDescription
settingsIFSettingsthe filter setting 
propertystringthe property or the string path of the scope settings 
Returns
  • true if there is one scope to be satisfied; false: none scopes to be satisfied

dist/filters/helpers/ui/excludeUIFiltersByAggregate.js

excludeUIFiltersByAggregate(uFilters)

Excludes Aggregate Filters in the Flattened UI Filters array

Parameters
NameTypeDescription
uFiltersCollection of Flat UI Filters 
Returns
  • a new Flat UI Filters that were excluded the aggregate filters

dist/filters/helpers/ui/excludeUIFlatFiltersByScopes.js

excludeUIFlatFiltersByScopes(uFilters, scopes)

Excludes and returns a UI Flat Filters without filters by the given scopes

Parameters
NameTypeDescription
uFiltersThe Flatten UI Filters 
scopescollection of scopes types 
Returns
  • The new array of UI Flattened filters

dist/filters/helpers/ui/getFilterPropertyLabel.js

getFilterPropertyLabel(filter)

Gets the label of the filter property

Parameters
NameTypeDescription
filterThe UI Filter 
Returns
  • a string of the filter property label

dist/filters/helpers/ui/getOutputFormatByColumn.js

getOutputFormatByColumn(column, datasets)

Gets output format object from Datasets by the given column. Item of the datasets array must have outputformat item in order to be returned

Parameters
NameTypeDescription
columnThe column 
datasetsarray of datasets 
Returns
  • The output format object

dist/filters/helpers/ui/getQrveyIdsByUIFilters.js

getQrveyIdsByUIFilters(uiFilter)

Gets a collection of Qrvey IDs in the UI Filter structure. Looks around all filter structure finding the qrveyid propertty in each dataset

Parameters
NameTypeDescription
uiFilter 
Returns
  • Void

dist/filters/helpers/ui/getUIFlatFilterByParams.js

getUIFlatFilterByParams()

Gets a filter from the given Flattened UI Filters by given params. Return a index of the array or an object The validation to filter the stored filter is depending on:

  • Column
  • Qrvey ID,
  • Scope type
  • Scope ID
  • Panel ID
  • Validator type
  • Property type
Returns
  • The index of the uFilter array or the Filter object s

dist/filters/helpers/ui/getUIFlatFiltersByParams.js

getUIFlatFiltersByParams()

Gets a filter from the given Flattened UI Filters by given params. Return a index of the array or an object The validation to filter the stored filter is depending on:

  • Column
  • Qrvey ID,
  • Scope type
  • Scope ID
  • Panel ID
  • Validator type
  • Property type
  • Enabled flags
Returns
  • The index of the uFilter array or the Filter object s

dist/filters/helpers/ui/getUIFlatFiltersByScopes.js

getUIFlatFiltersByScopes(uFilters, scopes)

Filters and gets a UI Flatten Filters by the given scopes

Parameters
NameTypeDescription
uFiltersThe Flatten UI Filters 
scopescollection of scopes types 
Returns
  • The new array of UI Flattened filters

dist/filters/helpers/ui/getUIValues.js

getUIValues(filter, settings)

Gets the UI Values generated depending on the validator

Parameters
NameTypeDescription
filterthe filter structure 
settingsa settings for this function 
Returns
  • an array of values

dist/filters/helpers/ui/getUpdatedUIFilters.js

getUpdatedUIFilters(data, datasets)

Gets a new UI Filter structure with a datasets/columns info updates

Parameters
NameTypeDescription
dataThe UI Filter structure 
datasetsAn array of datasets/column info used for updating the data 
Returns
  • A new UI FIlter structure

dist/filters/helpers/ui/resolveUIFlatFilterByParams.js

resolveUIFlatFilterByParams(filter, params)

Resolves conditions between UI flattened filter and given parameters

Parameters
NameTypeDescription
filterUI Flatten Filter 
paramsParameters to validate 
Returns
  • true: the conditions are satisfied.

Documentation generated with doxdox.

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts