@qrvey/utils 1.5.0-0 → 1.5.0-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/charts/adapters/endpointData.d.ts +90 -0
- package/dist/charts/adapters/endpointData.js +513 -0
- package/dist/charts/adapters/endpointDataGet.d.ts +14 -0
- package/dist/charts/adapters/endpointDataGet.js +427 -0
- package/dist/charts/adapters/endpointDataValidators.d.ts +4 -0
- package/dist/charts/adapters/endpointDataValidators.js +54 -0
- package/dist/charts/adapters/index.d.ts +3 -0
- package/dist/charts/adapters/index.js +3 -0
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/index.js +1 -0
- package/dist/cjs/charts/adapters/endpointData.d.ts +90 -0
- package/dist/cjs/charts/adapters/endpointData.js +519 -0
- package/dist/cjs/charts/adapters/endpointDataGet.d.ts +14 -0
- package/dist/cjs/charts/adapters/endpointDataGet.js +443 -0
- package/dist/cjs/charts/adapters/endpointDataValidators.d.ts +4 -0
- package/dist/cjs/charts/adapters/endpointDataValidators.js +61 -0
- package/dist/cjs/charts/adapters/index.d.ts +3 -0
- package/dist/cjs/{dates/range → charts/adapters}/index.js +3 -1
- package/dist/cjs/charts/index.d.ts +1 -0
- package/dist/cjs/charts/index.js +1 -0
- package/dist/cjs/column_format/constants/DURATION_PARTS_LIST.d.ts +1 -0
- package/dist/cjs/column_format/constants/DURATION_PARTS_LIST.js +12 -0
- package/dist/cjs/column_format/constants/index.d.ts +1 -0
- package/dist/cjs/column_format/constants/index.js +1 -0
- package/dist/cjs/column_format/helpers/defineTableChartFormat.js +19 -10
- package/dist/cjs/column_format/helpers/defineXYChartFormat.js +11 -13
- package/dist/cjs/columns/constants/COLUMN.js +1 -1
- package/dist/cjs/columns/constants/COLUMN_PROPERTY.js +2 -2
- package/dist/cjs/columns/helpers/getDatasetColumn.d.ts +9 -1
- package/dist/cjs/columns/helpers/getDatasetColumn.js +31 -4
- package/dist/cjs/columns/helpers/getDatasetColumnByDatasets.d.ts +6 -5
- package/dist/cjs/columns/helpers/getDatasetColumnByDatasets.js +22 -8
- package/dist/cjs/columns/helpers/getModelColumn.d.ts +4 -4
- package/dist/cjs/columns/helpers/getModelColumn.js +9 -19
- package/dist/cjs/columns/helpers/isComplexColumn.d.ts +5 -0
- package/dist/cjs/columns/helpers/isComplexColumn.js +5 -0
- package/dist/cjs/columns/helpers/isDateColumn.d.ts +5 -0
- package/dist/cjs/columns/helpers/isDateColumn.js +8 -1
- package/dist/cjs/columns/helpers/isNumericalColumn.d.ts +5 -0
- package/dist/cjs/columns/helpers/isNumericalColumn.js +7 -1
- package/dist/cjs/constants/Charts.Const.d.ts +1 -0
- package/dist/cjs/constants/Charts.Const.js +1 -0
- package/dist/cjs/dates/adapters/dateToHms.d.ts +1 -1
- package/dist/cjs/dates/adapters/dateToHms.js +6 -8
- package/dist/cjs/dates/adapters/dateToMdyDate.js +6 -9
- package/dist/cjs/dates/adapters/dateToMonthYear.js +6 -4
- package/dist/cjs/dates/adapters/dateToQuarterYear.d.ts +2 -2
- package/dist/cjs/dates/adapters/dateToQuarterYear.js +8 -6
- package/dist/cjs/dates/adapters/dateToWeekYear.js +5 -3
- package/dist/cjs/dates/adapters/dateToYear.d.ts +1 -1
- package/dist/cjs/dates/adapters/dateToYear.js +6 -4
- package/dist/cjs/dates/adapters/weekYearToDate.js +1 -6
- package/dist/cjs/dates/constants/DATETIME_COLUMN_FORMAT.js +1 -0
- package/dist/cjs/dates/constants/DATE_DISTINCT_PROPERTY.js +1 -1
- package/dist/cjs/dates/constants/DATE_FORMAT.js +7 -7
- package/dist/cjs/dates/constants/DATE_FORMATS.d.ts +1 -0
- package/dist/cjs/dates/constants/DATE_FORMATS.js +22 -0
- package/dist/cjs/dates/constants/DATE_GROUPING_ALL_PROPERTIES.d.ts +1 -0
- package/dist/cjs/dates/constants/DATE_GROUPING_ALL_PROPERTIES.js +9 -0
- package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSIONS.d.ts +1 -0
- package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSIONS.js +23 -0
- package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.d.ts +3 -0
- package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.js +40 -0
- package/dist/cjs/dates/constants/index.d.ts +4 -0
- package/dist/cjs/dates/constants/index.js +4 -0
- package/dist/cjs/dates/helpers/{includeDateTokens.d.ts → areIncludedDateTokens.d.ts} +1 -1
- package/dist/cjs/dates/helpers/{includeDateTokens.js → areIncludedDateTokens.js} +5 -4
- package/dist/cjs/dates/helpers/getDateFormatRegularExpressionInArray.d.ts +2 -2
- package/dist/cjs/dates/helpers/getDateFormatRegularExpressionInArray.js +9 -42
- package/dist/{dates/range → cjs/dates/helpers}/getDateRange.d.ts +3 -3
- package/dist/cjs/dates/{range → helpers}/getDateRange.js +73 -69
- package/dist/cjs/dates/helpers/getFormattedDateByFormat.d.ts +1 -0
- package/dist/cjs/dates/helpers/getFormattedDateByFormat.js +17 -17
- package/dist/cjs/dates/helpers/getSeparatorByDateFormat.d.ts +1 -1
- package/dist/cjs/dates/helpers/getSeparatorByDateFormat.js +1 -1
- package/dist/cjs/dates/helpers/getWeek.d.ts +6 -4
- package/dist/cjs/dates/helpers/getWeek.js +6 -3
- package/dist/cjs/dates/helpers/index.d.ts +4 -1
- package/dist/cjs/dates/helpers/index.js +4 -1
- package/dist/cjs/dates/helpers/isValidPotentialDate.d.ts +6 -0
- package/dist/cjs/dates/helpers/isValidPotentialDate.js +18 -0
- package/dist/cjs/dates/index.d.ts +0 -1
- package/dist/cjs/dates/index.js +0 -1
- package/dist/cjs/dates/relative/constants/RELATIVE_UNIT_INFO_LIST.js +5 -5
- package/dist/cjs/filters/adapters/FDToFlatUI.js +4 -4
- package/dist/cjs/filters/adapters/FDToUI.js +3 -3
- package/dist/cjs/filters/adapters/UIToFD.js +3 -3
- package/dist/cjs/filters/adapters/UIToFlatUI.js +3 -3
- package/dist/cjs/filters/adapters/UIToOldLogic.js +6 -6
- package/dist/cjs/filters/adapters/adaptFilterData.js +7 -7
- package/dist/cjs/filters/adapters/flatUIToFD.js +24 -24
- package/dist/cjs/filters/adapters/flatUIToOldLogic.js +42 -49
- package/dist/cjs/filters/adapters/flatUIToUI.js +29 -29
- package/dist/cjs/filters/adapters/index.d.ts +0 -1
- package/dist/cjs/filters/adapters/index.js +0 -1
- package/dist/cjs/filters/adapters/logicToFlatUI.js +6 -8
- package/dist/cjs/filters/helpers/OLD_getAggFilters.js +5 -4
- package/dist/cjs/filters/helpers/backend/buildExpression.js +1 -1
- package/dist/cjs/filters/helpers/backend/buildFilters.js +6 -16
- package/dist/cjs/filters/helpers/backend/getBackendValidator.js +1 -1
- package/dist/cjs/filters/helpers/backend/getBackendValues.js +1 -3
- package/dist/cjs/filters/helpers/backend/getLogicByDatasets.js +2 -2
- package/dist/cjs/filters/helpers/backend/getLogicByDatasetsColumns.js +2 -2
- package/dist/cjs/filters/helpers/backend/getLogicByScopes.js +2 -2
- package/dist/cjs/filters/helpers/backend/getLogicByScopesHierarchy.js +0 -2
- package/dist/cjs/filters/helpers/common/excludeFiltersByAggregateColumn.js +3 -3
- package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +10 -11
- package/dist/cjs/filters/helpers/common/excludeFiltersByScopes.js +3 -3
- package/dist/cjs/filters/helpers/common/getFilterLabel.js +1 -1
- package/dist/cjs/filters/helpers/common/getFiltersByAggregateColumn.js +3 -3
- package/dist/cjs/filters/helpers/common/getFiltersByParams.js +15 -17
- package/dist/cjs/filters/helpers/common/getFiltersByScopes.js +3 -3
- package/dist/cjs/filters/helpers/common/getFiltersByScopesIds.js +4 -4
- package/dist/cjs/filters/helpers/common/getFiltersByVisibility.js +4 -4
- package/dist/cjs/filters/helpers/common/mergeFilters.js +23 -19
- package/dist/cjs/filters/helpers/common/mergeValues.js +2 -2
- package/dist/cjs/filters/helpers/common/resolveScopeConditions.js +1 -1
- package/dist/cjs/filters/helpers/getAggFiltersFromFilterData.js +2 -2
- package/dist/cjs/filters/helpers/getTokensFromFilters.js +9 -4
- package/dist/cjs/filters/helpers/ui/excludeUIFiltersByAggregate.js +2 -2
- package/dist/cjs/filters/helpers/ui/excludeUIFlatFiltersByScopes.js +2 -2
- package/dist/cjs/filters/helpers/ui/getUIFlatFilterByParams.js +3 -3
- package/dist/cjs/filters/helpers/ui/getUIFlatFiltersByParams.js +2 -2
- package/dist/cjs/filters/helpers/ui/getUIFlatFiltersByScopes.js +2 -2
- package/dist/cjs/filters/helpers/ui/getUIValues.js +9 -11
- package/dist/cjs/filters/helpers/ui/transformFilterValues.js +1 -3
- package/dist/cjs/filters/services/Filters.api.d.ts +4 -4
- package/dist/cjs/filters/services/Filters.api.js +7 -7
- package/dist/cjs/filters/services/UChartApi.d.ts +11 -11
- package/dist/cjs/filters/services/UChartApi.js +176 -185
- package/dist/cjs/filters/services/UChartPaginationApi.d.ts +13 -13
- package/dist/cjs/filters/services/UChartPaginationApi.js +198 -212
- package/dist/cjs/format/definition.d.ts +4 -1
- package/dist/cjs/format/definition.js +10 -1
- package/dist/cjs/format/duration/addDurationFormat.d.ts +1 -1
- package/dist/cjs/format/duration/addDurationFormat.js +2 -2
- package/dist/cjs/format/duration/durationFormatter.d.ts +1 -1
- package/dist/cjs/format/duration/durationFormatter.js +7 -10
- package/dist/cjs/format/format.js +42 -34
- package/dist/cjs/format/localization.js +19 -4
- package/dist/cjs/general/mix/importScripts.js +8 -14
- package/dist/cjs/general/mix/randomId.js +11 -10
- package/dist/cjs/general/object/get.js +4 -4
- package/dist/cjs/general/object/getAttribute.js +1 -1
- package/dist/cjs/general/object/mapValues.js +2 -2
- package/dist/cjs/general/object/mergeDeep.js +6 -4
- package/dist/cjs/general/object/serialize.js +3 -3
- package/dist/cjs/general/string/padLeadingZeros.js +2 -2
- package/dist/cjs/globalization/helpers/getI18nDateGroupLabel.js +13 -10
- package/dist/cjs/globalization/helpers/getReverseI18nGroupLabel.js +12 -9
- package/dist/cjs/globalization/interfaces/II18nResource.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilder.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +9 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.d.ts +10 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.js +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFormatValues.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/chart_builder/index.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/chart_builder/index.js +1 -0
- package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +4 -0
- package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanelMenu.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.d.ts +4 -0
- package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.js +2 -0
- package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +10 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +13 -4
- package/dist/cjs/globalization/labels/common/I18N_COMMON.js +6 -0
- package/dist/cjs/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.d.ts +2 -0
- package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +7 -0
- package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +1 -0
- package/dist/cjs/qrvey/helpers/getLookupAnswers.js +4 -6
- package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +1 -1
- package/dist/cjs/services/adapters/index.d.ts +2 -1
- package/dist/cjs/services/adapters/index.js +2 -1
- package/dist/cjs/services/api/getAllDatasets.api.js +6 -8
- package/dist/cjs/services/helpers/Request.js +5 -4
- package/dist/column_format/constants/DURATION_PARTS_LIST.d.ts +1 -0
- package/dist/column_format/constants/DURATION_PARTS_LIST.js +9 -0
- package/dist/column_format/constants/index.d.ts +1 -0
- package/dist/column_format/constants/index.js +1 -0
- package/dist/column_format/helpers/defineTableChartFormat.js +19 -10
- package/dist/column_format/helpers/defineXYChartFormat.js +11 -13
- package/dist/columns/constants/COLUMN.js +1 -1
- package/dist/columns/constants/COLUMN_PROPERTY.js +2 -2
- package/dist/columns/helpers/getDatasetColumn.d.ts +9 -1
- package/dist/columns/helpers/getDatasetColumn.js +31 -4
- package/dist/columns/helpers/getDatasetColumnByDatasets.d.ts +6 -5
- package/dist/columns/helpers/getDatasetColumnByDatasets.js +22 -8
- package/dist/columns/helpers/getModelColumn.d.ts +4 -4
- package/dist/columns/helpers/getModelColumn.js +9 -19
- package/dist/columns/helpers/isComplexColumn.d.ts +5 -0
- package/dist/columns/helpers/isComplexColumn.js +5 -0
- package/dist/columns/helpers/isDateColumn.d.ts +5 -0
- package/dist/columns/helpers/isDateColumn.js +8 -1
- package/dist/columns/helpers/isNumericalColumn.d.ts +5 -0
- package/dist/columns/helpers/isNumericalColumn.js +7 -1
- package/dist/constants/Charts.Const.d.ts +1 -0
- package/dist/constants/Charts.Const.js +1 -0
- package/dist/dates/adapters/dateToHms.d.ts +1 -1
- package/dist/dates/adapters/dateToHms.js +6 -8
- package/dist/dates/adapters/dateToMdyDate.js +6 -9
- package/dist/dates/adapters/dateToMonthYear.js +6 -4
- package/dist/dates/adapters/dateToQuarterYear.d.ts +2 -2
- package/dist/dates/adapters/dateToQuarterYear.js +8 -6
- package/dist/dates/adapters/dateToWeekYear.js +5 -3
- package/dist/dates/adapters/dateToYear.d.ts +1 -1
- package/dist/dates/adapters/dateToYear.js +6 -4
- package/dist/dates/adapters/weekYearToDate.js +1 -6
- package/dist/dates/constants/DATETIME_COLUMN_FORMAT.js +1 -0
- package/dist/dates/constants/DATE_DISTINCT_PROPERTY.js +1 -1
- package/dist/dates/constants/DATE_FORMAT.js +7 -7
- package/dist/dates/constants/DATE_FORMATS.d.ts +1 -0
- package/dist/dates/constants/DATE_FORMATS.js +19 -0
- package/dist/dates/constants/DATE_GROUPING_ALL_PROPERTIES.d.ts +1 -0
- package/dist/dates/constants/DATE_GROUPING_ALL_PROPERTIES.js +6 -0
- package/dist/dates/constants/DATE_REGULAR_EXPRESSIONS.d.ts +1 -0
- package/dist/dates/constants/DATE_REGULAR_EXPRESSIONS.js +20 -0
- package/dist/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.d.ts +3 -0
- package/dist/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.js +37 -0
- package/dist/dates/constants/index.d.ts +4 -0
- package/dist/dates/constants/index.js +4 -0
- package/dist/dates/helpers/{includeDateTokens.d.ts → areIncludedDateTokens.d.ts} +1 -1
- package/dist/dates/helpers/{includeDateTokens.js → areIncludedDateTokens.js} +3 -2
- package/dist/dates/helpers/getDateFormatRegularExpressionInArray.d.ts +2 -2
- package/dist/dates/helpers/getDateFormatRegularExpressionInArray.js +9 -42
- package/dist/{cjs/dates/range → dates/helpers}/getDateRange.d.ts +3 -3
- package/dist/dates/{range → helpers}/getDateRange.js +73 -69
- package/dist/dates/helpers/getFormattedDateByFormat.d.ts +1 -0
- package/dist/dates/helpers/getFormattedDateByFormat.js +17 -17
- package/dist/dates/helpers/getSeparatorByDateFormat.d.ts +1 -1
- package/dist/dates/helpers/getSeparatorByDateFormat.js +1 -1
- package/dist/dates/helpers/getWeek.d.ts +6 -4
- package/dist/dates/helpers/getWeek.js +6 -3
- package/dist/dates/helpers/index.d.ts +4 -1
- package/dist/dates/helpers/index.js +4 -1
- package/dist/dates/helpers/isValidPotentialDate.d.ts +6 -0
- package/dist/dates/helpers/isValidPotentialDate.js +14 -0
- package/dist/dates/index.d.ts +0 -1
- package/dist/dates/index.js +0 -1
- package/dist/dates/relative/constants/RELATIVE_UNIT_INFO_LIST.js +5 -5
- package/dist/filters/adapters/FDToFlatUI.js +4 -4
- package/dist/filters/adapters/FDToUI.js +3 -3
- package/dist/filters/adapters/UIToFD.js +3 -3
- package/dist/filters/adapters/UIToFlatUI.js +3 -3
- package/dist/filters/adapters/UIToOldLogic.js +6 -6
- package/dist/filters/adapters/adaptFilterData.js +7 -7
- package/dist/filters/adapters/flatUIToFD.js +24 -24
- package/dist/filters/adapters/flatUIToOldLogic.js +42 -49
- package/dist/filters/adapters/flatUIToUI.js +29 -29
- package/dist/filters/adapters/index.d.ts +0 -1
- package/dist/filters/adapters/index.js +0 -1
- package/dist/filters/adapters/logicToFlatUI.js +6 -8
- package/dist/filters/helpers/OLD_getAggFilters.js +5 -4
- package/dist/filters/helpers/backend/buildExpression.js +1 -1
- package/dist/filters/helpers/backend/buildFilters.js +6 -16
- package/dist/filters/helpers/backend/getBackendValidator.js +1 -1
- package/dist/filters/helpers/backend/getBackendValues.js +1 -3
- package/dist/filters/helpers/backend/getLogicByDatasets.js +2 -2
- package/dist/filters/helpers/backend/getLogicByDatasetsColumns.js +2 -2
- package/dist/filters/helpers/backend/getLogicByScopes.js +2 -2
- package/dist/filters/helpers/backend/getLogicByScopesHierarchy.js +0 -2
- package/dist/filters/helpers/common/excludeFiltersByAggregateColumn.js +3 -3
- package/dist/filters/helpers/common/excludeFiltersByParams.js +10 -11
- package/dist/filters/helpers/common/excludeFiltersByScopes.js +3 -3
- package/dist/filters/helpers/common/getFilterLabel.js +1 -1
- package/dist/filters/helpers/common/getFiltersByAggregateColumn.js +3 -3
- package/dist/filters/helpers/common/getFiltersByParams.js +15 -17
- package/dist/filters/helpers/common/getFiltersByScopes.js +3 -3
- package/dist/filters/helpers/common/getFiltersByScopesIds.js +4 -4
- package/dist/filters/helpers/common/getFiltersByVisibility.js +4 -4
- package/dist/filters/helpers/common/mergeFilters.js +23 -19
- package/dist/filters/helpers/common/mergeValues.js +2 -2
- package/dist/filters/helpers/common/resolveScopeConditions.js +1 -1
- package/dist/filters/helpers/getAggFiltersFromFilterData.js +2 -2
- package/dist/filters/helpers/getTokensFromFilters.js +9 -4
- package/dist/filters/helpers/ui/excludeUIFiltersByAggregate.js +2 -2
- package/dist/filters/helpers/ui/excludeUIFlatFiltersByScopes.js +2 -2
- package/dist/filters/helpers/ui/getUIFlatFilterByParams.js +3 -3
- package/dist/filters/helpers/ui/getUIFlatFiltersByParams.js +2 -2
- package/dist/filters/helpers/ui/getUIFlatFiltersByScopes.js +2 -2
- package/dist/filters/helpers/ui/getUIValues.js +9 -11
- package/dist/filters/helpers/ui/transformFilterValues.js +1 -3
- package/dist/filters/services/Filters.api.d.ts +4 -4
- package/dist/filters/services/Filters.api.js +7 -7
- package/dist/filters/services/UChartApi.d.ts +11 -11
- package/dist/filters/services/UChartApi.js +176 -185
- package/dist/filters/services/UChartPaginationApi.d.ts +13 -13
- package/dist/filters/services/UChartPaginationApi.js +198 -212
- package/dist/format/definition.d.ts +4 -1
- package/dist/format/definition.js +9 -0
- package/dist/format/duration/addDurationFormat.d.ts +1 -1
- package/dist/format/duration/addDurationFormat.js +2 -2
- package/dist/format/duration/durationFormatter.d.ts +1 -1
- package/dist/format/duration/durationFormatter.js +7 -10
- package/dist/format/format.js +42 -34
- package/dist/format/localization.js +19 -4
- package/dist/general/mix/importScripts.js +8 -14
- package/dist/general/mix/randomId.js +11 -10
- package/dist/general/object/get.js +4 -4
- package/dist/general/object/getAttribute.js +1 -1
- package/dist/general/object/mapValues.js +2 -2
- package/dist/general/object/mergeDeep.js +6 -4
- package/dist/general/object/serialize.js +3 -3
- package/dist/general/string/padLeadingZeros.js +2 -2
- package/dist/globalization/helpers/getI18nDateGroupLabel.js +13 -10
- package/dist/globalization/helpers/getReverseI18nGroupLabel.js +12 -9
- package/dist/globalization/interfaces/II18nResource.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilder.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +9 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.d.ts +10 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.js +1 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFormatValues.d.ts +1 -0
- package/dist/globalization/interfaces/chart_builder/index.d.ts +1 -0
- package/dist/globalization/interfaces/chart_builder/index.js +1 -0
- package/dist/globalization/interfaces/common/II18nCommon.d.ts +4 -0
- package/dist/globalization/interfaces/filters/II18nTokenBox.d.ts +1 -0
- package/dist/globalization/interfaces/panel/II18nPanelMenu.d.ts +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
- package/dist/globalization/interfaces/tabular_view/II18nTabularView.d.ts +4 -0
- package/dist/globalization/interfaces/tabular_view/II18nTabularView.js +1 -0
- package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +10 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +13 -4
- package/dist/globalization/labels/common/I18N_COMMON.js +6 -0
- package/dist/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.d.ts +2 -0
- package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +4 -0
- package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +1 -0
- package/dist/qrvey/helpers/getLookupAnswers.js +4 -6
- package/dist/qrvey/helpers/getValueWithSuffixes.js +1 -1
- package/dist/services/adapters/index.d.ts +2 -1
- package/dist/services/adapters/index.js +2 -1
- package/dist/services/api/getAllDatasets.api.js +6 -8
- package/dist/services/helpers/Request.js +5 -4
- package/package.json +5 -5
- package/dist/cjs/dates/range/index.d.ts +0 -1
- package/dist/cjs/filters/adapters/transformFilters.d.ts +0 -60
- package/dist/cjs/filters/adapters/transformFilters.js +0 -427
- package/dist/dates/range/index.d.ts +0 -1
- package/dist/dates/range/index.js +0 -1
- package/dist/filters/adapters/transformFilters.d.ts +0 -60
- package/dist/filters/adapters/transformFilters.js +0 -423
|
@@ -20,13 +20,13 @@ export default class UChartApi {
|
|
|
20
20
|
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
21
21
|
* @returns the request body structure
|
|
22
22
|
*/
|
|
23
|
-
private _getPreviewRequestBody;
|
|
23
|
+
private static _getPreviewRequestBody;
|
|
24
24
|
/**
|
|
25
25
|
* Gets the filter object structure for the searching text
|
|
26
26
|
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
27
27
|
* @returns the filter object structure
|
|
28
28
|
*/
|
|
29
|
-
private _getSearchLogic;
|
|
29
|
+
private static _getSearchLogic;
|
|
30
30
|
/**
|
|
31
31
|
* Gets the filters from the chart settings
|
|
32
32
|
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
@@ -34,54 +34,54 @@ export default class UChartApi {
|
|
|
34
34
|
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
35
35
|
* @returns the filters from the chart settings
|
|
36
36
|
*/
|
|
37
|
-
private _getFilterCharts;
|
|
37
|
+
private static _getFilterCharts;
|
|
38
38
|
/**
|
|
39
39
|
* Gets chart body structure
|
|
40
40
|
* @param uFilter The filter Builder filter
|
|
41
41
|
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
42
42
|
* @returns the chart body structure
|
|
43
43
|
*/
|
|
44
|
-
private _getChartBody;
|
|
44
|
+
private static _getChartBody;
|
|
45
45
|
/**
|
|
46
46
|
* Gets dimension body structure
|
|
47
47
|
* @param uFilter The filter Builder filter
|
|
48
48
|
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
49
49
|
* @returns the dimension body structure
|
|
50
50
|
*/
|
|
51
|
-
private _getDimensionsBody;
|
|
51
|
+
private static _getDimensionsBody;
|
|
52
52
|
/**
|
|
53
53
|
* Gets max data point number
|
|
54
54
|
* @param column The column to filter
|
|
55
55
|
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
56
56
|
* @returns max data point number
|
|
57
57
|
*/
|
|
58
|
-
private _getMaxDataPoints;
|
|
58
|
+
private static _getMaxDataPoints;
|
|
59
59
|
/**
|
|
60
60
|
* Gets sort option structure
|
|
61
61
|
* @param column The column to filter
|
|
62
62
|
* @returns sort option structure
|
|
63
63
|
*/
|
|
64
|
-
private _getSortOption;
|
|
64
|
+
private static _getSortOption;
|
|
65
65
|
/**
|
|
66
66
|
* Gets summaries body structure
|
|
67
67
|
* @param uFilter The filter Builder filter
|
|
68
68
|
* @returns summaries body structure
|
|
69
69
|
*/
|
|
70
|
-
private _getSummariesBody;
|
|
70
|
+
private static _getSummariesBody;
|
|
71
71
|
/**
|
|
72
72
|
* Refines the body structure
|
|
73
73
|
* @param bodies The body structure
|
|
74
74
|
* @param uFilter The filter Builder filter
|
|
75
75
|
* @returns the body structure
|
|
76
76
|
*/
|
|
77
|
-
private _refineBodies;
|
|
77
|
+
private static _refineBodies;
|
|
78
78
|
/**
|
|
79
79
|
* Gets the validation type for the preview request
|
|
80
80
|
* @param column The column to filter
|
|
81
81
|
* @param vaildator Validator Type
|
|
82
82
|
* @returns the validator type for the preview request
|
|
83
83
|
*/
|
|
84
|
-
private _getValidationType;
|
|
84
|
+
private static _getValidationType;
|
|
85
85
|
/**
|
|
86
86
|
* Gets the Data from preview Response
|
|
87
87
|
* @param response The preview presponse
|
|
@@ -96,5 +96,5 @@ export default class UChartApi {
|
|
|
96
96
|
* @returns the sumaries
|
|
97
97
|
*/
|
|
98
98
|
private _getResponseSummaries;
|
|
99
|
-
private isResultEmpty;
|
|
99
|
+
private static isResultEmpty;
|
|
100
100
|
}
|
|
@@ -27,179 +27,14 @@ class UChartApi {
|
|
|
27
27
|
* @returns a promise with a resulting data
|
|
28
28
|
*/
|
|
29
29
|
this.getChartResult = (config, uFilter, filterLogic = [], chartSettings, _resetApi = false) => {
|
|
30
|
-
const requestBody =
|
|
30
|
+
const requestBody = UChartApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings);
|
|
31
31
|
const customChartApi = new Charts_api_1.default(Object.assign(Object.assign({}, config), { qrvey_id: (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
32
32
|
? uFilter.column.qrveyid
|
|
33
33
|
: chartSettings === null || chartSettings === void 0 ? void 0 : chartSettings.qrveyid }));
|
|
34
34
|
return customChartApi
|
|
35
35
|
.getResults(requestBody, false, true)
|
|
36
|
-
.then((response) =>
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
.catch((_) => {
|
|
40
|
-
return { data: [] };
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Gets request body structure
|
|
45
|
-
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
46
|
-
* @param {IFBLogic[]} filterLogic Additional filter logic to apply in the preview
|
|
47
|
-
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
48
|
-
* @returns the request body structure
|
|
49
|
-
*/
|
|
50
|
-
this._getPreviewRequestBody = (uFilter, filterLogic = [], chartSettings) => {
|
|
51
|
-
const searchLogic = this._getSearchLogic(uFilter);
|
|
52
|
-
const filterCharts = this._getFilterCharts(uFilter, searchLogic, chartSettings);
|
|
53
|
-
const chartsBody = !filterCharts[0]
|
|
54
|
-
? [this._getChartBody(uFilter)]
|
|
55
|
-
: [filterCharts[0]];
|
|
56
|
-
const filters = [
|
|
57
|
-
...filterLogic,
|
|
58
|
-
...(!filterCharts[0] ? (searchLogic === null || searchLogic === void 0 ? void 0 : searchLogic.logic) || [] : []),
|
|
59
|
-
];
|
|
60
|
-
return {
|
|
61
|
-
charts: chartsBody,
|
|
62
|
-
logic: filters,
|
|
63
|
-
qrveyid: uFilter.column.qrveyid,
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Gets chart body structure
|
|
68
|
-
* @param uFilter The filter Builder filter
|
|
69
|
-
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
70
|
-
* @returns the chart body structure
|
|
71
|
-
*/
|
|
72
|
-
this._getChartBody = (uFilter, chartSettings) => {
|
|
73
|
-
const dimensions = this._getDimensionsBody(uFilter, chartSettings);
|
|
74
|
-
const summaries = this._getSummariesBody(uFilter);
|
|
75
|
-
return { dimensions, summaries };
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Gets dimension body structure
|
|
79
|
-
* @param uFilter The filter Builder filter
|
|
80
|
-
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
81
|
-
* @returns the dimension body structure
|
|
82
|
-
*/
|
|
83
|
-
this._getDimensionsBody = (uFilter, chartSettings) => {
|
|
84
|
-
const { column, validator } = uFilter;
|
|
85
|
-
let dimensions;
|
|
86
|
-
if (!(0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
87
|
-
dimensions = [
|
|
88
|
-
{
|
|
89
|
-
questionid: column.id,
|
|
90
|
-
qrveyid: column.qrveyid,
|
|
91
|
-
maxDataPoints: this._getMaxDataPoints(column, chartSettings),
|
|
92
|
-
type: column.type,
|
|
93
|
-
formulaType: column.type === "FORMULA" ? column.formulaType : undefined,
|
|
94
|
-
sortOption: this._getSortOption(column),
|
|
95
|
-
},
|
|
96
|
-
];
|
|
97
|
-
dimensions = this._refineBodies([...dimensions], uFilter);
|
|
98
|
-
}
|
|
99
|
-
return dimensions;
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Gets max data point number
|
|
103
|
-
* @param column The column to filter
|
|
104
|
-
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
105
|
-
* @returns max data point number
|
|
106
|
-
*/
|
|
107
|
-
this._getMaxDataPoints = (column, chartSettings) => {
|
|
108
|
-
return !(0, isDateColumn_1.isDateColumn)(column) && !(0, isEmpty_1.isEmpty)(column.aggregate)
|
|
109
|
-
? (0, get_1._get)(chartSettings, "maxDataPoints.option", 1000)
|
|
110
|
-
: 1000;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Gets sort option structure
|
|
114
|
-
* @param column The column to filter
|
|
115
|
-
* @returns sort option structure
|
|
116
|
-
*/
|
|
117
|
-
this._getSortOption = (column) => {
|
|
118
|
-
let sortBy = "CATEGORY";
|
|
119
|
-
let sortDirection = (0, isNumericalColumn_1.isNumericalColumn)(column) ? "DESC" : "ASC";
|
|
120
|
-
if (!(0, isEmpty_1.isEmpty)(column.sorting)) {
|
|
121
|
-
sortBy = (0, get_1._get)(column.sorting, "sortBy");
|
|
122
|
-
sortDirection = (0, get_1._get)(column.sorting, "order");
|
|
123
|
-
if (sortBy == null)
|
|
124
|
-
sortBy = "VALUE";
|
|
125
|
-
if (sortDirection == null)
|
|
126
|
-
sortDirection = "DESC";
|
|
127
|
-
}
|
|
128
|
-
return { sortBy, sortDirection };
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Gets summaries body structure
|
|
132
|
-
* @param uFilter The filter Builder filter
|
|
133
|
-
* @returns summaries body structure
|
|
134
|
-
*/
|
|
135
|
-
this._getSummariesBody = (uFilter) => {
|
|
136
|
-
const { column, validator } = uFilter;
|
|
137
|
-
const summary = {
|
|
138
|
-
aggregate: (0, get_1._get)(column, "aggregate.label", AGGREGATE_1.AGGREGATE.COUNT),
|
|
139
|
-
questionid: column.id,
|
|
140
|
-
property: !(0, isDateColumn_1.isDateColumn)(uFilter.column) ? uFilter.property : undefined,
|
|
141
|
-
type: column.type,
|
|
142
|
-
};
|
|
143
|
-
let summaries = [summary];
|
|
144
|
-
if ((0, isNumericalColumn_1.isNumericalColumn)(column) || (0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
145
|
-
summaries = [
|
|
146
|
-
Object.assign(Object.assign({}, summary), { aggregate: AGGREGATE_1.AGGREGATE.MIN }),
|
|
147
|
-
Object.assign(Object.assign({}, summary), { aggregate: AGGREGATE_1.AGGREGATE.MAX }),
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
|
-
return summaries;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Refines the body structure
|
|
154
|
-
* @param bodies The body structure
|
|
155
|
-
* @param uFilter The filter Builder filter
|
|
156
|
-
* @returns the body structure
|
|
157
|
-
*/
|
|
158
|
-
this._refineBodies = (bodies, uFilter) => {
|
|
159
|
-
const _bodies = (0, cloneDeep_1.cloneDeep)(bodies);
|
|
160
|
-
if (uFilter.property != null) {
|
|
161
|
-
_bodies.forEach((body) => {
|
|
162
|
-
if ((0, isDateColumn_1.isDateColumn)(uFilter.column)) {
|
|
163
|
-
body["groupType"] = "DATE";
|
|
164
|
-
body["groupValue"] = uFilter.property.toUpperCase();
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
body["property"] = uFilter.property;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
return _bodies;
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* Gets the validation type for the preview request
|
|
175
|
-
* @param column The column to filter
|
|
176
|
-
* @param vaildator Validator Type
|
|
177
|
-
* @returns the validator type for the preview request
|
|
178
|
-
*/
|
|
179
|
-
this._getValidationType = (column, validator) => {
|
|
180
|
-
if ((0, isDateColumn_1.isDateColumn)(column) ||
|
|
181
|
-
column.type === COLUMN_1.COLUMN.BUCKET ||
|
|
182
|
-
(0, isNumericalColumn_1.isNumericalColumn)(column)) {
|
|
183
|
-
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.EQUALS;
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
if ([
|
|
187
|
-
FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_CONTAIN,
|
|
188
|
-
FILTER_VALIDATOR_1.FILTER_VALIDATOR.EQUALS,
|
|
189
|
-
FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_EQUAL,
|
|
190
|
-
].includes(validator)) {
|
|
191
|
-
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.CONTAINS;
|
|
192
|
-
}
|
|
193
|
-
else if (validator === FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_END_WITH) {
|
|
194
|
-
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.ENDS_WITH;
|
|
195
|
-
}
|
|
196
|
-
else if (validator === FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_START_WITH) {
|
|
197
|
-
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.STARTS_WITH;
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
return validator;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
36
|
+
.then((response) => this._getDataFromResponse(response, uFilter))
|
|
37
|
+
.catch((_) => ({ data: [] }));
|
|
203
38
|
};
|
|
204
39
|
/**
|
|
205
40
|
* Gets the Data from preview Response
|
|
@@ -219,7 +54,7 @@ class UChartApi {
|
|
|
219
54
|
{ value: (0, get_1._get)(response, "[0].max") },
|
|
220
55
|
];
|
|
221
56
|
}
|
|
222
|
-
else if (!
|
|
57
|
+
else if (!UChartApi.isResultEmpty(response)) {
|
|
223
58
|
const records = (0, get_1._get)(response, "data");
|
|
224
59
|
data.data = (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
225
60
|
? records.map((record) => ({
|
|
@@ -236,24 +71,16 @@ class UChartApi {
|
|
|
236
71
|
* @returns the sumaries
|
|
237
72
|
*/
|
|
238
73
|
this._getResponseSummaries = (records, values = []) => {
|
|
74
|
+
let _values = values;
|
|
239
75
|
records.forEach((record) => {
|
|
240
76
|
const value = record.summary[0].toString();
|
|
241
77
|
if (Array.isArray(record.items) && record.items.length)
|
|
242
|
-
|
|
78
|
+
_values = this._getResponseSummaries(record.items, _values);
|
|
243
79
|
else if (!Array.isArray(record.items) &&
|
|
244
|
-
!(0, isEmpty_1.isEmpty)(
|
|
245
|
-
|
|
80
|
+
!(0, isEmpty_1.isEmpty)(_values.find((v) => v.value === value)))
|
|
81
|
+
_values.push({ value });
|
|
246
82
|
});
|
|
247
|
-
return
|
|
248
|
-
};
|
|
249
|
-
this.isResultEmpty = (resultObject, validateNesteddata = false) => {
|
|
250
|
-
const result = (0, get_1._get)(resultObject, "[0].data");
|
|
251
|
-
let validation = (0, isEmpty_1.isEmpty)(result);
|
|
252
|
-
if (validateNesteddata && !validation) {
|
|
253
|
-
// Searching empty data when Chart is Multiseries. At least, Chart needs a single item to draw in the serie. (See the second level of the result object)
|
|
254
|
-
validation = result.every((data) => !(0, isEmpty_1.isEmpty)(data) && (0, isEmpty_1.isEmpty)((0, get_1._get)(data, "items")));
|
|
255
|
-
}
|
|
256
|
-
return validation;
|
|
83
|
+
return _values;
|
|
257
84
|
};
|
|
258
85
|
}
|
|
259
86
|
/**
|
|
@@ -261,11 +88,11 @@ class UChartApi {
|
|
|
261
88
|
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
262
89
|
* @returns the filter object structure
|
|
263
90
|
*/
|
|
264
|
-
_getSearchLogic(uFilter) {
|
|
91
|
+
static _getSearchLogic(uFilter) {
|
|
265
92
|
let searchLogic;
|
|
266
93
|
if (!(0, isEmpty_1.isEmpty)(uFilter.values)) {
|
|
267
94
|
searchLogic = (0, flatUIToOldLogic_1.flatUIToOldLogic)([
|
|
268
|
-
Object.assign(Object.assign({}, uFilter), { validator:
|
|
95
|
+
Object.assign(Object.assign({}, uFilter), { validator: UChartApi._getValidationType(uFilter.column, uFilter.validator), column: Object.assign({}, uFilter.column) }),
|
|
269
96
|
]);
|
|
270
97
|
}
|
|
271
98
|
return searchLogic;
|
|
@@ -277,7 +104,7 @@ class UChartApi {
|
|
|
277
104
|
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
278
105
|
* @returns the filters from the chart settings
|
|
279
106
|
*/
|
|
280
|
-
_getFilterCharts(uFilter, searchLogic, chartSettings) {
|
|
107
|
+
static _getFilterCharts(uFilter, searchLogic, chartSettings) {
|
|
281
108
|
let filterCharts = [];
|
|
282
109
|
const haveAggFilters = ((chartSettings === null || chartSettings === void 0 ? void 0 : chartSettings.aggregateColumns) || []).length &&
|
|
283
110
|
((chartSettings === null || chartSettings === void 0 ? void 0 : chartSettings.chart) || []).length;
|
|
@@ -297,3 +124,167 @@ class UChartApi {
|
|
|
297
124
|
}
|
|
298
125
|
}
|
|
299
126
|
exports.default = UChartApi;
|
|
127
|
+
/**
|
|
128
|
+
* Gets request body structure
|
|
129
|
+
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
130
|
+
* @param {IFBLogic[]} filterLogic Additional filter logic to apply in the preview
|
|
131
|
+
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
132
|
+
* @returns the request body structure
|
|
133
|
+
*/
|
|
134
|
+
UChartApi._getPreviewRequestBody = (uFilter, filterLogic = [], chartSettings) => {
|
|
135
|
+
const searchLogic = UChartApi._getSearchLogic(uFilter);
|
|
136
|
+
const filterCharts = UChartApi._getFilterCharts(uFilter, searchLogic, chartSettings);
|
|
137
|
+
const chartsBody = !filterCharts[0]
|
|
138
|
+
? [UChartApi._getChartBody(uFilter)]
|
|
139
|
+
: [filterCharts[0]];
|
|
140
|
+
const filters = [
|
|
141
|
+
...filterLogic,
|
|
142
|
+
...(!filterCharts[0] ? (searchLogic === null || searchLogic === void 0 ? void 0 : searchLogic.logic) || [] : []),
|
|
143
|
+
];
|
|
144
|
+
return {
|
|
145
|
+
charts: chartsBody,
|
|
146
|
+
logic: filters,
|
|
147
|
+
qrveyid: uFilter.column.qrveyid,
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Gets chart body structure
|
|
152
|
+
* @param uFilter The filter Builder filter
|
|
153
|
+
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
154
|
+
* @returns the chart body structure
|
|
155
|
+
*/
|
|
156
|
+
UChartApi._getChartBody = (uFilter, chartSettings) => {
|
|
157
|
+
const dimensions = UChartApi._getDimensionsBody(uFilter, chartSettings);
|
|
158
|
+
const summaries = UChartApi._getSummariesBody(uFilter);
|
|
159
|
+
return { dimensions, summaries };
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Gets dimension body structure
|
|
163
|
+
* @param uFilter The filter Builder filter
|
|
164
|
+
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
165
|
+
* @returns the dimension body structure
|
|
166
|
+
*/
|
|
167
|
+
UChartApi._getDimensionsBody = (uFilter, chartSettings) => {
|
|
168
|
+
const { column, validator } = uFilter;
|
|
169
|
+
let dimensions;
|
|
170
|
+
if (!(0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
171
|
+
dimensions = [
|
|
172
|
+
{
|
|
173
|
+
questionid: column.id,
|
|
174
|
+
qrveyid: column.qrveyid,
|
|
175
|
+
maxDataPoints: UChartApi._getMaxDataPoints(column, chartSettings),
|
|
176
|
+
type: column.type,
|
|
177
|
+
formulaType: column.type === "FORMULA" ? column.formulaType : undefined,
|
|
178
|
+
sortOption: UChartApi._getSortOption(column),
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
dimensions = UChartApi._refineBodies([...dimensions], uFilter);
|
|
182
|
+
}
|
|
183
|
+
return dimensions;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Gets max data point number
|
|
187
|
+
* @param column The column to filter
|
|
188
|
+
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
189
|
+
* @returns max data point number
|
|
190
|
+
*/
|
|
191
|
+
UChartApi._getMaxDataPoints = (column, chartSettings) => !(0, isDateColumn_1.isDateColumn)(column) && !(0, isEmpty_1.isEmpty)(column.aggregate)
|
|
192
|
+
? (0, get_1._get)(chartSettings, "maxDataPoints.option", 1000)
|
|
193
|
+
: 1000;
|
|
194
|
+
/**
|
|
195
|
+
* Gets sort option structure
|
|
196
|
+
* @param column The column to filter
|
|
197
|
+
* @returns sort option structure
|
|
198
|
+
*/
|
|
199
|
+
UChartApi._getSortOption = (column) => {
|
|
200
|
+
let sortBy = "CATEGORY";
|
|
201
|
+
let sortDirection = (0, isNumericalColumn_1.isNumericalColumn)(column) ? "DESC" : "ASC";
|
|
202
|
+
if (!(0, isEmpty_1.isEmpty)(column.sorting)) {
|
|
203
|
+
sortBy = (0, get_1._get)(column.sorting, "sortBy");
|
|
204
|
+
sortDirection = (0, get_1._get)(column.sorting, "order");
|
|
205
|
+
if (sortBy == null)
|
|
206
|
+
sortBy = "VALUE";
|
|
207
|
+
if (sortDirection == null)
|
|
208
|
+
sortDirection = "DESC";
|
|
209
|
+
}
|
|
210
|
+
return { sortBy, sortDirection };
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Gets summaries body structure
|
|
214
|
+
* @param uFilter The filter Builder filter
|
|
215
|
+
* @returns summaries body structure
|
|
216
|
+
*/
|
|
217
|
+
UChartApi._getSummariesBody = (uFilter) => {
|
|
218
|
+
const { column, validator } = uFilter;
|
|
219
|
+
const summary = {
|
|
220
|
+
aggregate: (0, get_1._get)(column, "aggregate.label", AGGREGATE_1.AGGREGATE.COUNT),
|
|
221
|
+
questionid: column.id,
|
|
222
|
+
property: !(0, isDateColumn_1.isDateColumn)(uFilter.column) ? uFilter.property : undefined,
|
|
223
|
+
type: column.type,
|
|
224
|
+
};
|
|
225
|
+
let summaries = [summary];
|
|
226
|
+
if ((0, isNumericalColumn_1.isNumericalColumn)(column) || (0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
227
|
+
summaries = [
|
|
228
|
+
Object.assign(Object.assign({}, summary), { aggregate: AGGREGATE_1.AGGREGATE.MIN }),
|
|
229
|
+
Object.assign(Object.assign({}, summary), { aggregate: AGGREGATE_1.AGGREGATE.MAX }),
|
|
230
|
+
];
|
|
231
|
+
}
|
|
232
|
+
return summaries;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Refines the body structure
|
|
236
|
+
* @param bodies The body structure
|
|
237
|
+
* @param uFilter The filter Builder filter
|
|
238
|
+
* @returns the body structure
|
|
239
|
+
*/
|
|
240
|
+
UChartApi._refineBodies = (bodies, uFilter) => {
|
|
241
|
+
const _bodies = (0, cloneDeep_1.cloneDeep)(bodies);
|
|
242
|
+
if (uFilter.property != null) {
|
|
243
|
+
_bodies.forEach((body) => {
|
|
244
|
+
if ((0, isDateColumn_1.isDateColumn)(uFilter.column)) {
|
|
245
|
+
body.groupType = "DATE";
|
|
246
|
+
body.groupValue = uFilter.property.toUpperCase();
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
body.property = uFilter.property;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
return _bodies;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Gets the validation type for the preview request
|
|
257
|
+
* @param column The column to filter
|
|
258
|
+
* @param vaildator Validator Type
|
|
259
|
+
* @returns the validator type for the preview request
|
|
260
|
+
*/
|
|
261
|
+
UChartApi._getValidationType = (column, validator) => {
|
|
262
|
+
if ((0, isDateColumn_1.isDateColumn)(column) ||
|
|
263
|
+
column.type === COLUMN_1.COLUMN.BUCKET ||
|
|
264
|
+
(0, isNumericalColumn_1.isNumericalColumn)(column)) {
|
|
265
|
+
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.EQUALS;
|
|
266
|
+
}
|
|
267
|
+
if ([
|
|
268
|
+
FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_CONTAIN,
|
|
269
|
+
FILTER_VALIDATOR_1.FILTER_VALIDATOR.EQUALS,
|
|
270
|
+
FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_EQUAL,
|
|
271
|
+
].includes(validator)) {
|
|
272
|
+
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.CONTAINS;
|
|
273
|
+
}
|
|
274
|
+
else if (validator === FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_END_WITH) {
|
|
275
|
+
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.ENDS_WITH;
|
|
276
|
+
}
|
|
277
|
+
else if (validator === FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_START_WITH) {
|
|
278
|
+
return FILTER_VALIDATOR_1.FILTER_VALIDATOR.STARTS_WITH;
|
|
279
|
+
}
|
|
280
|
+
return validator;
|
|
281
|
+
};
|
|
282
|
+
UChartApi.isResultEmpty = (resultObject, validateNesteddata = false) => {
|
|
283
|
+
const result = (0, get_1._get)(resultObject, "[0].data");
|
|
284
|
+
let validation = (0, isEmpty_1.isEmpty)(result);
|
|
285
|
+
if (validateNesteddata && !validation) {
|
|
286
|
+
// Searching empty data when Chart is Multiseries. At least, Chart needs a single item to draw in the serie. (See the second level of the result object)
|
|
287
|
+
validation = result.every((data) => !(0, isEmpty_1.isEmpty)(data) && (0, isEmpty_1.isEmpty)((0, get_1._get)(data, "items")));
|
|
288
|
+
}
|
|
289
|
+
return validation;
|
|
290
|
+
};
|
|
@@ -28,13 +28,13 @@ export default class UChartPaginationApi {
|
|
|
28
28
|
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
29
29
|
* @returns the request body structure
|
|
30
30
|
*/
|
|
31
|
-
private _getPreviewRequestBody;
|
|
31
|
+
private static _getPreviewRequestBody;
|
|
32
32
|
/**
|
|
33
33
|
* Gets the filter object structure for the searching text
|
|
34
34
|
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
35
35
|
* @returns the filter object structure
|
|
36
36
|
*/
|
|
37
|
-
private _getSearchLogic;
|
|
37
|
+
private static _getSearchLogic;
|
|
38
38
|
/**
|
|
39
39
|
* Gets the filters from the chart settings
|
|
40
40
|
* @param {IFUFlattenedFilter} uFilter The filter object
|
|
@@ -42,52 +42,52 @@ export default class UChartPaginationApi {
|
|
|
42
42
|
* @param {IFUChartSettings} chartSettings The settings of the chart. For Aggregate Columns.
|
|
43
43
|
* @returns the filters from the chart settings
|
|
44
44
|
*/
|
|
45
|
-
private _getFilterCharts;
|
|
45
|
+
private static _getFilterCharts;
|
|
46
46
|
/**
|
|
47
47
|
* Gets dimension body structure
|
|
48
48
|
* @param uFilter The filter Builder filter
|
|
49
49
|
* @returns the dimension body structure
|
|
50
50
|
*/
|
|
51
|
-
private _getDimensionsBody;
|
|
51
|
+
private static _getDimensionsBody;
|
|
52
52
|
/**
|
|
53
53
|
* Get a dimension body structure foor pagination endpoint
|
|
54
54
|
* @param dimensions
|
|
55
55
|
* @returns the dimension body structure
|
|
56
56
|
*/
|
|
57
|
-
private _getDimensionsBodyAdapter;
|
|
57
|
+
private static _getDimensionsBodyAdapter;
|
|
58
58
|
/**
|
|
59
59
|
* Gets max data point number
|
|
60
60
|
* @param column The column to filter
|
|
61
61
|
* @param chartSettings The settings of the chart. For Aggregate Columns.
|
|
62
62
|
* @returns max data point number
|
|
63
63
|
*/
|
|
64
|
-
private _getMaxDataPoints;
|
|
64
|
+
private static _getMaxDataPoints;
|
|
65
65
|
/**
|
|
66
66
|
* Gets sort option structure
|
|
67
67
|
* @param column The column to filter
|
|
68
68
|
* @returns sort option structure
|
|
69
69
|
*/
|
|
70
|
-
private _getSortOption;
|
|
70
|
+
private static _getSortOption;
|
|
71
71
|
/**
|
|
72
72
|
* Gets summaries body structure
|
|
73
73
|
* @param uFilter The filter Builder filter
|
|
74
74
|
* @returns summaries body structure
|
|
75
75
|
*/
|
|
76
|
-
private _getSummariesBody;
|
|
76
|
+
private static _getSummariesBody;
|
|
77
77
|
/**
|
|
78
78
|
* Refines the body structure
|
|
79
79
|
* @param bodies The body structure
|
|
80
80
|
* @param uFilter The filter Builder filter
|
|
81
81
|
* @returns the body structure
|
|
82
82
|
*/
|
|
83
|
-
private _refineBodies;
|
|
83
|
+
private static _refineBodies;
|
|
84
84
|
/**
|
|
85
85
|
* Gets the validation type for the preview request
|
|
86
86
|
* @param column The column to filter
|
|
87
87
|
* @param vaildator Validator Type
|
|
88
88
|
* @returns the validator type for the preview request
|
|
89
89
|
*/
|
|
90
|
-
private _getValidationType;
|
|
90
|
+
private static _getValidationType;
|
|
91
91
|
/**
|
|
92
92
|
* Gets the Data from preview Response
|
|
93
93
|
* @param response The preview presponse
|
|
@@ -101,7 +101,7 @@ export default class UChartPaginationApi {
|
|
|
101
101
|
* @param values The values from the preview response
|
|
102
102
|
* @returns the sumaries
|
|
103
103
|
*/
|
|
104
|
-
private _getResponseSummaries;
|
|
104
|
+
private static _getResponseSummaries;
|
|
105
105
|
/**
|
|
106
106
|
* Refines the afterKey object
|
|
107
107
|
* @param props
|
|
@@ -123,6 +123,6 @@ export default class UChartPaginationApi {
|
|
|
123
123
|
* @param column2
|
|
124
124
|
* @returns True: Columns are equal; False: Columns are not equal
|
|
125
125
|
*/
|
|
126
|
-
areColumnsEquals: (column1: IFUColumn, column2: IFUColumn) => boolean;
|
|
127
|
-
isResultPaginationEmpty: (resultObject: any) => boolean;
|
|
126
|
+
static areColumnsEquals: (column1: IFUColumn, column2: IFUColumn) => boolean;
|
|
127
|
+
static isResultPaginationEmpty: (resultObject: any) => boolean;
|
|
128
128
|
}
|