@qrvey/utils
TypeScript icon, indicating that this package has built-in type declarations

1.13.0 • Public • Published

@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
Name Type Description
bytes type number  
Returns
  • Void

formatFileSize(bytes)

Set convert Bytes into MB

Parameters
Name Type Description
bytes type number  
Returns
  • Void

isValidTimeString([timeString])

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

Parameters
Name Type Description
timeString string - 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
Name Type Description
timeString any - The time string to be formatted.  
format string - 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
Name Type Description
customTokens ICustomTokensComplex - 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
Name Type Description
customTokens ICustomTokensComplex - 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
Name Type Description
customtonTokensConfig ICustomTokensSimple 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
Name Type Description
customTokens Array.<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
Name Type Description
label string 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
Name Type Description
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
Name Type Description
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
Name Type Description
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
Name Type Description
timeLabel TIME_PERIOD - TIME_PERIOD.CUSTOM_RANGE  
range CustomRangeConfig - 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
Name Type Description
customRangeData CustomRangeConfig - 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
Name Type Description
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
Name Type Description
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
Name Type Description
column The 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
Name Type Description
column IColumn a partial column info  
dataset IDataset the dataset info to look for the column  
getIndex boolean flag 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
Name Type Description
column IColumn a partial column info  
dataset IDataset the dataset info  
Returns
  • true: the arguments are valid.

getDatasetColumns(dataset)

Gets the column array

Parameters
Name Type Description
dataset IDataset the dataset info  
Returns
  • the column array

dist/columns/helpers/getModelColumn.js

getModelColumn(column, model)

Get a model column by a partial column info.

Parameters
Name Type Description
column IColumn The partial column info  
model IModel The 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
Name Type Description
column IColumn a partial column object  
datasets IDataset the datasets collection to look for the column  
getIndex boolean flag to get the index of the column array or the complete column info  
Returns
  • the Column object

isValidArguments(column, dataset)

Validates the arguments

Parameters
Name Type Description
column IColumn a partial column info  
dataset IDataset the datasets collection  
Returns
  • true: the arguments are valid.

dist/filters/services/Filters.api.js

getModel(qrveyid)

Get the model by Qrvey ID

Parameters
Name Type Description
qrveyid The Qrvey ID  
Returns
  • a promise with the resulting model

getDatasets(qrveyids)

Get a dataset list from a collection of Qrvey IDs

Parameters
Name Type Description
qrveyids Collection 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
Name Type Description
uFilter The Filter Builder Filter  
filterLogic Additional filter logic to apply in the preview  
chartSettings  
resetApi flag 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
Name Type Description
config the config.  
Returns
  • Void

dist/filters/services/UChartApi.js

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

Gets a promise with a resulting data

Parameters
Name Type Description
config the config  
uFilter The filter Builder filter  
filterLogic Additional filter logic to apply in the preview  
chartSettings The 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
Name Type Description
response The preview presponse  
uFilter The filter Builder filter  
Returns
  • The resulting data

this._getResponseSummaries(records, values)

Gets summaries from preview response

Parameters
Name Type Description
records The data from preview response  
values The values from the preview response  
Returns
  • the sumaries

_getSearchLogic(uFilter)

Gets the filter object structure for the searching text

Parameters
Name Type Description
uFilter IFUFlattenedFilter The filter object  
Returns
  • the filter object structure

_getFilterCharts(uFilter, searchLogic, chartSettings)

Gets the filters from the chart settings

Parameters
Name Type Description
uFilter IFUFlattenedFilter The filter object  
searchLogic OLD_IFilterData Additional filter object for the searching text  
chartSettings IFUChartSettings The 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
Name Type Description
records The data from preview response  
Returns
  • the sumaries

UChartApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings)

Gets request body structure

Parameters
Name Type Description
uFilter IFUFlattenedFilter The filter object  
filterLogic Array.<IFBLogic> Additional filter logic to apply in the preview  
chartSettings IFUChartSettings The settings of the chart. For Aggregate Columns.  
Returns
  • the request body structure

UChartApi._getChartBody(uFilter, chartSettings)

Gets chart body structure

Parameters
Name Type Description
uFilter The filter Builder filter  
chartSettings The settings of the chart. For Aggregate Columns.  
Returns
  • the chart body structure

UChartApi._getDimensionsBody(uFilter, chartSettings)

Gets dimension body structure

Parameters
Name Type Description
uFilter The filter Builder filter  
chartSettings The settings of the chart. For Aggregate Columns.  
Returns
  • the dimension body structure

UChartApi._getMaxDataPoints(column, chartSettings)

Gets max data point number

Parameters
Name Type Description
column The column to filter  
chartSettings The settings of the chart. For Aggregate Columns.  
Returns
  • max data point number

UChartApi._getSortOption(column)

Gets sort option structure

Parameters
Name Type Description
column The column to filter  
Returns
  • sort option structure

UChartApi._getSummariesBody(uFilter)

Gets summaries body structure

Parameters
Name Type Description
uFilter The filter Builder filter  
Returns
  • summaries body structure

UChartApi._refineBodies(bodies, uFilter)

Refines the body structure

Parameters
Name Type Description
bodies The body structure  
uFilter The filter Builder filter  
Returns
  • the body structure

UChartApi._getValidationType(column, vaildator)

Gets the validation type for the preview request

Parameters
Name Type Description
column The column to filter  
vaildator Validator 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
Name Type Description
config the config  
uFilter The filter Builder filter  
filterLogic Additional filter logic to apply in the preview  
chartSettings The 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
Name Type Description
response The preview presponse  
uFilter The filter Builder filter  
Returns
  • The resulting data

this.refineAfterkey(props)

Refines the afterKey object

Parameters
Name Type Description
props  
Returns
  • Void

this.setAfterKey(afterKey)

Sets the afterKey object

Parameters
Name Type Description
afterKey the afterKey object  
Returns
  • Void

this.setProps(uFilter)

Sets the Filter Builder Filter

Parameters
Name Type Description
uFilter  
Returns
  • Void

_getSearchLogic(uFilter)

Gets the filter object structure for the searching text

Parameters
Name Type Description
uFilter IFUFlattenedFilter The filter object  
Returns
  • the filter object structure

_getFilterCharts(uFilter, searchLogic, chartSettings)

Gets the filters from the chart settings

Parameters
Name Type Description
uFilter IFUFlattenedFilter The filter object  
searchLogic OLD_IFilterData Additional filter object for the searching text  
chartSettings IFUChartSettings The 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
Name Type Description
records The data from preview response  
Returns
  • the sumaries

UChartPaginationApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings)

Gets request body structure

Parameters
Name Type Description
uFilter IFUFlattenedFilter The filter object  
filterLogic Array.<IFBLogic> Additional filter logic to apply in the preview  
chartSettings IFUChartSettings The settings of the chart. For Aggregate Columns.  
Returns
  • the request body structure

UChartPaginationApi._getDimensionsBody(uFilter)

Gets dimension body structure

Parameters
Name Type Description
uFilter The filter Builder filter  
Returns
  • the dimension body structure

UChartPaginationApi._getDimensionsBodyAdapter(dimensions)

Get a dimension body structure foor pagination endpoint

Parameters
Name Type Description
dimensions  
Returns
  • the dimension body structure

UChartPaginationApi._getMaxDataPoints(column, chartSettings)

Gets max data point number

Parameters
Name Type Description
column The column to filter  
chartSettings The settings of the chart. For Aggregate Columns.  
Returns
  • max data point number

UChartPaginationApi._getSortOption(column)

Gets sort option structure

Parameters
Name Type Description
column The column to filter  
Returns
  • sort option structure

UChartPaginationApi._getSummariesBody(uFilter)

Gets summaries body structure

Parameters
Name Type Description
uFilter The filter Builder filter  
Returns
  • summaries body structure

UChartPaginationApi._refineBodies(bodies, uFilter)

Refines the body structure

Parameters
Name Type Description
bodies The body structure  
uFilter The filter Builder filter  
Returns
  • the body structure

UChartPaginationApi._getValidationType(column, vaildator)

Gets the validation type for the preview request

Parameters
Name Type Description
column The column to filter  
vaildator Validator Type  
Returns
  • the validator type for the preview request

UChartPaginationApi._getResponseSummaries(records, values)

Gets summaries from preview response

Parameters
Name Type Description
records The data from preview response  
values The values from the preview response  
Returns
  • the sumaries

UChartPaginationApi.areColumnsEquals(column1, column2)

Checks if two filter columns are the same.

Parameters
Name Type Description
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
Name Type Description
offset number string the 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
Name Type Description
date IDate String, object or millisencond number of the date  
settings IDFDateToHmsSettings the settings of the dateToHms function  
Returns
  • string string of [HH:mm:ss] date format

getDefaultSettings(settings)

Gets the settings for this function.

Parameters
Name Type Description
settings IDFDateToHmsSettings the settings of the dateToHms function  
Returns
  • IDFDateToHmsSettings a new object for the settings

getHours(date, settings)

Gets the Hours

Parameters
Name Type Description
date Date the date object  
settings IDFDateToHmsSettings the settings of the dateToHms function  
Returns
  • string the hour string

getMinutes(date, settings)

Gets the Minutes

Parameters
Name Type Description
date Date the date object  
settings IDFDateToHmsSettings the settings of the dateToHms function  
Returns
  • string the minute string

getSeconds(date, settings)

Gets the Seconds

Parameters
Name Type Description
date Date the date object  
settings IDFDateToHmsSettings the 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
Name Type Description
date IDate String, object or millisencond number of the date  
settings IDateSettings the 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
Name Type Description
date IDate String, object or millisencond number of the date  
settings IDateSettings the 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
Name Type Description
date IDate String of a valid date, date object or millisencond number of the date  
settings IDateSettings the 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
Name Type Description
date IDate String, object or millisencond number of the date  
settings IDateSettings the 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
Name Type Description
date IDate String, object or millisencond number of the date  
settings IDateSettings the 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
Name Type Description
monthYearDate string String of [H:m:s] time  
settings IDateSettings the 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
Name Type Description
{string}monthYearDate String of [mm/dd/yyyy] date  
settings IDateSettings the 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
Name Type Description
monthYearDate string String of [Month Year] date  
settings IDateSettings the 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
Name Type Description
offset number string the 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
Name Type Description
quarterYearDate string String of [Quarter Year] date  
settings IDateSettings the 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
Name Type Description
date string String of [Week Year] date  
settings IDateSettings the 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
Name Type Description
yearDate string String of [Year] date  
settings IDateSettings the 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
Name Type Description
{string }date The string of the date. It may contain tokens.  
format IDateFormat The 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
Name Type Description
date string String with a formatted date  
format IDateFormat The date format  
settings IDateSettings the 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
Name Type Description
date IDate the date  
timezone IDTimezone the 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
Name Type Description
date IDate String, object or millisencond number of the date  
offset IDTimezoneOffset the timezone offset  
Returns
  • IDate the updated Date object

dist/dates/helpers/getDateFormatByProperty.js

getDateFormatByProperty(property)

Gets the date format by the given property

Parameters
Name Type Description
property IColumnPropertyType The 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
Name Type Description
dateFormat IDateFormat an 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
Name Type Description
format IDateFormat The 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
Name Type Description
value String string date value  
dateGroupProperty String could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY'  
withTime Boolean determines 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
Name Type Description
dt Date - 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
Name Type Description
settings IDateSettings the 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
Name Type Description
date IDate String with a formatted date  
format IDateFormat The date format  
settings IDateSettings the 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
Name Type Description
format IDateFormat the 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
Name Type Description
timezone IDTimezone the timezone object  
model IModel IDataset the 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
Name Type Description
timezone IDTimezone The timezone object  
model IModel IDataset The 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
Name Type Description
timezone IDTimezone The timezone object  
model IModel IDataset The model info  
offset IDTimezoneOffset a 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
Name Type Description
offset IDTimezoneOffset a given offset  
Returns
  • IDTimezoneType the right timezone type for the offset

getUTC(timezone)

Gets the UTC string by the timezone object

Parameters
Name Type Description
timezone IDTimezone the 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
Name Type Description
type IDTimezoneType the timezone type  
timezone IDTimezone IBTimezone the 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
Name Type Description
date Date the 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
Name Type Description
timezone IDTimezone the timezone object  
minified boolean Flag 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
Name Type Description
date Date - 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
Name Type Description
offset IDTimezoneOffset the 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
Name Type Description
date IDate String, object or millisencond number of the date  
Returns
  • true: the date is valid.

includingDateTokens(date)

Validates if the given date has tokens

Parameters
Name Type Description
date IDate String, 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
Name Type Description
date IDate String, 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
Name Type Description
date IDate String, 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
Name Type Description
offset IDTimezoneOffset the timezone offset  
Returns
  • boolean true: is valid timezone offset.

isValidOffsetRange(offset)

Validates if the given offset is in the timezone range

Parameters
Name Type Description
offset IDTimezoneOffset the 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
Name Type Description
date string String of date  
format IDateFormat String 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
Name Type Description
filterData The filter data object.  
datasetsInfo Collection 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
Name Type Description
scopes The filter scope section  
datasetsInfo Collection 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
Name Type Description
filterData The filter data object.  
Returns
  • a filter logic array

getLogicBodyFromFD21(filterData)

Gets the logic body

Parameters
Name Type Description
filterData The 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
Name Type Description
filterData The filter data object.  
datasetsInfo Collection 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
Name Type Description
scopes The filter scope section  
section The filter section.  
version The version of the filter structure  
datasetsInfo Collection 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
Name Type Description
filterData The UI filter data object.  
Returns
  • a Filter Data structure

UI21ToFD(uFilterData, version) private method

Builds the Fitler Data structure from UI filter data

Parameters
Name Type Description
uFilterData The UI filter Data object  
version the 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
Name Type Description
filterData The UI filter data object.  
datasetsInfo Collection 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
Name Type Description
scopes The 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
Name Type Description
property the 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
Name Type Description
filterData The filter data structure. Accepts both v2.1 or v2.0  
getUIFilterData Flag to get a Filter Data (False) or the UI Filter Data (True)  
datasetsInfo Collection 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
Name Type Description
filter The 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
Name Type Description
uFilters Array of flattened filters from UI  
version Tag 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
Name Type Description
fbFilters Array of flat filters from UI  
Returns
  • an array of scopes structure.

buildScope(uFilter)

Gets an scope structure for the filter data

Parameters
Name Type Description
uFilter UI structure filter  
Returns
  • an scope structure

buildDataset(uFilter)

Gets an dataset structure for the filter data

Parameters
Name Type Description
uFilter a UI structure filter  
Returns
  • an dataset structure

buildFilter(uFilter)

Gets an filter structure for the filter data

Parameters
Name Type Description
uFilter a UI structure filter  
Returns
  • an filter structure

dist/filters/adapters/flatUIToLogic.js

flatUIToLogic(uFilter)

Generates a Logic structure from flattened UI filters

Parameters
Name Type Description
uFilter Array 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
Name Type Description
uFilters Array 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
Name Type Description
uFilters Array of flattened filters from UI  
version Tag 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
Name Type Description
fbFilters Array of flat filters from UI  
Returns
  • an array of scopes structure.

buildScope(uFilter)

Gets an scope structure for the UI filter data

Parameters
Name Type Description
uFilter UI structure filter  
Returns
  • an scope structure

buildDataset(uFilter)

Gets an dataset structure for the UI filter data

Parameters
Name Type Description
uFilter a UI structure filter  
Returns
  • an dataset structure

buildFilter(uFilter)

Gets an filter structure for the UI filter data

Parameters
Name Type Description
uFilter a 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
Name Type Description
filterData The old filter data structure with logic (v2.0)  
version Tag 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
Name Type Description
logics The 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
Name Type Description
filters The array of UI filters  
filter The old logic structure filter  
getIndex Determines 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
Name Type Description
values the Array of Ranking values  
uiValues Object 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
Name Type Description
uFilters Array of filters from old logic structure  
datasetsInfo Collection 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
Name Type Description
answers Array 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
Name Type Description
value string  
now Date  
Returns
  • string

convertRelativeToAbsolute(args)

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

Parameters
Name Type Description
args RelativeToAbsoluteStruct  
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
Name Type Description
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
Name Type Description
logics  
summaries  
Returns
  • the filter aggregate structure

getAggregateFilters(logics, formatToFilters)

Filters and gets the filters used for aggregate values.

Parameters
Name Type Description
logics The filter logic structure  
formatToFilters Flag 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
Name Type Description
chartSettings Chart Settings for the Filter Builder  
scopes the pair id/label scopes  
currentScope the 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
Name Type Description
tokens Array.<IFFilterTokens> - IFFilterTokens[] - the tokens to convert to a string  
Returns
  • A string

dist/filters/helpers/getAggFiltersFromFilterData.js

getAggFiltersFromFilterData(filterData, _summaries) private method

Parameters
Name Type Description
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
Name Type Description
config any config  
Returns
  • a Available Scope IDS config

dist/filters/helpers/getScopesByHierarchy.js

getScopesByHierarchy(scopes, currentScope)

[TODO: Make a description for this]

Parameters
Name Type Description
scopes the collection of Scopes/Scope IDs  
currentScope Current 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
Name Type Description
filters IFUData - The filters object.  
options IFTokensFromFiltersSettings - 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
Name Type Description
filters IFUData - The filters object that you want to convert to a string.  
options IFTokensFromFiltersSettings - IFTokensFromFiltersSettings  
Returns
  • A string

dist/filters/helpers/getAvailableScopes.js

getAvailableScopes(config)

Gets Scopes/Scope IDs by given IDs

Parameters
Name Type Description
config given 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
Name Type Description
number number - The number of milliseconds to format.  
format string - The format string.  
locale string - The locale to use for formatting. If not specified, the default locale is used. Optional
fractionDigits number - 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
Name Type Description
locale string Array.<string> - string string[]
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
Name Type Description
template string - The format template string.  
Returns
  • Void

matchFormatsReplace(template)

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

Parameters
Name Type Description
template string - 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
Name Type Description
template string - 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
Name Type Description
number number - 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
Name Type Description
parts - { [x: string]: any; }  
part string `Array.<string number>` - 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
Name Type Description
column The 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
Name Type Description
column The column with info  
dataset the 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
Name Type Description
column Info of the column  
model The model object  
property Optional 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
Name Type Description
column the partial column  
datasets the 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
Name Type Description
column The column located inside the model object.  
property Optional 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
Name Type Description
question The 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
Name Type Description
column The 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
Name Type Description
column The column with info  
model The 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
Name Type Description
_question The 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
Name Type Description
_question The 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
Name Type Description
column the 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
Name Type Description
value a number or string  
suffixes An 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
Name Type Description
column The 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
Name Type Description
value A value to transform  
settings The settings of the transformValue function  
Returns
  • A transformed value

getDefaultSettings(settings)

Gets the default settings properties

Parameters
Name Type Description
settings ITransformValueSettings the given settings  
Returns
  • ITransformValueSettings the settings with default properties

getOutputFormat(settings)

Gets the outputformat settings

Parameters
Name Type Description
settings The settings of the transformValue function  
Returns
  • the outputformat settings

getFormatConfig(settings)

Gets the format config if the locale exists in i18n settings

Parameters
Name Type Description
settings The 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
Name Type Description
settings ITransformValueSettings - 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
Name Type Description
property IColumnPropertyType - 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
Name Type Description
object1 First Object to compare  
object2 Second 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
Name Type Description
value The 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
Name Type Description
scripts Array.<String> Array.<Object> can be an array of string or an array of object with the follow structure:  
scripts.url String CDN URL  
scripts.namespace String Function (Optional) if is a String, that name is evaluated on Window[namespace] object otherwise the Function is invoked expecting a Thrutly value  
scripts.type String (Optional) it could be module of text/javascript. Default text/javascript  
scripts.noModule Boolean (Optional) add momodule attribute to script tag. Default false  
scripts.dependencies Array.<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
Name Type Description
url String Cdn Url  
type String (Optional) it could be module of text/javascript. Default text/javascript  
noModule boolean (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
Name Type Description
variable the given variable  
includeFalsy flag 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
Name Type Description
variable the 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
Name Type Description
arg any  
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
Name Type Description
length Number size of the generated string. Default 8  
exclude Array collection 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
Name Type Description
obj Any Any 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
Name Type Description
num number the 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
Name Type Description
text String  
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
Name Type Description
num number string the number  
size number the quantity of zeros to add  
padding number True: 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
Name Type Description
num number string the number  
sign string the sign of the number  
Returns
  • string the absolute number

getNumSign(num)

Gets the number sign

Parameters
Name Type Description
num number string the 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
Name Type Description
info Object - Information needed to add property to the array of objects.  
info.array Array - The array of objects you want to add a property to.  
info.property string - The property you want to add to the object.  
info.value any - - 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
Name Type Description
array Array a collection of items to delete  
index Number the 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
Name Type Description
arr nested tree array  
childArrKey property representing the children array on the nested tree  
condition function 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
Name Type Description
arr Array 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
Name Type Description
arr An array  
property the 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
Name Type Description
array  
callback function 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
Name Type Description
array  
callback function 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
Name Type Description
arr The array  
prop Property 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
Name Type Description
obj any the object  
timezone IDTimezone the 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
Name Type Description
obj The 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
Name Type Description
baseObject The object to query  
path The string path or collection of string paths of the property to get.  
defaultValue The 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
Name Type Description
obj object object to look for  
key string String 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
Name Type Description
obj object an object  
property string String 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
Name Type Description
obj the 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
Name Type Description
baseObject Object Base object.  
iteratee Function The 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
Name Type Description
obj1 The target object  
obj2 The object to be merged  
settings Object settings for this function  
Returns
  • a new merged object

isValid(obj1, obj2)

Validates if the two arguments are objects

Parameters
Name Type Description
obj1 The target object  
obj2 The 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
Name Type Description
settings the 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
Name Type Description
entity The 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
Name Type Description
obj Object base object  
props Array.<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
Name Type Description
obj an 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
Name Type Description
baseObject Object base object  
keys Array.<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
Name Type Description
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
Name Type Description
branchesMap the 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
Name Type Description
timezone IBTimezone the 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
Name Type Description
config the widget config. Includes general configuration properties  
qrveyids Collection 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
Name Type Description
config Configuration  
params Object for getting precise data  
Returns
  • Void

dist/services/api/getDatasetColumns.api.js

getDatasetColumns(qrveyid)

Get a dataset by Qrvey ID

Parameters
Name Type Description
qrveyid The Qrvey ID  
Returns
  • a promise

dist/services/api/getDatasetsByIds.api.js

getDatasetsByIds(qrveyid)

Get a dataset by Qrvey ID

Parameters
Name Type Description
qrveyid The 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
Name Type Description
fn Function original Function  
time Number default 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
Name Type Description
fn Function original Function  
time Number default 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
Name Type Description
rgbaChannel the 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
Name Type Description
destination the 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
Name Type Description
color the 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
Name Type Description
color the 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
Name Type Description
color the 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
Name Type Description
hexadecimal hexadecimal 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
Name Type Description
hexadecimal RGBA 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
Name Type Description
color the 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
Name Type Description
color the 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
Name Type Description
color the 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
Name Type Description
color the 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
Name Type Description
colorType the color type  
wrapperTags the 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
Name Type Description
colorType the color type  
wrapper the html element to set the CSS variables  
cssVariables the CSS variables name to apply the style property  
Returns
  • Void

dist/typescript/decorators/Debounce.js

Debounce(time)

(Method Decorator) Debounce Class Method

Parameters
Name Type Description
time (optional) deafult 500  
Returns
  • Void

dist/typescript/decorators/Throttled.js

Throttled(time)

(Method Decorator) Throttled Class Method

Parameters
Name Type Description
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
Name Type Description
cfg  
Returns
  • Void

dist/filters/helpers/common/areFiltersEquals.js

areFiltersEquals(filter1, filter2)

Validates if both filters are the same

Parameters
Name Type Description
filter1 filter 1  
filter2 filter 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
Name Type Description
filterData The 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
Name Type Description
filterData The Filter Data or the UI Filter Data  
params given 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
Name Type Description
filterData The Filter Data  
scopes collection 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
Name Type Description
column The 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
Name Type Description
filter the 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
Name Type Description
filter the 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
Name Type Description
filterData The 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
Name Type Description
data the filter data  
datasets the 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
Name Type Description
filterData The Filter Data or the UI Filter Data  
params given 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
Name Type Description
filterData The Filter Data  
scopes collection 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
Name Type Description
filterData IFSData IFUData the filter data  
timezone IDTimezone the 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
Name Type Description
filterData a Filter Data or UI Filter Data  
scopes a 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
Name Type Description
filterData The filter data  
scopes The 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
Name Type Description
settings an 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
Name Type Description
settings an 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
Name Type Description
settings an 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
Name Type Description
props Configuration 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
Name Type Description
props Configuration 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
Name Type Description
filters Array.<IFUDataset> The filter datasets to verbose  
settings IFFGetVerboseFilters the settings to the function  
Returns
  • the description of the datasets array

getDatasets(filters, settings)

Gets the datasets by some conditions

Parameters
Name Type Description
filters Array.<IFUDataset> The filtered datasets to verbose  
settings IFFGetVerboseFilters the 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
Name Type Description
dataset IFUDataset the filter dataset object  
settings IFFGetVerboseFilters the 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
Name Type Description
settings IFFGetVerboseFilters the 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
Name Type Description
settings IFFGetVerboseFilters the 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
Name Type Description
filters Array.<IFUFilter> The filter filters to verbose  
settings IFFGetVerboseFilters the settings to the function  
Returns
  • the description of the filters array

getFilters(filters, settings)

Gets the filters by some conditions

Parameters
Name Type Description
filters Array.<IFUFilter> The filtered filters to verbose  
settings IFFGetVerboseFilters the settings to the function  
Returns
  • Array.&lt;IFUFilter&gt; the collection of the filters

getTitle(filter, settings)

Gets the title of the filter

Parameters
Name Type Description
filter IFUFilter the filter object  
settings IFFGetVerboseFilters the 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
Name Type Description
currentIndex number the iteration index of the value  
filter IFUFilter the filter object  
settings IFFGetVerboseFilters the 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
Name Type Description
settings IFFGetVerboseFilters the 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
Name Type Description
filters Array.<IFValue> The filter values to verbose  
settings IFFGetVerboseFilters the 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
Name Type Description
filter IFValue The filter to get the values  
settings IFFGetVerboseFilters the 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
Name Type Description
currentIndex number the iteration index of the value  
values Array.<IFUValue> the collection of values  
settings IFFGetVerboseFilters the 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
Name Type Description
filter IFUFilter the filter object  
value IFUValue the 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
Name Type Description
filters IFUData The filters object to verbose  
settings IFFGetVerboseFilters the settings for the function  
Returns
  • A string

getVerboseFilterDatasetsSettings(settings)

Gets the dataset settings by the given settings

Parameters
Name Type Description
settings IFFGetVerboseFilters the settings for the function  
Returns
  • the dataset settings

getVerboseFilterFiltersSettings(settings)

Gets the filter settings by the given settings

Parameters
Name Type Description
settings IFFGetVerboseFilters the settings for the function  
Returns
  • the filter settings

getVerboseFilterScopesSettings(settings)

Gets the scope settings by the given settings

Parameters
Name Type Description
settings IFFGetVerboseFilters the settings for the function  
Returns
  • the scope settings

getVerboseFilterValuesSettings(settings)

Gets the value settings by the given settings

Parameters
Name Type Description
settings IFFGetVerboseFilters the 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
Name Type Description
filterData the filter data or the UI filter data.  
qrveyid The 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
Name Type Description
validator The 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
Name Type Description
filters Array.<IFUScope> The filters scopes to verbose  
settings IFFGetVerboseFilters the settings to the function  
Returns
  • A string

getScopes(filters, settings)

Gets the scopes by some conditions

Parameters
Name Type Description
filters Array.<IFUScope> The filtered scopes to verbose  
settings IFFGetVerboseFilters the 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
Name Type Description
scope IFUScope the filter scope info  
settings IFFGetVerboseFilters the 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
Name Type Description
settings IFFGetVerboseFilters the 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
Name Type Description
settings IFFGetVerboseFilters the 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
Name Type Description
column The filter column  
property The 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
Name Type Description
validator The 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
Name Type Description
validator The 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
Name Type Description
filter The 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
Name Type Description
validator The 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
Name Type Description
validator The 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
Name Type Description
filter1 the target filter structure  
filter2 the filter to be used to merge the values  
settings configuration 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
Name Type Description
filterData1 IFUData The target filter data  
filterData2 IFUData the filter data to be merged  
settings IFFiltersMergeFilters configuration 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
Name Type Description
scopes1 Array.<IFUScope> the target scope structure  
scopes2 Array.<IFUScope> the scope to be merged  
settings IFFiltersMergeFilters configuration 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
Name Type Description
datasets1 Array.<IFUDataset> the target dataset structure  
datasets2 Array.<IFUDataset> the dataset to be merged  
settings IFFiltersMergeFilters configuration 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
Name Type Description
filters1 Array.<IFUFilter> the target filter structure  
filters2 Array.<IFUFilter> the filter to be merged  
settings IFFiltersMergeFilters configuration 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
Name Type Description
scope1 IFUScope the target scope structure  
scope2 IFUScope the scope to be used to merge the values  
settings IFFiltersMergeFilters configuration 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
Name Type Description
dataset1 IFUDataset the target dataset structure  
dataset2 IFUDataset the dataset to be used to merge the values  
settings IFFiltersMergeFilters configuration 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
Name Type Description
filter1 IFUFilter the target filter structure  
filter2 IFUFilter the filter to be used to merge the values  
settings IFFiltersMergeFilters configuration 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
Name Type Description
filter The dataset structure  
params given parameters to validate the dataset  
letPassUndefinedProperties Flag to avoid applying the condition when the filter properties are undefined  
letPassUndefinedParams Flag 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
Name Type Description
filter The filter  
params given parameters to validate the filter  
letPassUndefinedProperties Flag to avoid applying the condition when the filter properties are undefined  
letPassUndefinedParams Flag 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
Name Type Description
filter The filter scope structure  
params given parameters to validate the filter  
letPassUndefinedProperties Flag to avoid applying the condition when the properties of the properties are undefined  
letPassUndefinedParams Flag 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
Name Type Description
statement RelativeStatement  
Returns
  • RelativeStatement

dist/dates/relative/helpers/getStatementCase.js

getStatementCase(includeCurrent, isCalendarDate)

Returns a number/constant that identifies a relative date case

Parameters
Name Type Description
includeCurrent boolean  
isCalendarDate boolean  
Returns
  • number

dist/dates/relative/helpers/parseDate.js

parseDate(date)

Parses a string date and returns a dayjs date

Parameters
Name Type Description
date string 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
Name Type Description
config any 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
Name Type Description
filter The filter to transform  
Returns
  • a filter expression

dist/filters/helpers/backend/buildUserFilters.js

buildUserFilters(userFilters)

Transform user Filters array into Filter Logic structure

Parameters
Name Type Description
userFilters The 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
Name Type Description
aggFilters The aggFilter Structure  
summaryIndex an index  
Returns
  • a new aggFilters structure

dist/filters/helpers/backend/getBackendGroupValue.js

getBackendGroupValue(filter)

Gets a group value for the backend logic structure

Parameters
Name Type Description
filter The filter  
Returns
  • a property

dist/filters/helpers/backend/getBackendProperty.js

getBackendProperty(filter)

Gets a property for the logic structure

Parameters
Name Type Description
filter The filter  
Returns
  • a property

dist/filters/helpers/backend/getBackendValidator.js

getBackendValidator(validator)

Gets the Validator that is used in requests

Parameters
Name Type Description
validator Filter 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
Name Type Description
filter The filter structure  
Returns
  • A collection of backend expression value

getResultValues(values, filter) private method

Gets the expression values. Depending on the column type

Parameters
Name Type Description
values a collection of filter values  
filter The filter structure  
Returns
  • Expression values

getRankingValues(values, rankingGroupIndex) private method

Gets the Ranking values.

Parameters
Name Type Description
values a collection of filter values in the ranking structure  
rankingGroupIndex determine 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
Name Type Description
logic The logic of the filter  
datasets The collection of qrveyids  
Returns
  • a new filtered logic

dist/filters/helpers/backend/getLogicByDatasetsColumns.js

getLogicByDatasetsColumns(logic, datasets)

Parameters
Name Type Description
logic Array.<IFBLogic> The logic of the filters  
datasets Array.<IDataset> The collection of datasets  
Returns
  • a new filtered logic

filterCallback(settings, datasets)

Runs the function for the callback

Parameters
Name Type Description
settings IFFGetLogicByDatasetsColumns the settings for the helper  
datasets Array.<IDataset> The dataset collection  
Returns

getLetQrveyidPass(expression, settings)

Gets the letQrveyidPass flag

Parameters
Name Type Description
expression IFBExpression the logic expression of the filter  
settings IFFGetLogicByDatasetsColumns the settings for the helper  
Returns
  • boolean true: the qrveyid will be passed

getLetQuestionidPass(expression, settings)

Gets the letQuestionidPass flag

Parameters
Name Type Description
expression IFBExpression the logic expression of the filter  
settings IFFGetLogicByDatasetsColumns the settings for the helper  
Returns
  • boolean true: the questionid will be passed

getDataset(expression, letQrveyidPass, datasets)

Gets the dataset related to the expression

Parameters
Name Type Description
expression IFBExpression the logic expression of the filter  
letQrveyidPass boolean flag that allows perform the condition to compare the qrveyid with the datasets  
datasets Array.<IDataset> The dataset collection  
Returns
  • IDataset the dataset object

getGetLogicByDatasetsSettings(settings)

Gets the default settings for the getLogicByDatasetsColumn function

Parameters
Name Type Description
settings IFFGetLogicByDatasetsColumns the 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
Name Type Description
logics The logic array  
scopes The 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
Name Type Description
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
Name Type Description
settings IFSettings the filter setting  
scopeProperties string the property or the string path of the scope settings  
condition string validate 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
Name Type Description
settings IFSettings the filter setting  
property string the 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
Name Type Description
filterSettings IFSettings the given filter settings  
allowedScopes Array.<IFScope> a collection of scope types that are permitted  
otherSettings IFSettings another 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
Name Type Description
settings IFSettings the given filter settings  
allowedScopes Array.<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
Name Type Description
settings IFSettings the given filter settings  
allowedScopes Array.<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
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the given filter settings  
Returns
  • a new filter settings object

getFilterSettingsByNoDefaultScope(settings)

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

Parameters
Name Type Description
settings IFSettings the given filter settings  
Returns
  • a new filter settings object

getFilterSettingsByOnlyDefaultScope(settings)

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

Parameters
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the given filter settings  
Returns
  • a new filter settings object

getFilterSettingsByOnlyPanelScope(settings)

Gets the filter settings when there is only the panel scope

Parameters
Name Type Description
settings IFSettings the given filter settings  
Returns
  • a new filter settings object

getFilterSettingsByOnlyDataScope(settings)

Gets the filter settings when there is only the data scope

Parameters
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the filter settings  
scope IFScope the 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
Name Type Description
settings IFSettings the filter settings  
scope IFScope the scope type  
Returns
  • an string with the color.

dist/filters/helpers/settings/getScopesSettings.js

getScopesSettings(scopes)

Gets the scopes settings as array

Parameters
Name Type Description
scopes IFSettingsScopes the scopes settings  
Returns
  • an array of the scopes settings

dist/filters/helpers/settings/getScopesToDisplay.js

getScopesToDisplay(settings)

Gets the scope allowed to display

Parameters
Name Type Description
settings IFSettings the 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
Name Type Description
settings IFSettings the filter setting  
scopeProperties string the property or the string path of the scope settings  
condition string validate 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
Name Type Description
settings IFSettings the filter setting  
property string the 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
Name Type Description
uFilters Collection 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
Name Type Description
uFilters The Flatten UI Filters  
scopes collection 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
Name Type Description
filter The 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
Name Type Description
column The column  
datasets array 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
Name Type Description
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
Name Type Description
uFilters The Flatten UI Filters  
scopes collection 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
Name Type Description
filter the filter structure  
settings a 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
Name Type Description
data The UI Filter structure  
datasets An 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
Name Type Description
filter UI Flatten Filter  
params Parameters to validate  
Returns
  • true: the conditions are satisfied.

Documentation generated with doxdox.

Readme

Keywords

none

Package Sidebar

Install

npm i @qrvey/utils

Weekly Downloads

2,823

Version

1.13.0

License

MIT

Unpacked Size

2.96 MB

Total Files

4326

Last publish

Collaborators

  • qrvey-jespinel
  • andresbetinqrvey
  • amit.bhatnagar
  • ricardo.madrid
  • jmsosa
  • emirpolo
  • sandresbc86
  • juandavidleg1
  • hugo.tilano
  • mario.vasco
  • jose.gonzalez.qrvey