1.11.1 • Published 6 months ago

@qrvey/utils v1.11.1

Weekly downloads
326
License
MIT
Repository
-
Last release
6 months ago

@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
NameTypeDescription
columnThe 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
NameTypeDescription
valueStringstring date value 
dateGroupLabelStringcould be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' 
withTimeBooleandetermines if the date range will include time. Default is true 
Examples
// 1) Year:
getDateRange('2020', 'YEAR');
// Will return:
{
   from: '01/01/2020 00:00:00',
   to: '12/31/2020 23:59:59'
}

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

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

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
NameTypeDescription
valuestring 
nowDate 
Returns
  • string

convertRelativeToAbsolute(args)

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

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

dist/date/relative/relative.js

resolveRelative(statements, clock)

Resolve a list of relative statements according to operator

Parameters
NameTypeDescription
statementsArray.<RelativeStatement> Array.<string>- Raw statements/values 
clockDate- 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.&lt;AbsoluteRange&gt; Array.&lt;string&gt;

dist/filters/adapters/FDToFlatUI.js

FDToFlatUI(filterData, datasetsInfo)

Generates a Flattened UI filter structure from Filter Data structure.

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

FD21ToFlatUI(scopes, datasetsInfo)

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

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

dist/filters/adapters/FDToLogic.js

FDToLogic(filterData)

Generates a Filter Logic structure from Filter Data structure.

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

getLogicBodyFromFD21(filterData)

Gets the logic body

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

dist/filters/adapters/FDToUI.js

FDToUI(filterData, datasetsInfo)

Generates a UI filter structure from Filter Data structure.

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

FD21ToUI(scopes, section, version, datasetsInfo)

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

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

dist/filters/adapters/UIToFD.js

UIToFD(filterData)

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

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

UI21ToFD(uFilterData, version)

Builds the Fitler Data structure from UI filter data

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

dist/filters/adapters/UIToFlatUI.js

UIToFlatUI(filterData)

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

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

dist/filters/adapters/flatUIToFD.js

flatUIToFD(uFilters, version)

Generates a filter data structure from the flatttened UI filters.

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

buildScopes(fbFilters)

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

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

buildScope(uFilter)

Gets an scope structure for the filter data

Parameters
NameTypeDescription
uFilterUI structure filter 
Returns
  • an scope structure

buildDataset(uFilter)

Gets an dataset structure for the filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an dataset structure

buildFilter(uFilter)

Gets an filter structure for the filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an filter structure

dist/filters/adapters/flatUIToLogic.js

flatUIToLogic(uFilter)

Generates a Logic structure from flattened UI filters

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

dist/filters/adapters/flatUIToOldLogic.js

flatUIToOldLogic(uFilters)

Generates a Logic structure from flattened UI filters

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

dist/filters/adapters/flatUIToUI.js

flatUIToUI(uFilters, version)

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

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

buildScopes(fbFilters)

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

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

buildScope(uFilter)

Gets an scope structure for the UI filter data

Parameters
NameTypeDescription
uFilterUI structure filter 
Returns
  • an scope structure

buildDataset(uFilter)

Gets an dataset structure for the UI filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an dataset structure

buildFilter(uFilter)

Gets an filter structure for the UI filter data

Parameters
NameTypeDescription
uFiltera UI structure filter 
Returns
  • an filter structure

dist/filters/adapters/logicToFD.js

logicToFD(filterData, version)

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

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

dist/filters/adapters/logicToFlatUI.js

logicToFlatUI(logics)

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

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

getFilter(filters, filter, getIndex)

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

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

refineRankingValues(values, uiValues)

Refines the values of the Ranking column type.

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

dist/filters/adapters/logicToUI.js

logicToUI(uFilters, datasetsInfo)

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

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

dist/filters/adapters/transformFilters.js

transformFilters(oldFiltersObj, section)

Transform the old filters structure into the new one

Parameters
NameTypeDescription
oldFiltersObjObjectan object with the old filters structure 
sectionStringcould 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
NameTypeDescription
labelstring 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
NameTypeDescription
chartSettingsChart Settings for the Filter Builder 
scopes 
currentScope 
Returns

dist/filters/helpers/getAvailableScopes.js

getAvailableScopes(config)

Gets Scopes/Scope IDs by given IDs

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

dist/filters/helpers/getAvailableScopesIDsByConfig.js

getAvailableScopesIDsByConfig(config)

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

Parameters
NameTypeDescription
configany config 
Returns
  • a Available Scope IDS config

dist/filters/helpers/getScopesByHierarchy.js

getScopesByHierarchy(scopes, currentScope)

TODO: Make a description for this

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

dist/general/array/delete.js

ArrayDelete(array, index)

Inmutable Array Item deletion

Parameters
NameTypeDescription
arrayArrayList to loo for item to delte 
indexNumberposition 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
NameTypeDescription
arrnested tree array 
childArrKeyproperty representing the children array on the nested tree 
conditionfunction callback that determines if the filter is applied on the last child node of the nested tree 
Returns
  • array filtered

dist/general/array/flattenDeep.js

flattenDeep(arr)

Flat deeply an array

Parameters
NameTypeDescription
arrArray to flat deeply 
Returns
  • flatten array

dist/general/function/debounce.js

debounce(fn, time)

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

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

dist/general/function/throttled.js

throttled(fn, time)

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

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

dist/general/mix/importScripts.js

importScripts(scripts)

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

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

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

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

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

loadScript(url, type, noModule)

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

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

dist/general/mix/isEmpty.js

isEmpty(obj)

return if an String, object or string is empty or not

Parameters
NameTypeDescription
objAny 
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
NameTypeDescription
argany 
Returns
  • Boolean

dist/general/mix/randomId.js

randomId(length)

create random unique string

Parameters
NameTypeDescription
lengthNumbersize 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
NameTypeDescription
objAny 
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
NameTypeDescription
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
NameTypeDescription
objobjectobject to look for 
keystringString attribute in snake_case style 
Examples
getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
Returns
  • Void

dist/general/object/hasProperty.js

_hasProperty(obj, property)

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

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

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

dist/general/object/mapValues.js

mapValues(baseObject, iteratee)

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

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

dist/general/object/omit.js

omit(obj, props)

return a nwe Object excluding attributes in props list

Parameters
NameTypeDescription
objObjectbase object 
propsArray.<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
NameTypeDescription
baseObjectObjectbase object 
keysArray.<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
NameTypeDescription
textString 
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
NameTypeDescription
cfg 
Returns
  • Void

dist/typescript/decorators/Debounce.js

Debounce(time)

(Method Decorator) Debounce Class Method

Parameters
NameTypeDescription
time(optional) deafult 500 
Returns
  • Void

dist/typescript/decorators/Throttled.js

Throttled(time)

(Method Decorator) Throttled Class Method

Parameters
NameTypeDescription
time(optional) deafult 500 
Returns
  • Void

dist/date/relative/helpers/formatStatement.js

formatStatement(statement)

Build a proper relative date statement type

Parameters
NameTypeDescription
statementRelativeStatement 
Returns
  • RelativeStatement

dist/date/relative/helpers/getStatementCase.js

getStatementCase(includeCurrent, isCalendarDate)

Returns a number/constant that identifies a relative date case

Parameters
NameTypeDescription
includeCurrentboolean 
isCalendarDateboolean 
Returns
  • number

dist/date/relative/helpers/parseDate.js

parseDate(date)

Parses a string date and returns a dayjs date

Parameters
NameTypeDescription
datestring Dayjs Date 
Returns
  • Dayjs A dayjs date

dist/filters/helpers/backend/buildUserFilters.js

buildUserFilters(userFilters)

Transform user Filters array into Filter Logic structure

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

dist/filters/helpers/backend/getAggFiltersBySummaryIndex.js

getAggFiltersBySummaryIndex(aggFilters, summaryIndex)

Parameters
NameTypeDescription
aggFilters 
summaryIndex 
Returns

dist/filters/helpers/backend/getBackendGroupValue.js

getBackendGroupValue(filter)

Gets a group value for the backend logic structure

Parameters
NameTypeDescription
filterThe filter 
Returns
  • a property

dist/filters/helpers/backend/getBackendProperty.js

getBackendProperty(filter)

Gets a property for the logic structure

Parameters
NameTypeDescription
filterThe filter 
Returns
  • a property

dist/filters/helpers/backend/getBackendValidator.js

getBackendValidator(validator)

Gets the Validator that is used in requests

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

dist/filters/helpers/backend/getBackendValues.js

getBackendValues(filter)

Gets the expresion values in the logic format

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

getResultValues(values, filter)

Gets the expression values. Depending on the column type

Parameters
NameTypeDescription
valuesa collection of filter values 
filterThe filter structure 
Returns

getRankingValues(values, rankingGroupIndex)

Gets the Ranking values.

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

dist/filters/helpers/backend/getLogicByScopes.js

getLogicByScopes(logics, scopes)

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

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

dist/filters/helpers/backend/getLogicByScopesHierarchy.js

getLogicByScopesHierarchy(filterData, scopes, currentScope)

Gets filters from the logic by the scopes hierarchy.

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

dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js

getFilterBuilderGeneralConfig(config)

Returns a filter builder config object by a any given config

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

dist/filters/helpers/common/areFiltersEquals.js

areFiltersEquals(filter1, filter2)

Validates if both filters are the same

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

dist/filters/helpers/common/excludeFiltersByAggregateColumn.js

excludeFiltersByAggregateColumn(filterData)

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

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

dist/filters/helpers/common/excludeFiltersByParams.js

excludeFiltersByParams(filterData, params)

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

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

dist/filters/helpers/common/excludeFiltersByScopes.js

excludeFiltersByScopes(filterData, scopes)

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

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

dist/filters/helpers/common/getFilterColumnLabel.js

getFilterColumnLabel(column)

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

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

dist/filters/helpers/common/getFilterLabel.js

getFilterLabel(filter)

Gets the Filter Label + Column label

Parameters
NameTypeDescription
filterthe UI filter 
Returns
  • a sring label

dist/filters/helpers/common/getFilterid.js

getFilterid(filter)

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

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

dist/filters/helpers/common/getFiltersByAggregateColumn.js

getFiltersByAggregateColumn(filterData)

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

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

dist/filters/helpers/common/getFiltersByParams.js

getFiltersByParams(filterData, params)

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

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

dist/filters/helpers/common/getFiltersByScopes.js

getFiltersByScopes(filterData, scopes)

Filters and gets a Filter Data by the given scopes

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

dist/filters/helpers/common/getFiltersByScopesIds.js

getFiltersByScopesIds(filterData, scopes)

Gets filters from Filter Data by Scopes/Scope IDs.

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

dist/filters/helpers/common/getFiltersByVisibility.js

getFiltersByVisibility(filterData, scopes)

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

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

dist/filters/helpers/common/haveFiltersByDataset.js

haveFiltersByDataset(filterData, qrveyid)

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

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

dist/filters/helpers/common/isBetweenValidator.js

isBetweenValidator(validator)

Validates if the given validator is a Between type

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

dist/filters/helpers/common/isInValidator.js

isInValidator(validator)

Validates if the given validator is a In type

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

dist/filters/helpers/common/isNullValidator.js

isNullValidator(validator)

Checks if the given validator is a Null type.

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

dist/filters/helpers/common/isRangeValidator.js

isRangeValidator(validator)

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

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

dist/filters/helpers/common/isRegularValidator.js

isRegularValidator(validator)

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

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

dist/filters/helpers/common/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
NameTypeDescription
filterData1The target filter data 
filterData2the filter data to be merged 
overwriteValuesFlag 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
NameTypeDescription
scopes1the target scope structure 
scopes2the scope to be merged 
overwriteValuesFlag 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
NameTypeDescription
datasets1the target dataset structure 
datasets2the dataset to be merged 
overwriteValuesFlag 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
NameTypeDescription
filters1the target filter structure 
filters2the filter to be merged 
overwriteValuesFlag 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
NameTypeDescription
filter1the target filter structure 
filter2the filter to be used to merge the values 
overwriteFlag 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
NameTypeDescription
filterThe dataset structure 
paramsgiven 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
NameTypeDescription
filterThe filter 
paramsgiven 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
NameTypeDescription
filterThe filter scope structure 
paramsgiven 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
NameTypeDescription
uFiltersCollection of Flat UI Filters 
Returns
  • a new Flat UI Filters that were excluded the aggregate filters

dist/filters/helpers/ui/excludeUIFlatFiltersByScopes.js

excludeUIFlatFiltersByScopes(uFilters, scopes)

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

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

dist/filters/helpers/ui/getOutputFormatByColumn.js

getOutputFormatByColumn(column, datasets)

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

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

dist/filters/helpers/ui/getUIFlatFilterByParams.js

getUIFlatFilterByParams()

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

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

dist/filters/helpers/ui/getUIFlatFiltersByParams.js

getUIFlatFiltersByParams()

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

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

dist/filters/helpers/ui/getUIFlatFiltersByScopes.js

getUIFlatFiltersByScopes(uFilters, scopes)

Filters and gets a UI Flatten Filters by the given scopes

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

dist/filters/helpers/ui/resolveUIFlatFiltersByParams.js

resolveUIFlatFilterByParams(filter, params)

Resolves conditions between UI flattened filter and given parameters

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

Documentation generated with doxdox.

1.11.2

7 months ago

1.11.1

10 months ago

1.11.0

10 months ago

1.12.0-1

9 months ago

1.12.0-2

9 months ago

1.12.0-3

9 months ago

1.12.0-4

9 months ago

1.12.0-0

9 months ago

1.12.0-9

8 months ago

1.12.0-5

9 months ago

1.12.0-6

8 months ago

1.12.0-7

8 months ago

1.12.0-8

8 months ago

1.11.0-12

10 months ago

1.11.0-13

10 months ago

1.12.0-0-chart-v2-0

10 months ago

1.12.0-12

8 months ago

1.12.0-13

7 months ago

1.12.0-10

8 months ago

1.12.0-11

8 months ago

1.12.0-18

6 months ago

1.12.0-19

6 months ago

1.12.0-16

7 months ago

1.12.0-17

6 months ago

1.12.0-14

7 months ago

1.12.0-15

7 months ago

1.11.0-11

11 months ago

1.11.0-10

11 months ago

1.11.0-1-imports-1

12 months ago

1.11.0-1-imports-0

12 months ago

1.11.0-4

12 months ago

1.11.0-5

11 months ago

1.11.0-2

12 months ago

1.11.0-3

12 months ago

1.11.0-8

11 months ago

1.11.0-9

11 months ago

1.11.0-6

11 months ago

1.11.0-7

11 months ago

1.10.1

1 year ago

1.10.0

1 year ago

1.11.0-0

1 year ago

1.11.0-1

1 year ago

1.10.0-12

1 year ago

1.10.0-13

1 year ago

1.10.0-14

1 year ago

1.10.0-15

1 year ago

1.10.0-16

1 year ago

1.10.0-10

1 year ago

1.10.0-11

1 year ago

1.10.0-9

1 year ago

1.10.0-0

1 year ago

1.10.0-1

1 year ago

1.10.0-2

1 year ago

1.10.0-3

1 year ago

1.10.0-4

1 year ago

1.10.0-5

1 year ago

1.10.0-6

1 year ago

1.10.0-7

1 year ago

1.10.0-8

1 year ago

1.9.0-5

1 year ago

1.9.0-6

1 year ago

1.9.0-3

1 year ago

1.9.0-4

1 year ago

1.9.0-7

1 year ago

1.9.0-8

1 year ago

1.9.0

1 year ago

1.6.0

2 years ago

1.9.0-1

1 year ago

1.9.0-2

1 year ago

1.9.0-0

1 year ago

1.4.9

2 years ago

1.8.0-4

1 year ago

1.8.0-5

1 year ago

1.8.0-6

1 year ago

1.8.0-7

1 year ago

1.8.0-0

2 years ago

1.8.0-1

2 years ago

1.8.0-2

2 years ago

1.8.0-3

1 year ago

1.8.0-8

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.1

2 years ago

1.7.0

2 years ago

1.7.0-4

2 years ago

1.7.0-3

2 years ago

1.7.0-2

2 years ago

1.7.0-1

2 years ago

1.7.0-5

2 years ago

1.6.0-3

2 years ago

1.6.0-2

2 years ago

1.6.0-5

2 years ago

1.6.0-4

2 years ago

1.6.0-7

2 years ago

1.6.0-6

2 years ago

1.5.0

2 years ago

1.6.0-1

2 years ago

1.6.0-0

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.5.0-fv-2

2 years ago

1.6.0-0-to-0

2 years ago

1.7.0-0

2 years ago

1.5.0-10

2 years ago

1.5.0-11

2 years ago

1.5.0-12

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.5.0-9

2 years ago

1.5.0-8

2 years ago

1.5.0-7

2 years ago

1.5.0-6

2 years ago

1.5.0-5

2 years ago

1.5.0-4

2 years ago

1.5.0-3

2 years ago

1.5.0-2

2 years ago

1.5.0-1

2 years ago

1.5.0-fv-1

2 years ago

1.5.0-0

2 years ago

1.5.0-fv-0

2 years ago

1.4.0-5

2 years ago

1.4.0-7

2 years ago

1.4.0-6

2 years ago

1.3.0-4

2 years ago

1.3.0-3

2 years ago

1.3.0-8

2 years ago

1.3.0-7

2 years ago

1.3.0-6

2 years ago

1.3.0-5

2 years ago

1.3.0-9

2 years ago

1.4.0-4

2 years ago

1.4.0-1

2 years ago

1.4.0-0

2 years ago

1.4.0-3

2 years ago

1.4.0-2

2 years ago

1.4.0-an15677-0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.3.0-20

2 years ago

1.3.0-21

2 years ago

1.3.0-11

2 years ago

1.3.0-10

2 years ago

1.3.0-13

2 years ago

1.3.0-12

2 years ago

1.3.0-15

2 years ago

1.3.0-14

2 years ago

1.3.0-17

2 years ago

1.3.0-16

2 years ago

1.3.0-19

2 years ago

1.3.0-18

2 years ago

1.3.0-0

2 years ago

1.3.0-2

2 years ago

1.3.0-1

2 years ago

1.2.10-9

2 years ago

1.2.10-7

2 years ago

1.2.10-8

2 years ago

1.2.10-6

2 years ago

1.2.9

2 years ago

1.2.9-38

2 years ago

1.2.9-39

2 years ago

1.2.9-36

2 years ago

1.2.9-37

2 years ago

1.2.9-34

2 years ago

1.2.9-35

2 years ago

1.2.10-3

2 years ago

1.2.10-4

2 years ago

1.2.10-1

2 years ago

1.2.10-2

2 years ago

1.2.10-0

2 years ago

1.2.10-5

2 years ago

1.2.9-29

2 years ago

1.2.9-30

2 years ago

1.2.9-31

2 years ago

1.2.9-32

2 years ago

1.2.9-33

2 years ago

1.2.9-16

2 years ago

1.2.9-17

2 years ago

1.2.9-14

2 years ago

1.2.9-15

2 years ago

1.2.9-18

2 years ago

1.2.9-19

2 years ago

1.2.9-13

2 years ago

1.2.9-27

2 years ago

1.2.9-28

2 years ago

1.2.9-25

2 years ago

1.2.9-26

2 years ago

1.2.9-20

2 years ago

1.2.9-23

2 years ago

1.2.9-24

2 years ago

1.2.9-21

2 years ago

1.2.9-22

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.9-12

2 years ago

1.2.9-10

2 years ago

1.2.9-11

2 years ago

1.2.4-13

2 years ago

1.2.4-14

2 years ago

1.2.4-15

2 years ago

1.2.4-16

2 years ago

1.2.4-10

2 years ago

1.2.4-11

2 years ago

1.2.4-12

2 years ago

1.2.4-17

2 years ago

1.2.4-18

2 years ago

1.2.4-19

2 years ago

1.2.9-6

2 years ago

1.2.9-5

2 years ago

1.2.9-8

2 years ago

1.2.9-7

2 years ago

1.2.9-9

2 years ago

1.2.9-0

2 years ago

1.2.9-2

2 years ago

1.2.9-1

2 years ago

1.2.9-4

2 years ago

1.2.9-3

2 years ago

1.2.4-24

2 years ago

1.2.4-25

2 years ago

1.2.4-26

2 years ago

1.2.4-20

2 years ago

1.2.4-21

2 years ago

1.2.4-22

2 years ago

1.2.4-23

2 years ago

1.2.4-3

2 years ago

1.2.4-5

2 years ago

1.2.4-4

2 years ago

1.2.4-7

2 years ago

1.2.4-6

2 years ago

1.2.4-9

2 years ago

1.2.4-8

2 years ago

1.2.4-1

3 years ago

1.2.4-0

3 years ago

1.2.4-2

3 years ago

1.2.0

3 years ago

1.2.0-1

3 years ago

1.2.0-0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.2-1

3 years ago

1.1.2-0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.0-35

3 years ago

1.1.0-34

3 years ago

1.1.0-33

3 years ago

1.1.0-32

3 years ago

1.1.0-31

3 years ago

1.1.0-30

3 years ago

1.1.0-29

3 years ago

1.1.0-28

3 years ago

1.1.0-27

3 years ago

1.1.0-26

3 years ago

1.1.0-25

3 years ago

1.1.0-24

3 years ago

1.1.0-23

3 years ago

1.1.0-22

3 years ago

1.1.0-19

3 years ago

1.1.0-21

3 years ago

1.1.0-20

3 years ago

1.1.0-18

3 years ago

1.1.0-17

3 years ago

1.1.0-15

3 years ago

1.1.0-14

3 years ago

1.1.0-16

3 years ago

1.1.0-13

3 years ago

1.1.0-12

3 years ago

1.1.0-9

3 years ago

1.1.0-11

3 years ago

1.1.0-10

3 years ago

1.1.0-8

3 years ago

1.1.0-7

3 years ago

1.1.0-6

3 years ago

1.1.0-5

3 years ago

1.1.0-4

3 years ago

1.1.0-3

3 years ago

1.1.0-2

3 years ago

1.1.0-1

3 years ago

1.1.0-0

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

4 years ago