@qrvey/utils 1.12.0
Helper, Utils for all Qrvey Projects
Apply to the given date format to a date value
Name | Type | Description | |
---|---|---|---|
bytes | type number |
Void
Set convert Bytes into MB
Name | Type | Description | |
---|---|---|---|
bytes | type number |
Void
It returns true if the given string is a valid time string, and false otherwise
Name | Type | Description | |
---|---|---|---|
timeString | string |
- The time string to validate. | Optional |
- A boolean value.
It takes a time string and a format string and returns a formatted time string
Name | Type | Description | |
---|---|---|---|
timeString | any |
- The time string to be formatted. | |
format | string |
- The format of the time string. |
Void
The function getCleanCustomTokens
takes an object customTokens
and returns a new object
cleanTokens
with filtered values based on certain conditions.
Name | Type | Description | |
---|---|---|---|
customTokens | ICustomTokensComplex |
- The customTokens parameter is an object of type ICustomTokensComplex . |
- a cleaned version of the customTokens object.
The function getCustomTokenBoxParse
takes in an object of custom tokens and returns a formatted
list of tokens with aliases and labels.
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 keyin the object, and the value is an array of tokens within that group. |
- an object called
tokensList
.
The function getCustomtonTokens
takes a configuration object and returns a parsed version of the
custom tokens, with keys and values appropriately formatted.
Name | Type | Description | |
---|---|---|---|
customtonTokensConfig |
ICustomTokensSimple ICustomTokensComplex
|
- The customtonTokensConfig parameter is an object that can have two possible types:ICustomTokensSimple or ICustomTokensComplex . |
- an object of type
ICustomTokensComplex
.
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.
Name | Type | Description | |
---|---|---|---|
customTokens | Array.<CustomTokens> |
- An array of objects representing custom tokens. Each object should have properties such as "key" and "label". |
- an array of
CustomTokens
objects. Each object in the array has an additionalkey
property, which is generated by camelizing thekey
orlabel
property of the originalCustomTokens
object.
Get a text and evaluate if it matchs with a token box label.
Name | Type | Description | |
---|---|---|---|
label | string to evaluate |
- True is label matchs; otherwise false
If data is truthy, return data.logic, otherwise return an empty array.
Name | Type | Description | |
---|---|---|---|
filters | - The data object that is passed to the component. |
Void
It takes a data object and returns a MetricValue object
Name | Type | Description | |
---|---|---|---|
data | - The data object that is passed to the component. |
- A metric value object
If data is truthy and data.dateColumn is truthy, return true, otherwise return false.
Name | Type | Description | |
---|---|---|---|
data | - The data object that is passed to the component. |
Void
Given a time label and a custom range, return a relative date config or a metric custom range.
Name | Type | Description | |
---|---|---|---|
timeLabel | TIME_PERIOD |
- TIME_PERIOD.CUSTOM_RANGE | |
range | CustomRangeConfig |
- CustomRangeConfig |
- A relative date config or a metric custom range
It takes in a custom range config object and returns a custom range object
Name | Type | Description | |
---|---|---|---|
customRangeData | CustomRangeConfig |
- CustomRangeConfig |
- A function that takes in a customRangeData object and returns a customRange object.
It takes in a metricData object and returns a CustomRangeConfig object
Name | Type | Description | |
---|---|---|---|
metricData | - The metric data object that is returned from the API. |
- An object with the following properties: startingDate: metricData?.timePeriodDate, endDate: metricData?.timePeriodEndDate, label: metricData?.timePeriodCustomRange?.label,
It takes in a metricData object and returns a CustomRangeConfig object
Name | Type | Description | |
---|---|---|---|
metricData | - The metric data object that is returned from the API. |
- An object with the following properties: startingDate: metricData?.comparisonDate, endDate: metricData?.comparisonEndDate, label: metricData?.comparisonCustomRange?.label,
Void
[TODO: Finish the function] Get an string of the properties of the given column.
Name | Type | Description | |
---|---|---|---|
column | The column |
- an string with the property, aggregate or calculation label.
Gets the column from the dataset object Recieves a partial column object and returns a full column object from the Dataset
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 |
- the dataset column index or the dataset column object
Validates the arguments
Name | Type | Description | |
---|---|---|---|
column | IColumn |
a partial column info | |
dataset | IDataset |
the dataset info |
- true: the arguments are valid.
Gets the column array
Name | Type | Description | |
---|---|---|---|
dataset | IDataset |
the dataset info |
- the column array
Get a model column by a partial column info.
Name | Type | Description | |
---|---|---|---|
column | IColumn |
The partial column info | |
model | IModel |
The model object |
- the model column
Gets a column from a datasets collection. Recieves a partial column object and returns a full column object from the Dataset
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 |
- the Column object
Validates the arguments
Name | Type | Description | |
---|---|---|---|
column | IColumn |
a partial column info | |
dataset | IDataset |
the datasets collection |
- true: the arguments are valid.
Get the model by Qrvey ID
Name | Type | Description | |
---|---|---|---|
qrveyid | The Qrvey ID |
- a promise with the resulting model
Get a dataset list from a collection of Qrvey IDs
Name | Type | Description | |
---|---|---|---|
qrveyids | Collection of Qrvey IDs |
- a promise
Get a promise with a preview of resulting data. Depending on the validator, the endpoint will change.
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. |
- a promise with a preview of resulting data.
Gets the available scopes and scope IDs
- a collection of the pair Scopes and Scope IDs
Set the config into the Filter Builder Api class
Name | Type | Description | |
---|---|---|---|
config | the config. |
Void
Gets a promise with a resulting data
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. |
- a promise with a resulting data
Gets the Data from preview Response
Name | Type | Description | |
---|---|---|---|
response | The preview presponse | ||
uFilter | The filter Builder filter |
- The resulting data
Gets summaries from preview response
Name | Type | Description | |
---|---|---|---|
records | The data from preview response | ||
values | The values from the preview response |
- the sumaries
Gets the filter object structure for the searching text
Name | Type | Description | |
---|---|---|---|
uFilter | IFUFlattenedFilter |
The filter object |
- the filter object structure
Gets the filters from the chart settings
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. |
- the filters from the chart settings
Tranform response in array of object with value key Null or undefined values are avoided
Name | Type | Description | |
---|---|---|---|
records | The data from preview response |
- the sumaries
Gets request body structure
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. |
- the request body structure
Gets chart body structure
Name | Type | Description | |
---|---|---|---|
uFilter | The filter Builder filter | ||
chartSettings | The settings of the chart. For Aggregate Columns. |
- the chart body structure
Gets dimension body structure
Name | Type | Description | |
---|---|---|---|
uFilter | The filter Builder filter | ||
chartSettings | The settings of the chart. For Aggregate Columns. |
- the dimension body structure
Gets max data point number
Name | Type | Description | |
---|---|---|---|
column | The column to filter | ||
chartSettings | The settings of the chart. For Aggregate Columns. |
- max data point number
Gets sort option structure
Name | Type | Description | |
---|---|---|---|
column | The column to filter |
- sort option structure
Gets summaries body structure
Name | Type | Description | |
---|---|---|---|
uFilter | The filter Builder filter |
- summaries body structure
Refines the body structure
Name | Type | Description | |
---|---|---|---|
bodies | The body structure | ||
uFilter | The filter Builder filter |
- the body structure
Gets the validation type for the preview request
Name | Type | Description | |
---|---|---|---|
column | The column to filter | ||
vaildator | Validator Type |
- the validator type for the preview request
Gets afterKey object
- the afterKey object
Gets a promise with a resulting data
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. |
- a promise with a resulting data
Gets the Data from preview Response
Name | Type | Description | |
---|---|---|---|
response | The preview presponse | ||
uFilter | The filter Builder filter |
- The resulting data
Refines the afterKey object
Name | Type | Description | |
---|---|---|---|
props |
Void
Sets the afterKey object
Name | Type | Description | |
---|---|---|---|
afterKey | the afterKey object |
Void
Sets the Filter Builder Filter
Name | Type | Description | |
---|---|---|---|
uFilter |
Void
Gets the filter object structure for the searching text
Name | Type | Description | |
---|---|---|---|
uFilter | IFUFlattenedFilter |
The filter object |
- the filter object structure
Gets the filters from the chart settings
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. |
- the filters from the chart settings
Tranform response in array of object with value key Null or undefined values are avoided
Name | Type | Description | |
---|---|---|---|
records | The data from preview response |
- the sumaries
Gets request body structure
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. |
- the request body structure
Gets dimension body structure
Name | Type | Description | |
---|---|---|---|
uFilter | The filter Builder filter |
- the dimension body structure
Get a dimension body structure foor pagination endpoint
Name | Type | Description | |
---|---|---|---|
dimensions |
- the dimension body structure
Gets max data point number
Name | Type | Description | |
---|---|---|---|
column | The column to filter | ||
chartSettings | The settings of the chart. For Aggregate Columns. |
- max data point number
Gets sort option structure
Name | Type | Description | |
---|---|---|---|
column | The column to filter |
- sort option structure
Gets summaries body structure
Name | Type | Description | |
---|---|---|---|
uFilter | The filter Builder filter |
- summaries body structure
Refines the body structure
Name | Type | Description | |
---|---|---|---|
bodies | The body structure | ||
uFilter | The filter Builder filter |
- the body structure
Gets the validation type for the preview request
Name | Type | Description | |
---|---|---|---|
column | The column to filter | ||
vaildator | Validator Type |
- the validator type for the preview request
Gets summaries from preview response
Name | Type | Description | |
---|---|---|---|
records | The data from preview response | ||
values | The values from the preview response |
- the sumaries
Checks if two filter columns are the same.
Name | Type | Description | |
---|---|---|---|
column1 | |||
column2 |
- True: Columns are equal; False: Columns are not equal
Gets the numeric offset (minutes) from the ISO offset (string)
Name | Type | Description | |
---|---|---|---|
offset |
number string
|
the timezone offset |
-
number
the offset in minutes
- Transform a Date to [HH:mm:ss] date format.
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date | |
settings | IDFDateToHmsSettings |
the settings of the dateToHms function |
-
string
string of [HH:mm:ss] date format
Gets the settings for this function.
Name | Type | Description | |
---|---|---|---|
settings | IDFDateToHmsSettings |
the settings of the dateToHms function |
-
IDFDateToHmsSettings
a new object for the settings
Gets the Hours
Name | Type | Description | |
---|---|---|---|
date | Date |
the date object | |
settings | IDFDateToHmsSettings |
the settings of the dateToHms function |
-
string
the hour string
Gets the Minutes
Name | Type | Description | |
---|---|---|---|
date | Date |
the date object | |
settings | IDFDateToHmsSettings |
the settings of the dateToHms function |
-
string
the minute string
Gets the Seconds
Name | Type | Description | |
---|---|---|---|
date | Date |
the date object | |
settings | IDFDateToHmsSettings |
the settings of the dateToHms function |
-
string
the seconds string
Transform a Date to [mm/dd/yyyy] date format.
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date | |
settings | IDateSettings |
the configuration of dates |
-
string
string of [mm/dd/yyyy] date format
Transform a Date to [Month Year] date format.
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date | |
settings | IDateSettings |
the configuration of dates |
-
string
string of [Month Year] date format
Transform a valid Date to [Quarter Year] date format.
Name | Type | Description | |
---|---|---|---|
date | IDate |
String of a valid date, date object or millisencond number of the date | |
settings | IDateSettings |
the configuration of dates |
-
string
string of [Quarter Year] date format
Transform a Date to [W# Year] date format.
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date | |
settings | IDateSettings |
the configuration of dates |
-
string
string of [W# Year] date format
Transform a Date to [Year] date format.
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date | |
settings | IDateSettings |
the configuration of dates |
-
string
string of [Year] date format
Transforms String time from a [H:m:s] format to Date object.
Name | Type | Description | |
---|---|---|---|
monthYearDate | string |
String of [H:m:s] time | |
settings | IDateSettings |
the configuration of dates |
-
IDate
The date object or the date in milliseconds. If the argument is an unexpected time, the function will return the same value
Transforms String Date from a [mm/dd/yyyy] format to Date object.
Name | Type | Description | |
---|---|---|---|
{string}monthYearDate | String of [mm/dd/yyyy] date | ||
settings | IDateSettings |
the configuration of dates |
-
IDate
The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
Transforms String Date from a [Month Year] format to Date object.
Name | Type | Description | |
---|---|---|---|
monthYearDate | string |
String of [Month Year] date | |
settings | IDateSettings |
the configuration of dates |
-
IDate
The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
Gets the ISO offset From the numeric offset (minutes)
Name | Type | Description | |
---|---|---|---|
offset |
number string
|
the timezone offset |
-
string
the offset in minutes
Transforms String Date from a [Quarter Year] format to Date object.
Name | Type | Description | |
---|---|---|---|
quarterYearDate | string |
String of [Quarter Year] date | |
settings | IDateSettings |
the configuration of dates |
-
IDate
The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
Transforms String Date from a [Week Year] format to Date object.
Name | Type | Description | |
---|---|---|---|
date | string |
String of [Week Year] date | |
settings | IDateSettings |
the configuration of dates |
-
IDate
The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
Transforms String Date from a [Year] format to Date object.
Name | Type | Description | |
---|---|---|---|
yearDate | string |
String of [Year] date | |
settings | IDateSettings |
the configuration of dates |
-
IDate
The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
Determines if the given date has tokens. The date is splitted depending on date format. Undefined date is returning false.
Name | Type | Description | |
---|---|---|---|
{string }date | The string of the date. It may contain tokens. | ||
format | IDateFormat |
The date format |
-
boolean
true: include tokens; false: otherwise
Gets a Date Object instance by a Date format
Name | Type | Description | |
---|---|---|---|
date | string |
String with a formatted date | |
format | IDateFormat |
The date format | |
settings | IDateSettings |
the configuration of dates |
-
IDate
a Date object, milisecond time or the same value if date format does not match.
Gets a date value in the given timezone
Name | Type | Description | |
---|---|---|---|
date | IDate |
the date | |
timezone | IDTimezone |
the timezone object |
-
IDate
A transformed value
Gets a Date with the given offset of the Timezone. No given an offset the default is going to be set by the browser
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date | |
offset | IDTimezoneOffset |
the timezone offset |
-
IDate
the updated Date object
Gets the date format by the given property
Name | Type | Description | |
---|---|---|---|
property | IColumnPropertyType |
The Column Property |
-
IDateFormat
The date format
Gets an array of regular expressions by the given date format. Day format is the default date format
Name | Type | Description | |
---|---|---|---|
dateFormat | IDateFormat |
an string of the format |
-
Array.<string>
an array of regular expressions
Gets the pick level number related to the Date picker element
Name | Type | Description | |
---|---|---|---|
format | IDateFormat |
The date format |
-
number
A number of the pick level setting
Get date range object from a string date value
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 |
// 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'
}
-
Object
an object with the date range with two string date properties: from and to
It takes a Date object as an argument and returns a string in the format of MM/DD/YYYY
Name | Type | Description | |
---|---|---|---|
dt | Date |
- Date - The date object to convert to a string |
- A string in the format of MM/DD/YYYY
Gets the default properties for Date Settings object
Name | Type | Description | |
---|---|---|---|
settings | IDateSettings |
the configuration of dates |
-
IDateSettings
a new object with the date settings.
A Date object, string or millisecond number are gotten in order to convert it in an formatted string date
- Some strings are valid
Name | Type | Description | |
---|---|---|---|
date | IDate |
String with a formatted date | |
format | IDateFormat |
The date format | |
settings | IDateSettings |
the configuration of dates |
-
IDate
a formmatted date or the same value if format does not match
Gets the separator of the date format
Name | Type | Description | |
---|---|---|---|
format | IDateFormat |
the date format |
-
string
a separator string
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
Name | Type | Description | |
---|---|---|---|
timezone | IDTimezone |
the timezone object | |
model |
IModel IDataset
|
the info of the dataset (model) |
-
IDTimezone
a new timezone object
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.
Name | Type | Description | |
---|---|---|---|
timezone | IDTimezone |
The timezone object | |
model |
IModel IDataset
|
The model info |
-
IDTimezoneOffset
the offset of the objects
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.
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 |
-
IDTimezoneType
the rigth type of the timezone
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.
Name | Type | Description | |
---|---|---|---|
offset | IDTimezoneOffset |
a given offset |
-
IDTimezoneType
the right timezone type for the offset
Gets the UTC string by the timezone object
Name | Type | Description | |
---|---|---|---|
timezone | IDTimezone |
the timezone object |
-
string
the label of the UTC value
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
Name | Type | Description | |
---|---|---|---|
type | IDTimezoneType |
the timezone type | |
timezone |
IDTimezone IBTimezone
|
the timezone object |
-
IDTimezoneOffset
the offset of the timezone
Gets the week number of the year Additionally, the month and the year
Name | Type | Description | |
---|---|---|---|
date | Date |
the date object |
-
IDateWeek
an object with the week, month and year or undefined if the date is not valid.
Gets the UTC format dependeing on the given offset
Name | Type | Description | |
---|---|---|---|
timezone | IDTimezone |
the timezone object | |
minified | boolean |
Flag to reduce the Zeros |
-
string
an string with the UTC format
If the date is a valid Date object, return true, otherwise return false.
Name | Type | Description | |
---|---|---|---|
date | Date |
- The date object to check. |
-
boolean
True: The Date object is valid
Validate if offset uses a valid ISO 8601 offset specification
- If the given offset is a numeric, returns an invalid flag.
Name | Type | Description | |
---|---|---|---|
offset | IDTimezoneOffset |
the timezone offset |
-
boolean
true if the given offset is valid
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
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date |
- true: the date is valid.
Validates if the given date has tokens
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date |
-
boolean
true: the date has tokens
Validates if the given date is a date instance
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date |
-
boolean
true: the date is a date instance
Validates if the given date is a string date
Name | Type | Description | |
---|---|---|---|
date | IDate |
String, object or millisencond number of the date |
-
boolean
true: the date is a string date
Validates if the given param is a valid timezone offset
Name | Type | Description | |
---|---|---|---|
offset | IDTimezoneOffset |
the timezone offset |
-
boolean
true: is valid timezone offset.
Validates if the given offset is in the timezone range
Name | Type | Description | |
---|---|---|---|
offset | IDTimezoneOffset |
the timezone offset |
-
boolean
true: the offset is in the timezone range
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
Name | Type | Description | |
---|---|---|---|
date | string |
String of date | |
format | IDateFormat |
String of the format to validate |
-
boolean
True if it is valid or not. Undefined if date is undefined
Generates a Flattened UI filter structure from Filter Data structure.
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object. | ||
datasetsInfo | Collection of datasets information |
- a flattened UI filters array
Generates a Filter Builder Structure from the Filter Data structure v2.1
Name | Type | Description | |
---|---|---|---|
scopes | The filter scope section | ||
datasetsInfo | Collection of datasets information |
- a flattened UI filters array
Generates a Filter Logic structure from Filter Data structure.
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object. |
- a filter logic array
Gets the logic body
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object |
- a filter logic array
Generates a UI filter structure from Filter Data structure.
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object. | ||
datasetsInfo | Collection of datasets information |
- a UI Filters structure
Generates a UI filter Structure from the Filter Data structure v2.1
Name | Type | Description | |
---|---|---|---|
scopes | The filter scope section | ||
section | The filter section. | ||
version | The version of the filter structure | ||
datasetsInfo | Collection of datasets information |
- a UI filter Structure
Generates a Filter Data Structure structure from UI Filter Data structure.
Name | Type | Description | |
---|---|---|---|
filterData | The UI filter data object. |
- a Filter Data structure
Builds the Fitler Data structure from UI filter data
Name | Type | Description | |
---|---|---|---|
uFilterData | The UI filter Data object | ||
version | the version of the structure |
- a Filter Data structure
Generates a Flattened UI filter structure from UI Filter Data structure.
Name | Type | Description | |
---|---|---|---|
filterData | The UI filter data object. | ||
datasetsInfo | Collection of datasets information. Optional for updating the datasets info |
- a flattened UI filters array
Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
Name | Type | Description | |
---|---|---|---|
scopes | The filter scope section |
- a flattened UI filters array
[TODO: For 2022, eliminate this adapter] Get the new property base on the old date grouping properties
Name | Type | Description | |
---|---|---|---|
property | the property to be adapted |
- a adapted property
Checks and adapts the v2.0 Filter Data Structure to the v2.1
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 |
- A new filter data structure v2.1
[TODO: For 2022, eliminate this adapter] Gets an adapted filter value array. Validates the enabled property and sets
Name | Type | Description | |
---|---|---|---|
filter | The filter |
- A new value array with the filled properties.
Generates a filter data structure from the flatttened UI filters.
Name | Type | Description | |
---|---|---|---|
uFilters | Array of flattened filters from UI | ||
version | Tag for the version of the filter data structure |
- a Filter Data.
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
Name | Type | Description | |
---|---|---|---|
fbFilters | Array of flat filters from UI |
- an array of scopes structure.
Gets an scope structure for the filter data
Name | Type | Description | |
---|---|---|---|
uFilter | UI structure filter |
- an scope structure
Gets an dataset structure for the filter data
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
- an dataset structure
Gets an filter structure for the filter data
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
- an filter structure
Generates a Logic structure from flattened UI filters
Name | Type | Description | |
---|---|---|---|
uFilter | Array of flat filters from UI |
- The logic structure
Generates a Logic structure from flattened UI filters
Name | Type | Description | |
---|---|---|---|
uFilters | Array of flat filters from UI |
- The logic structure
Generates a UI filter data structure from the flatttened UI filters.
Name | Type | Description | |
---|---|---|---|
uFilters | Array of flattened filters from UI | ||
version | Tag for the version of the filter data structure |
- a UI Filter Data.
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
Name | Type | Description | |
---|---|---|---|
fbFilters | Array of flat filters from UI |
- an array of scopes structure.
Gets an scope structure for the UI filter data
Name | Type | Description | |
---|---|---|---|
uFilter | UI structure filter |
- an scope structure
Gets an dataset structure for the UI filter data
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
- an dataset structure
Gets an filter structure for the UI filter data
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
- an filter structure
Generates a filter data structure from the old logic structure (v2.0).
Name | Type | Description | |
---|---|---|---|
filterData | The old filter data structure with logic (v2.0) | ||
version | Tag for the version of the filter data structure |
- a Filter Data.
Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
Name | Type | Description | |
---|---|---|---|
logics | The old logic structure (v2.0) |
- The Flattened UI Filters array
Get the filter or the index of the given array, validating an old filter structure.
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 |
- the index or the UI filter object
Refines the values of the Ranking column type.
Name | Type | Description | |
---|---|---|---|
values | the Array of Ranking values | ||
uiValues | Object with additional info about the values of the filter. |
- the array of Ranking values
Generates a UI filter structure from the old logic structure (v2.0).
Name | Type | Description | |
---|---|---|---|
uFilters | Array of filters from old logic structure | ||
datasetsInfo | Collection of datasets information |
- a UI Filter Data.
Adapter for model answer to convert to recognizable values for Filter Builder
Name | Type | Description | |
---|---|---|---|
answers | Array of the qrvey model answers |
- Array of values
Resolves statement and returns statement value
-
AbsoluteRange
string
Resolves statement as an anchor
string
Convert verbal statement to range value
AbsoluteRange
Apply 'this' cursor logic to statement
AbsoluteStatement
Apply 'the last' cursor logic to statement
AbsoluteStatement
Apply 'the next' cursor logic to statement
AbsoluteStatement
Replace '@now' token inside a string
Name | Type | Description | |
---|---|---|---|
value | string |
||
now | Date |
string
Returns a range object (date) from a group of statement params
Name | Type | Description | |
---|---|---|---|
args | RelativeToAbsoluteStruct |
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'
string
Resolve a list of relative statements according to operator
Name | Type | Description | |
---|---|---|---|
statements | - Raw statements/values | ||
clock | - Clock/time reference for relative date resolution |
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" }
Name | Type | Description | |
---|---|---|---|
logics | |||
summaries |
- the filter aggregate structure
Filters and gets the filters used for aggregate values.
Name | Type | Description | |
---|---|---|---|
logics | The filter logic structure | ||
formatToFilters | Flag to change de way of returning the filter structure. |
- the aggregate filters in the IFilterFilters way or as logic structure.
[TODO: Make a proper description for this function]
Name | Type | Description | |
---|---|---|---|
chartSettings | Chart Settings for the Filter Builder | ||
scopes | the pair id/label scopes | ||
currentScope | the scope to be validated |
- the chart settings
It takes an array of tokens and returns a string
Name | Type | Description | |
---|---|---|---|
tokens | Array.<IFFilterTokens> |
- IFFilterTokens[] - the tokens to convert to a string |
- A string
Name | Type | Description | |
---|---|---|---|
filterData | |||
_summaries |
- the aggFilters structure
Gets the Scopes IDS for the Available Scope function by any config
Name | Type | Description | |
---|---|---|---|
config | any config |
- a Available Scope IDS config
[TODO: Make a description for this]
Name | Type | Description | |
---|---|---|---|
scopes | the collection of Scopes/Scope IDs | ||
currentScope | Current scope type |
- A new array of Scopes/Scope IDs
It takes a filter object and returns an array of tokens that represent the filter
Name | Type | Description | |
---|---|---|---|
filters | IFUData |
- The filters object. | |
options | IFTokensFromFiltersSettings |
- IFTokensFromFiltersSettings |
-
Array.<IFFilterTokens>
An array of tokens that represents the filters object
It takes a set of filters and returns a string that describes the filters
Name | Type | Description | |
---|---|---|---|
filters | IFUData |
- The filters object that you want to convert to a string. | |
options | IFTokensFromFiltersSettings |
- IFTokensFromFiltersSettings |
- A string
Gets Scopes/Scope IDs by given IDs
Name | Type | Description | |
---|---|---|---|
config | given Differnts IDs in order set a available scope |
- a Scopes/Scope IDs array
[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
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 |
- A string
It sets the locale formatter for the number.
Void
It returns a new instance of the Intl.NumberFormat class, which is a built-in JavaScript class that formats numbers
Name | Type | Description | |
---|---|---|---|
locale |
string Array.<string>
|
- string | string[] |
- A new instance of the Intl.NumberFormat class.
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
Name | Type | Description | |
---|---|---|---|
template | string |
- The format template string. |
Void
It replaces the H and D characters in the template with h and d respectively
Name | Type | Description | |
---|---|---|---|
template | string |
- The template string to be used for the date format. |
- The template string with all instances of H replaced with h and all instances of D replaced with d.
It sets the numberFactor to the value of the duration part that matches the unit.
Void
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
Name | Type | Description | |
---|---|---|---|
template | string |
- string - the template string that we want to parse |
- An array of objects that have the order and the name of the part of the duration.
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
Name | Type | Description | |
---|---|---|---|
number | number |
- The number of milliseconds to format. |
- The template string with the values replaced.
It takes a dictionary of values and a list of keys, and returns a formatted string
Name | Type | Description | |
---|---|---|---|
parts | - { [x: string]: any; } | ||
part |
string `Array.<string |
number>` | - This is the part of the date that we're formatting. |
- The value of the part of the date that is being formatted.
This class allows to use the translation service of the i18next library
Void
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.
Name | Type | Description | |
---|---|---|---|
column | The question column |
- true if the column belongs to a static values question; otherwise, false
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.
Name | Type | Description | |
---|---|---|---|
column | The column with info | ||
dataset | the dataset object to search the column |
- true if expression column is categorizable; otherwise not. If does not exist, undefined is sent.
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.
Name | Type | Description | |
---|---|---|---|
column | Info of the column | ||
model | The model object | ||
property | Optional Attribute, especially for expression columns. |
- Formatted answers inside of answer property.
Gets a dataset by a given partial column
Name | Type | Description | |
---|---|---|---|
column | the partial column | ||
datasets | the collection of dataset to look for one. |
- the found dataset or undefined
Get the answers of expression columns. Depends of the property attribute and if the column is categorizable.
Name | Type | Description | |
---|---|---|---|
column | The column located inside the model object. | ||
property | Optional Attribute, especially for expression columns. |
- Formatted answers inside of an answer property.
Get the answers of dropdown columns. Answers is a direct array of strings so it is necessary to format them.
Name | Type | Description | |
---|---|---|---|
question | The column located inside the model object. |
- Formatted answers inside of an answer property.
Get the answers of image columns.
Name | Type | Description | |
---|---|---|---|
column | The column located inside the model object. |
- Formatted answers inside of an answer property.
Special function for Image Upload This function returns if the current column has object or text analysis as property.
Name | Type | Description | |
---|---|---|---|
column | The column with info | ||
model | The model object |
- true if this column has analysis. Otherwise false.
Get the answers of rating columns.
Name | Type | Description | |
---|---|---|---|
_question | The column located inside the model object. |
- Formatted answers inside of an answer property
Get the answers of slidebar columns. The quantity of answers depend on the steps chosen in maker.
Name | Type | Description | |
---|---|---|---|
_question | The column located inside the model object. |
- Formatted answers inside of an answer property
Gets a string of the translate structure by the given column
Name | Type | Description | |
---|---|---|---|
column | the Info of the column |
- a string of the translation structure where the label is located.
Get a string value with suffixes if available. Add suffix into the value string. Prioritized for numeric values.
Name | Type | Description | |
---|---|---|---|
value | a number or string | ||
suffixes | An object with singular or plural suffix string. |
- a string value with suffix
Get the answers of Yes/No columns. Yes/No answers from model object are capitalized but the filters need values in lowercase.
Name | Type | Description | |
---|---|---|---|
column | The column located inside the model object. |
- Formatted answers inside of an answer property
Transforms a value depending of localization/globalization and extras settings.
Name | Type | Description | |
---|---|---|---|
value | A value to transform | ||
settings | The settings of the transformValue function |
- A transformed value
Gets the default settings properties
Name | Type | Description | |
---|---|---|---|
settings | ITransformValueSettings |
the given settings |
-
ITransformValueSettings
the settings with default properties
Gets the outputformat settings
Name | Type | Description | |
---|---|---|---|
settings | The settings of the transformValue function |
- the outputformat settings
Gets the format config if the locale exists in i18n settings
Name | Type | Description | |
---|---|---|---|
settings | The settings of the transformValue function |
- the format config
If the property is a day, return the date format without the time, otherwise return the original format.
Name | Type | Description | |
---|---|---|---|
settings | ITransformValueSettings |
- ITransformValueSettings |
- The outputFormat of the column.
Get the format related to the columnn property. If the property is hour, minute, second, or undefined, return true.
Name | Type | Description | |
---|---|---|---|
property | IColumnPropertyType |
- The property of the date to group by. |
-
boolean
A boolean value.
Compares two objects to know if they are equals. Go across nested objects. Includes arrays in the comparison.
Name | Type | Description | |
---|---|---|---|
object1 | First Object to compare | ||
object2 | Second Object to compare |
- True: objects are equal. False: Objects are not equal. Undefined: invalid
Gets the toStringTag
of value
.
Name | Type | Description | |
---|---|---|---|
value | The value to query. |
-
string
Returns thetoStringTag
.
Import a set of external Scripts given the URL in both serie and cascade way
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 |
// 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'
]);
-
Promise
Promise when all script have been loaded
Creates the script element and appends to document.head return a Promise that is resolved when the script is loaded
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
|
Void
Validates if the given argument is empty
Name | Type | Description | |
---|---|---|---|
variable | the given variable | ||
includeFalsy | flag to determine include the falsy variables into the validation |
- true: the given argument is empty; false: is not.
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.
Name | Type | Description | |
---|---|---|---|
variable | the variable to validate |
- True: variable is a NaN; False: The variable is a number
return if a given variable is either null
or undefined
useful to avoid falsify validating Number Zero (0)
Name | Type | Description | |
---|---|---|---|
arg | any |
Boolean
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.
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. |
-
String
Random string
Gets the length of the given array.
- Useful for Object, Array and string type.
- For
null
orundefined
or else argument the returned value will be 0.
Name | Type | Description | |
---|---|---|---|
obj | Any |
Any object-type variable |
-
Number
the size of the given variable
Gets the numeric sign of a given number
Name | Type | Description | |
---|---|---|---|
num | number |
the number |
-
string
an string with the sign
Upper case the first letter of a given text
Name | Type | Description | |
---|---|---|---|
text | String |
-
String
a capitalized text
Sets an amount of zeros as prefix of the given number by its length
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. |
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"
- the string of the number with the prefixed zeros
Gets the absolute number of the giving parameters
Name | Type | Description | |
---|---|---|---|
num |
number string
|
the number | |
sign | string |
the sign of the number |
-
string
the absolute number
Gets the number sign
Name | Type | Description | |
---|---|---|---|
num |
number string
|
the number |
-
string
the number sign
It takes an array of objects, adds a property to each object, and returns the new array.
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. ---------------------------------------------------------------------------------------------- |
<caption>Example usage of addPropertyToArrayOfObjects.</caption> addPropertyToArrayOfObjects({
array: [{ name: "John", lastName: "Doe" }, { name: "Chris", lastName: "Musk" }],
property: "lastName",
value: 'Peck'
});
- the new array created.
Inmutable Array Item deletion
Name | Type | Description | |
---|---|---|---|
array | Array |
a collection of items to delete | |
index | Number |
the position of the item to delete |
- a new Array or the given parameter when is empty or not an array
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
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 |
- array filtered
Flat deeply an array
Name | Type | Description | |
---|---|---|---|
arr | Array to flat deeply |
- flatten array
Gets a collection of object values by the given property
Name | Type | Description | |
---|---|---|---|
arr | An array | ||
property | the property to get the value collection |
- a collection of values by property
Gets the first index from the array by a callback condition
Name | Type | Description | |
---|---|---|---|
array | |||
callback | function callback |
- the first index of the array. -1 when the condition is not satisfied
Gets the last index from the array by a callback condition
Name | Type | Description | |
---|---|---|---|
array | |||
callback | function callback |
- the last index of the array. -1 when the condition is not satisfied
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
Name | Type | Description | |
---|---|---|---|
arr | The array | ||
prop | Property name to search duplicated values |
- Array without duplicated items.
Transforms the date+times propertiesof the given object by the Timezone object
Name | Type | Description | |
---|---|---|---|
obj | any |
the object | |
timezone | IDTimezone |
the timezone object |
-
IFSData
IFUData
the new filter data with the transformed datetime values
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
Name | Type | Description | |
---|---|---|---|
obj | The object |
- The new reference object or the given object if the parsing is incorrect or empty
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.
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. |
// 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'])
- the resolved value.
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
Name | Type | Description | |
---|---|---|---|
obj | object |
object to look for | |
key | string |
String attribute in snake_case style |
getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
Void
Use the hasOwnProperty in order to verify if the given property exists in the object.
Name | Type | Description | |
---|---|---|---|
obj | object |
an object | |
property | string |
String to verify if exists in the object as property |
const prop = 'prop2'
const obj1 = { prop1: 'hello', prop2: 'world'}
_hasProperty(ob1, prop1) // true
const obj2 = { prop1: 'hello world' }
_hasProperty(ob1, prop2) // false
- True if the object has the given property; otherwise, false.
Checks if the given argument is an object type
Name | Type | Description | |
---|---|---|---|
obj | the variable to check |
- True: It is an object; False: It is not.
Invoke iteratee (function) for each object key-value pair and return a mapped object
Name | Type | Description | |
---|---|---|---|
baseObject | Object |
Base object. | |
iteratee | Function |
The executed per iteration. |
-
Object
New mapped object.
Merges two objects into a new one. The second given argument to the first given argument.
Name | Type | Description | |
---|---|---|---|
obj1 | The target object | ||
obj2 | The object to be merged | ||
settings | Object settings for this function |
- a new merged object
Validates if the two arguments are objects
Name | Type | Description | |
---|---|---|---|
obj1 | The target object | ||
obj2 | The object to be merged |
- true: they are valid; false: they are not
Validates and gets the settings with all set parameters.
Name | Type | Description | |
---|---|---|---|
settings | the settings object |
- a new settings object with all set parameters.
Created a new reference of the given argument
Name | Type | Description | |
---|---|---|---|
entity | The variable to be copied | ||
cache |
- A new reference of the given argument
return a new Object excluding attributes in props list
Name | Type | Description | |
---|---|---|---|
obj | Object |
base object | |
props | Array.<String> |
list of attribute to exclude |
-
Object
clean object
Removes and returns the given object cleaning the undefined values
Name | Type | Description | |
---|---|---|---|
obj | an object |
- the new object with no undefined values
return a new object just with attributes in keys list
Name | Type | Description | |
---|---|---|---|
baseObject | Object |
base object | |
keys | Array.<String> |
list of attributes to preserve |
-
Object
new object just with desired attributes
serialize object to url param
Name | Type | Description | |
---|---|---|---|
obj | - Object to be serialized |
Void
Adapts the branches map from backend to the UI branches map
Name | Type | Description | |
---|---|---|---|
branchesMap | the backend branches map |
- The Branches map array
Transforms the backenc timezone structure to UI timezone structure
Name | Type | Description | |
---|---|---|---|
timezone | IBTimezone |
the backend timezone object |
-
IDTimezone
the UI timezone object
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
Name | Type | Description | |
---|---|---|---|
config | the widget config. Includes general configuration properties | ||
qrveyids | Collection of Qrvey IDs for returning a set of available datasets |
- a promise that if it is resolved displays a collection of dataset info.
Request function for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
Name | Type | Description | |
---|---|---|---|
config | Configuration | ||
params | Object for getting precise data |
Void
Get a dataset by Qrvey ID
Name | Type | Description | |
---|---|---|---|
qrveyid | The Qrvey ID |
- a promise
Get a dataset by Qrvey ID
Name | Type | Description | |
---|---|---|---|
qrveyid | The Qrvey ID |
- a promise
Delays invoking fn until after time milliseconds have elapsed since the last time the debounced function was invoked.
Name | Type | Description | |
---|---|---|---|
fn | Function |
original Function | |
time | Number |
default 500ms |
-
Function
debounced functions
Make sure to only invokes fn at most once per every time milliseconds
Name | Type | Description | |
---|---|---|---|
fn | Function |
original Function | |
time | Number |
default 500ms |
-
Function
throttled function
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
Name | Type | Description | |
---|---|---|---|
rgbaChannel | the rgba channel object |
- a HSP color number
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.
Name | Type | Description | |
---|---|---|---|
destination | the string of the destination. |
- the CSS variables and their values.
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
Name | Type | Description | |
---|---|---|---|
color | the Hexadecimal color |
- the RGBA channels
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
Name | Type | Description | |
---|---|---|---|
color | the name color |
- the RGBA channels
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
Name | Type | Description | |
---|---|---|---|
color | the RGBA color |
- the RGBA channels
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
Name | Type | Description | |
---|---|---|---|
hexadecimal | hexadecimal color |
- the Alpha channel (opacity)
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
Name | Type | Description | |
---|---|---|---|
hexadecimal | RGBA color |
- the Alpha channel (opacity)
Determines if the Color is dark or light. Uses the lightOrDark module.
Name | Type | Description | |
---|---|---|---|
color | the string of the color (RGBA, or Hexadecimal) |
- true: the color is dark.
Validates if the given color is an hexadecimal structure
Name | Type | Description | |
---|---|---|---|
color | the string of the color |
- true: the color is an hexadecimal type
Validates if the given color is an RGBA structure
Name | Type | Description | |
---|---|---|---|
color | the string of the color |
- true: the color is an RGBA type
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
Name | Type | Description | |
---|---|---|---|
color | the string of the color. |
- the color type (Dark or Light)
Sets CSS Variables into a given wrapper collection. For the Dark Theme feature.
Name | Type | Description | |
---|---|---|---|
colorType | the color type | ||
wrapperTags | the html elements to set the CSS variables |
Void
Sets CSS Variables into a given wrapper collection. For the Dark Theme feature.
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 |
Void
(Method Decorator) Debounce Class Method
Name | Type | Description | |
---|---|---|---|
time | (optional) deafult 500 |
Void
(Method Decorator) Throttled Class Method
Name | Type | Description | |
---|---|---|---|
time | (optional) deafult 500 |
Void
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
\ @Config() @Prop() settings;
someMethod() {
this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
}
Void
lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
- function - Function to use in ref prop in html elements
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
Name | Type | Description | |
---|---|---|---|
cfg |
Void
Validates if both filters are the same
Name | Type | Description | |
---|---|---|---|
filter1 | filter 1 | ||
filter2 | filter 2 |
- true: the filters are equal; false: the filters are NOT equal
Excludes Aggregate Filters in the Filter Data. Excluding filters when the column.aggregate is included.
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object |
- The new filter data object that were excluded the aggregate filters
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
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data or the UI Filter Data | ||
params | given parameters to validate the filter data |
- a new Filter object structure
Excludes and returns a filter data without filters by the given scopes
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data | ||
scopes | collection of scopes to be as filtering parameters |
- The new Filter Data without filters by the given scopes.
Get an string of the properties of the given filter column.
Name | Type | Description | |
---|---|---|---|
column | The filter column |
- an string with the property, aggregate or calculation label.
Gets the Filter Label + Column label
Name | Type | Description | |
---|---|---|---|
filter | the UI filter |
- a sring label
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
Name | Type | Description | |
---|---|---|---|
filter | the filter structure |
- a text to identify the filter
Gets Aggregate Filters in the Filter Data. Gets the filters when the column.aggregate is included.
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object |
- The new filter data object that were get the aggregate filters
Filtering the filters by the columns of datasets. Module specially for CLS.
Name | Type | Description | |
---|---|---|---|
data | the filter data | ||
datasets | the collection of datasets and their columns |
- A new filter data with the filtered filters by columns
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
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data or the UI Filter Data | ||
params | given parameters to validate the dataset |
- a new Filter object structure
Filters and gets a Filter Data by the given scopes
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data | ||
scopes | collection of scopes types |
- The new Filter Data
Gets and transforms the Filter Data by the Timezone object
Name | Type | Description | |
---|---|---|---|
filterData |
IFSData IFUData
|
the filter data | |
timezone | IDTimezone |
the timezone object |
-
IFSData
IFUData
the new filter data with the transformed datetime values
Get a new Filter Data by filtering scopes/scope IDs and enabled flags
Name | Type | Description | |
---|---|---|---|
filterData | a Filter Data or UI Filter Data | ||
scopes | a Scopes/Scope IDs array |
- a new Filter Data
Gets filters from Filter Data by Scopes/Scope IDs.
Name | Type | Description | |
---|---|---|---|
filterData | The filter data | ||
scopes | The collection of Scopes/Scope IDs |
- a new Filter Data
Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.
Name | Type | Description | |
---|---|---|---|
settings | an object to the MergeFilters settings |
- a new MergeFilters settings object.
Transforms the given ParamsToGetFilter settings object. Adds the missing properties if they do not exist.
Name | Type | Description | |
---|---|---|---|
settings | an object to the ParamsToGetFilter settings |
- a new ParamsToGetFilter settings object.
Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.
Name | Type | Description | |
---|---|---|---|
settings | an object to the MergeFilters settings |
- a new MergeFilters settings object.
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.
Name | Type | Description | |
---|---|---|---|
props | Configuration to get static values from the given dataset. |
- The values.
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.
Name | Type | Description | |
---|---|---|---|
props | Configuration to get static values from the given model. |
- The values.
Gets an string that describes the filter datasets content
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFUDataset> |
The filter datasets to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
- the description of the datasets array
Gets the datasets by some conditions
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFUDataset> |
The filtered datasets to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
-
Array.<IFUDataset>
the collection of the datasets
Gets the title of the filter dataset
Name | Type | Description | |
---|---|---|---|
dataset | IFUDataset |
the filter dataset object | |
settings | IFFGetVerboseFilters |
the settings to the function |
-
string
the title of the filter dataset
Gets the separators for the title. It would be
- New Line
- An string from argument
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings of the module |
-
string
the string of the separator
Gets the separators of each filter. It would be
- New Line
- The operator
- An string from argument
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings of the module |
-
string
the string of the separator
Gets an string that describes the filter filters content
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFUFilter> |
The filter filters to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
- the description of the filters array
Gets the filters by some conditions
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFUFilter> |
The filtered filters to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
-
Array.<IFUFilter>
the collection of the filters
Gets the title of the filter
Name | Type | Description | |
---|---|---|---|
filter | IFUFilter |
the filter object | |
settings | IFFGetVerboseFilters |
the settings to the function |
-
string
the title of the filter
Gets the separators of each filter. It would be
- New Line
- The operator
- An string from argument
Name | Type | Description | |
---|---|---|---|
currentIndex | number |
the iteration index of the value | |
filter | IFUFilter |
the filter object | |
settings | IFFGetVerboseFilters |
the settings of the module |
-
string
the string of the separator
Gets the separators for the title. It would be
- New Line
- An string from argument
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings of the module |
-
string
the string of the separator
Gets an string that describes the filter values content
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFValue> |
The filter values to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
- the description of the filter values
Gets the value collection of the filter by some conditions
Name | Type | Description | |
---|---|---|---|
filter | IFValue |
The filter to get the values | |
settings | IFFGetVerboseFilters |
the settings to the function |
-
Array.<string>
the collection of the filter values
Gets the separators of each values. It would be
- New Line
- The operator
- An string from argument
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 |
-
string
the string of the separator
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.
Name | Type | Description | |
---|---|---|---|
filter | IFUFilter |
the filter object | |
value | IFUValue |
the value item |
-
string
the resulting value
Gets an string that describes the filter data content
Name | Type | Description | |
---|---|---|---|
filters | IFUData |
The filters object to verbose | |
settings | IFFGetVerboseFilters |
the settings for the function |
- A string
Gets the dataset settings by the given settings
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings for the function |
- the dataset settings
Gets the filter settings by the given settings
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings for the function |
- the filter settings
Gets the scope settings by the given settings
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings for the function |
- the scope settings
Gets the value settings by the given settings
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings for the function |
- the value settings
Validates if the filter data has filters by a dataset ID (Qrvey ID).
Name | Type | Description | |
---|---|---|---|
filterData | the filter data or the UI filter data. | ||
qrveyid | The Qrvey ID |
- true: the filter data has filters by the Qrvey ID
Validates if the given validator is a Between type
Name | Type | Description | |
---|---|---|---|
validator | The validator |
- true: it is a between validator; false: it is not a between validator
Gets an string that describes the filter scopes content
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFUScope> |
The filters scopes to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
- A string
Gets the scopes by some conditions
Name | Type | Description | |
---|---|---|---|
filters | Array.<IFUScope> |
The filtered scopes to verbose | |
settings | IFFGetVerboseFilters |
the settings to the function |
-
Array.<IFUScope>
the collection of the scopes
Gets the title of the filter scope
Name | Type | Description | |
---|---|---|---|
scope | IFUScope |
the filter scope info | |
settings | IFFGetVerboseFilters |
the settings of the function |
-
string
the title of the filter scope
Gets the separators for the title. It would be
- New Line
- An string from argument
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings of the module |
-
string
the string of the title separator
Gets the separators of each filter. It would be
- New Line
- The operator
- An string from argument
Name | Type | Description | |
---|---|---|---|
settings | IFFGetVerboseFilters |
the settings of the module |
-
string
the string of the separator
Determines if the filter column and property is a distinct group dates type
Name | Type | Description | |
---|---|---|---|
column | The filter column | ||
property | The filter property |
- True if the given property is included from distinct group dates type
Validates if the given validator is a In type
Name | Type | Description | |
---|---|---|---|
validator | The validator |
- true: it is a In validator; false: it is not a In validator
Validates if the given validator is a Range type. Range type means the value has min and max values to filter
Name | Type | Description | |
---|---|---|---|
validator | The filter validator |
- true: it is a range validator
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.
Name | Type | Description | |
---|---|---|---|
filter | The filter object |
- a true if the filter is a ranking filter.
Checks if the given validator is a Null type.
Name | Type | Description | |
---|---|---|---|
validator | The Filter Validator |
- True: It is a Null Validator; False: It is not a Null Validator.
Validates if the given validator is a regular type. Regular type means the filter object has a value as string to filter
Name | Type | Description | |
---|---|---|---|
validator | The filter validator |
- true: it is a range validator
Gets a new value structure array by merging two value structures
Name | Type | Description | |
---|---|---|---|
filter1 | the target filter structure | ||
filter2 | the filter to be used to merge the values | ||
settings | configuration of the mergeFilter |
- a new value structure array
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
Name | Type | Description | |
---|---|---|---|
filterData1 | IFUData |
The target filter data | |
filterData2 | IFUData |
the filter data to be merged | |
settings | IFFiltersMergeFilters |
configuration of the mergeFilters |
-
IFUData
a new filter data structure
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
Name | Type | Description | |
---|---|---|---|
scopes1 | Array.<IFUScope> |
the target scope structure | |
scopes2 | Array.<IFUScope> |
the scope to be merged | |
settings | IFFiltersMergeFilters |
configuration of the mergeFilters |
-
Array.<IFUScope>
a new scope array structure
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
Name | Type | Description | |
---|---|---|---|
datasets1 | Array.<IFUDataset> |
the target dataset structure | |
datasets2 | Array.<IFUDataset> |
the dataset to be merged | |
settings | IFFiltersMergeFilters |
configuration of the mergeFilter |
-
Array.<IFUDataset>
a new dataset structure array
Gets a new filter structure array by merging two filter structures
Name | Type | Description | |
---|---|---|---|
filters1 | Array.<IFUFilter> |
the target filter structure | |
filters2 | Array.<IFUFilter> |
the filter to be merged | |
settings | IFFiltersMergeFilters |
configuration of the mergeFilters |
-
Array.<IFUFilter>
a new filter structure array
Gets a new scope structure for the configured settings
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 |
-
IFUScope
a new filter structure with overwritted props
Gets a new dataset structure for the configured settings
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 |
-
IFUDataset
a new filter structure with overwritted props
Gets a new filter structure for the configured settings
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 |
- a new filter structure with overwritted props
Resolves the conditions by given params
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. |
- true: the condition is satisfied
Resolves the conditions by given params
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. |
- true: the condition is satisfied
Resolves the conditions by given params
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. |
- true: the condition is satisfied
Build a proper relative date statement type
Name | Type | Description | |
---|---|---|---|
statement | RelativeStatement |
RelativeStatement
Returns a number/constant that identifies a relative date case
Name | Type | Description | |
---|---|---|---|
includeCurrent | boolean |
||
isCalendarDate | boolean |
number
Parses a string date and returns a dayjs date
Name | Type | Description | |
---|---|---|---|
date |
string Dayjs Date
|
-
Dayjs
A dayjs date
Returns a filter builder config object by a any given config
Name | Type | Description | |
---|---|---|---|
config | any config object |
- The filter builder config object
Builds filter expression by the filter data.
- If the resulting value array is empty the enabled property will be false.
Name | Type | Description | |
---|---|---|---|
filter | The filter to transform |
- a filter expression
Transform user Filters array into Filter Logic structure
Name | Type | Description | |
---|---|---|---|
userFilters | The filters that the user defined. |
- The filter logic for the given user filters. if No a given object is recieved, it will return an empty array.
Name | Type | Description | |
---|---|---|---|
aggFilters | The aggFilter Structure | ||
summaryIndex | an index |
- a new aggFilters structure
Gets a group value for the backend logic structure
Name | Type | Description | |
---|---|---|---|
filter | The filter |
- a property
Gets a property for the logic structure
Name | Type | Description | |
---|---|---|---|
filter | The filter |
- a property
Gets the Validator that is used in requests
Name | Type | Description | |
---|---|---|---|
validator | Filter Validator used in UI |
- Filter Validator used in Backend
Gets the expresion values in the logic format
Name | Type | Description | |
---|---|---|---|
filter | The filter structure |
- A collection of backend expression value
Gets the expression values. Depending on the column type
Name | Type | Description | |
---|---|---|---|
values | a collection of filter values | ||
filter | The filter structure |
- Expression values
Gets the Ranking values.
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 |
- Expression values for ranking
[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
Name | Type | Description | |
---|---|---|---|
logic | The logic of the filter | ||
datasets | The collection of qrveyids |
- a new filtered logic
Name | Type | Description | |
---|---|---|---|
logic | Array.<IFBLogic> |
The logic of the filters | |
datasets | Array.<IDataset> |
The collection of datasets |
- a new filtered logic
Runs the function for the callback
Name | Type | Description | |
---|---|---|---|
settings | IFFGetLogicByDatasetsColumns |
the settings for the helper | |
datasets | Array.<IDataset> |
The dataset collection |
Gets the letQrveyidPass flag
Name | Type | Description | |
---|---|---|---|
expression | IFBExpression |
the logic expression of the filter | |
settings | IFFGetLogicByDatasetsColumns |
the settings for the helper |
-
boolean
true: the qrveyid will be passed
Gets the letQuestionidPass flag
Name | Type | Description | |
---|---|---|---|
expression | IFBExpression |
the logic expression of the filter | |
settings | IFFGetLogicByDatasetsColumns |
the settings for the helper |
-
boolean
true: the questionid will be passed
Gets the dataset related to the expression
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 |
-
IDataset
the dataset object
Gets the default settings for the getLogicByDatasetsColumn function
Name | Type | Description | |
---|---|---|---|
settings | IFFGetLogicByDatasetsColumns |
the settings for the helper given by the implementer |
-
IFFGetLogicByDatasetsColumns
an object with all properties set
Gets the filters from logic data by Scopes/Scope IDs.
Name | Type | Description | |
---|---|---|---|
logics | The logic array | ||
scopes | The collection of Scopes/Scope IDs |
- a new Logic array
Gets filters from the logic by the scopes hierarchy.
Name | Type | Description | |
---|---|---|---|
filterData | |||
scopes | |||
currentScope |
- a new array of Logic
Validates if the scope settings is satisfied by properties in multiple scopes
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 |
- true iif there are scopes to be satisfied; false: one or none scopes to be satisfied
Validates if the scope settings is satisfied the property in multiple scopes
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the filter setting | |
property | string |
the property or the string path of the scope settings |
- true if there are scopes to be satisfied; false: one or none scopes to be satisfied
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
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 |
- a new filter settings object
Gets the filter settings by multiple scopes conditions
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings | |
allowedScopes | Array.<IFScope> |
a collection of scope types that are permitted |
- a new filter settings object
Gets the filter settings when a single scope is permitted
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings | |
allowedScopes | Array.<IFScope> |
a collection of scope types that are permitted |
- a new filter settings object
Gets the filter settings when there is not scope to accept
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when a general scope are only permitted The general scopes could be the GLOBAL, PAGE, TAB and PANEL types.
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there is not a default scope type
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there is only a default scope type
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there are a default scope and other single scope
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there is only the panel scope
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there is only the data scope
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there are not general scopes allowed The general scopes could be the GLOBAL, PAGE, TAB and PANEL types.
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there are no panel scopes and multiple scopes allowed.
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the filter settings when there are no panel scopes and multiple scopes allowed.
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the given filter settings |
- a new filter settings object
Gets the scope settings by the scope type
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the filter settings | |
scope | IFScope |
the scope type |
- the scope settings
Gets the color of the scope in the settings object
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the filter settings | |
scope | IFScope |
the scope type |
- an string with the color.
Gets the scopes settings as array
Name | Type | Description | |
---|---|---|---|
scopes | IFSettingsScopes |
the scopes settings |
- an array of the scopes settings
Gets the scope allowed to display
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the filter settings |
- an array of the scopes settings
Validates if the scope settings is satisfied by properties at least in one scope
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 |
- true if there is one scope to be satisfied; false: none scopes to be satisfied
Validates if the scope settings is satisfied by a property at least in one scope
Name | Type | Description | |
---|---|---|---|
settings | IFSettings |
the filter setting | |
property | string |
the property or the string path of the scope settings |
- true if there is one scope to be satisfied; false: none scopes to be satisfied
Excludes Aggregate Filters in the Flattened UI Filters array
Name | Type | Description | |
---|---|---|---|
uFilters | Collection of Flat UI Filters |
- a new Flat UI Filters that were excluded the aggregate filters
Excludes and returns a UI Flat Filters without filters by the given scopes
Name | Type | Description | |
---|---|---|---|
uFilters | The Flatten UI Filters | ||
scopes | collection of scopes types |
- The new array of UI Flattened filters
Gets the label of the filter property
Name | Type | Description | |
---|---|---|---|
filter | The UI Filter |
- a string of the filter property label
Gets output format object from Datasets by the given column. Item of the datasets array must have outputformat item in order to be returned
Name | Type | Description | |
---|---|---|---|
column | The column | ||
datasets | array of datasets |
- The output format object
Gets a collection of Qrvey IDs in the UI Filter structure. Looks around all filter structure finding the qrveyid propertty in each dataset
Name | Type | Description | |
---|---|---|---|
uiFilter |
Void
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
- The index of the uFilter array or the Filter object s
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
- The index of the uFilter array or the Filter object s
Filters and gets a UI Flatten Filters by the given scopes
Name | Type | Description | |
---|---|---|---|
uFilters | The Flatten UI Filters | ||
scopes | collection of scopes types |
- The new array of UI Flattened filters
Gets the UI Values generated depending on the validator
Name | Type | Description | |
---|---|---|---|
filter | the filter structure | ||
settings | a settings for this function |
- an array of values
Gets a new UI Filter structure with a datasets/columns info updates
Name | Type | Description | |
---|---|---|---|
data | The UI Filter structure | ||
datasets | An array of datasets/column info used for updating the data |
- A new UI FIlter structure
Resolves conditions between UI flattened filter and given parameters
Name | Type | Description | |
---|---|---|---|
filter | UI Flatten Filter | ||
params | Parameters to validate |
- true: the conditions are satisfied.
Documentation generated with doxdox.