@qrvey/utils 1.11.0-1 → 1.11.0-1-features-0
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/cjs/columns/helpers/index.d.ts +1 -0
- package/dist/cjs/columns/helpers/index.js +1 -0
- package/dist/cjs/columns/helpers/isDurationColumn.d.ts +7 -0
- package/dist/cjs/columns/helpers/isDurationColumn.js +18 -0
- package/dist/cjs/columns/interfaces/IColumnPropertyType.d.ts +2 -1
- package/dist/cjs/dates/helpers/getTimezoneObject.js +1 -1
- package/dist/cjs/filters/adapters/FDToFlatUI.js +2 -1
- package/dist/cjs/filters/adapters/UIToOldLogic.js +1 -0
- package/dist/cjs/filters/adapters/logicToFlatUI.js +4 -4
- package/dist/cjs/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +2 -0
- package/dist/cjs/filters/helpers/backend/getBackendValues.js +3 -1
- package/dist/cjs/filters/helpers/common/adaptTimeUnitValuesFromFilters.d.ts +11 -0
- package/dist/cjs/filters/helpers/common/adaptTimeUnitValuesFromFilters.js +29 -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/helpers/common/resolveDatasetConditions.js +5 -0
- package/dist/cjs/filters/helpers/common/resolveFilterConditions.js +5 -0
- package/dist/cjs/filters/helpers/common/resolveScopeConditions.js +5 -0
- package/dist/cjs/filters/interfaces/OLD_IFilterDetail.d.ts +4 -0
- package/dist/cjs/filters/interfaces/builder/IFilterBuilderSettings.d.ts +5 -0
- package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilter.d.ts +2 -0
- package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.d.ts +9 -0
- package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.js +2 -0
- package/dist/cjs/filters/interfaces/common/index.d.ts +1 -0
- package/dist/cjs/filters/interfaces/common/index.js +1 -0
- package/dist/cjs/filters/interfaces/settings/IFSettingsFilterBuilder.d.ts +1 -0
- package/dist/cjs/filters/interfaces/settings/IFSettingsFilterPanel.d.ts +1 -0
- package/dist/cjs/format/definition.d.ts +1 -0
- package/dist/cjs/format/definition.js +2 -1
- package/dist/cjs/format/duration/convertTimeUnit.d.ts +15 -0
- package/dist/cjs/format/duration/convertTimeUnit.js +34 -0
- package/dist/cjs/format/duration/index.d.ts +1 -0
- package/dist/cjs/format/duration/index.js +1 -0
- package/dist/cjs/globalization/interfaces/common/I18nTimeUnitProperties.d.ts +10 -0
- package/dist/cjs/globalization/interfaces/common/I18nTimeUnitProperties.js +2 -0
- package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/common/index.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/common/index.js +1 -0
- package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.d.ts +1 -0
- package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/cjs/globalization/labels/common/I18N_TIME_UNITS.d.ts +2 -0
- package/dist/cjs/globalization/labels/common/I18N_TIME_UNITS.js +14 -0
- package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/qrvey/helpers/getPropertyLabel.d.ts +7 -0
- package/dist/cjs/qrvey/helpers/getPropertyLabel.js +14 -3
- package/dist/cjs/time/adapters/adaptTimeUnitNumbers.d.ts +9 -0
- package/dist/cjs/time/adapters/adaptTimeUnitNumbers.js +204 -0
- package/dist/cjs/time/adapters/daysToHours.d.ts +6 -0
- package/dist/cjs/time/adapters/daysToHours.js +22 -0
- package/dist/cjs/time/adapters/daysToMinutes.d.ts +6 -0
- package/dist/cjs/time/adapters/daysToMinutes.js +22 -0
- package/dist/cjs/time/adapters/daysToMonths.d.ts +6 -0
- package/dist/cjs/time/adapters/daysToMonths.js +22 -0
- package/dist/cjs/time/adapters/daysToSeconds.d.ts +6 -0
- package/dist/cjs/time/adapters/daysToSeconds.js +22 -0
- package/dist/cjs/time/adapters/daysToYears.d.ts +6 -0
- package/dist/cjs/time/adapters/daysToYears.js +22 -0
- package/dist/cjs/time/adapters/hoursToDays.d.ts +6 -0
- package/dist/cjs/time/adapters/hoursToDays.js +22 -0
- package/dist/cjs/time/adapters/hoursToMinutes.d.ts +6 -0
- package/dist/cjs/time/adapters/hoursToMinutes.js +22 -0
- package/dist/cjs/time/adapters/hoursToMonths.d.ts +6 -0
- package/dist/cjs/time/adapters/hoursToMonths.js +22 -0
- package/dist/cjs/time/adapters/hoursToSeconds.d.ts +6 -0
- package/dist/cjs/time/adapters/hoursToSeconds.js +22 -0
- package/dist/cjs/time/adapters/hoursToYears.d.ts +6 -0
- package/dist/cjs/time/adapters/hoursToYears.js +22 -0
- package/dist/cjs/time/adapters/index.d.ts +31 -0
- package/dist/cjs/time/adapters/index.js +47 -0
- package/dist/cjs/time/adapters/minutesToDays.d.ts +6 -0
- package/dist/cjs/time/adapters/minutesToDays.js +22 -0
- package/dist/cjs/time/adapters/minutesToHours.d.ts +6 -0
- package/dist/cjs/time/adapters/minutesToHours.js +22 -0
- package/dist/cjs/time/adapters/minutesToMonths.d.ts +6 -0
- package/dist/cjs/time/adapters/minutesToMonths.js +22 -0
- package/dist/cjs/time/adapters/minutesToSeconds.d.ts +6 -0
- package/dist/cjs/time/adapters/minutesToSeconds.js +22 -0
- package/dist/cjs/time/adapters/minutesToYears.d.ts +6 -0
- package/dist/cjs/time/adapters/minutesToYears.js +22 -0
- package/dist/cjs/time/adapters/monthsToDays.d.ts +6 -0
- package/dist/cjs/time/adapters/monthsToDays.js +22 -0
- package/dist/cjs/time/adapters/monthsToHours.d.ts +6 -0
- package/dist/cjs/time/adapters/monthsToHours.js +22 -0
- package/dist/cjs/time/adapters/monthsToMinutes.d.ts +6 -0
- package/dist/cjs/time/adapters/monthsToMinutes.js +22 -0
- package/dist/cjs/time/adapters/monthsToSeconds.d.ts +6 -0
- package/dist/cjs/time/adapters/monthsToSeconds.js +22 -0
- package/dist/cjs/time/adapters/monthsToYears.d.ts +6 -0
- package/dist/cjs/time/adapters/monthsToYears.js +22 -0
- package/dist/cjs/time/adapters/secondsToDays.d.ts +6 -0
- package/dist/cjs/time/adapters/secondsToDays.js +22 -0
- package/dist/cjs/time/adapters/secondsToHours.d.ts +6 -0
- package/dist/cjs/time/adapters/secondsToHours.js +22 -0
- package/dist/cjs/time/adapters/secondsToMinutes.d.ts +6 -0
- package/dist/cjs/time/adapters/secondsToMinutes.js +22 -0
- package/dist/cjs/time/adapters/secondsToMonths.d.ts +6 -0
- package/dist/cjs/time/adapters/secondsToMonths.js +22 -0
- package/dist/cjs/time/adapters/secondsToYears.d.ts +6 -0
- package/dist/cjs/time/adapters/secondsToYears.js +22 -0
- package/dist/cjs/time/adapters/yearsToDays.d.ts +6 -0
- package/dist/cjs/time/adapters/yearsToDays.js +22 -0
- package/dist/cjs/time/adapters/yearsToHours.d.ts +6 -0
- package/dist/cjs/time/adapters/yearsToHours.js +22 -0
- package/dist/cjs/time/adapters/yearsToMinutes.d.ts +6 -0
- package/dist/cjs/time/adapters/yearsToMinutes.js +22 -0
- package/dist/cjs/time/adapters/yearsToMonths.d.ts +6 -0
- package/dist/cjs/time/adapters/yearsToMonths.js +22 -0
- package/dist/cjs/time/adapters/yearsToSeconds.d.ts +6 -0
- package/dist/cjs/time/adapters/yearsToSeconds.js +22 -0
- package/dist/cjs/time/constants/TIME_UNIT_INFO.d.ts +5 -0
- package/dist/cjs/time/constants/TIME_UNIT_INFO.js +55 -0
- package/dist/cjs/time/constants/TIME_UNIT_INFO_LIST.d.ts +2 -0
- package/dist/cjs/time/constants/TIME_UNIT_INFO_LIST.js +13 -0
- package/dist/cjs/time/constants/TIME_UNIT_PROPERTY.d.ts +8 -0
- package/dist/cjs/time/constants/TIME_UNIT_PROPERTY.js +12 -0
- package/dist/cjs/time/constants/TIME_UNIT_PROPERTY_LABEL.d.ts +8 -0
- package/dist/cjs/time/constants/TIME_UNIT_PROPERTY_LABEL.js +12 -0
- package/dist/cjs/time/constants/index.d.ts +4 -0
- package/dist/cjs/time/constants/index.js +20 -0
- package/dist/cjs/time/index.d.ts +3 -0
- package/dist/cjs/time/index.js +19 -0
- package/dist/cjs/time/interfaces/ITimeUnitProperty.d.ts +2 -0
- package/dist/cjs/time/interfaces/ITimeUnitProperty.js +2 -0
- package/dist/cjs/time/interfaces/ITimeUnitPropertyInfo.d.ts +5 -0
- package/dist/cjs/time/interfaces/ITimeUnitPropertyInfo.js +2 -0
- package/dist/cjs/time/interfaces/index.d.ts +2 -0
- package/dist/cjs/time/interfaces/index.js +18 -0
- package/dist/columns/helpers/index.d.ts +1 -0
- package/dist/columns/helpers/index.js +1 -0
- package/dist/columns/helpers/isDurationColumn.d.ts +7 -0
- package/dist/columns/helpers/isDurationColumn.js +14 -0
- package/dist/columns/interfaces/IColumnPropertyType.d.ts +2 -1
- package/dist/dates/helpers/getTimezoneObject.js +1 -1
- package/dist/filters/adapters/FDToFlatUI.js +2 -1
- package/dist/filters/adapters/UIToOldLogic.js +1 -0
- package/dist/filters/adapters/logicToFlatUI.js +4 -4
- package/dist/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +2 -0
- package/dist/filters/helpers/backend/getBackendValues.js +3 -1
- package/dist/filters/helpers/common/adaptTimeUnitValuesFromFilters.d.ts +11 -0
- package/dist/filters/helpers/common/adaptTimeUnitValuesFromFilters.js +25 -0
- package/dist/filters/helpers/common/index.d.ts +1 -0
- package/dist/filters/helpers/common/index.js +1 -0
- package/dist/filters/helpers/common/resolveDatasetConditions.js +5 -0
- package/dist/filters/helpers/common/resolveFilterConditions.js +5 -0
- package/dist/filters/helpers/common/resolveScopeConditions.js +5 -0
- package/dist/filters/interfaces/OLD_IFilterDetail.d.ts +4 -0
- package/dist/filters/interfaces/builder/IFilterBuilderSettings.d.ts +5 -0
- package/dist/filters/interfaces/common/IFSParamsToGetFilter.d.ts +2 -0
- package/dist/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.d.ts +9 -0
- package/dist/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.js +1 -0
- package/dist/filters/interfaces/common/index.d.ts +1 -0
- package/dist/filters/interfaces/common/index.js +1 -0
- package/dist/filters/interfaces/settings/IFSettingsFilterBuilder.d.ts +1 -0
- package/dist/filters/interfaces/settings/IFSettingsFilterPanel.d.ts +1 -0
- package/dist/format/definition.d.ts +1 -0
- package/dist/format/definition.js +1 -0
- package/dist/format/duration/convertTimeUnit.d.ts +15 -0
- package/dist/format/duration/convertTimeUnit.js +27 -0
- package/dist/format/duration/index.d.ts +1 -0
- package/dist/format/duration/index.js +1 -0
- package/dist/globalization/interfaces/common/I18nTimeUnitProperties.d.ts +10 -0
- package/dist/globalization/interfaces/common/I18nTimeUnitProperties.js +1 -0
- package/dist/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/globalization/interfaces/common/index.d.ts +1 -0
- package/dist/globalization/interfaces/common/index.js +1 -0
- package/dist/globalization/interfaces/tabular_view/II18nTabularView.d.ts +1 -0
- package/dist/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/globalization/labels/common/I18N_TIME_UNITS.d.ts +2 -0
- package/dist/globalization/labels/common/I18N_TIME_UNITS.js +11 -0
- package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/qrvey/helpers/getPropertyLabel.d.ts +7 -0
- package/dist/qrvey/helpers/getPropertyLabel.js +14 -3
- package/dist/time/adapters/adaptTimeUnitNumbers.d.ts +9 -0
- package/dist/time/adapters/adaptTimeUnitNumbers.js +200 -0
- package/dist/time/adapters/daysToHours.d.ts +6 -0
- package/dist/time/adapters/daysToHours.js +15 -0
- package/dist/time/adapters/daysToMinutes.d.ts +6 -0
- package/dist/time/adapters/daysToMinutes.js +15 -0
- package/dist/time/adapters/daysToMonths.d.ts +6 -0
- package/dist/time/adapters/daysToMonths.js +15 -0
- package/dist/time/adapters/daysToSeconds.d.ts +6 -0
- package/dist/time/adapters/daysToSeconds.js +15 -0
- package/dist/time/adapters/daysToYears.d.ts +6 -0
- package/dist/time/adapters/daysToYears.js +15 -0
- package/dist/time/adapters/hoursToDays.d.ts +6 -0
- package/dist/time/adapters/hoursToDays.js +15 -0
- package/dist/time/adapters/hoursToMinutes.d.ts +6 -0
- package/dist/time/adapters/hoursToMinutes.js +15 -0
- package/dist/time/adapters/hoursToMonths.d.ts +6 -0
- package/dist/time/adapters/hoursToMonths.js +15 -0
- package/dist/time/adapters/hoursToSeconds.d.ts +6 -0
- package/dist/time/adapters/hoursToSeconds.js +15 -0
- package/dist/time/adapters/hoursToYears.d.ts +6 -0
- package/dist/time/adapters/hoursToYears.js +15 -0
- package/dist/time/adapters/index.d.ts +31 -0
- package/dist/time/adapters/index.js +31 -0
- package/dist/time/adapters/minutesToDays.d.ts +6 -0
- package/dist/time/adapters/minutesToDays.js +15 -0
- package/dist/time/adapters/minutesToHours.d.ts +6 -0
- package/dist/time/adapters/minutesToHours.js +15 -0
- package/dist/time/adapters/minutesToMonths.d.ts +6 -0
- package/dist/time/adapters/minutesToMonths.js +15 -0
- package/dist/time/adapters/minutesToSeconds.d.ts +6 -0
- package/dist/time/adapters/minutesToSeconds.js +15 -0
- package/dist/time/adapters/minutesToYears.d.ts +6 -0
- package/dist/time/adapters/minutesToYears.js +15 -0
- package/dist/time/adapters/monthsToDays.d.ts +6 -0
- package/dist/time/adapters/monthsToDays.js +15 -0
- package/dist/time/adapters/monthsToHours.d.ts +6 -0
- package/dist/time/adapters/monthsToHours.js +15 -0
- package/dist/time/adapters/monthsToMinutes.d.ts +6 -0
- package/dist/time/adapters/monthsToMinutes.js +15 -0
- package/dist/time/adapters/monthsToSeconds.d.ts +6 -0
- package/dist/time/adapters/monthsToSeconds.js +15 -0
- package/dist/time/adapters/monthsToYears.d.ts +6 -0
- package/dist/time/adapters/monthsToYears.js +15 -0
- package/dist/time/adapters/secondsToDays.d.ts +6 -0
- package/dist/time/adapters/secondsToDays.js +15 -0
- package/dist/time/adapters/secondsToHours.d.ts +6 -0
- package/dist/time/adapters/secondsToHours.js +15 -0
- package/dist/time/adapters/secondsToMinutes.d.ts +6 -0
- package/dist/time/adapters/secondsToMinutes.js +15 -0
- package/dist/time/adapters/secondsToMonths.d.ts +6 -0
- package/dist/time/adapters/secondsToMonths.js +15 -0
- package/dist/time/adapters/secondsToYears.d.ts +6 -0
- package/dist/time/adapters/secondsToYears.js +15 -0
- package/dist/time/adapters/yearsToDays.d.ts +6 -0
- package/dist/time/adapters/yearsToDays.js +15 -0
- package/dist/time/adapters/yearsToHours.d.ts +6 -0
- package/dist/time/adapters/yearsToHours.js +15 -0
- package/dist/time/adapters/yearsToMinutes.d.ts +6 -0
- package/dist/time/adapters/yearsToMinutes.js +15 -0
- package/dist/time/adapters/yearsToMonths.d.ts +6 -0
- package/dist/time/adapters/yearsToMonths.js +15 -0
- package/dist/time/adapters/yearsToSeconds.d.ts +6 -0
- package/dist/time/adapters/yearsToSeconds.js +15 -0
- package/dist/time/constants/TIME_UNIT_INFO.d.ts +5 -0
- package/dist/time/constants/TIME_UNIT_INFO.js +52 -0
- package/dist/time/constants/TIME_UNIT_INFO_LIST.d.ts +2 -0
- package/dist/time/constants/TIME_UNIT_INFO_LIST.js +10 -0
- package/dist/time/constants/TIME_UNIT_PROPERTY.d.ts +8 -0
- package/dist/time/constants/TIME_UNIT_PROPERTY.js +9 -0
- package/dist/time/constants/TIME_UNIT_PROPERTY_LABEL.d.ts +8 -0
- package/dist/time/constants/TIME_UNIT_PROPERTY_LABEL.js +9 -0
- package/dist/time/constants/index.d.ts +4 -0
- package/dist/time/constants/index.js +4 -0
- package/dist/time/index.d.ts +3 -0
- package/dist/time/index.js +3 -0
- package/dist/time/interfaces/ITimeUnitProperty.d.ts +2 -0
- package/dist/time/interfaces/ITimeUnitProperty.js +1 -0
- package/dist/time/interfaces/ITimeUnitPropertyInfo.d.ts +5 -0
- package/dist/time/interfaces/ITimeUnitPropertyInfo.js +1 -0
- package/dist/time/interfaces/index.d.ts +2 -0
- package/dist/time/interfaces/index.js +2 -0
- package/package.json +1 -1
|
@@ -20,4 +20,5 @@ __exportStar(require("./getDatasetColumnByDatasets"), exports);
|
|
|
20
20
|
__exportStar(require("./getModelColumn"), exports);
|
|
21
21
|
__exportStar(require("./isComplexColumn"), exports);
|
|
22
22
|
__exportStar(require("./isDateColumn"), exports);
|
|
23
|
+
__exportStar(require("./isDurationColumn"), exports);
|
|
23
24
|
__exportStar(require("./isNumericalColumn"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IColumn } from "../interfaces/IColumn";
|
|
2
|
+
/**
|
|
3
|
+
* It checks if the given column has a duration format.
|
|
4
|
+
* @param {IColumn} A UI Column object
|
|
5
|
+
* @returns true: the column is a duration type
|
|
6
|
+
*/
|
|
7
|
+
export declare const isDurationColumn: (column: IColumn) => boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDurationColumn = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const DURATION_PARTS_LIST_1 = require("../../column_format/constants/DURATION_PARTS_LIST");
|
|
6
|
+
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
7
|
+
/**
|
|
8
|
+
* It checks if the given column has a duration format.
|
|
9
|
+
* @param {IColumn} A UI Column object
|
|
10
|
+
* @returns true: the column is a duration type
|
|
11
|
+
*/
|
|
12
|
+
const isDurationColumn = (column) => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (!(0, isEmpty_1.isEmpty)(column) &&
|
|
15
|
+
(0, __1.isNumericalColumn)(column) &&
|
|
16
|
+
DURATION_PARTS_LIST_1.DURATION_PARTS_LIST.includes((_a = column.outputFormat) === null || _a === void 0 ? void 0 : _a.format));
|
|
17
|
+
};
|
|
18
|
+
exports.isDurationColumn = isDurationColumn;
|
|
@@ -2,4 +2,5 @@ import { ICompoundColumnPropertyType } from "./ICompoundColumnPropertyType";
|
|
|
2
2
|
import { IDateColumnPropertyType } from "./IDateColumnPropertyType";
|
|
3
3
|
import { COLUMN_PROPERTY } from "../constants/COLUMN_PROPERTY";
|
|
4
4
|
import { IComplexColumnPropertyType } from "./IComplexColumnPropertyType";
|
|
5
|
-
|
|
5
|
+
import { ITimeUnitProperty } from "../../time/interfaces/ITimeUnitProperty";
|
|
6
|
+
export type IColumnPropertyType = COLUMN_PROPERTY | IComplexColumnPropertyType | ICompoundColumnPropertyType | IDateColumnPropertyType | ITimeUnitProperty;
|
|
@@ -90,7 +90,7 @@ function getType(timezone, model, offset) {
|
|
|
90
90
|
* @returns {IDTimezoneType} the right timezone type for the offset
|
|
91
91
|
*/
|
|
92
92
|
function getTypeByOffset(offset) {
|
|
93
|
-
if (offset === "+00:00") {
|
|
93
|
+
if (offset === "+00:00" || offset === "00:00" || offset === "-00:00") {
|
|
94
94
|
return TIMEZONE_TYPE_1.TIMEZONE_TYPE.DEFAULT;
|
|
95
95
|
}
|
|
96
96
|
else if (offset === "browser") {
|
|
@@ -40,6 +40,7 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
40
40
|
scope.datasets.forEach((dataset) => {
|
|
41
41
|
if (dataset.filters.length > 0) {
|
|
42
42
|
dataset.filters.forEach((filter) => {
|
|
43
|
+
var _a;
|
|
43
44
|
const datasetInfo = datasetsInfo.find((dInfo) => dInfo.qrveyid === dataset.qrveyid);
|
|
44
45
|
let columnInfo;
|
|
45
46
|
if (!(0, isEmpty_1.isEmpty)(datasetInfo))
|
|
@@ -65,7 +66,7 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
65
66
|
type: (columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.type) || filter.column.type,
|
|
66
67
|
},
|
|
67
68
|
dateSection: filter.dateSection,
|
|
68
|
-
displayed: filter.displayed,
|
|
69
|
+
displayed: (_a = filter.displayed) !== null && _a !== void 0 ? _a : true,
|
|
69
70
|
enabled: filter.enabled,
|
|
70
71
|
extras: Object.assign(Object.assign({}, filter.extras), { panelid: filter.extras.panelid, filterLabel: filter.extras.filterLabel, info, scope: filter.extras.scope, scopeid: filter.extras.scopeid, section: filter.extras.section, scopeInfo: {
|
|
71
72
|
collapsed: scope.collapsed,
|
|
@@ -136,5 +136,6 @@ const getFilterDetail = (filter, scope, dataset) => {
|
|
|
136
136
|
uiValue: (0, getUIValues_1.getUIValues)(filter, { addEnableds: true }),
|
|
137
137
|
validator: filter.validator,
|
|
138
138
|
values: (0, adaptFilterValues_1.adaptFilterValues)(filter),
|
|
139
|
+
_newFilters: Object.assign({}, filter),
|
|
139
140
|
};
|
|
140
141
|
};
|
|
@@ -65,7 +65,7 @@ function buildFilterByExpression(expression, scopeItem, uFilters) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
function getFilterByExpression(expression, scopeItem) {
|
|
68
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
69
69
|
const uiExtras = expression.uiExtras;
|
|
70
70
|
const scopeid = scopeItem.scope !== FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL
|
|
71
71
|
? (0, get_1._get)(scopeItem, "uiExtras.scopeid")
|
|
@@ -91,11 +91,11 @@ function getFilterByExpression(expression, scopeItem) {
|
|
|
91
91
|
type: (_l = uiExtras.column) === null || _l === void 0 ? void 0 : _l.type,
|
|
92
92
|
},
|
|
93
93
|
dateSection: uiExtras.dateSection,
|
|
94
|
-
displayed: true,
|
|
94
|
+
displayed: (_o = (_m = uiExtras._newFilters) === null || _m === void 0 ? void 0 : _m.displayed) !== null && _o !== void 0 ? _o : true,
|
|
95
95
|
enabled: uiExtras.enabled,
|
|
96
96
|
extras: Object.assign(Object.assign({}, uiExtras.extras), { panelid: uiExtras.panelid, filterLabel: uiExtras.panelName, info,
|
|
97
97
|
scopeid, scope: scopeItem.scope, section: uiExtras.section, scopeInfo: {
|
|
98
|
-
collapsed: (
|
|
98
|
+
collapsed: (_p = scopeItem.uiExtras) === null || _p === void 0 ? void 0 : _p.collapsed,
|
|
99
99
|
enabled: scopeItem.enabled,
|
|
100
100
|
displayed: true,
|
|
101
101
|
scope: scopeItem.scope,
|
|
@@ -104,7 +104,7 @@ function getFilterByExpression(expression, scopeItem) {
|
|
|
104
104
|
collapsed: false,
|
|
105
105
|
enabled: true,
|
|
106
106
|
displayed: true,
|
|
107
|
-
qrveyid: (
|
|
107
|
+
qrveyid: (_q = uiExtras.column) === null || _q === void 0 ? void 0 : _q.qrveyid,
|
|
108
108
|
label: (0, get_1._get)(uiExtras.column, "dataset.name") ||
|
|
109
109
|
(0, get_1._get)(uiExtras.column, "label"),
|
|
110
110
|
} }),
|
|
@@ -12,6 +12,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
12
12
|
filterBuilder: {
|
|
13
13
|
scopeSelectorDisplayed: true,
|
|
14
14
|
scopeSelectorEnabled: true,
|
|
15
|
+
strictlyInteractivity: false,
|
|
15
16
|
},
|
|
16
17
|
filterDisplayer: {
|
|
17
18
|
addFilterDisplayed: true,
|
|
@@ -74,6 +75,7 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
74
75
|
},
|
|
75
76
|
iconsDisplayed: true,
|
|
76
77
|
readonly: false,
|
|
78
|
+
strictlyInteractivity: false,
|
|
77
79
|
updateFilterInfo: true,
|
|
78
80
|
},
|
|
79
81
|
filterPanelSettings: {
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getBackendValues = void 0;
|
|
4
4
|
const COLUMN_1 = require("../../../columns/constants/COLUMN");
|
|
5
5
|
const flattenDeep_1 = require("../../../general/array/flattenDeep");
|
|
6
|
+
const time_1 = require("../../../time");
|
|
6
7
|
const FILTER_VALIDATOR_1 = require("../../constants/common/FILTER_VALIDATOR");
|
|
7
8
|
const FILTER_VALIDATOR_INFO_1 = require("../../constants/common/FILTER_VALIDATOR_INFO");
|
|
9
|
+
const adaptTimeUnitValuesFromFilters_1 = require("../common/adaptTimeUnitValuesFromFilters");
|
|
8
10
|
const isRankingFilter_1 = require("../common/isRankingFilter");
|
|
9
11
|
/**
|
|
10
12
|
* Gets the expresion values in the logic format
|
|
@@ -12,7 +14,7 @@ const isRankingFilter_1 = require("../common/isRankingFilter");
|
|
|
12
14
|
* @returns A collection of backend expression value
|
|
13
15
|
*/
|
|
14
16
|
function getBackendValues(filter) {
|
|
15
|
-
const values =
|
|
17
|
+
const values = (0, adaptTimeUnitValuesFromFilters_1.adaptTimeUnitValuesFromFilters)(time_1.TIME_UNIT_PROPERTY.SECOND, filter) || [];
|
|
16
18
|
switch (filter.validator) {
|
|
17
19
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.EQUALS:
|
|
18
20
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.NOT_EQUAL:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ITimeUnitProperty } from "../../../time/interfaces/ITimeUnitProperty";
|
|
2
|
+
import { IFValue } from "../../interfaces";
|
|
3
|
+
import { IFSFilter } from "../../interfaces/common/IFSFilter";
|
|
4
|
+
/**
|
|
5
|
+
* Converts the Filter values to the given time unit
|
|
6
|
+
* It is only happening when the filter column format is a duration type
|
|
7
|
+
* @param {ITimeUnitProperty} to a time unit
|
|
8
|
+
* @param {IFSFilter} filter the filter object
|
|
9
|
+
* @returns the converted filter values
|
|
10
|
+
*/
|
|
11
|
+
export declare function adaptTimeUnitValuesFromFilters(to: ITimeUnitProperty, filter: IFSFilter): IFValue[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adaptTimeUnitValuesFromFilters = void 0;
|
|
4
|
+
const isDurationColumn_1 = require("../../../columns/helpers/isDurationColumn");
|
|
5
|
+
const general_1 = require("../../../general");
|
|
6
|
+
const adaptTimeUnitNumbers_1 = require("../../../time/adapters/adaptTimeUnitNumbers");
|
|
7
|
+
const isRangeValidator_1 = require("./isRangeValidator");
|
|
8
|
+
const isRegularValidator_1 = require("./isRegularValidator");
|
|
9
|
+
/**
|
|
10
|
+
* Converts the Filter values to the given time unit
|
|
11
|
+
* It is only happening when the filter column format is a duration type
|
|
12
|
+
* @param {ITimeUnitProperty} to a time unit
|
|
13
|
+
* @param {IFSFilter} filter the filter object
|
|
14
|
+
* @returns the converted filter values
|
|
15
|
+
*/
|
|
16
|
+
function adaptTimeUnitValuesFromFilters(to, filter) {
|
|
17
|
+
if ((0, general_1.isEmpty)(filter) || (0, general_1.isEmpty)(to))
|
|
18
|
+
return filter.values;
|
|
19
|
+
if ((0, isDurationColumn_1.isDurationColumn)(filter.column)) {
|
|
20
|
+
if ((0, isRangeValidator_1.isRangeValidator)(filter.validator)) {
|
|
21
|
+
return filter.values.map((value) => (Object.assign(Object.assign({}, value), { max: String((0, adaptTimeUnitNumbers_1.adaptTimeUnitNumbers)(filter.property, to, Number(value.max))), min: String((0, adaptTimeUnitNumbers_1.adaptTimeUnitNumbers)(filter.property, to, Number(value.min))) })));
|
|
22
|
+
}
|
|
23
|
+
else if ((0, isRegularValidator_1.isRegularValidator)(filter.validator)) {
|
|
24
|
+
return filter.values.map((value) => (Object.assign(Object.assign({}, value), { value: String((0, adaptTimeUnitNumbers_1.adaptTimeUnitNumbers)(filter.property, to, Number(value.value))) })));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return filter.values;
|
|
28
|
+
}
|
|
29
|
+
exports.adaptTimeUnitValuesFromFilters = adaptTimeUnitValuesFromFilters;
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./adaptTimeUnitValuesFromFilters"), exports);
|
|
17
18
|
__exportStar(require("./areFiltersEquals"), exports);
|
|
18
19
|
__exportStar(require("./excludeFiltersByAggregateColumn"), exports);
|
|
19
20
|
__exportStar(require("./excludeFiltersByParams"), exports);
|
|
@@ -17,6 +17,11 @@ function resolveDatasetConditions(dataset, params, letPassUndefinedProperties =
|
|
|
17
17
|
(letPassUndefinedProperties && dataset.enabled == null) ||
|
|
18
18
|
(letPassUndefinedParams && params.enableds.datasets == null) ||
|
|
19
19
|
params.enableds.datasets === dataset.enabled) &&
|
|
20
|
+
(!(0, hasProperty_1._hasProperty)(params, "displayeds") ||
|
|
21
|
+
!(0, hasProperty_1._hasProperty)(params.displayeds, "datasets") ||
|
|
22
|
+
(letPassUndefinedProperties && dataset.displayed == null) ||
|
|
23
|
+
(letPassUndefinedParams && params.displayeds.datasets == null) ||
|
|
24
|
+
params.displayeds.datasets === dataset.displayed) &&
|
|
20
25
|
(!(0, hasProperty_1._hasProperty)(params, "qrveyid") ||
|
|
21
26
|
(letPassUndefinedProperties && dataset.qrveyid == null) ||
|
|
22
27
|
(letPassUndefinedParams && (0, isEmpty_1.isEmpty)(params.qrveyid)) ||
|
|
@@ -18,6 +18,11 @@ function resolveFilterConditions(filter, params, letPassUndefinedProperties = fa
|
|
|
18
18
|
(letPassUndefinedProperties && filter.enabled == null) ||
|
|
19
19
|
(letPassUndefinedParams && params.enableds.filters == null) ||
|
|
20
20
|
params.enableds.filters === filter.enabled) &&
|
|
21
|
+
(!(0, hasProperty_1._hasProperty)(params, "displayeds") ||
|
|
22
|
+
!(0, hasProperty_1._hasProperty)(params.displayeds, "filters") ||
|
|
23
|
+
(letPassUndefinedProperties && filter.displayed == null) ||
|
|
24
|
+
(letPassUndefinedParams && params.displayeds.filters == null) ||
|
|
25
|
+
params.displayeds.filters === filter.displayed) &&
|
|
21
26
|
(!(0, hasProperty_1._hasProperty)(params, "dateSection") ||
|
|
22
27
|
(letPassUndefinedProperties && filter.dateSection == null) ||
|
|
23
28
|
(letPassUndefinedParams && (0, isEmpty_1.isEmpty)(params.dateSection)) ||
|
|
@@ -17,6 +17,11 @@ function resolveScopeConditions(scope, params, letPassUndefinedProperties = fals
|
|
|
17
17
|
(letPassUndefinedProperties && scope.enabled == null) ||
|
|
18
18
|
(letPassUndefinedParams && params.enableds.scopes == null) ||
|
|
19
19
|
params.enableds.scopes === scope.enabled) &&
|
|
20
|
+
(!(0, hasProperty_1._hasProperty)(params, "displayeds") ||
|
|
21
|
+
!(0, hasProperty_1._hasProperty)(params.displayeds, "scopes") ||
|
|
22
|
+
(letPassUndefinedProperties && scope.displayed == null) ||
|
|
23
|
+
(letPassUndefinedParams && params.displayeds.scopes == null) ||
|
|
24
|
+
params.displayeds.scopes === scope.displayed) &&
|
|
20
25
|
(!(0, hasProperty_1._hasProperty)(params, "scope") ||
|
|
21
26
|
(letPassUndefinedProperties && scope.scope == null) ||
|
|
22
27
|
(letPassUndefinedParams && (0, isEmpty_1.isEmpty)(params.scope)) ||
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
2
|
import { IDataset } from "../../qrvey/interfaces/IDataset";
|
|
3
|
+
import { IFSFilter } from "./common/IFSFilter";
|
|
3
4
|
import { IFSFilterExtrasInfo } from "./common/IFSFilterExtrasInfo";
|
|
4
5
|
import { IFDateSection } from "./IFDateSection";
|
|
5
6
|
import { IFOperator } from "./IFOperator";
|
|
@@ -9,6 +10,8 @@ import { IFSection } from "./IFSection";
|
|
|
9
10
|
import { IFValidator } from "./IFValidator";
|
|
10
11
|
import { IFValue } from "./IFValue";
|
|
11
12
|
import { IFUChartSettings } from "./ui/IFUChartSettings";
|
|
13
|
+
import { IFUFilter } from "./ui/IFUFilter";
|
|
14
|
+
import { IFUFlattenedFilter } from "./ui/IFUFlattenedFilter";
|
|
12
15
|
import { IFUValue } from "./ui/IFUValue";
|
|
13
16
|
export interface OLD_IFilterDetail {
|
|
14
17
|
column?: Omit<IColumn, "label"> & {
|
|
@@ -44,4 +47,5 @@ export interface OLD_IFilterDetail {
|
|
|
44
47
|
section?: IFSection;
|
|
45
48
|
groupValue?: IFProperty;
|
|
46
49
|
extras?: any;
|
|
50
|
+
_newFilters?: IFUFilter | IFSFilter | IFUFlattenedFilter;
|
|
47
51
|
}
|
|
@@ -8,4 +8,9 @@ export interface IFilterBuilderSettings {
|
|
|
8
8
|
chart?: IFUChartSettings;
|
|
9
9
|
mode?: FILTER_FLOW;
|
|
10
10
|
returningFilterStructureType?: IFStructureType;
|
|
11
|
+
displayed?: boolean;
|
|
12
|
+
displayable?: boolean;
|
|
13
|
+
deletable?: boolean;
|
|
14
|
+
editable?: boolean;
|
|
15
|
+
enableable?: boolean;
|
|
11
16
|
}
|
|
@@ -4,6 +4,7 @@ import { IFScope } from "../IFScope";
|
|
|
4
4
|
import { IFValidator } from "../IFValidator";
|
|
5
5
|
import { IFUChartSettings } from "../ui/IFUChartSettings";
|
|
6
6
|
import { IFSColumn } from "./IFSColumn";
|
|
7
|
+
import { IFSParamsToGetFilterDisplayeds } from "./IFSParamsToGetFilterDisplayeds";
|
|
7
8
|
import { IFSParamsToGetFilterEnableds } from "./IFSParamsToGetFilterEnableds";
|
|
8
9
|
/**
|
|
9
10
|
* Structure for filter properties
|
|
@@ -11,6 +12,7 @@ import { IFSParamsToGetFilterEnableds } from "./IFSParamsToGetFilterEnableds";
|
|
|
11
12
|
export interface IFSParamsToGetFilter {
|
|
12
13
|
column?: Partial<IFSColumn>;
|
|
13
14
|
dateSection?: IFDateSection;
|
|
15
|
+
displayeds?: IFSParamsToGetFilterDisplayeds;
|
|
14
16
|
enableds?: IFSParamsToGetFilterEnableds;
|
|
15
17
|
chart?: IFUChartSettings;
|
|
16
18
|
panelid?: string;
|
|
@@ -23,6 +23,7 @@ export * from "./IFSFilterExtras";
|
|
|
23
23
|
export * from "./IFSFilterExtrasInfo";
|
|
24
24
|
export * from "./IFSGetDataValues";
|
|
25
25
|
export * from "./IFSParamsToGetFilter";
|
|
26
|
+
export * from "./IFSParamsToGetFilterDisplayeds";
|
|
26
27
|
export * from "./IFSParamsToGetFilterEnableds";
|
|
27
28
|
export * from "./IFSScope";
|
|
28
29
|
export * from "./IFSScopeID";
|
|
@@ -39,6 +39,7 @@ __exportStar(require("./IFSFilterExtras"), exports);
|
|
|
39
39
|
__exportStar(require("./IFSFilterExtrasInfo"), exports);
|
|
40
40
|
__exportStar(require("./IFSGetDataValues"), exports);
|
|
41
41
|
__exportStar(require("./IFSParamsToGetFilter"), exports);
|
|
42
|
+
__exportStar(require("./IFSParamsToGetFilterDisplayeds"), exports);
|
|
42
43
|
__exportStar(require("./IFSParamsToGetFilterEnableds"), exports);
|
|
43
44
|
__exportStar(require("./IFSScope"), exports);
|
|
44
45
|
__exportStar(require("./IFSScopeID"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_DATE = exports.DEFAULT_OPTIONS = exports.DURATION_PARTS = exports.PARTS_REGEX = exports.DATETIME_OPTIONS = exports.CURRENCY_DEFAULT = exports.LANG_DEFAULT = exports.STANDARD_NUMERIC_FORMATS = exports.currencyISO = exports.isTextColumn = exports.supportNumericFormatting = exports.hasfileSizeProperty = exports.appliesFormatting = exports.DATEGROUP_FORMATTING_UNSUPPORT = exports.QUESTION_FORMAT_SUPPORT = exports.numericalFields = exports.complexFields = exports.textFields = void 0;
|
|
3
|
+
exports.DEFAULT_TIME_UNIT = exports.DEFAULT_DATE = exports.DEFAULT_OPTIONS = exports.DURATION_PARTS = exports.PARTS_REGEX = exports.DATETIME_OPTIONS = exports.CURRENCY_DEFAULT = exports.LANG_DEFAULT = exports.STANDARD_NUMERIC_FORMATS = exports.currencyISO = exports.isTextColumn = exports.supportNumericFormatting = exports.hasfileSizeProperty = exports.appliesFormatting = exports.DATEGROUP_FORMATTING_UNSUPPORT = exports.QUESTION_FORMAT_SUPPORT = exports.numericalFields = exports.complexFields = exports.textFields = void 0;
|
|
4
4
|
const isComplexColumn_1 = require("../columns/helpers/isComplexColumn");
|
|
5
5
|
const COLUMN_1 = require("../columns/constants/COLUMN");
|
|
6
6
|
const Charts_Const_1 = require("../constants/Charts.Const");
|
|
@@ -142,3 +142,4 @@ exports.DEFAULT_OPTIONS = {
|
|
|
142
142
|
fractionDigits: 0,
|
|
143
143
|
};
|
|
144
144
|
exports.DEFAULT_DATE = "1/1/1970";
|
|
145
|
+
exports.DEFAULT_TIME_UNIT = "seconds";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import duration from "dayjs/plugin/duration";
|
|
2
|
+
/**
|
|
3
|
+
* "Convert a time value from one unit to another."
|
|
4
|
+
*
|
|
5
|
+
* The function takes three parameters:
|
|
6
|
+
*
|
|
7
|
+
* * value: The time value to convert.
|
|
8
|
+
* * sourceUnit: The unit of the time value to convert.
|
|
9
|
+
* * targetUnit: The target unit to convert the time value
|
|
10
|
+
* @param {number} value - The value to convert
|
|
11
|
+
* @param sourceUnit - The unit of the value you're passing in.
|
|
12
|
+
* @param targetUnit - The unit of time you want to convert to.
|
|
13
|
+
* @returns The value converted to the specified unit
|
|
14
|
+
*/
|
|
15
|
+
export declare function convertTimeUnit(value: number, sourceUnit?: duration.DurationUnitType, targetUnit?: duration.DurationUnitType): number;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.convertTimeUnit = void 0;
|
|
7
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
+
const duration_1 = __importDefault(require("dayjs/plugin/duration"));
|
|
9
|
+
const general_1 = require("../../general");
|
|
10
|
+
const definition_1 = require("../definition");
|
|
11
|
+
dayjs_1.default.extend(duration_1.default);
|
|
12
|
+
/**
|
|
13
|
+
* "Convert a time value from one unit to another."
|
|
14
|
+
*
|
|
15
|
+
* The function takes three parameters:
|
|
16
|
+
*
|
|
17
|
+
* * value: The time value to convert.
|
|
18
|
+
* * sourceUnit: The unit of the time value to convert.
|
|
19
|
+
* * targetUnit: The target unit to convert the time value
|
|
20
|
+
* @param {number} value - The value to convert
|
|
21
|
+
* @param sourceUnit - The unit of the value you're passing in.
|
|
22
|
+
* @param targetUnit - The unit of time you want to convert to.
|
|
23
|
+
* @returns The value converted to the specified unit
|
|
24
|
+
*/
|
|
25
|
+
function convertTimeUnit(value, sourceUnit = definition_1.DEFAULT_TIME_UNIT, targetUnit = definition_1.DEFAULT_TIME_UNIT) {
|
|
26
|
+
if ((0, general_1.isEmpty)(value) ||
|
|
27
|
+
(0, general_1.isEmpty)(sourceUnit) ||
|
|
28
|
+
(0, general_1.isEmpty)(targetUnit) ||
|
|
29
|
+
isNaN(value))
|
|
30
|
+
return undefined;
|
|
31
|
+
const durationValue = dayjs_1.default.duration(value, sourceUnit).as(targetUnit);
|
|
32
|
+
return isNaN(durationValue) ? undefined : durationValue;
|
|
33
|
+
}
|
|
34
|
+
exports.convertTimeUnit = convertTimeUnit;
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./durationFormatter"), exports);
|
|
18
18
|
__exportStar(require("./addDurationFormat"), exports);
|
|
19
|
+
__exportStar(require("./convertTimeUnit"), exports);
|
|
@@ -8,6 +8,7 @@ import { II18nUnits } from "./II18nUnits";
|
|
|
8
8
|
import { II18nCalendar } from "../calendar/II18nCalendar";
|
|
9
9
|
import { II18nTokenBox } from "../filters/II18nTokenBox";
|
|
10
10
|
import { II18nTokenMode } from "./II18nTokenMode";
|
|
11
|
+
import { I18nTimeUnitProperties } from "./I18nTimeUnitProperties";
|
|
11
12
|
export interface II18nCommon {
|
|
12
13
|
aggregates: string;
|
|
13
14
|
aggregate_labels: II18nAgreggateLabels;
|
|
@@ -20,6 +21,7 @@ export interface II18nCommon {
|
|
|
20
21
|
properties: II18nColumnProperties;
|
|
21
22
|
search: string;
|
|
22
23
|
sort: string;
|
|
24
|
+
time_units: I18nTimeUnitProperties;
|
|
23
25
|
token_box: II18nTokenBox;
|
|
24
26
|
token_mode: II18nTokenMode;
|
|
25
27
|
units: II18nUnits;
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./II18nCommon"), exports);
|
|
18
|
+
__exportStar(require("./I18nTimeUnitProperties"), exports);
|
|
18
19
|
__exportStar(require("./II18nAgreggateLabels"), exports);
|
|
19
20
|
__exportStar(require("./II18nColumnProperties"), exports);
|
|
20
21
|
__exportStar(require("./II18nColumnTypes"), exports);
|
|
@@ -14,6 +14,7 @@ export interface II18nTabularView {
|
|
|
14
14
|
edit_modal_edit_option: string;
|
|
15
15
|
edit_modal_cancel_option: string;
|
|
16
16
|
filter_access_point: string;
|
|
17
|
+
no_columns_selected_message: string;
|
|
17
18
|
no_records_found_message: string;
|
|
18
19
|
select_columns_all_option: string;
|
|
19
20
|
select_columns_date_option: string;
|
|
@@ -8,6 +8,7 @@ const I18N_COLUMN_LABEL_1 = require("./I18N_COLUMN_LABEL");
|
|
|
8
8
|
const I18N_COLUMN_PROPERTY_LABEL_1 = require("./I18N_COLUMN_PROPERTY_LABEL");
|
|
9
9
|
const I18N_DATE_GROUPING_1 = require("./I18N_DATE_GROUPING");
|
|
10
10
|
const I18N_DAY_NAMES_1 = require("./I18N_DAY_NAMES");
|
|
11
|
+
const I18N_TIME_UNITS_1 = require("./I18N_TIME_UNITS");
|
|
11
12
|
exports.I18N_COMMON = {
|
|
12
13
|
aggregates: "Aggregates",
|
|
13
14
|
aggregate_labels: I18N_AGGREGATE_LABEL_1.I18N_AGGREGATE_LABEL,
|
|
@@ -25,6 +26,7 @@ exports.I18N_COMMON = {
|
|
|
25
26
|
properties: I18N_COLUMN_PROPERTY_LABEL_1.I18N_COLUMN_PROPERTY_LABEL,
|
|
26
27
|
search: "Search",
|
|
27
28
|
sort: "Sort",
|
|
29
|
+
time_units: I18N_TIME_UNITS_1.I18N_TIME_UNITS,
|
|
28
30
|
token_box: {
|
|
29
31
|
data_tokens: "Data Tokens",
|
|
30
32
|
language_tokens: "Language Tokens",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.I18N_TIME_UNITS = void 0;
|
|
4
|
+
const TIME_UNIT_PROPERTY_LABEL_1 = require("../../../time/constants/TIME_UNIT_PROPERTY_LABEL");
|
|
5
|
+
exports.I18N_TIME_UNITS = {
|
|
6
|
+
day: TIME_UNIT_PROPERTY_LABEL_1.TIME_UNIT_PROPERTY_LABEL.DAY,
|
|
7
|
+
hour: TIME_UNIT_PROPERTY_LABEL_1.TIME_UNIT_PROPERTY_LABEL.HOUR,
|
|
8
|
+
minute: TIME_UNIT_PROPERTY_LABEL_1.TIME_UNIT_PROPERTY_LABEL.MINUTE,
|
|
9
|
+
month: TIME_UNIT_PROPERTY_LABEL_1.TIME_UNIT_PROPERTY_LABEL.MONTH,
|
|
10
|
+
second: TIME_UNIT_PROPERTY_LABEL_1.TIME_UNIT_PROPERTY_LABEL.SECOND,
|
|
11
|
+
year: TIME_UNIT_PROPERTY_LABEL_1.TIME_UNIT_PROPERTY_LABEL.YEAR,
|
|
12
|
+
title: "Time Unit",
|
|
13
|
+
placeholder: "Select Time Unit",
|
|
14
|
+
};
|
|
@@ -17,6 +17,7 @@ exports.I18N_TABULAR_VIEW = {
|
|
|
17
17
|
edit_modal_edit_option: "Update",
|
|
18
18
|
edit_modal_cancel_option: "Cancel",
|
|
19
19
|
filter_access_point: "Filter",
|
|
20
|
+
no_columns_selected_message: "No columns selected",
|
|
20
21
|
no_records_found_message: "No Records Found",
|
|
21
22
|
select_columns_all_option: "All",
|
|
22
23
|
select_columns_date_option: "Date",
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -28,5 +28,6 @@ __exportStar(require("./qrvey/index"), exports);
|
|
|
28
28
|
__exportStar(require("./stencil/index"), exports);
|
|
29
29
|
__exportStar(require("./services/index"), exports);
|
|
30
30
|
__exportStar(require("./typescript/index"), exports);
|
|
31
|
+
__exportStar(require("./time/index"), exports);
|
|
31
32
|
__exportStar(require("./tokens/index"), exports);
|
|
32
33
|
__exportStar(require("./column_format/index"), exports);
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
|
|
2
2
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
3
3
|
import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
|
|
4
|
+
/**
|
|
5
|
+
* Gets the label of a property by the column
|
|
6
|
+
* @param {IColumn} column the column object
|
|
7
|
+
* @param {IColumnPropertyType} property the column property
|
|
8
|
+
* @param translate function to apply the i18n translation
|
|
9
|
+
* @returns the label
|
|
10
|
+
*/
|
|
4
11
|
export declare function getPropertyLabel(column: IColumn, property: IColumnPropertyType, translate?: II18nServiceTranslate): string;
|
|
@@ -5,11 +5,22 @@ const COLUMN_PROPERTY_INFO_1 = require("../../columns/constants/COLUMN_PROPERTY_
|
|
|
5
5
|
const isDateColumn_1 = require("../../columns/helpers/isDateColumn");
|
|
6
6
|
const COLUMN_1 = require("../../columns/constants/COLUMN");
|
|
7
7
|
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
8
|
+
const isDurationColumn_1 = require("../../columns/helpers/isDurationColumn");
|
|
9
|
+
const TIME_UNIT_INFO_LIST_1 = require("../../time/constants/TIME_UNIT_INFO_LIST");
|
|
10
|
+
/**
|
|
11
|
+
* Gets the label of a property by the column
|
|
12
|
+
* @param {IColumn} column the column object
|
|
13
|
+
* @param {IColumnPropertyType} property the column property
|
|
14
|
+
* @param translate function to apply the i18n translation
|
|
15
|
+
* @returns the label
|
|
16
|
+
*/
|
|
8
17
|
function getPropertyLabel(column, property, translate) {
|
|
9
18
|
let propertyLabel;
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
|
|
19
|
+
let columnProperties = COLUMN_PROPERTY_INFO_1.COLUMN_PROPERTY_INFO[(0, isDateColumn_1.isDateColumn)(column) ? COLUMN_1.COLUMN.DATE : column.type];
|
|
20
|
+
if ((0, isEmpty_1.isEmpty)(columnProperties) && (0, isDurationColumn_1.isDurationColumn)(column))
|
|
21
|
+
columnProperties = TIME_UNIT_INFO_LIST_1.TIME_UNIT_INFO_LIST;
|
|
22
|
+
if (!(0, isEmpty_1.isEmpty)(columnProperties)) {
|
|
23
|
+
const propertyObject = columnProperties.find((pValue) => pValue.value === property);
|
|
13
24
|
if (!(0, isEmpty_1.isEmpty)(propertyObject))
|
|
14
25
|
propertyLabel = !(0, isEmpty_1.isEmpty)(translate)
|
|
15
26
|
? translate(propertyObject.i18nLabelPath)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITimeUnitProperty } from "../interfaces/ITimeUnitProperty";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a number from a time unit to another
|
|
4
|
+
* @param {ITimeUnitProperty} from a time unit
|
|
5
|
+
* @param {ITimeUnitProperty} to a time unit
|
|
6
|
+
* @param {number} number the number to convert
|
|
7
|
+
* @returns the converted number
|
|
8
|
+
*/
|
|
9
|
+
export declare function adaptTimeUnitNumbers(from: ITimeUnitProperty, to: ITimeUnitProperty, number: number): number;
|