@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
package/dist/format/format.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { format as d3Format } from "d3";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
import { DATEGROUP_FORMATTING_UNSUPPORT, appliesFormatting, hasfileSizeProperty, isTextColumn, } from "./definition";
|
|
4
|
+
import isoWeek from "dayjs/plugin/isoWeek";
|
|
4
5
|
import advancedFormat from "dayjs/plugin/advancedFormat";
|
|
5
6
|
import { isEmpty } from "../general/mix/isEmpty";
|
|
6
7
|
import { _get } from "../general/object/get";
|
|
@@ -8,6 +9,9 @@ import { COLUMN } from "../columns/constants/COLUMN";
|
|
|
8
9
|
import { FORMULA } from "../formulas/constants/FORMULA";
|
|
9
10
|
import { formatWithLocale } from "./localization";
|
|
10
11
|
import { isObject } from "../general/object/isObject";
|
|
12
|
+
import { DURATION_PARTS_LIST } from "../column_format/constants/DURATION_PARTS_LIST";
|
|
13
|
+
import { cloneDeep } from "../general/object/cloneDeep";
|
|
14
|
+
dayjs.extend(isoWeek); // Add support for iso week format https://github.com/iamkun/dayjs/issues/1328
|
|
11
15
|
dayjs.extend(advancedFormat); // Add support to advanced formats https://day.js.org/docs/en/plugin/advanced-format
|
|
12
16
|
/**
|
|
13
17
|
* Apply to the given date format to a date value
|
|
@@ -18,60 +22,62 @@ function isValidDateString(dateString = "") {
|
|
|
18
22
|
/^\d{4}-\d{2}-\d{2}/.test(dateString)); // YYYY-MM-DD
|
|
19
23
|
}
|
|
20
24
|
export function formatDate(dateString, format) {
|
|
25
|
+
let _format = cloneDeep(format);
|
|
21
26
|
if (isObject(format))
|
|
22
|
-
|
|
23
|
-
if (isEmpty(dateString) || !isNaN(dateString) ||
|
|
27
|
+
_format = _format.format || "";
|
|
28
|
+
if (isEmpty(dateString) || !isNaN(dateString) || _format === "Default")
|
|
24
29
|
return dateString;
|
|
25
30
|
if (!isValidDateString(dateString))
|
|
26
31
|
return dateString;
|
|
27
32
|
const dateValue = dateString === null || dateString === void 0 ? void 0 : dateString.replace(/Z$/i, "");
|
|
28
|
-
return dayjs(dateValue.split(".")[0]).format(
|
|
33
|
+
return dayjs(dateValue.split(".")[0]).format(_format
|
|
29
34
|
.replace("HH24:", "HH:")
|
|
30
35
|
.replace("MI:SS", "mm:ss")
|
|
31
36
|
.replace("MM:SS", "mm:ss"));
|
|
32
37
|
}
|
|
33
38
|
export function formatAbbreviated(num, decimals) {
|
|
34
|
-
if (num
|
|
39
|
+
if (num === 0)
|
|
35
40
|
return 0;
|
|
36
41
|
const absValue = Math.abs(num);
|
|
37
42
|
const exp = Math.floor(Math.log10(absValue));
|
|
38
43
|
if (exp <= 0 && exp >= -3)
|
|
39
44
|
return num.toFixed(decimals === 0 ? 2 : decimals);
|
|
40
|
-
return d3Format(num > -100 && num < 100 ?
|
|
45
|
+
return d3Format(num > -100 && num < 100 ? `.${decimals + 2}n` : ".3s")(num);
|
|
41
46
|
}
|
|
42
47
|
function formatNumber(num, outputFormat, _config) {
|
|
48
|
+
let _num = num;
|
|
43
49
|
try {
|
|
44
|
-
|
|
50
|
+
_num = +(_num || 0);
|
|
45
51
|
}
|
|
46
52
|
catch (e) {
|
|
47
|
-
|
|
53
|
+
_num = 0;
|
|
48
54
|
}
|
|
49
|
-
if (isNaN(
|
|
50
|
-
|
|
55
|
+
if (isNaN(_num))
|
|
56
|
+
_num = 0;
|
|
51
57
|
const num_decimals = !isEmpty(outputFormat.decimals) && outputFormat.format !== "Abbreviated"
|
|
52
58
|
? outputFormat.decimals
|
|
53
59
|
: 0;
|
|
54
60
|
switch (outputFormat.format) {
|
|
55
61
|
case "Abbreviated":
|
|
56
|
-
return formatAbbreviated(
|
|
62
|
+
return formatAbbreviated(_num, num_decimals);
|
|
57
63
|
case "Numeric":
|
|
58
64
|
case "Decimal":
|
|
59
|
-
return d3Format(`,.${num_decimals}f`)(
|
|
65
|
+
return d3Format(`,.${num_decimals}f`)(_num).replace(/\.(%*)$/, "$1");
|
|
60
66
|
case "Currency": {
|
|
61
|
-
const currency = `${
|
|
62
|
-
const absNum = Math.abs(
|
|
67
|
+
const currency = `${_num < 0 ? "-" : ""} ${_get(outputFormat, "currency.label", "$")}`;
|
|
68
|
+
const absNum = Math.abs(_num);
|
|
63
69
|
return (currency +
|
|
64
70
|
d3Format(`,.${num_decimals}f`)(absNum).replace(/\.(%*)$/, "$1"));
|
|
65
71
|
}
|
|
66
72
|
case "Percentage":
|
|
67
|
-
return `${d3Format(`,.${num_decimals}f`)(
|
|
73
|
+
return `${d3Format(`,.${num_decimals}f`)(_num).replace(/\.(%*)$/, "$1")}%`;
|
|
68
74
|
case "Scientific":
|
|
69
|
-
return Number(
|
|
75
|
+
return Number(_num)
|
|
70
76
|
.toExponential(num_decimals)
|
|
71
77
|
.replace(".00", "")
|
|
72
78
|
.replace("e+0", "");
|
|
73
79
|
default:
|
|
74
|
-
return `${
|
|
80
|
+
return `${_num}`;
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
/**
|
|
@@ -105,12 +111,16 @@ export const addFormat = (value, outputFormat = "None", config) => {
|
|
|
105
111
|
: outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format);
|
|
106
112
|
case "NUMERIC": {
|
|
107
113
|
const parse = parseFloat(value);
|
|
108
|
-
const withLocale = outputFormat !== "None" && (config === null || config === void 0 ? void 0 : config.lang)
|
|
109
|
-
|
|
110
|
-
?
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
const withLocale = (outputFormat !== "None" && (config === null || config === void 0 ? void 0 : config.lang)) ||
|
|
115
|
+
(outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Duration" ||
|
|
116
|
+
DURATION_PARTS_LIST.includes[outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format];
|
|
117
|
+
if (isNaN(parse)) {
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
else if (withLocale) {
|
|
121
|
+
return formatWithLocale(value, outputFormat, config);
|
|
122
|
+
}
|
|
123
|
+
return formatNumber(parse, outputFormat, config);
|
|
114
124
|
}
|
|
115
125
|
case "IMAGEUPLOAD":
|
|
116
126
|
case "FILEUPLOAD":
|
|
@@ -204,16 +214,16 @@ export const defineFormat = (column = {}, isSimpleTable = false, isCategoryDimen
|
|
|
204
214
|
DATEGROUP_FORMATTING_UNSUPPORT.includes(dateGroupLabel))
|
|
205
215
|
return "None";
|
|
206
216
|
if ((isCategoryDimension || isTable) &&
|
|
207
|
-
selectType
|
|
217
|
+
selectType === "NUMERIC" &&
|
|
208
218
|
dateGroupLabel &&
|
|
209
219
|
outputType === "DATE")
|
|
210
220
|
return column.outputFormat;
|
|
211
221
|
if ((isCategoryDimension || isTable) &&
|
|
212
|
-
selectType
|
|
222
|
+
selectType === "NUMERIC" &&
|
|
213
223
|
dateGroupLabel &&
|
|
214
224
|
outputType === "NUMERIC")
|
|
215
225
|
return _get(column, "defaultFormat");
|
|
216
|
-
if (selectedFormat && selectedFormat
|
|
226
|
+
if (selectedFormat && selectedFormat !== "Default") {
|
|
217
227
|
if (isNumericDefaultSelected)
|
|
218
228
|
return defaultAbbreviated;
|
|
219
229
|
return column.selectedFormat;
|
|
@@ -259,7 +269,7 @@ export const defineFormat = (column = {}, isSimpleTable = false, isCategoryDimen
|
|
|
259
269
|
return defaultAbbreviated;
|
|
260
270
|
return _get(column, "defaultFormat");
|
|
261
271
|
}
|
|
262
|
-
if (selectedFormat && selectedFormat
|
|
272
|
+
if (selectedFormat && selectedFormat !== "Default") {
|
|
263
273
|
if (isNumericDefaultSelected)
|
|
264
274
|
return defaultAbbreviated;
|
|
265
275
|
return column.selectedFormat;
|
|
@@ -320,14 +330,12 @@ export const defineFormat = (column = {}, isSimpleTable = false, isCategoryDimen
|
|
|
320
330
|
format: "fileSize",
|
|
321
331
|
};
|
|
322
332
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
};
|
|
330
|
-
}
|
|
333
|
+
if (outputFormat !== "Default")
|
|
334
|
+
return column.outputFormat;
|
|
335
|
+
return {
|
|
336
|
+
type: "NUMERIC",
|
|
337
|
+
format: "Numeric",
|
|
338
|
+
};
|
|
331
339
|
}
|
|
332
340
|
if (column.isGroup)
|
|
333
341
|
return "None";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { DATETIME_COLUMN_FORMAT } from "../dates/constants/DATETIME_COLUMN_FORMAT";
|
|
2
2
|
import { isEmpty } from "../general/mix/isEmpty";
|
|
3
3
|
import { currencyISO, LANG_DEFAULT, CURRENCY_DEFAULT, DATETIME_OPTIONS, } from "./definition";
|
|
4
|
+
import { DurationFormatter } from "./duration/durationFormatter";
|
|
4
5
|
export const getLang = (locale) => {
|
|
5
6
|
if (!locale)
|
|
6
7
|
return;
|
|
7
8
|
else if (typeof locale === "object")
|
|
8
9
|
return locale;
|
|
9
|
-
|
|
10
|
-
return { lang: locale === "browser" ? window.navigator.language : locale };
|
|
10
|
+
return { lang: locale === "browser" ? window.navigator.language : locale };
|
|
11
11
|
};
|
|
12
12
|
export const chooseLang = (config) => {
|
|
13
13
|
var _a;
|
|
@@ -55,10 +55,20 @@ function formatLocaleNumber(value, outputFormat, config) {
|
|
|
55
55
|
const langOpts = options || getLocaleOptions(outputFormat);
|
|
56
56
|
const valueToFormat = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Percentage" /* LOCALE_FORMATS.PERCENTAGE */ ? value / 100 : value;
|
|
57
57
|
try {
|
|
58
|
-
const key =
|
|
58
|
+
const key = (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) +
|
|
59
|
+
lang +
|
|
60
|
+
JSON.stringify(langOpts) +
|
|
61
|
+
((outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.template) ? outputFormat.template : "");
|
|
59
62
|
let formatter = NUMBER_FORMAT_CACHE[key];
|
|
60
63
|
if (!formatter) {
|
|
61
|
-
|
|
64
|
+
const intlNumberFormat = new Intl.NumberFormat([lang, LANG_DEFAULT], langOpts);
|
|
65
|
+
formatter =
|
|
66
|
+
(outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Duration" /* LOCALE_FORMATS.DURATION */
|
|
67
|
+
? new DurationFormatter({
|
|
68
|
+
template: outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.template,
|
|
69
|
+
intlNumberFormat,
|
|
70
|
+
})
|
|
71
|
+
: intlNumberFormat;
|
|
62
72
|
NUMBER_FORMAT_CACHE[key] = formatter;
|
|
63
73
|
}
|
|
64
74
|
return formatter.format(valueToFormat);
|
|
@@ -107,6 +117,11 @@ function getLocaleOptions(outputFormat) {
|
|
|
107
117
|
maximumFractionDigits: decimals,
|
|
108
118
|
minimumFractionDigits: decimals,
|
|
109
119
|
};
|
|
120
|
+
case "Duration" /* LOCALE_FORMATS.DURATION */:
|
|
121
|
+
return {
|
|
122
|
+
maximumFractionDigits: 0,
|
|
123
|
+
minimumFractionDigits: 0,
|
|
124
|
+
};
|
|
110
125
|
default:
|
|
111
126
|
return {
|
|
112
127
|
style: "decimal" /* LOCALE_STYLES.DECIMAL */,
|
|
@@ -38,22 +38,16 @@ export function importScripts(scripts) {
|
|
|
38
38
|
if (typeof script === "string") {
|
|
39
39
|
return loadScript(script);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return script.dependencies && importScripts(script.dependencies);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
41
|
+
if (script.namespace) {
|
|
42
|
+
const exist = typeof script.namespace === "function"
|
|
43
|
+
? script.namespace()
|
|
44
|
+
: window[script.namespace];
|
|
45
|
+
if (exist) {
|
|
46
|
+
return script.dependencies && importScripts(script.dependencies);
|
|
55
47
|
}
|
|
48
|
+
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
56
49
|
}
|
|
50
|
+
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
57
51
|
});
|
|
58
52
|
return Promise.all(promiseList);
|
|
59
53
|
}
|
|
@@ -9,11 +9,12 @@ import { isNull } from "./isNull";
|
|
|
9
9
|
* @return {String} Random string
|
|
10
10
|
*/
|
|
11
11
|
export function randomId(length = 8, exclude = []) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
let _length = length, _exclude = exclude;
|
|
13
|
+
if (typeof _length !== "number")
|
|
14
|
+
_length = 8;
|
|
15
|
+
if (isNull(_exclude) || !Array.isArray(_exclude))
|
|
16
|
+
_exclude = [];
|
|
17
|
+
_exclude = _exclude.filter((e) => typeof e === "string");
|
|
17
18
|
const charSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
|
|
18
19
|
const blackList = [];
|
|
19
20
|
let id = "";
|
|
@@ -21,14 +22,14 @@ export function randomId(length = 8, exclude = []) {
|
|
|
21
22
|
if (!isEmpty(id) && !blackList.includes(id))
|
|
22
23
|
blackList.push(id);
|
|
23
24
|
id = "";
|
|
24
|
-
for (let i = 0; i <
|
|
25
|
+
for (let i = 0; i < _length; i++) {
|
|
25
26
|
const randPos = Math.floor(Math.random() * charSet.length);
|
|
26
27
|
id += charSet[randPos];
|
|
27
28
|
}
|
|
28
|
-
} while (
|
|
29
|
-
|
|
30
|
-
blackList.length <
|
|
31
|
-
if (
|
|
29
|
+
} while (_exclude.length > 0 &&
|
|
30
|
+
_exclude.includes(id) &&
|
|
31
|
+
blackList.length < _exclude.length);
|
|
32
|
+
if (_exclude.length > 0 && blackList.length >= _exclude.length)
|
|
32
33
|
id = "";
|
|
33
34
|
return id;
|
|
34
35
|
}
|
|
@@ -35,11 +35,11 @@ export function _get(baseObject, path, defaultValue) {
|
|
|
35
35
|
.replace(/(\[(\d)\])/g, ".$2")
|
|
36
36
|
.split(".")
|
|
37
37
|
.filter((k) => k.length);
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
return _get(
|
|
38
|
+
const _baseObject = baseObject[keys[0]];
|
|
39
|
+
if (_baseObject !== undefined && keys.length > 1) {
|
|
40
|
+
return _get(_baseObject, keys.slice(1), defaultValue);
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return _baseObject === undefined ? defaultValue : _baseObject;
|
|
43
43
|
}
|
|
44
44
|
function validateToReturnDefaultValue(baseObject, path) {
|
|
45
45
|
return (baseObject == null ||
|
|
@@ -28,7 +28,7 @@ export function getAttribute(obj, key) {
|
|
|
28
28
|
return ((_e = (_d = (_c = (_b = (_a = obj[key]) !== null && _a !== void 0 ? _a : obj[snake]) !== null && _b !== void 0 ? _b : obj[camel]) !== null && _c !== void 0 ? _c : obj[pascal]) !== null && _d !== void 0 ? _d : obj[lower]) !== null && _e !== void 0 ? _e : obj[upper]);
|
|
29
29
|
}
|
|
30
30
|
function getSnakeCase(key) {
|
|
31
|
-
return key.replace(/[A-Z]/g, (a, i) => i
|
|
31
|
+
return key.replace(/[A-Z]/g, (a, i) => i === 0 ? a.toLowerCase() : `_${a.toLowerCase()}`);
|
|
32
32
|
}
|
|
33
33
|
function getCamelCase(key) {
|
|
34
34
|
return key
|
|
@@ -9,8 +9,8 @@ const defaultIteratee = (v) => v;
|
|
|
9
9
|
*/
|
|
10
10
|
export function mapValues(baseObject, iteratee) {
|
|
11
11
|
const newObject = {};
|
|
12
|
-
|
|
12
|
+
const _iteratee = typeof iteratee === "function" ? iteratee : defaultIteratee;
|
|
13
13
|
for (const key in baseObject)
|
|
14
|
-
newObject[key] =
|
|
14
|
+
newObject[key] = _iteratee(baseObject[key], key);
|
|
15
15
|
return newObject;
|
|
16
16
|
}
|
|
@@ -9,13 +9,13 @@ import { objectCopy } from "./objectCopy";
|
|
|
9
9
|
* @returns a new merged object
|
|
10
10
|
*/
|
|
11
11
|
export function mergeDeep(obj1, obj2, settings) {
|
|
12
|
-
|
|
12
|
+
const defaultSettings = getParamsToMergeDeep(settings);
|
|
13
13
|
if (!isValid(obj1, obj2))
|
|
14
14
|
return objectCopy(obj1);
|
|
15
15
|
const result = {};
|
|
16
16
|
for (const i in obj1) {
|
|
17
17
|
if (i != null && i in obj2 && isObject(obj1[i])) {
|
|
18
|
-
result[i] = mergeDeep(obj1[i], obj2[i],
|
|
18
|
+
result[i] = mergeDeep(obj1[i], obj2[i], defaultSettings);
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
21
|
result[i] = obj1[i];
|
|
@@ -23,8 +23,10 @@ export function mergeDeep(obj1, obj2, settings) {
|
|
|
23
23
|
}
|
|
24
24
|
for (const i in obj2) {
|
|
25
25
|
if (i != null &&
|
|
26
|
-
((!isObject(obj2[i]) &&
|
|
27
|
-
|
|
26
|
+
((!isObject(obj2[i]) &&
|
|
27
|
+
i in result &&
|
|
28
|
+
defaultSettings.mergeExistingValues) ||
|
|
29
|
+
(!(i in result) && defaultSettings.mergeMissingProperties))) {
|
|
28
30
|
result[i] = obj2[i];
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -13,14 +13,14 @@ export function serialize(obj) {
|
|
|
13
13
|
if (Array.isArray(obj[key])) {
|
|
14
14
|
for (const key2 in obj[key]) {
|
|
15
15
|
if (_hasProperty(obj[key], key2)) {
|
|
16
|
-
str +=
|
|
16
|
+
str += `&${key}=${encodeURIComponent(obj[key][key2])}`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
str +=
|
|
21
|
+
str += `&${key}=${encodeURIComponent(obj[key])}`;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return `?${str.substring(1)}`;
|
|
26
26
|
}
|
|
@@ -24,12 +24,13 @@ function getI18nMonthLabel(label, translate) {
|
|
|
24
24
|
return splittedLabel.join(" ");
|
|
25
25
|
}
|
|
26
26
|
function getI18nYearMonthLabel(label, translate) {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
let newLabel = label;
|
|
28
|
+
if (!isTokenLabel(newLabel) && !isEmpty(translate)) {
|
|
29
|
+
const month = getI18nMonthPropertyByIndex(DATE_YEAR_MONTHS.findIndex((_month) => _month === newLabel));
|
|
29
30
|
if (!isEmpty(month))
|
|
30
|
-
|
|
31
|
+
newLabel = translate(`common.date_grouping.${month}_mmm`);
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return newLabel;
|
|
33
34
|
}
|
|
34
35
|
function getI18nMonthPropertyByIndex(index) {
|
|
35
36
|
const months = [
|
|
@@ -54,10 +55,11 @@ function getI18nQuarterLabel(label, translate) {
|
|
|
54
55
|
return splittedLabel.join(" ");
|
|
55
56
|
}
|
|
56
57
|
function getI18nYearQuarterLabel(label, translate) {
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
let newLabel = label;
|
|
59
|
+
if (!isTokenLabel(newLabel) && !isEmpty(translate)) {
|
|
60
|
+
newLabel = newLabel.replace(/Q/i, translate("common.date_grouping.quarter"));
|
|
59
61
|
}
|
|
60
|
-
return
|
|
62
|
+
return newLabel;
|
|
61
63
|
}
|
|
62
64
|
function getI18nWeekLabel(label, translate) {
|
|
63
65
|
const splittedLabel = label.split(" ");
|
|
@@ -65,8 +67,9 @@ function getI18nWeekLabel(label, translate) {
|
|
|
65
67
|
return splittedLabel.join(" ");
|
|
66
68
|
}
|
|
67
69
|
function getI18nYearWeekLabel(label, translate) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
let newLabel = label;
|
|
71
|
+
if (!isTokenLabel(newLabel) && !isEmpty(translate)) {
|
|
72
|
+
newLabel = newLabel.replace(/W/i, translate("common.date_grouping.week"));
|
|
70
73
|
}
|
|
71
|
-
return
|
|
74
|
+
return newLabel;
|
|
72
75
|
}
|
|
@@ -25,10 +25,11 @@ function getReverseI18nMonthLabel(label, translate) {
|
|
|
25
25
|
return splittedLabel.join(" ");
|
|
26
26
|
}
|
|
27
27
|
function getReverseI18nYearMonthLabel(label, translate) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
let newLabel = label;
|
|
29
|
+
if (!isTokenLabel(newLabel) && !isEmpty(translate)) {
|
|
30
|
+
newLabel = getReverseI18nMonthProperty(newLabel, translate);
|
|
30
31
|
}
|
|
31
|
-
return
|
|
32
|
+
return newLabel;
|
|
32
33
|
}
|
|
33
34
|
function getReverseI18nMonthProperty(label, translate) {
|
|
34
35
|
const translatedMonths = [
|
|
@@ -54,10 +55,11 @@ function getReverseI18nQuarterLabel(label, translate) {
|
|
|
54
55
|
return splittedLabel.join(" ");
|
|
55
56
|
}
|
|
56
57
|
function getReverseI18nYearQuarterLabel(label, translate) {
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
let newLabel = label;
|
|
59
|
+
if (!isTokenLabel(newLabel) && !isEmpty(translate)) {
|
|
60
|
+
newLabel = newLabel.replace(new RegExp(translate("common.date_grouping.quarter"), "i"), I18N_COMMON.date_grouping.quarter);
|
|
59
61
|
}
|
|
60
|
-
return
|
|
62
|
+
return newLabel;
|
|
61
63
|
}
|
|
62
64
|
function getReverseI18nWeekLabel(label, translate) {
|
|
63
65
|
const splittedLabel = label.split(" ");
|
|
@@ -65,8 +67,9 @@ function getReverseI18nWeekLabel(label, translate) {
|
|
|
65
67
|
return splittedLabel.join(" ");
|
|
66
68
|
}
|
|
67
69
|
function getReverseI18nYearWeekLabel(label, translate) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
let newLabel = label;
|
|
71
|
+
if (!isTokenLabel(newLabel) && !isEmpty(translate)) {
|
|
72
|
+
newLabel = newLabel.replace(new RegExp(translate("common.date_grouping.week"), "i"), I18N_COMMON.date_grouping.week);
|
|
70
73
|
}
|
|
71
|
-
return
|
|
74
|
+
return newLabel;
|
|
72
75
|
}
|
|
@@ -11,6 +11,7 @@ import { II18nBucketBuilder } from "./bucket_builder/II18nBucketBuilder";
|
|
|
11
11
|
import { II18nCrossTabs } from "./cross_tabs";
|
|
12
12
|
import { II18nChartBuilder } from ".";
|
|
13
13
|
import { II18nStyleThemes } from "./style_themes/II18nStyleThemes";
|
|
14
|
+
import { II18nTabularView } from "./tabular_view/II18nTabularView";
|
|
14
15
|
export interface II18nResource {
|
|
15
16
|
bucket_builder?: II18nBucketBuilder;
|
|
16
17
|
chart_builder?: II18nChartBuilder;
|
|
@@ -25,4 +26,5 @@ export interface II18nResource {
|
|
|
25
26
|
panel?: II18nPanel;
|
|
26
27
|
style_themes?: II18nStyleThemes;
|
|
27
28
|
table_charts?: II18nTableCharts;
|
|
29
|
+
tabular_view?: II18nTabularView;
|
|
28
30
|
}
|
|
@@ -69,6 +69,7 @@ import { II18nChartBuilderTimePeriod } from "./II18nChartBuilderTimePeriod";
|
|
|
69
69
|
import { II18nChartBuilderTimePeriodCustomRange } from "./II18nChartBuilderTimePeriodCustomRange";
|
|
70
70
|
import { II18nChartBuilderWordCloud } from "./II18nChartBuilderWordCloud";
|
|
71
71
|
import { II18nChartBuilderBoxWhisker } from "./II18nChartBuilderBoxWhisker";
|
|
72
|
+
import { II18nChartBuilderDurationParts } from "./II18nChartBuilderDurationParts";
|
|
72
73
|
export interface II18nChartBuilder {
|
|
73
74
|
action_panel: II18nChartBuilderActionPanel;
|
|
74
75
|
aggregated_formula: II18nChartBuilderAggregatedFormulas;
|
|
@@ -141,4 +142,5 @@ export interface II18nChartBuilder {
|
|
|
141
142
|
trend_chart: II18nChartBuilderTrendChart;
|
|
142
143
|
trends_line: II18nChartBuilderTrendsLine;
|
|
143
144
|
word_cloud: II18nChartBuilderWordCloud;
|
|
145
|
+
duration_parts: II18nChartBuilderDurationParts;
|
|
144
146
|
}
|
|
@@ -26,4 +26,13 @@ export interface II18nChartBuilderAxisStyle {
|
|
|
26
26
|
values_rotation_diagonal: string;
|
|
27
27
|
values_rotation_horizontal: string;
|
|
28
28
|
values_rotation_vertical: string;
|
|
29
|
+
value_font_type: string;
|
|
30
|
+
value_font_weight: string;
|
|
31
|
+
value_font_size: string;
|
|
32
|
+
value_font_color: string;
|
|
33
|
+
label_check: string;
|
|
34
|
+
label_font_type: string;
|
|
35
|
+
label_font_weight: string;
|
|
36
|
+
label_font_size: string;
|
|
37
|
+
label_font_color: string;
|
|
29
38
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,9 @@ import { II18nDateGrouping } from "./II18nDateGrouping";
|
|
|
6
6
|
import { II18nDayNames } from "./II18nDayNames";
|
|
7
7
|
import { II18nUnits } from "./II18nUnits";
|
|
8
8
|
import { II18nCalendar } from "../calendar/II18nCalendar";
|
|
9
|
+
import { II18nTokenBox } from "../filters/II18nTokenBox";
|
|
9
10
|
export interface II18nCommon {
|
|
11
|
+
aggregates: string;
|
|
10
12
|
aggregate_labels: II18nAgreggateLabels;
|
|
11
13
|
calendar: II18nCalendar;
|
|
12
14
|
column_types: II18nColumnTypes;
|
|
@@ -16,5 +18,7 @@ export interface II18nCommon {
|
|
|
16
18
|
no_data_found: string;
|
|
17
19
|
properties: II18nColumnProperties;
|
|
18
20
|
search: string;
|
|
21
|
+
sort: string;
|
|
22
|
+
token_box: II18nTokenBox;
|
|
19
23
|
units: II18nUnits;
|
|
20
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ import { I18N_FORMULA_BUILDER } from "./formula_builder";
|
|
|
8
8
|
import { I18N_FILTER_PANEL } from "./filters/I18N_FILTER_PANEL";
|
|
9
9
|
import { I18N_FILTER_DISPLAY } from "./filters/I18N_FILTER_DISPLAY";
|
|
10
10
|
import { I18N_BUCKET_BUILDER } from "./bucket_builder/I18N_BUCKET_BUILDER";
|
|
11
|
+
import { I18N_TABULAR_VIEW } from "./tabular_view/I18N_TABULAR_VIEW";
|
|
11
12
|
import { I18N_CROSS_TABS } from "./cross_tabs";
|
|
12
13
|
import { I18N_CHART_BUILDER } from "./chart_builder";
|
|
13
14
|
import { I18N_STYLE_THEMES } from "./style_themes";
|
|
@@ -25,4 +26,5 @@ export const I18N_DEFAULT = {
|
|
|
25
26
|
panel: I18N_PANEL,
|
|
26
27
|
style_themes: I18N_STYLE_THEMES,
|
|
27
28
|
table_charts: I18N_TABLE_CHARTS,
|
|
29
|
+
tabular_view: I18N_TABULAR_VIEW,
|
|
28
30
|
};
|