@qrvey/utils v1.11.1
@qrvey/utils 1.1.0
Helper, Utils for all Qrvey Projects
dist/qrvey/getColumnsLabel.js
getColumnLabels(column)
Get an string of the properties of the given column.
Parameters
Name | Type | Description | |
---|---|---|---|
column | The column |
Returns
- an string with the property, aggregate or calculation label.
dist/date/range/getDateRange.js
getDateRange(value, dateGroupLabel, withTime)
Get date range object from a string date value
Parameters
Name | Type | Description | |
---|---|---|---|
value | String | string date value | |
dateGroupLabel | String | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' | |
withTime | Boolean | determines if the date range will include time. Default is true |
Examples
// 1) Year:
getDateRange('2020', 'YEAR');
// Will return:
{
from: '01/01/2020 00:00:00',
to: '12/31/2020 23:59:59'
}
// 2) Quarter:
getDateRange('Q3 2020', 'QUARTER');
// Will return:
{
from: '07/01/2020 00:00:00',
to: '09/30/2020 23:59:59'
}
// 3) Month:
getDateRange('Oct 2020', 'MONTH');
// Will return:
{
from: '10/01/2020 00:00:00',
to: '10/31/2020 23:59:59'
}
Returns
Object
an object with the date range with two string date properties: from and to
dist/date/relative/Adapter.js
value()
Resolves statement and returns statement value
Returns
AbsoluteRange
string
valueAsAnchor()
Resolves statement as an anchor
Returns
string
_statementToRange() private method
Convert verbal statement to range value
Returns
AbsoluteRange
_resolveAsThis() private method
Apply 'this' cursor logic to statement
Returns
AbsoluteStatement
_resolveAsTheLast() private method
Apply 'the last' cursor logic to statement
Returns
AbsoluteStatement
_resolveAsTheNext() private method
Apply 'the next' cursor logic to statement
Returns
AbsoluteStatement
replaceNowToken(value, now)
Replace '@now' token inside a string
Parameters
Name | Type | Description | |
---|---|---|---|
value | string | ||
now | Date |
Returns
string
convertRelativeToAbsolute(args)
Returns a range object (date) from a group of statement params
Parameters
Name | Type | Description | |
---|---|---|---|
args | RelativeToAbsoluteStruct |
Examples
pivot = '2021-03-03T12:30:40'
unit = month
steps = 2
setTo = END
resolverAsCalendar: true
=> Returns '2021-05-31T23:59:59'
pivot = '2021-03-03T12:30:40'
unit = month
steps = -2
setTo = START
resolverAsCalendar: false
=> Returns '2021-01-03T00:00:00'
Returns
string
dist/date/relative/relative.js
resolveRelative(statements, clock)
Resolve a list of relative statements according to operator
Parameters
Name | Type | Description | |
---|---|---|---|
statements | Array.<RelativeStatement> Array.<string> | - Raw statements/values | |
clock | Date | - Clock/time reference for relative date resolution |
Examples
Input:
{
"cursor": "the_next",
"unit": "year",
"number": 1,
"includeCurrent": false,
"isCalendarDate": false,
"anchor": "03/05/2021"
}
Output:
{ gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
Returns
Array.<AbsoluteRange>
Array.<string>
dist/filters/adapters/FDToFlatUI.js
FDToFlatUI(filterData, datasetsInfo)
Generates a Flattened UI filter structure from Filter Data structure.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object. | ||
datasetsInfo | Collection of datasets information |
Returns
- a flattened UI filters array
FD21ToFlatUI(scopes, datasetsInfo)
Generates a Filter Builder Structure from the Filter Data structure v2.1
Parameters
Name | Type | Description | |
---|---|---|---|
scopes | The filter scope section | ||
datasetsInfo | Collection of datasets information |
Returns
- a flattened UI filters array
dist/filters/adapters/FDToLogic.js
FDToLogic(filterData)
Generates a Filter Logic structure from Filter Data structure.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object. |
Returns
- a filter logic array
getLogicBodyFromFD21(filterData)
Gets the logic body
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object |
Returns
- a filter logic array
dist/filters/adapters/FDToUI.js
FDToUI(filterData, datasetsInfo)
Generates a UI filter structure from Filter Data structure.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object. | ||
datasetsInfo | Collection of datasets information |
Returns
- a UI Filters structure
FD21ToUI(scopes, section, version, datasetsInfo)
Generates a UI filter Structure from the Filter Data structure v2.1
Parameters
Name | Type | Description | |
---|---|---|---|
scopes | The filter scope section | ||
section | The filter section. | ||
version | The version of the filter structure | ||
datasetsInfo | Collection of datasets information |
Returns
- a UI filter Structure
dist/filters/adapters/UIToFD.js
UIToFD(filterData)
Generates a Filter Data Structure structure from UI Filter Data structure.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The UI filter data object. |
Returns
- a Filter Data structure
UI21ToFD(uFilterData, version)
Builds the Fitler Data structure from UI filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilterData | The UI filter Data object | ||
version | the version of the structure |
Returns
dist/filters/adapters/UIToFlatUI.js
UIToFlatUI(filterData)
Generates a Flattened UI filter structure from UI Filter Data structure.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The UI filter data object. |
Returns
- a flattened UI filters array
UI21ToFlatUI(scopes)
Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
Parameters
Name | Type | Description | |
---|---|---|---|
scopes | The filter scope section |
Returns
- a flattened UI filters array
dist/filters/adapters/adaptFilterData.js
adaptFilterData(filterData, getUIFilterData, datasetsInfo)
Checks and adapts the v2.0 Filter Data Structure to the v2.1
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data structure. Accepts both v2.1 or v2.0 | ||
getUIFilterData | Flag to get a Filter Data (False) or the UI Filter Data (True) | ||
datasetsInfo | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory |
Returns
- A new filter data structure v2.1
dist/filters/adapters/flatUIToFD.js
flatUIToFD(uFilters, version)
Generates a filter data structure from the flatttened UI filters.
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | Array of flattened filters from UI | ||
version | Tag for the version of the filter data structure |
Returns
- a Filter Data.
buildScopes(fbFilters)
Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs Also, adds and organizes filters by datasets
Parameters
Name | Type | Description | |
---|---|---|---|
fbFilters | Array of flat filters from UI |
Returns
- an array of scopes structure.
buildScope(uFilter)
Gets an scope structure for the filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | UI structure filter |
Returns
- an scope structure
buildDataset(uFilter)
Gets an dataset structure for the filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
Returns
- an dataset structure
buildFilter(uFilter)
Gets an filter structure for the filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
Returns
- an filter structure
dist/filters/adapters/flatUIToLogic.js
flatUIToLogic(uFilter)
Generates a Logic structure from flattened UI filters
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | Array of flat filters from UI |
Returns
- The logic structure
dist/filters/adapters/flatUIToOldLogic.js
flatUIToOldLogic(uFilters)
Generates a Logic structure from flattened UI filters
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | Array of flat filters from UI |
Returns
- The logic structure
dist/filters/adapters/flatUIToUI.js
flatUIToUI(uFilters, version)
Generates a UI filter data structure from the flatttened UI filters.
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | Array of flattened filters from UI | ||
version | Tag for the version of the filter data structure |
Returns
- a UI Filter Data.
buildScopes(fbFilters)
Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs Also, adds and organizes filters by datasets
Parameters
Name | Type | Description | |
---|---|---|---|
fbFilters | Array of flat filters from UI |
Returns
- an array of scopes structure.
buildScope(uFilter)
Gets an scope structure for the UI filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | UI structure filter |
Returns
- an scope structure
buildDataset(uFilter)
Gets an dataset structure for the UI filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
Returns
- an dataset structure
buildFilter(uFilter)
Gets an filter structure for the UI filter data
Parameters
Name | Type | Description | |
---|---|---|---|
uFilter | a UI structure filter |
Returns
- an filter structure
dist/filters/adapters/logicToFD.js
logicToFD(filterData, version)
Generates a filter data structure from the old logic structure (v2.0).
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The old filter data structure with logic (v2.0) | ||
version | Tag for the version of the filter data structure |
Returns
- a Filter Data.
dist/filters/adapters/logicToFlatUI.js
logicToFlatUI(logics)
Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
Parameters
Name | Type | Description | |
---|---|---|---|
logics | The old logic structure (v2.0) |
Returns
- The Flattened UI Filters array
getFilter(filters, filter, getIndex)
Get the filter or the index of the given array, validating an old filter structure.
Parameters
Name | Type | Description | |
---|---|---|---|
filters | The array of UI filters | ||
filter | The old logic structure filter | ||
getIndex | Determines if the index or returns the UI filter object |
Returns
- the index or the UI filter object
refineRankingValues(values, uiValues)
Refines the values of the Ranking column type.
Parameters
Name | Type | Description | |
---|---|---|---|
values | the Array of Ranking values | ||
uiValues | Object with additional info about the values of the filter. |
Returns
- the array of Ranking values
dist/filters/adapters/logicToUI.js
logicToUI(uFilters, datasetsInfo)
Generates a UI filter structure from the old logic structure (v2.0).
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | Array of filters from old logic structure | ||
datasetsInfo | Collection of datasets information |
Returns
- a UI Filter Data.
dist/filters/adapters/transformFilters.js
transformFilters(oldFiltersObj, section)
Transform the old filters structure into the new one
Parameters
Name | Type | Description | |
---|---|---|---|
oldFiltersObj | Object | an object with the old filters structure | |
section | String | could be 'ANALYZE', 'PB', 'UM' or any other value. Deafult is 'ANYWHERE' |
Examples
const oldPreferenceFilters = {
"WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
"WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
"WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
"WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
"WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
"formulaId": null,
"panelId": null,
"values": [
{
"EQUALS": [
{
"id": "AK4M8UV2a0",
"value": "A",
"enabled": true,
"imageUrl": null
},
{
"id": "AK4M8UV2a1",
"value": "B",
"enabled": true,
"imageUrl": null
}
]
}
],
"bucketId": null,
"text": "MC",
"title": "MC",
"type": "SINGLE_CHOICE",
"qid": "AK4M8UV2",
"dataset": {
"sourceid": "xYOQAdpqT",
"name": "Form All Questions",
"qrveyid": "xYOQAdpqT",
"text": "Form All Questions",
"linkid": 0
},
"enabled": true,
"linked": null
}
};
const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
Returns
Object
an object with the new filters structure
isTokenBoxLabel(label)
Get a text and evaluate if it matchs with a token box label.
Parameters
Name | Type | Description | |
---|---|---|---|
label | string to evaluate |
Returns
- True is label matchs; otherwise false
dist/filters/helpers/applyHierarchyForAggFilters.js
applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
TODO: Make a proper description for this function
Parameters
Name | Type | Description | |
---|---|---|---|
chartSettings | Chart Settings for the Filter Builder | ||
scopes | |||
currentScope |
Returns
dist/filters/helpers/getAvailableScopes.js
getAvailableScopes(config)
Gets Scopes/Scope IDs by given IDs
Parameters
Name | Type | Description | |
---|---|---|---|
config | given Differnts IDs in order set a available scope |
Returns
- a Scopes/Scope IDs array
dist/filters/helpers/getAvailableScopesIDsByConfig.js
getAvailableScopesIDsByConfig(config)
Gets the Scopes IDS for the Available Scope function by any config
Parameters
Name | Type | Description | |
---|---|---|---|
config | any config |
Returns
- a Available Scope IDS config
dist/filters/helpers/getScopesByHierarchy.js
getScopesByHierarchy(scopes, currentScope)
TODO: Make a description for this
Parameters
Name | Type | Description | |
---|---|---|---|
scopes | the collection of Scopes/Scope IDs | ||
currentScope | Current scope type |
Returns
- A new array of Scopes/Scope IDs
dist/general/array/delete.js
ArrayDelete(array, index)
Inmutable Array Item deletion
Parameters
Name | Type | Description | |
---|---|---|---|
array | Array | List to loo for item to delte | |
index | Number | position of item to delete |
Returns
- new Array
dist/general/array/filterNestedTree.js
filterNestedTree(arr, childArrKey, condition)
Filters a nested tree array by a custom condition on the las child node
Parameters
Name | Type | Description | |
---|---|---|---|
arr | nested tree array | ||
childArrKey | property representing the children array on the nested tree | ||
condition | function callback that determines if the filter is applied on the last child node of the nested tree |
Returns
- array filtered
dist/general/array/flattenDeep.js
flattenDeep(arr)
Flat deeply an array
Parameters
Name | Type | Description | |
---|---|---|---|
arr | Array to flat deeply |
Returns
- flatten array
dist/general/function/debounce.js
debounce(fn, time)
Delays invoking fn until after time milliseconds have elapsed since the last time the debounced function was invoked.
Parameters
Name | Type | Description | |
---|---|---|---|
fn | Function | original Function | |
time | Number | default 500ms |
Returns
Function
debounced functions
dist/general/function/throttled.js
throttled(fn, time)
Make sure to only invokes fn at most once per every time milliseconds
Parameters
Name | Type | Description | |
---|---|---|---|
fn | Function | original Function | |
time | Number | default 500ms |
Returns
Function
throttled function
dist/general/mix/importScripts.js
importScripts(scripts)
Import a set of external Scripts given the URL in both serie and cascade way
Parameters
Name | Type | Description | |
---|---|---|---|
scripts | Array.<String> Array.<Object> | can be an array of string or an array of object with the follow structure: | |
scripts.url | String | CDN URL | |
scripts.namespace | String Function | (Optional) if is a String, that name is evaluated on Windownamespace object otherwise the Function is invoked expecting a Thrutly value | |
scripts.type | String | (Optional) it could be module of text/javascript . Default text/javascript | |
scripts.noModule | Boolean | (Optional) add momodule attribute to script tag. Default false | |
scripts.dependencies | Array.<Object> | an array with the same structure to load in cascade mode |
Examples
// 1) Simple script (paralell loading)
importScripts(['http://myscript.js', 'http://another.js']);
// 2) Loading `.js` and `.esm.js` script (parallel loading)
importScripts([
{ url: 'http://myscript.esm.js', type: 'module' },
{ url: 'http://myscript.js', noModule: true }
]);
// 3) import dependent scripts (cascade)
importScripts([
{ url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
]);
// 4) mix
importScripts([
{ url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
{ url: 'http://another.esm.js', type: 'module' },
{ url: 'http://another.js', noModule: true },
'http://simplescript.js'
]);
Returns
Promise
Promise when all script have been loaded
loadScript(url, type, noModule)
Creates the script element and appends to document.head return a Promise that is resolved when the script is loaded
Parameters
Name | Type | Description | |
---|---|---|---|
url | String | Cdn Url | |
type | String | (Optional) it could be module of text/javascript . Default text/javascript | |
noModule | boolean | (Optional) add momodule attribute to script tag. Default false |
Returns
Void
dist/general/mix/isEmpty.js
isEmpty(obj)
return if an String, object or string is empty or not
Parameters
Name | Type | Description | |
---|---|---|---|
obj | Any |
Returns
boolean
dist/general/mix/isNull.js
isNull(arg)
return if a given variable is either null
or undefined
useful to avoid falsify validating Number Zero (0)
Parameters
Name | Type | Description | |
---|---|---|---|
arg | any |
Returns
Boolean
dist/general/mix/randomId.js
randomId(length)
create random unique string
Parameters
Name | Type | Description | |
---|---|---|---|
length | Number | size of the generated string. Default 8 |
Returns
String
dist/general/mix/size.js
size(obj)
get the length of an Array or String and also the number of first level attributes
in an Object.
For null
or undefined
argument the returned value will be 0.
Parameters
Name | Type | Description | |
---|---|---|---|
obj | Any |
Returns
Number
dist/general/object/get.js
get(obj, path, def)
Gets the value at path
of obj
. If the resolved value is undefined, the def
is returned in its place.
Parameters
Name | Type | Description | |
---|---|---|---|
obj | |||
path | |||
def |
Examples
const object = { 'a': [{ 'b': { 'c': 3 } }] };
get(object, 'a[0].b.c'); // => 3
get(object, 'a.b.c', 'default'); // => 'default'
Returns
Void
dist/general/object/getAttribute.js
getAttribute(obj, key)
search for 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
Parameters
Name | Type | Description | |
---|---|---|---|
obj | object | object to look for | |
key | string | String attribute in snake_case style |
Examples
getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
Returns
Void
dist/general/object/hasProperty.js
_hasProperty(obj, property)
Use the hasOwnProperty in order to verify if the given property exists in the object.
Parameters
Name | Type | Description | |
---|---|---|---|
obj | object | an object | |
property | string | String to verify if exists in the object as property |
Examples
const prop = 'prop2'
const obj1 = { prop1: 'hello', prop2: 'world'}
_hasProperty(ob1, prop1) // true
const obj2 = { prop1: 'hello world' }
_hasProperty(ob1, prop2) // false
Returns
- True if the object has the given property; otherwise, false.
dist/general/object/mapValues.js
mapValues(baseObject, iteratee)
Invoke iteratee (function) for each object key-value pair and return a mapped object
Parameters
Name | Type | Description | |
---|---|---|---|
baseObject | Object | Base object. | |
iteratee | Function | The executed per iteration. |
Returns
Object
New mapped object.
dist/general/object/omit.js
omit(obj, props)
return a nwe Object excluding attributes in props list
Parameters
Name | Type | Description | |
---|---|---|---|
obj | Object | base object | |
props | Array.<String> | list of attribute to exclude |
Returns
Object
clean object
dist/general/object/pick.js
pick(baseObject, keys)
return a new object just with attributes in keys list
Parameters
Name | Type | Description | |
---|---|---|---|
baseObject | Object | base object | |
keys | Array.<String> | list of attributes to preserve |
Returns
Object
new object just with desired attributes
dist/general/string/capitalize.js
capitalize(text)
Upper case teh first letter of a given text
Parameters
Name | Type | Description | |
---|---|---|---|
text | String |
Returns
String
dist/stencil/decorators/Config.js
Config()
Stencil.js - Prop Decorator
Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
But for this, is required ask for a property in snake_case
style
Examples
\ @Config() @Prop() settings;
someMethod() {
this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
}
Returns
Void
dist/stencil/util/createRef.js
createRef()
lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
Returns
- function - Function to use in ref prop in html elements
dist/stencil/util/getConfig.js
getConfig(cfg)
verify the Config object type and try to return a parsed Object
- In case cfg is a string, first try to make a JSON parse in other case try to find this string as a variable on Windows object
- If cfg is a fuction, tis is invoked and parsed
- Finally, if is an object, cfg is inmediatly returned
Parameters
Name | Type | Description | |
---|---|---|---|
cfg |
Returns
Void
dist/typescript/decorators/Debounce.js
Debounce(time)
(Method Decorator) Debounce Class Method
Parameters
Name | Type | Description | |
---|---|---|---|
time | (optional) deafult 500 |
Returns
Void
dist/typescript/decorators/Throttled.js
Throttled(time)
(Method Decorator) Throttled Class Method
Parameters
Name | Type | Description | |
---|---|---|---|
time | (optional) deafult 500 |
Returns
Void
dist/date/relative/helpers/formatStatement.js
formatStatement(statement)
Build a proper relative date statement type
Parameters
Name | Type | Description | |
---|---|---|---|
statement | RelativeStatement |
Returns
RelativeStatement
dist/date/relative/helpers/getStatementCase.js
getStatementCase(includeCurrent, isCalendarDate)
Returns a number/constant that identifies a relative date case
Parameters
Name | Type | Description | |
---|---|---|---|
includeCurrent | boolean | ||
isCalendarDate | boolean |
Returns
number
dist/date/relative/helpers/parseDate.js
parseDate(date)
Parses a string date and returns a dayjs date
Parameters
Name | Type | Description | |
---|---|---|---|
date | string Dayjs Date |
Returns
Dayjs
A dayjs date
dist/filters/helpers/backend/buildUserFilters.js
buildUserFilters(userFilters)
Transform user Filters array into Filter Logic structure
Parameters
Name | Type | Description | |
---|---|---|---|
userFilters | The filters that the user defined. |
Returns
- The filter logic for the given user filters. if No a given object is recieved, it will return an empty array.
dist/filters/helpers/backend/getAggFiltersBySummaryIndex.js
getAggFiltersBySummaryIndex(aggFilters, summaryIndex)
Parameters
Name | Type | Description | |
---|---|---|---|
aggFilters | |||
summaryIndex |
Returns
dist/filters/helpers/backend/getBackendGroupValue.js
getBackendGroupValue(filter)
Gets a group value for the backend logic structure
Parameters
Name | Type | Description | |
---|---|---|---|
filter | The filter |
Returns
- a property
dist/filters/helpers/backend/getBackendProperty.js
getBackendProperty(filter)
Gets a property for the logic structure
Parameters
Name | Type | Description | |
---|---|---|---|
filter | The filter |
Returns
- a property
dist/filters/helpers/backend/getBackendValidator.js
getBackendValidator(validator)
Gets the Validator that is used in requests
Parameters
Name | Type | Description | |
---|---|---|---|
validator | Filter Validator used in UI |
Returns
- Filter Validator used in Backend
dist/filters/helpers/backend/getBackendValues.js
getBackendValues(filter)
Gets the expresion values in the logic format
Parameters
Name | Type | Description | |
---|---|---|---|
filter | The filter structure |
Returns
- A collection of backend expression value
getResultValues(values, filter)
Gets the expression values. Depending on the column type
Parameters
Name | Type | Description | |
---|---|---|---|
values | a collection of filter values | ||
filter | The filter structure |
Returns
getRankingValues(values, rankingGroupIndex)
Gets the Ranking values.
Parameters
Name | Type | Description | |
---|---|---|---|
values | a collection of filter values in the ranking structure | ||
rankingGroupIndex | determine the value by this index to build and return it |
Returns
- Expression values for ranking
dist/filters/helpers/backend/getLogicByScopes.js
getLogicByScopes(logics, scopes)
Gets the filters from logic data by Scopes/Scope IDs.
Parameters
Name | Type | Description | |
---|---|---|---|
logics | The logic array | ||
scopes | The collection of Scopes/Scope IDs |
Returns
- a new Logic array
dist/filters/helpers/backend/getLogicByScopesHierarchy.js
getLogicByScopesHierarchy(filterData, scopes, currentScope)
Gets filters from the logic by the scopes hierarchy.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | |||
scopes | |||
currentScope |
Returns
- a new array of Logic
dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js
getFilterBuilderGeneralConfig(config)
Returns a filter builder config object by a any given config
Parameters
Name | Type | Description | |
---|---|---|---|
config | any config object |
Returns
- The filter builder config object
dist/filters/helpers/common/areFiltersEquals.js
areFiltersEquals(filter1, filter2)
Validates if both filters are the same
Parameters
Name | Type | Description | |
---|---|---|---|
filter1 | filter 1 | ||
filter2 | filter 2 |
Returns
- true: the filters are equal; false: the filters are NOT equal
dist/filters/helpers/common/excludeFiltersByAggregateColumn.js
excludeFiltersByAggregateColumn(filterData)
Excludes Aggregate Filters in the Filter Data. Excluding filters when the column.aggregate is included.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object |
Returns
- The new filter data object that were excluded the aggregate filters
dist/filters/helpers/common/excludeFiltersByParams.js
excludeFiltersByParams(filterData, params)
Excludes filters from the given Filters. The validation to filter the stored filter is depending on:
- Column
- Qrvey ID
- Scope type
- Scope ID
- Panel ID
- Validator type
- Property type
- Enabled flags
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data or the UI Filter Data | ||
params | given parameters to validate the filter data |
Returns
- a new Filter object structure
dist/filters/helpers/common/excludeFiltersByScopes.js
excludeFiltersByScopes(filterData, scopes)
Excludes and returns a filter data without filters by the given scopes
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data | ||
scopes | collection of scopes to be as filtering parameters |
Returns
- The new Filter Data without filters by the given scopes.
dist/filters/helpers/common/getFilterColumnLabel.js
getFilterColumnLabel(column)
Get an string of the properties of the given filter column.
Parameters
Name | Type | Description | |
---|---|---|---|
column | The filter column |
Returns
- an string with the property, aggregate or calculation label.
dist/filters/helpers/common/getFilterLabel.js
getFilterLabel(filter)
Gets the Filter Label + Column label
Parameters
Name | Type | Description | |
---|---|---|---|
filter | the UI filter |
Returns
- a sring label
dist/filters/helpers/common/getFilterid.js
getFilterid(filter)
Get the Filter ID by the filter structure The order of the epression ID is:
- Scope Type
- scopeid
- qrveyid
- panelid
- columnid
- validator
- property
- Column Aggregate
- Column Calculation
- Optional Index
Parameters
Name | Type | Description | |
---|---|---|---|
filter | the filter structure |
Returns
- a text to identify the filter
dist/filters/helpers/common/getFiltersByAggregateColumn.js
getFiltersByAggregateColumn(filterData)
Gets Aggregate Filters in the Filter Data. Gets the filters when the column.aggregate is included.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data object |
Returns
- The new filter data object that were get the aggregate filters
dist/filters/helpers/common/getFiltersByParams.js
getFiltersByParams(filterData, params)
Gets filters from the given params. The validation to filter the stored filter is depending on:
- Column
- Qrvey ID
- Scope type
- Scope ID
- Panel ID
- Validator type
- Property type
- Enabled flags
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data or the UI Filter Data | ||
params | given parameters to validate the dataset |
Returns
- a new Filter object structure
dist/filters/helpers/common/getFiltersByScopes.js
getFiltersByScopes(filterData, scopes)
Filters and gets a Filter Data by the given scopes
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The Filter Data | ||
scopes | collection of scopes types |
Returns
- The new Filter Data
dist/filters/helpers/common/getFiltersByScopesIds.js
getFiltersByScopesIds(filterData, scopes)
Gets filters from Filter Data by Scopes/Scope IDs.
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | The filter data | ||
scopes | The collection of Scopes/Scope IDs |
Returns
- a new Filter Data
dist/filters/helpers/common/getFiltersByVisibility.js
getFiltersByVisibility(filterData, scopes)
Get a new Filter Data by filtering scopes/scope IDs and enabled flags
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | a Filter Data or UI Filter Data | ||
scopes | a Scopes/Scope IDs array |
Returns
- a new Filter Data
dist/filters/helpers/common/haveFiltersByDataset.js
haveFiltersByDataset(filterData, qrveyid)
Validates if the filter data has filters by a dataset ID (Qrvey ID).
Parameters
Name | Type | Description | |
---|---|---|---|
filterData | the filter data or the UI filter data. | ||
qrveyid | The Qrvey ID |
Returns
- true: the filter data has filters by the Qrvey ID
dist/filters/helpers/common/isBetweenValidator.js
isBetweenValidator(validator)
Validates if the given validator is a Between type
Parameters
Name | Type | Description | |
---|---|---|---|
validator | The validator |
Returns
- true: it is a between validator; false: it is not a between validator
dist/filters/helpers/common/isInValidator.js
isInValidator(validator)
Validates if the given validator is a In type
Parameters
Name | Type | Description | |
---|---|---|---|
validator | The validator |
Returns
- true: it is a In validator; false: it is not a In validator
dist/filters/helpers/common/isNullValidator.js
isNullValidator(validator)
Checks if the given validator is a Null type.
Parameters
Name | Type | Description | |
---|---|---|---|
validator | The Filter Validator |
Returns
- True: It is a Null Validator; False: It is not a Null Validator.
dist/filters/helpers/common/isRangeValidator.js
isRangeValidator(validator)
Validates if the given validator is a Range type. Range type means the value has min and max values to filter
Parameters
Name | Type | Description | |
---|---|---|---|
validator | The filter validator |
Returns
- true: it is a range validator
dist/filters/helpers/common/isRegularValidator.js
isRegularValidator(validator)
Validates if the given validator is a regular type. Regular type means the filter object has a value as string to filter
Parameters
Name | Type | Description | |
---|---|---|---|
validator | The filter validator |
Returns
- true: it is a range validator
dist/filters/helpers/common/mergeFilters.js
mergeFilters(filterData1, filterData2, overwriteValues)
Merge filter data structures in a new one. The first Filter Data passed in the argument has the priority
Parameters
Name | Type | Description | |
---|---|---|---|
filterData1 | The target filter data | ||
filterData2 | the filter data to be merged | ||
overwriteValues | Flag to overwrite or not the filter values |
Returns
- a new filter data structure
mergeScopes(scopes1, scopes2, overwriteValues)
Gets a new scope structure array by merging two scope structures
Parameters
Name | Type | Description | |
---|---|---|---|
scopes1 | the target scope structure | ||
scopes2 | the scope to be merged | ||
overwriteValues | Flag to overwrite or not the filter values |
Returns
- a new scope structure array
mergeDatasets(datasets1, datasets2, overwriteValues)
Gets a new dataset structure array by merging two dataset structures
Parameters
Name | Type | Description | |
---|---|---|---|
datasets1 | the target dataset structure | ||
datasets2 | the dataset to be merged | ||
overwriteValues | Flag to overwrite or not the filter values |
Returns
- a new dataset structure array
mergeFilterss(filters1, filters2, overwriteValues)
Gets a new filter structure array by merging two filter structures
Parameters
Name | Type | Description | |
---|---|---|---|
filters1 | the target filter structure | ||
filters2 | the filter to be merged | ||
overwriteValues | Flag to overwrite or not the filter values |
Returns
- a new filter structure array
mergeValues(filter1, filter2, overwrite)
Gets a new value structure array by merging two value structures
Parameters
Name | Type | Description | |
---|---|---|---|
filter1 | the target filter structure | ||
filter2 | the filter to be used to merge the values | ||
overwrite | Flag to overwrite or not the filter values |
Returns
- a new value structure array
dist/filters/helpers/common/resolveDatasetConditions.js
resolveDatasetConditions(filter, params)
Resolves the conditions by given params
Parameters
Name | Type | Description | |
---|---|---|---|
filter | The dataset structure | ||
params | given parameters to validate the dataset |
Returns
- true: the condition is satisfied
dist/filters/helpers/common/resolveFilterConditions.js
resolveFilterConditions(filter, params)
Resolves the conditions by given params
Parameters
Name | Type | Description | |
---|---|---|---|
filter | The filter | ||
params | given parameters to validate the filter |
Returns
- true: the condition is satisfied
dist/filters/helpers/common/resolveScopeConditions.js
resolveScopeConditions(filter, params)
Resolves the conditions by given params
Parameters
Name | Type | Description | |
---|---|---|---|
filter | The filter scope structure | ||
params | given parameters to validate the filter |
Returns
- true: the condition is satisfied
dist/filters/helpers/ui/excludeUIFiltersByAggregate.js
excludeUIFiltersByAggregate(uFilters)
Excludes Aggregate Filters in the Flattened UI Filters array
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | Collection of Flat UI Filters |
Returns
- a new Flat UI Filters that were excluded the aggregate filters
dist/filters/helpers/ui/excludeUIFlatFiltersByScopes.js
excludeUIFlatFiltersByScopes(uFilters, scopes)
Excludes and returns a UI Flat Filters without filters by the given scopes
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | The Flatten UI Filters | ||
scopes | collection of scopes types |
Returns
- The new array of UI Flattened filters
dist/filters/helpers/ui/getOutputFormatByColumn.js
getOutputFormatByColumn(column, datasets)
Gets output format object from Datasets by the given column. Item of the datasets array must have outputformat item in order to be returned
Parameters
Name | Type | Description | |
---|---|---|---|
column | The column | ||
datasets | array of datasets |
Returns
- The output format object
dist/filters/helpers/ui/getUIFlatFilterByParams.js
getUIFlatFilterByParams()
Gets a filter from the given Flattened UI Filters by given params. Return a index of the array or an object The validation to filter the stored filter is depending on:
- Column
- Qrvey ID,
- Scope type
- Scope ID
- Panel ID
- Validator type
- Property type
Returns
- The index of the uFilter array or the Filter object s
dist/filters/helpers/ui/getUIFlatFiltersByParams.js
getUIFlatFiltersByParams()
Gets a filter from the given Flattened UI Filters by given params. Return a index of the array or an object The validation to filter the stored filter is depending on:
- Column
- Qrvey ID,
- Scope type
- Scope ID
- Panel ID
- Validator type
- Property type
- Enabled flags
Returns
- The index of the uFilter array or the Filter object s
dist/filters/helpers/ui/getUIFlatFiltersByScopes.js
getUIFlatFiltersByScopes(uFilters, scopes)
Filters and gets a UI Flatten Filters by the given scopes
Parameters
Name | Type | Description | |
---|---|---|---|
uFilters | The Flatten UI Filters | ||
scopes | collection of scopes types |
Returns
- The new array of UI Flattened filters
dist/filters/helpers/ui/resolveUIFlatFiltersByParams.js
resolveUIFlatFilterByParams(filter, params)
Resolves conditions between UI flattened filter and given parameters
Parameters
Name | Type | Description | |
---|---|---|---|
filter | UI Flatten Filter | ||
params | Parameters to validate |
Returns
- true: the conditions are satisfied.
Documentation generated with doxdox.
7 months ago
10 months ago
7 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
10 months ago
10 months ago
9 months ago
10 months ago
8 months ago
7 months ago
8 months ago
8 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
12 months ago
11 months ago
12 months ago
12 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago