@qrvey/utils 1.9.0 → 1.10.0-1
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/dist/charts/adapters/endpointData.js +0 -3
- package/dist/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
- package/dist/charts/interfaces/IAggregateLabel.d.ts +1 -1
- package/dist/charts/interfaces/IAggregateType.d.ts +1 -1
- package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
- package/dist/cjs/charts/adapters/endpointData.js +0 -3
- package/dist/cjs/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
- package/dist/cjs/charts/interfaces/IAggregateLabel.d.ts +1 -1
- package/dist/cjs/charts/interfaces/IAggregateType.d.ts +1 -1
- package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
- package/dist/cjs/column_format/interfaces/IChartGroupType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IChartShelfType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IChartTableType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IFormatStringType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IColumnType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IComplexColumnType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/ICompoundColumnType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/INumericalColumnType.d.ts +1 -1
- package/dist/cjs/dates/adapters/ISOToNumericOffset.d.ts +6 -0
- package/dist/cjs/dates/adapters/ISOToNumericOffset.js +21 -0
- package/dist/cjs/dates/adapters/index.d.ts +2 -0
- package/dist/cjs/dates/adapters/index.js +2 -0
- package/dist/cjs/dates/adapters/numericOffsetToISO.d.ts +6 -0
- package/dist/cjs/dates/adapters/numericOffsetToISO.js +29 -0
- package/dist/cjs/dates/constants/ISO_8601_REGEX.d.ts +1 -0
- package/dist/cjs/dates/constants/ISO_8601_REGEX.js +4 -0
- package/dist/cjs/dates/constants/TIMEZONE_TYPE.d.ts +5 -0
- package/dist/cjs/dates/constants/TIMEZONE_TYPE.js +9 -0
- package/dist/cjs/dates/constants/index.d.ts +1 -0
- package/dist/cjs/dates/constants/index.js +1 -0
- package/dist/cjs/dates/helpers/getDateByTimezone.d.ts +8 -0
- package/dist/cjs/dates/helpers/getDateByTimezone.js +41 -0
- package/dist/cjs/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
- package/dist/cjs/dates/helpers/getDateByTimezoneOffset.js +22 -0
- package/dist/cjs/dates/helpers/getTimezoneObject.d.ts +10 -0
- package/dist/cjs/dates/helpers/getTimezoneObject.js +21 -0
- package/dist/cjs/dates/helpers/getTimezoneOffsetByType.d.ts +13 -0
- package/dist/cjs/dates/helpers/getTimezoneOffsetByType.js +27 -0
- package/dist/cjs/dates/helpers/index.d.ts +4 -1
- package/dist/cjs/dates/helpers/index.js +4 -1
- package/dist/cjs/dates/helpers/isValidISOOffset.d.ts +7 -0
- package/dist/cjs/dates/helpers/isValidISOOffset.js +17 -0
- package/dist/cjs/dates/interfaces/IBTimezone.d.ts +7 -0
- package/dist/cjs/dates/interfaces/IBTimezone.js +2 -0
- package/dist/cjs/dates/interfaces/IBTimezoneType.d.ts +2 -0
- package/dist/cjs/dates/interfaces/IBTimezoneType.js +2 -0
- package/dist/cjs/dates/interfaces/IDTimezone.d.ts +6 -0
- package/dist/cjs/dates/interfaces/IDTimezone.js +2 -0
- package/dist/cjs/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
- package/dist/cjs/dates/interfaces/IDTimezoneOffset.js +2 -0
- package/dist/cjs/dates/interfaces/IDTimezoneType.d.ts +2 -0
- package/dist/cjs/dates/interfaces/IDTimezoneType.js +2 -0
- package/dist/cjs/dates/interfaces/IDateFormat.d.ts +1 -1
- package/dist/cjs/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
- package/dist/cjs/dates/interfaces/IGetDateByTimezoneSettings.d.ts +6 -0
- package/dist/cjs/dates/interfaces/IGetDateByTimezoneSettings.js +2 -0
- package/dist/cjs/dates/interfaces/index.d.ts +6 -0
- package/dist/cjs/dates/interfaces/index.js +6 -0
- package/dist/cjs/dates/relative/helpers/parseDate.d.ts +2 -2
- package/dist/cjs/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
- package/dist/cjs/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
- package/dist/cjs/dates/relative/interfaces/RelativeInput.d.ts +1 -1
- package/dist/cjs/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
- package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
- package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +5 -5
- package/dist/cjs/filters/helpers/common/getFiltersByTimezone.d.ts +10 -0
- package/dist/cjs/filters/helpers/common/getFiltersByTimezone.js +26 -0
- package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
- package/dist/cjs/filters/helpers/common/index.js +1 -0
- package/dist/cjs/filters/interfaces/IFDateProperty.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFDateSection.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFOperator.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFProperty.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFScope.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFSection.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFStructureType.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFValidator.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFValue.d.ts +1 -1
- package/dist/cjs/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
- package/dist/cjs/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
- package/dist/cjs/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
- package/dist/cjs/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
- package/dist/cjs/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFSColumn.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFilterConfig.d.ts +1 -1
- package/dist/cjs/filters/interfaces/panel/IFPAction.d.ts +1 -1
- package/dist/cjs/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
- package/dist/cjs/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
- package/dist/cjs/format/duration/durationFormatter.js +2 -1
- package/dist/cjs/format/format.d.ts +1 -1
- package/dist/cjs/format/format.js +10 -4
- package/dist/cjs/formulas/interfaces/IFormulaType.d.ts +1 -1
- package/dist/cjs/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
- package/dist/cjs/general/index.d.ts +1 -0
- package/dist/cjs/general/index.js +1 -0
- package/dist/cjs/general/mix/importScripts.d.ts +2 -2
- package/dist/cjs/general/numeric/getSign.d.ts +6 -0
- package/dist/cjs/general/numeric/getSign.js +12 -0
- package/dist/cjs/general/numeric/index.d.ts +1 -0
- package/dist/cjs/general/numeric/index.js +17 -0
- package/dist/cjs/general/object/applyTimezoneDeep.d.ts +8 -0
- package/dist/cjs/general/object/applyTimezoneDeep.js +48 -0
- package/dist/cjs/general/object/index.d.ts +1 -0
- package/dist/cjs/general/object/index.js +1 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
- package/dist/cjs/interfaces/Chart.Interface.d.ts +1 -1
- package/dist/cjs/interfaces/IChartBuilder.Interface.d.ts +1 -1
- package/dist/cjs/interfaces/Qrvey.Interface.d.ts +2 -2
- package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +1 -0
- package/dist/cjs/interfaces/general/IWidgetConfig.d.ts +2 -1
- package/dist/cjs/qrvey/helpers/transformValue.js +34 -6
- package/dist/cjs/qrvey/interfaces/IAppStatus.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/IAppType.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/IBDataset.d.ts +2 -0
- package/dist/cjs/qrvey/interfaces/IBModel.d.ts +5 -0
- package/dist/cjs/qrvey/interfaces/ICalculation.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/ICalculationType.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/IDataset.d.ts +3 -1
- package/dist/cjs/qrvey/interfaces/IModel.d.ts +3 -1
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +6 -0
- package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +2 -0
- package/dist/cjs/services/adapters/BModelToUIModel.adapter.js +2 -0
- package/dist/cjs/services/adapters/BTimezoneToUITimezone.d.ts +8 -0
- package/dist/cjs/services/adapters/BTimezoneToUITimezone.js +18 -0
- package/dist/cjs/services/helpers/Request.d.ts +1 -1
- package/dist/cjs/services/helpers/Request.js +11 -5
- package/dist/cjs/typescript/DeepPartial.d.ts +1 -1
- package/dist/cjs/typescript/DeepRequired.d.ts +1 -1
- package/dist/cjs/typescript/ValueOf.d.ts +1 -1
- package/dist/column_format/interfaces/IChartGroupType.d.ts +1 -1
- package/dist/column_format/interfaces/IChartShelfType.d.ts +1 -1
- package/dist/column_format/interfaces/IChartTableType.d.ts +1 -1
- package/dist/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
- package/dist/column_format/interfaces/IFormatStringType.d.ts +1 -1
- package/dist/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
- package/dist/columns/interfaces/IColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/IColumnType.d.ts +1 -1
- package/dist/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/IComplexColumnType.d.ts +1 -1
- package/dist/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/ICompoundColumnType.d.ts +1 -1
- package/dist/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/INumericalColumnType.d.ts +1 -1
- package/dist/dates/adapters/ISOToNumericOffset.d.ts +6 -0
- package/dist/dates/adapters/ISOToNumericOffset.js +17 -0
- package/dist/dates/adapters/index.d.ts +2 -0
- package/dist/dates/adapters/index.js +2 -0
- package/dist/dates/adapters/numericOffsetToISO.d.ts +6 -0
- package/dist/dates/adapters/numericOffsetToISO.js +25 -0
- package/dist/dates/constants/ISO_8601_REGEX.d.ts +1 -0
- package/dist/dates/constants/ISO_8601_REGEX.js +1 -0
- package/dist/dates/constants/TIMEZONE_TYPE.d.ts +5 -0
- package/dist/dates/constants/TIMEZONE_TYPE.js +6 -0
- package/dist/dates/constants/index.d.ts +1 -0
- package/dist/dates/constants/index.js +1 -0
- package/dist/dates/helpers/getDateByTimezone.d.ts +8 -0
- package/dist/dates/helpers/getDateByTimezone.js +37 -0
- package/dist/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
- package/dist/dates/helpers/getDateByTimezoneOffset.js +18 -0
- package/dist/dates/helpers/getTimezoneObject.d.ts +10 -0
- package/dist/dates/helpers/getTimezoneObject.js +17 -0
- package/dist/dates/helpers/getTimezoneOffsetByType.d.ts +13 -0
- package/dist/dates/helpers/getTimezoneOffsetByType.js +23 -0
- package/dist/dates/helpers/index.d.ts +4 -1
- package/dist/dates/helpers/index.js +4 -1
- package/dist/dates/helpers/isValidISOOffset.d.ts +7 -0
- package/dist/dates/helpers/isValidISOOffset.js +13 -0
- package/dist/dates/interfaces/IBTimezone.d.ts +7 -0
- package/dist/dates/interfaces/IBTimezone.js +1 -0
- package/dist/dates/interfaces/IBTimezoneType.d.ts +2 -0
- package/dist/dates/interfaces/IBTimezoneType.js +1 -0
- package/dist/dates/interfaces/IDTimezone.d.ts +6 -0
- package/dist/dates/interfaces/IDTimezone.js +1 -0
- package/dist/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
- package/dist/dates/interfaces/IDTimezoneOffset.js +1 -0
- package/dist/dates/interfaces/IDTimezoneType.d.ts +2 -0
- package/dist/dates/interfaces/IDTimezoneType.js +1 -0
- package/dist/dates/interfaces/IDateFormat.d.ts +1 -1
- package/dist/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
- package/dist/dates/interfaces/IGetDateByTimezoneSettings.d.ts +6 -0
- package/dist/dates/interfaces/IGetDateByTimezoneSettings.js +1 -0
- package/dist/dates/interfaces/index.d.ts +6 -0
- package/dist/dates/interfaces/index.js +6 -0
- package/dist/dates/relative/helpers/parseDate.d.ts +2 -2
- package/dist/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
- package/dist/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
- package/dist/dates/relative/interfaces/RelativeInput.d.ts +1 -1
- package/dist/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
- package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
- package/dist/filters/helpers/common/excludeFiltersByParams.js +5 -5
- package/dist/filters/helpers/common/getFiltersByTimezone.d.ts +10 -0
- package/dist/filters/helpers/common/getFiltersByTimezone.js +22 -0
- package/dist/filters/helpers/common/index.d.ts +1 -0
- package/dist/filters/helpers/common/index.js +1 -0
- package/dist/filters/interfaces/IFDateProperty.d.ts +1 -1
- package/dist/filters/interfaces/IFDateSection.d.ts +1 -1
- package/dist/filters/interfaces/IFOperator.d.ts +1 -1
- package/dist/filters/interfaces/IFProperty.d.ts +1 -1
- package/dist/filters/interfaces/IFScope.d.ts +1 -1
- package/dist/filters/interfaces/IFSection.d.ts +1 -1
- package/dist/filters/interfaces/IFStructureType.d.ts +1 -1
- package/dist/filters/interfaces/IFValidator.d.ts +1 -1
- package/dist/filters/interfaces/IFValue.d.ts +1 -1
- package/dist/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
- package/dist/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
- package/dist/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
- package/dist/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
- package/dist/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
- package/dist/filters/interfaces/common/IFSColumn.d.ts +1 -1
- package/dist/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
- package/dist/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
- package/dist/filters/interfaces/common/IFilterConfig.d.ts +1 -1
- package/dist/filters/interfaces/panel/IFPAction.d.ts +1 -1
- package/dist/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
- package/dist/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
- package/dist/format/duration/durationFormatter.js +2 -1
- package/dist/format/format.d.ts +1 -1
- package/dist/format/format.js +10 -4
- package/dist/formulas/interfaces/IFormulaType.d.ts +1 -1
- package/dist/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
- package/dist/general/index.d.ts +1 -0
- package/dist/general/index.js +1 -0
- package/dist/general/mix/importScripts.d.ts +2 -2
- package/dist/general/numeric/getSign.d.ts +6 -0
- package/dist/general/numeric/getSign.js +8 -0
- package/dist/general/numeric/index.d.ts +1 -0
- package/dist/general/numeric/index.js +1 -0
- package/dist/general/object/applyTimezoneDeep.d.ts +8 -0
- package/dist/general/object/applyTimezoneDeep.js +44 -0
- package/dist/general/object/index.d.ts +1 -0
- package/dist/general/object/index.js +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
- package/dist/interfaces/Chart.Interface.d.ts +1 -1
- package/dist/interfaces/IChartBuilder.Interface.d.ts +1 -1
- package/dist/interfaces/Qrvey.Interface.d.ts +2 -2
- package/dist/interfaces/format/IFormatConfig.Interface.d.ts +1 -0
- package/dist/interfaces/general/IWidgetConfig.d.ts +2 -1
- package/dist/qrvey/helpers/transformValue.js +34 -6
- package/dist/qrvey/interfaces/IAppStatus.d.ts +1 -1
- package/dist/qrvey/interfaces/IAppType.d.ts +1 -1
- package/dist/qrvey/interfaces/IBDataset.d.ts +2 -0
- package/dist/qrvey/interfaces/IBModel.d.ts +5 -0
- package/dist/qrvey/interfaces/ICalculation.d.ts +1 -1
- package/dist/qrvey/interfaces/ICalculationType.d.ts +1 -1
- package/dist/qrvey/interfaces/IDataset.d.ts +3 -1
- package/dist/qrvey/interfaces/IModel.d.ts +3 -1
- package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +6 -0
- package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +2 -0
- package/dist/services/adapters/BModelToUIModel.adapter.js +2 -0
- package/dist/services/adapters/BTimezoneToUITimezone.d.ts +8 -0
- package/dist/services/adapters/BTimezoneToUITimezone.js +14 -0
- package/dist/services/helpers/Request.d.ts +1 -1
- package/dist/services/helpers/Request.js +11 -5
- package/dist/typescript/DeepPartial.d.ts +1 -1
- package/dist/typescript/DeepRequired.d.ts +1 -1
- package/dist/typescript/ValueOf.d.ts +1 -1
- package/package.json +20 -19
- package/dist/cjs/dates/helpers/adjustTimezone.d.ts +0 -6
- package/dist/cjs/dates/helpers/adjustTimezone.js +0 -19
- package/dist/dates/helpers/adjustTimezone.d.ts +0 -6
- package/dist/dates/helpers/adjustTimezone.js +0 -15
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_PANEL_ACTION } from "../../constants/panel/FILTER_PANEL_ACTION";
|
|
2
|
-
export
|
|
2
|
+
export type IFPAction = FILTER_PANEL_ACTION;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_PANEL_VIEW } from "../../constants/panel/FILTER_PANEL_VIEW";
|
|
2
|
-
export
|
|
2
|
+
export type IFPSettingsPanelView = FILTER_PANEL_VIEW;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { IDTimezone } from "../../../dates/interfaces/IDTimezone";
|
|
1
2
|
import { II18nConfig } from "../../../globalization/interfaces/II18nConfig";
|
|
2
3
|
import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nServiceTranslate";
|
|
3
4
|
export interface IFUTransformFilterValuesSettings {
|
|
5
|
+
timezone?: IDTimezone;
|
|
4
6
|
translate: II18nServiceTranslate;
|
|
5
7
|
i18n: II18nConfig;
|
|
6
8
|
suffixTranslateLabel?: string;
|
|
9
|
+
noLocale?: boolean;
|
|
10
|
+
noTranslate?: boolean;
|
|
11
|
+
noSuffix?: boolean;
|
|
12
|
+
noTimezone?: boolean;
|
|
7
13
|
}
|
|
@@ -101,7 +101,8 @@ export class DurationFormatter {
|
|
|
101
101
|
*/
|
|
102
102
|
parseFormatTemplate(template) {
|
|
103
103
|
this.template = isEmpty(template) ? "" : template;
|
|
104
|
-
|
|
104
|
+
const templateParts = this.template.match(PARTS_REGEX) || [];
|
|
105
|
+
return templateParts
|
|
105
106
|
.reduce((store, part) => {
|
|
106
107
|
const config = DURATION_PARTS[part[0]];
|
|
107
108
|
if (config)
|
package/dist/format/format.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IFormatConfig } from "../interfaces/format/IFormatConfig.Interface";
|
|
2
|
-
export declare function formatDate(dateString: any, format: any): any;
|
|
2
|
+
export declare function formatDate(dateString: any, format: any, offset: any): any;
|
|
3
3
|
export declare function formatAbbreviated(num: any, decimals: any): any;
|
|
4
4
|
/**
|
|
5
5
|
* Set convert Bytes into MB
|
package/dist/format/format.js
CHANGED
|
@@ -3,6 +3,7 @@ import dayjs from "dayjs";
|
|
|
3
3
|
import { DATEGROUP_FORMATTING_UNSUPPORT, appliesFormatting, hasfileSizeProperty, isTextColumn, DEFAULT_DATE, } from "./definition";
|
|
4
4
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
5
5
|
import advancedFormat from "dayjs/plugin/advancedFormat";
|
|
6
|
+
import utc from "dayjs/plugin/utc";
|
|
6
7
|
import { isEmpty } from "../general/mix/isEmpty";
|
|
7
8
|
import { _get } from "../general/object/get";
|
|
8
9
|
import { COLUMN } from "../columns/constants/COLUMN";
|
|
@@ -13,6 +14,7 @@ import { DURATION_PARTS_LIST } from "../column_format/constants/DURATION_PARTS_L
|
|
|
13
14
|
import { cloneDeep } from "../general/object/cloneDeep";
|
|
14
15
|
dayjs.extend(isoWeek); // Add support for iso week format https://github.com/iamkun/dayjs/issues/1328
|
|
15
16
|
dayjs.extend(advancedFormat); // Add support to advanced formats https://day.js.org/docs/en/plugin/advanced-format
|
|
17
|
+
dayjs.extend(utc);
|
|
16
18
|
/**
|
|
17
19
|
* Apply to the given date format to a date value
|
|
18
20
|
* @param bytes type number
|
|
@@ -21,7 +23,7 @@ function isValidDateString(dateString = "") {
|
|
|
21
23
|
return (/^\d{2}\/\d{2}\/\d{4}/.test(dateString) || // MM/DD/YYY OR DD/MM/YYYY
|
|
22
24
|
/^\d{4}-\d{2}-\d{2}/.test(dateString)); // YYYY-MM-DD
|
|
23
25
|
}
|
|
24
|
-
export function formatDate(dateString, format) {
|
|
26
|
+
export function formatDate(dateString, format, offset) {
|
|
25
27
|
let _format = cloneDeep(format);
|
|
26
28
|
if (isObject(format))
|
|
27
29
|
_format = _format.format || "";
|
|
@@ -29,8 +31,12 @@ export function formatDate(dateString, format) {
|
|
|
29
31
|
return dateString;
|
|
30
32
|
if (!isValidDateString(dateString))
|
|
31
33
|
return dateString;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
+
const dateStringCleaned = dateString === null || dateString === void 0 ? void 0 : dateString.replace(/Z$/i, "");
|
|
35
|
+
const firstPartOfDateString = dayjs(dateStringCleaned.split(".")[0]);
|
|
36
|
+
const newDateValue = !isEmpty(offset)
|
|
37
|
+
? firstPartOfDateString.utcOffset(offset)
|
|
38
|
+
: firstPartOfDateString;
|
|
39
|
+
return newDateValue.format(_format
|
|
34
40
|
.replace("HH24:", "HH:")
|
|
35
41
|
.replace("MI:SS", "mm:ss")
|
|
36
42
|
.replace("MM:SS", "mm:ss"));
|
|
@@ -135,7 +141,7 @@ export const addFormat = (value, outputFormat = "None", config) => {
|
|
|
135
141
|
: formatDate(value, (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Default" &&
|
|
136
142
|
((_c = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.originalFormat) === null || _c === void 0 ? void 0 : _c.format)
|
|
137
143
|
? (_d = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.originalFormat) === null || _d === void 0 ? void 0 : _d.format
|
|
138
|
-
: outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format);
|
|
144
|
+
: outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format, config === null || config === void 0 ? void 0 : config.offset);
|
|
139
145
|
case "NUMERIC": {
|
|
140
146
|
const parse = parseFloat(value);
|
|
141
147
|
const withLocale = (outputFormat !== "None" && (config === null || config === void 0 ? void 0 : config.lang)) ||
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FORMULA } from "../constants/FORMULA";
|
|
2
|
-
export
|
|
2
|
+
export type IFormulaType = FORMULA;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @returns the new array created.
|
|
15
15
|
*/
|
|
16
16
|
export declare function addPropertyToArrayOfObjects(obj: AddPropertyToArrayOfObjectsParams): any[];
|
|
17
|
-
|
|
17
|
+
type AddPropertyToArrayOfObjectsParams = {
|
|
18
18
|
array: any[];
|
|
19
19
|
property: string;
|
|
20
20
|
value: any;
|
package/dist/general/index.d.ts
CHANGED
package/dist/general/index.js
CHANGED
|
@@ -49,5 +49,5 @@ export interface IScriptItem {
|
|
|
49
49
|
noModule?: boolean;
|
|
50
50
|
type?: string;
|
|
51
51
|
}
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type TScriptItem = string | IScriptItem;
|
|
53
|
+
export type TScriptType = "text/javascript" | "module" | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./getSign";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./getSign";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
2
|
+
/**
|
|
3
|
+
* Transforms the date+times propertiesof the given object by the Timezone object
|
|
4
|
+
* @param {any} obj the object
|
|
5
|
+
* @param {IDTimezone} timezone the timezone object
|
|
6
|
+
* @returns {IFSData | IFUData} the new filter data with the transformed datetime values
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyTimezoneDeep(obj: any, timezone: IDTimezone): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DATE_FORMAT } from "../../dates/constants/DATE_FORMAT";
|
|
2
|
+
import { DATE_GROUPING_TIME_PROPERTY } from "../../dates/constants/DATE_GROUPING_TIME_PROPERTY";
|
|
3
|
+
import { getDateByTimezone } from "../../dates/helpers/getDateByTimezone";
|
|
4
|
+
import { validateDate } from "../../dates/helpers/validateDate";
|
|
5
|
+
import { isEmpty } from "../mix/isEmpty";
|
|
6
|
+
import { isObject } from "./isObject";
|
|
7
|
+
/**
|
|
8
|
+
* Transforms the date+times propertiesof the given object by the Timezone object
|
|
9
|
+
* @param {any} obj the object
|
|
10
|
+
* @param {IDTimezone} timezone the timezone object
|
|
11
|
+
* @returns {IFSData | IFUData} the new filter data with the transformed datetime values
|
|
12
|
+
*/
|
|
13
|
+
export function applyTimezoneDeep(obj, timezone) {
|
|
14
|
+
if (isEmpty(obj))
|
|
15
|
+
return obj;
|
|
16
|
+
let result;
|
|
17
|
+
if (isObject(obj)) {
|
|
18
|
+
result = {};
|
|
19
|
+
}
|
|
20
|
+
else if (Array.isArray(obj)) {
|
|
21
|
+
result = [];
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
for (const i in obj) {
|
|
25
|
+
if (isObject(obj[i]) || Array.isArray(obj[i])) {
|
|
26
|
+
result[i] = applyTimezoneDeep(obj[i], timezone);
|
|
27
|
+
}
|
|
28
|
+
else if (obj[i] instanceof Date ||
|
|
29
|
+
validateDate(obj[i], DATE_FORMAT.HOUR)) {
|
|
30
|
+
result[i] = getDateByTimezone(obj[i], {
|
|
31
|
+
property: DATE_GROUPING_TIME_PROPERTY.HOUR,
|
|
32
|
+
timezone,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
result[i] = obj[i];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
catch (_a) {
|
|
42
|
+
return obj;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
|
|
2
|
-
|
|
2
|
+
type FormatOptions = "small_multiples" | "conditional_formatting";
|
|
3
3
|
export declare const I18N_CHART_BUILDER_FORMAT_OPTIONS: Pick<II18nChartBuilder, FormatOptions>;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
|
|
2
|
-
|
|
2
|
+
type General = "nav_panel" | "save_dialog" | "save_incomplete_dialog" | "leave_dialog" | "custom_format_dialog" | "data_panel" | "dimensions" | "shelf_menu" | "scale_types" | "trend_chart" | "chart_info" | "dnd_zone" | "chart_labels" | "action_panel" | "messages_general" | "messages_default" | "messages_crosstab" | "messages_table_chart" | "messages_missing_default" | "messages_ms" | "messages_pie" | "messages_min_max" | "messages_metric" | "messages_heatmap" | "messages_geo" | "messages_geo_bubble" | "messages_box_whiskers" | "messages_combined";
|
|
3
3
|
export declare const I18N_CHART_BUILDER_GENERAL: Pick<II18nChartBuilder, General>;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
|
|
2
|
-
|
|
2
|
+
type GeneralOptions = "aggregated_formula" | "general_options" | "totals" | "legends" | "menu_actions" | "sorting" | "table_calculations" | "tooltip_settings";
|
|
3
3
|
export declare const I18N_CHART_BUILDER_GENERAL_OPTIONS: Pick<II18nChartBuilder, GeneralOptions>;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
|
|
2
|
-
|
|
2
|
+
type LayerOptions = "trends_line" | "references_line";
|
|
3
3
|
export declare const I18N_CHART_BUILDER_LAYER_OPTIONS: Pick<II18nChartBuilder, LayerOptions>;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
|
|
2
|
-
|
|
2
|
+
type StyleOptions = "style_options" | "color_settings" | "color_by_values" | "chart_orientation" | "axis_style" | "bar_types" | "line_style_options" | "symbol_style_options" | "chart_mode" | "category_labels" | "font_options" | "circle_size" | "gauge_style" | "target_config" | "table_header" | "table_body" | "resize_rows" | "custom_scale" | "gaps_options" | "base_map" | "map_region" | "table_style_options";
|
|
3
3
|
export declare const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOptions>;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
|
|
2
|
-
|
|
2
|
+
type TimePeriod = "time_period" | "time_period_custom_range";
|
|
3
3
|
export declare const I18N_CHART_BUILDER_TIME_PERIOD: Pick<II18nChartBuilder, TimePeriod>;
|
|
4
4
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CHART_TYPE } from "../constants/Charts.Const";
|
|
2
|
-
export
|
|
2
|
+
export type ChartType = CHART_TYPE;
|
|
@@ -26,7 +26,7 @@ export declare enum TIME_PERIOD {
|
|
|
26
26
|
ALL_HISTORY = "ALL_HISTORY",
|
|
27
27
|
CUSTOM_RANGE = "CUSTOM_RANGE"
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type TimePeriod = TIME_PERIOD;
|
|
30
30
|
export declare enum TP_CUSTOM_RANGE {
|
|
31
31
|
BEFORE = "BEFORE",
|
|
32
32
|
AFTER = "AFTER",
|
|
@@ -7,5 +7,5 @@ export interface IColumnCalculation {
|
|
|
7
7
|
type: string;
|
|
8
8
|
value: IColumnCalculationLabel;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type IColumnCalculationLabel = CALCULATION_LABEL;
|
|
11
|
+
export type IColumnCalculationAbbreviation = CALCULATION_ABBREVIATION;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
1
2
|
import { II18nConfig } from "../../globalization/interfaces/II18nConfig";
|
|
2
3
|
export interface IWidgetConfig {
|
|
3
4
|
appid?: string;
|
|
@@ -5,6 +6,6 @@ export interface IWidgetConfig {
|
|
|
5
6
|
domain: string;
|
|
6
7
|
i18n?: II18nConfig;
|
|
7
8
|
qv_token?: string;
|
|
8
|
-
|
|
9
|
+
timezone?: IDTimezone;
|
|
9
10
|
userid?: string;
|
|
10
11
|
}
|
|
@@ -7,6 +7,7 @@ import { addFormat } from "../../format/format";
|
|
|
7
7
|
import { isEmpty } from "../../general/mix/isEmpty";
|
|
8
8
|
import { getI18nDateGroupLabel } from "../../globalization/helpers/getI18nDateGroupLabel";
|
|
9
9
|
import { getValueWithSuffixes } from "./getValueWithSuffixes";
|
|
10
|
+
import { getDateByTimezone } from "../../dates/helpers/getDateByTimezone";
|
|
10
11
|
/**
|
|
11
12
|
* Transforms a value depending of localization/globalization and extras settings.
|
|
12
13
|
* @param value A value to transform
|
|
@@ -16,12 +17,39 @@ import { getValueWithSuffixes } from "./getValueWithSuffixes";
|
|
|
16
17
|
export function transformValue(value, settings) {
|
|
17
18
|
if (isEmpty(value))
|
|
18
19
|
return value;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const defaultSettings = getDefaultSettings(settings);
|
|
21
|
+
let timezonedValue = value;
|
|
22
|
+
if (!defaultSettings.noTimezone) {
|
|
23
|
+
timezonedValue = getDateByTimezone(value, {
|
|
24
|
+
property: defaultSettings.property,
|
|
25
|
+
timezone: defaultSettings.timezone,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
let valueWithI18n = timezonedValue;
|
|
29
|
+
if (!defaultSettings.noTranslate) {
|
|
30
|
+
valueWithI18n = getI18nDateGroupLabel(timezonedValue, defaultSettings.property, defaultSettings.translate);
|
|
31
|
+
}
|
|
32
|
+
let valueWithLocalization = valueWithI18n;
|
|
33
|
+
if (!defaultSettings.noLocale) {
|
|
34
|
+
valueWithLocalization = addFormat(valueWithI18n, getOutputFormat(settings), getFormatConfig(settings));
|
|
35
|
+
}
|
|
36
|
+
let valueWithSuffix = valueWithI18n;
|
|
37
|
+
if (!defaultSettings.noSuffix) {
|
|
38
|
+
valueWithSuffix = getValueWithSuffixes(valueWithLocalization, {
|
|
39
|
+
suffixTranslateLabel: defaultSettings.suffixTranslateLabel,
|
|
40
|
+
translate: defaultSettings.translate,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return valueWithSuffix;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Gets the default settings properties
|
|
47
|
+
* @param {ITransformValueSettings} settings the given settings
|
|
48
|
+
* @returns {ITransformValueSettings} the settings with default properties
|
|
49
|
+
*/
|
|
50
|
+
function getDefaultSettings(settings) {
|
|
51
|
+
var _a, _b, _c, _d;
|
|
52
|
+
return Object.assign(Object.assign({}, settings), { noLocale: (_a = settings === null || settings === void 0 ? void 0 : settings.noLocale) !== null && _a !== void 0 ? _a : false, noSuffix: (_b = settings === null || settings === void 0 ? void 0 : settings.noSuffix) !== null && _b !== void 0 ? _b : false, noTimezone: (_c = settings === null || settings === void 0 ? void 0 : settings.noTimezone) !== null && _c !== void 0 ? _c : false, noTranslate: (_d = settings === null || settings === void 0 ? void 0 : settings.noTranslate) !== null && _d !== void 0 ? _d : false });
|
|
25
53
|
}
|
|
26
54
|
/**
|
|
27
55
|
* Gets the outputformat settings
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { APP_STATUS } from "../constants/APP_STATUS";
|
|
2
|
-
export
|
|
2
|
+
export type IAppStatus = APP_STATUS;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { APP_TYPE } from "../constants/APP_TYPE";
|
|
2
|
-
export
|
|
2
|
+
export type IAppType = APP_TYPE;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IBColumn } from "../../columns/interfaces/IBColumn";
|
|
2
|
+
import { IBTimezone } from "../../dates/interfaces/IBTimezone";
|
|
2
3
|
/**
|
|
3
4
|
* Structure for Dataset in the frontend side of Qrvey App
|
|
4
5
|
*/
|
|
@@ -7,4 +8,5 @@ export interface IBDataset {
|
|
|
7
8
|
name?: string;
|
|
8
9
|
options?: IBColumn[];
|
|
9
10
|
qrveyid: string;
|
|
11
|
+
timezone?: IBTimezone;
|
|
10
12
|
}
|
|
@@ -2,11 +2,15 @@ import { IAppStatus } from "./IAppStatus";
|
|
|
2
2
|
import { IBModelBranchesMap } from "./IBModelBranchesMap";
|
|
3
3
|
import { IBModelData } from "./IBModelData";
|
|
4
4
|
import { IAppType } from "./IAppType";
|
|
5
|
+
import { IBTimezone } from "../../dates/interfaces/IBTimezone";
|
|
5
6
|
export interface IBModel {
|
|
6
7
|
appType: IAppType;
|
|
7
8
|
appid: string;
|
|
8
9
|
branchesMap?: IBModelBranchesMap[];
|
|
9
10
|
createDate: string;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Data Link feature is not longer supported
|
|
13
|
+
*/
|
|
10
14
|
datalinkInfo?: any[];
|
|
11
15
|
geoGroups?: any[];
|
|
12
16
|
modifyDate: string;
|
|
@@ -16,5 +20,6 @@ export interface IBModel {
|
|
|
16
20
|
questionOrder: string[];
|
|
17
21
|
questions: IBModelData;
|
|
18
22
|
status: IAppStatus;
|
|
23
|
+
timezone: IBTimezone;
|
|
19
24
|
userid: string;
|
|
20
25
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CALCULATION } from "../constants/CALCULATION";
|
|
2
|
-
export
|
|
2
|
+
export type ICalculation = CALCULATION;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CALCULATION } from "../constants/CALCULATION";
|
|
2
|
-
export
|
|
2
|
+
export type IColumnCalculationType = (typeof CALCULATION)[keyof typeof CALCULATION];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
|
+
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
2
3
|
import { IBDataset } from "./IBDataset";
|
|
3
4
|
/**
|
|
4
5
|
* Structure for Dataset in the frontend side of Qrvey App
|
|
5
6
|
*/
|
|
6
|
-
export interface IDataset extends Omit<IBDataset, "name" | "options"> {
|
|
7
|
+
export interface IDataset extends Omit<IBDataset, "name" | "options" | "timezone"> {
|
|
7
8
|
label?: string;
|
|
8
9
|
options?: IColumn[];
|
|
10
|
+
timezone?: IDTimezone;
|
|
9
11
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
|
+
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
2
3
|
import { IBModel } from "./IBModel";
|
|
3
4
|
import { IModelBranchesMap } from "./IModelBranchesMap";
|
|
4
|
-
export interface IModel extends Omit<IBModel, "questions" | "branchesMap" | "name" | "numResponses" | "questionOrder"> {
|
|
5
|
+
export interface IModel extends Omit<IBModel, "questions" | "branchesMap" | "name" | "numResponses" | "questionOrder" | "timezone"> {
|
|
5
6
|
columns: IColumn[];
|
|
6
7
|
columnOrder: string[];
|
|
7
8
|
branchesMap: IModelBranchesMap[];
|
|
8
9
|
label: string;
|
|
10
|
+
timezone: IDTimezone;
|
|
9
11
|
totalRecords: number;
|
|
10
12
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
2
|
import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
|
|
3
|
+
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
3
4
|
import { II18nConfig } from "../../globalization/interfaces/II18nConfig";
|
|
4
5
|
import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
|
|
5
6
|
export interface ITransformValueSettings {
|
|
6
7
|
column: IColumn;
|
|
7
8
|
property: IColumnPropertyType;
|
|
9
|
+
timezone?: IDTimezone;
|
|
8
10
|
translate: II18nServiceTranslate;
|
|
9
11
|
i18n: II18nConfig;
|
|
10
12
|
suffixTranslateLabel?: string;
|
|
13
|
+
noLocale?: boolean;
|
|
14
|
+
noTranslate?: boolean;
|
|
15
|
+
noSuffix?: boolean;
|
|
16
|
+
noTimezone?: boolean;
|
|
11
17
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { getAttribute } from "../../general/object/getAttribute";
|
|
2
2
|
import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
|
|
3
|
+
import { BTimezoneToUITimezone } from "./BTimezoneToUITimezone";
|
|
3
4
|
export function BDatasetsToUIDatasets(datasets = []) {
|
|
4
5
|
return datasets.map((dataset) => ({
|
|
5
6
|
qrveyid: getAttribute(dataset, "qrvey_id"),
|
|
6
7
|
label: dataset.name,
|
|
7
8
|
options: BColumnsToUIColumns(dataset.options, dataset),
|
|
9
|
+
timezone: BTimezoneToUITimezone(dataset.timezone),
|
|
8
10
|
}));
|
|
9
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
2
|
import { BBranchesMapToUIBranchesMap } from "./BBranchesMapToUIBranchesMap.adapter";
|
|
3
3
|
import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
|
|
4
|
+
import { BTimezoneToUITimezone } from "./BTimezoneToUITimezone";
|
|
4
5
|
export function BModelToUIModel(model) {
|
|
5
6
|
if (isEmpty(model))
|
|
6
7
|
return;
|
|
@@ -20,6 +21,7 @@ export function BModelToUIModel(model) {
|
|
|
20
21
|
totalRecords: model.numResponses,
|
|
21
22
|
qrveyid: model.qrveyid,
|
|
22
23
|
status: model.status,
|
|
24
|
+
timezone: BTimezoneToUITimezone(model.timezone),
|
|
23
25
|
userid: model.userid,
|
|
24
26
|
};
|
|
25
27
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IDTimezone } from "../../dates/interfaces/IDTimezone";
|
|
2
|
+
import { IBTimezone } from "../../dates/interfaces/IBTimezone";
|
|
3
|
+
/**
|
|
4
|
+
* Transforms the backenc timezone structure to UI timezone structure
|
|
5
|
+
* @param {IBTimezone} timezone the backend timezone object
|
|
6
|
+
* @returns {IDTimezone} the UI timezone object
|
|
7
|
+
*/
|
|
8
|
+
export declare function BTimezoneToUITimezone(timezone: IBTimezone): IDTimezone;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TIMEZONE_TYPE } from "../../dates/constants/TIMEZONE_TYPE";
|
|
2
|
+
import { getTimezoneOffsetByType } from "../../dates/helpers/getTimezoneOffsetByType";
|
|
3
|
+
/**
|
|
4
|
+
* Transforms the backenc timezone structure to UI timezone structure
|
|
5
|
+
* @param {IBTimezone} timezone the backend timezone object
|
|
6
|
+
* @returns {IDTimezone} the UI timezone object
|
|
7
|
+
*/
|
|
8
|
+
export function BTimezoneToUITimezone(timezone) {
|
|
9
|
+
const type = (timezone === null || timezone === void 0 ? void 0 : timezone.type) || TIMEZONE_TYPE.DEFAULT;
|
|
10
|
+
return {
|
|
11
|
+
type,
|
|
12
|
+
offset: getTimezoneOffsetByType(Object.assign(Object.assign({}, timezone), { type })),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -2,7 +2,7 @@ export default class Request {
|
|
|
2
2
|
static checkStatus(response: any): Promise<any>;
|
|
3
3
|
static hasQvToken(config: any): boolean;
|
|
4
4
|
static getQvToken(config: any): any;
|
|
5
|
-
static
|
|
5
|
+
static getTimezoneOffset(config: any): string;
|
|
6
6
|
static hasApiKey(config: any): boolean;
|
|
7
7
|
static getApiKey(config: any): any;
|
|
8
8
|
static makeUrl(config: any, url: any, params?: any): string;
|
|
@@ -7,6 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { numericOffsetToISO } from "../../dates/adapters/numericOffsetToISO";
|
|
11
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
10
12
|
import { getAttribute } from "../../general/object/getAttribute";
|
|
11
13
|
import { serialize } from "../../general/object/serialize";
|
|
12
14
|
import { parseUrl } from "../../general/string/parseUrl";
|
|
@@ -24,8 +26,12 @@ export default class Request {
|
|
|
24
26
|
static getQvToken(config) {
|
|
25
27
|
return getAttribute(config, "qv_token");
|
|
26
28
|
}
|
|
27
|
-
static
|
|
28
|
-
|
|
29
|
+
static getTimezoneOffset(config) {
|
|
30
|
+
var _a;
|
|
31
|
+
const timezoneOffset = (_a = config.timezone) === null || _a === void 0 ? void 0 : _a.offset;
|
|
32
|
+
if (!isEmpty(timezoneOffset)) {
|
|
33
|
+
return numericOffsetToISO(timezoneOffset);
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
static hasApiKey(config) {
|
|
31
37
|
return !!this.getApiKey(config);
|
|
@@ -68,9 +74,9 @@ export default class Request {
|
|
|
68
74
|
cfg.credentials = "include";
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
cfg.headers["q-timezone-control"] = `offset=${
|
|
77
|
+
const timezoneOffset = this.getTimezoneOffset(reqData.config);
|
|
78
|
+
if (timezoneOffset) {
|
|
79
|
+
cfg.headers["q-timezone-control"] = `offset=${timezoneOffset}`;
|
|
74
80
|
}
|
|
75
81
|
// AbortSignal (https://developers.google.com/web/updates/2017/09/abortable-fetch)
|
|
76
82
|
if (reqData.config && reqData.config.signal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ValueOf<T> = T[keyof T];
|