@infomaximum/widget-sdk 4.10.0 → 4.11.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/index.d.ts CHANGED
@@ -394,9 +394,9 @@ interface IFormulaFilterValue {
394
394
  /** Метод фильтрации */
395
395
  filteringMethod: valueof<typeof formulaFilterMethods>;
396
396
  /** Выбранные в списке значения в виде моделей */
397
- checkedValues: (string | null)[];
397
+ checkedValues?: (string | null)[];
398
398
  /** Значения полей формы редактора */
399
- formValues: Partial<{
399
+ formValues?: Partial<{
400
400
  [EFormulaFilterFieldKeys.date]: string | null;
401
401
  [EFormulaFilterFieldKeys.dateRange]: [string, string];
402
402
  [EFormulaFilterFieldKeys.duration]: string;
@@ -740,6 +740,7 @@ interface IParameterFromManualInput {
740
740
  inputMethod: EWidgetActionInputMethod.MANUALLY;
741
741
  description: string;
742
742
  defaultValue?: string;
743
+ filterByRows?: boolean;
743
744
  }
744
745
  interface IParameterFromStaticList {
745
746
  inputMethod: EWidgetActionInputMethod.STATIC_LIST;
@@ -752,6 +753,7 @@ interface IParameterFromDynamicList {
752
753
  defaultValue: string;
753
754
  displayOptions: string;
754
755
  filters: TExtendedFormulaFilterValue[];
756
+ filterByRows?: boolean;
755
757
  }
756
758
  interface IWidgetActionParameterCommon {
757
759
  name: string;
@@ -813,7 +815,6 @@ type TActionOpenView = IActionCommon & {
813
815
  }>));
814
816
  type TActionsOnClick = IActionGoToUrl | IActionRunScript | IActionUpdateVariable | TActionOpenView;
815
817
  interface IWidgetAction extends IActionCommon {
816
- filters: TExtendedFormulaFilterValue[];
817
818
  parameters: TWidgetActionParameter[];
818
819
  type: EActionTypes.EXECUTE_SCRIPT;
819
820
  scriptKey: string;
@@ -851,12 +852,14 @@ declare enum ESortDirection {
851
852
  type TSortDirection = ESortDirection.ascend | ESortDirection.descend;
852
853
  interface ISortOrder {
853
854
  formula: string;
855
+ dataType?: ESimpleDataType;
854
856
  direction: TSortDirection;
855
857
  displayCondition?: TNullable<string>;
856
858
  }
857
859
  type TWidgetSortingValue = {
858
860
  mode: ESortingValueModes.FORMULA;
859
861
  formula: string;
862
+ dataType?: ESimpleDataType;
860
863
  } | {
861
864
  mode: ESortingValueModes.IN_WIDGET;
862
865
  group: string;
package/dist/index.esm.js CHANGED
@@ -566,6 +566,9 @@ var getFormulaFilterValues = function (filterValue) {
566
566
  if (checkedValues && checkedValues.length) {
567
567
  return checkedValues;
568
568
  }
569
+ if (!formValues) {
570
+ return [];
571
+ }
569
572
  function stringifyNumbersRange(range) {
570
573
  if (range === void 0) { range = [undefined, undefined]; }
571
574
  return range.map(function (value, index) {
@@ -600,7 +603,7 @@ var getFormulaFilterValues = function (filterValue) {
600
603
  }
601
604
  return compact([datePickerValue]);
602
605
  case EFormatTypes.STRING:
603
- return compact([(_a = formValues === null || formValues === void 0 ? void 0 : formValues[EFormulaFilterFieldKeys.string]) !== null && _a !== void 0 ? _a : null]);
606
+ return compact([(_a = formValues[EFormulaFilterFieldKeys.string]) !== null && _a !== void 0 ? _a : null]);
604
607
  case EFormatTypes.NUMBER:
605
608
  case EFormatTypes.YEAR:
606
609
  case EFormatTypes.DAY_OF_MONTH:
@@ -1090,7 +1093,13 @@ var getDefaultSortOrders = function (_a) {
1090
1093
  ].includes(dimension.format);
1091
1094
  });
1092
1095
  if (timeDimension) {
1093
- return [{ formula: getDimensionFormula(timeDimension), direction: ESortDirection.ascend }];
1096
+ return [
1097
+ {
1098
+ formula: getDimensionFormula(timeDimension),
1099
+ dataType: timeDimension.dataType,
1100
+ direction: ESortDirection.ascend,
1101
+ },
1102
+ ];
1094
1103
  }
1095
1104
  if (measures.length > 0) {
1096
1105
  var firstMeasure = measures[0];
@@ -1099,6 +1108,7 @@ var getDefaultSortOrders = function (_a) {
1099
1108
  {
1100
1109
  direction: ESortDirection.descend,
1101
1110
  formula: getMeasureFormula(firstMeasure),
1111
+ dataType: firstMeasure.dataType,
1102
1112
  },
1103
1113
  ];
1104
1114
  }
@@ -1112,7 +1122,9 @@ function mapSortingToInputs(_a) {
1112
1122
  var _b;
1113
1123
  var direction = _a.direction, value = _a.value;
1114
1124
  if (value.mode === ESortingValueModes.FORMULA) {
1115
- return value.formula ? { formula: value.formula, direction: direction } : undefined;
1125
+ return value.formula
1126
+ ? { formula: value.formula, direction: direction, dataType: value.dataType }
1127
+ : undefined;
1116
1128
  }
1117
1129
  var indicatorsGroup = settings[value.group];
1118
1130
  var indicator = indicatorsGroup === null || indicatorsGroup === void 0 ? void 0 : indicatorsGroup[value.index];
@@ -1130,6 +1142,7 @@ function mapSortingToInputs(_a) {
1130
1142
  return {
1131
1143
  formula: formula,
1132
1144
  direction: direction,
1145
+ dataType: activeDimensions.dataType,
1133
1146
  displayCondition: ((_b = indicator.displayCondition) === null || _b === void 0 ? void 0 : _b.mode) === EDisplayConditionMode.FORMULA
1134
1147
  ? indicator.displayCondition.formula
1135
1148
  : undefined,
@@ -1138,6 +1151,7 @@ function mapSortingToInputs(_a) {
1138
1151
  return {
1139
1152
  formula: getMeasureFormula(indicator),
1140
1153
  direction: direction,
1154
+ dataType: indicator.dataType,
1141
1155
  };
1142
1156
  });
1143
1157
  return sortOrder;
package/dist/index.js CHANGED
@@ -567,6 +567,9 @@ var getFormulaFilterValues = function (filterValue) {
567
567
  if (checkedValues && checkedValues.length) {
568
568
  return checkedValues;
569
569
  }
570
+ if (!formValues) {
571
+ return [];
572
+ }
570
573
  function stringifyNumbersRange(range) {
571
574
  if (range === void 0) { range = [undefined, undefined]; }
572
575
  return range.map(function (value, index) {
@@ -601,7 +604,7 @@ var getFormulaFilterValues = function (filterValue) {
601
604
  }
602
605
  return compact([datePickerValue]);
603
606
  case exports.EFormatTypes.STRING:
604
- return compact([(_a = formValues === null || formValues === void 0 ? void 0 : formValues[exports.EFormulaFilterFieldKeys.string]) !== null && _a !== void 0 ? _a : null]);
607
+ return compact([(_a = formValues[exports.EFormulaFilterFieldKeys.string]) !== null && _a !== void 0 ? _a : null]);
605
608
  case exports.EFormatTypes.NUMBER:
606
609
  case exports.EFormatTypes.YEAR:
607
610
  case exports.EFormatTypes.DAY_OF_MONTH:
@@ -1091,7 +1094,13 @@ var getDefaultSortOrders = function (_a) {
1091
1094
  ].includes(dimension.format);
1092
1095
  });
1093
1096
  if (timeDimension) {
1094
- return [{ formula: getDimensionFormula(timeDimension), direction: exports.ESortDirection.ascend }];
1097
+ return [
1098
+ {
1099
+ formula: getDimensionFormula(timeDimension),
1100
+ dataType: timeDimension.dataType,
1101
+ direction: exports.ESortDirection.ascend,
1102
+ },
1103
+ ];
1095
1104
  }
1096
1105
  if (measures.length > 0) {
1097
1106
  var firstMeasure = measures[0];
@@ -1100,6 +1109,7 @@ var getDefaultSortOrders = function (_a) {
1100
1109
  {
1101
1110
  direction: exports.ESortDirection.descend,
1102
1111
  formula: getMeasureFormula(firstMeasure),
1112
+ dataType: firstMeasure.dataType,
1103
1113
  },
1104
1114
  ];
1105
1115
  }
@@ -1113,7 +1123,9 @@ function mapSortingToInputs(_a) {
1113
1123
  var _b;
1114
1124
  var direction = _a.direction, value = _a.value;
1115
1125
  if (value.mode === exports.ESortingValueModes.FORMULA) {
1116
- return value.formula ? { formula: value.formula, direction: direction } : undefined;
1126
+ return value.formula
1127
+ ? { formula: value.formula, direction: direction, dataType: value.dataType }
1128
+ : undefined;
1117
1129
  }
1118
1130
  var indicatorsGroup = settings[value.group];
1119
1131
  var indicator = indicatorsGroup === null || indicatorsGroup === void 0 ? void 0 : indicatorsGroup[value.index];
@@ -1131,6 +1143,7 @@ function mapSortingToInputs(_a) {
1131
1143
  return {
1132
1144
  formula: formula,
1133
1145
  direction: direction,
1146
+ dataType: activeDimensions.dataType,
1134
1147
  displayCondition: ((_b = indicator.displayCondition) === null || _b === void 0 ? void 0 : _b.mode) === exports.EDisplayConditionMode.FORMULA
1135
1148
  ? indicator.displayCondition.formula
1136
1149
  : undefined,
@@ -1139,6 +1152,7 @@ function mapSortingToInputs(_a) {
1139
1152
  return {
1140
1153
  formula: getMeasureFormula(indicator),
1141
1154
  direction: direction,
1155
+ dataType: indicator.dataType,
1142
1156
  };
1143
1157
  });
1144
1158
  return sortOrder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.10.0",
3
+ "version": "4.11.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",