autoql-fe-utils 1.7.25 → 1.7.27

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
@@ -965,7 +965,7 @@ declare const isSingleValueResponse: (response: any) => boolean;
965
965
  declare const getUniqueYearsForColumn: (data: any, columns: any, index: any) => any;
966
966
  declare const getSupportedDisplayTypes: ({ response, columns, dataLength, pivotDataLength, isDataLimited, allowNumericStringColumns, }?: getSupportedDisplayTypesParams) => string[];
967
967
  declare const getFirstChartDisplayType: (supportedDisplayTypes: any, fallback: any) => any;
968
- declare const getDefaultDisplayType: (response?: AxiosResponse, defaultToChart?: boolean, columns?: Column[], dataLength?: number, pivotDataLength?: number, preferredDisplayType?: string, isDataLimited?: boolean) => string;
968
+ declare const getDefaultDisplayType: (response?: AxiosResponse, defaultToChart?: boolean, columns?: Column[], dataLength?: number, pivotDataLength?: number, preferredDisplayType?: string, isDataLimited?: boolean, preferRegularTable?: boolean) => string;
969
969
  declare const hasData: (response: any) => any;
970
970
  declare const hasMoreData: (response: any, currentNumRows: any) => boolean;
971
971
  declare const isDataLimited: (queryResponse: any, rows?: any) => boolean;
@@ -16820,7 +16820,7 @@
16820
16820
  }
16821
16821
  return fallback;
16822
16822
  };
16823
- var getDefaultDisplayType = (response, defaultToChart, columns, dataLength, pivotDataLength, preferredDisplayType, isDataLimited2 = false) => {
16823
+ var getDefaultDisplayType = (response, defaultToChart, columns, dataLength, pivotDataLength, preferredDisplayType, isDataLimited2 = false, preferRegularTable = false) => {
16824
16824
  var _a, _b, _c, _d, _e, _f, _g, _h;
16825
16825
  const supportedDisplayTypes = getSupportedDisplayTypes({
16826
16826
  response,
@@ -16842,7 +16842,7 @@
16842
16842
  if (supportedDisplayTypes.length === 1) {
16843
16843
  return supportedDisplayTypes[0];
16844
16844
  }
16845
- if (supportedDisplayTypes.includes("pivot_table")) {
16845
+ if (supportedDisplayTypes.includes("pivot_table") && !preferRegularTable) {
16846
16846
  let displayType = "pivot_table";
16847
16847
  if (defaultToChart) {
16848
16848
  displayType = isAggregation((_f = (_e = response == null ? void 0 : response.data) == null ? void 0 : _e.data) == null ? void 0 : _f.columns) ? getFirstChartDisplayType(supportedDisplayTypes, "pivot_table") : "pivot_table";
@@ -21086,15 +21086,25 @@
21086
21086
  const filters = [];
21087
21087
  if (((_a = params == null ? void 0 : params.filter) == null ? void 0 : _a.length) > 0) {
21088
21088
  params.filter.forEach((filter3) => {
21089
- var _a2, _b, _c;
21089
+ var _a2, _b, _c, _d, _e, _f;
21090
21090
  try {
21091
21091
  const column = columns.find((col) => col.field == filter3.field);
21092
21092
  if (column) {
21093
+ const firstChar = (_b = (_a2 = filter3.value) == null ? void 0 : _a2.trim()) == null ? void 0 : _b.substring(0, 1);
21094
+ let operator = "like";
21095
+ let value = filter3.value;
21096
+ if (firstChar === "=") {
21097
+ operator = "=";
21098
+ value = (_c = filter3.value.slice(1)) != null ? _c : "";
21099
+ }
21100
+ if (!value) {
21101
+ return;
21102
+ }
21093
21103
  const filterObj = {
21094
- name: (_a2 = column.name) != null ? _a2 : "",
21095
- columnName: (_b = column.title) != null ? _b : "",
21096
- value: filter3.value,
21097
- operator: "like",
21104
+ name: (_d = column.name) != null ? _d : "",
21105
+ columnName: (_e = column.title) != null ? _e : "",
21106
+ value,
21107
+ operator,
21098
21108
  id: column.id
21099
21109
  };
21100
21110
  if (isColumnNumberType(column)) {
@@ -21105,7 +21115,7 @@
21105
21115
  const dates = filter3.value.split(" to ");
21106
21116
  const precision = getPrecisionForDayJS(column.precision);
21107
21117
  const startDate = dayjsWithPlugins_default.utc(dates[0]).startOf(precision).toISOString();
21108
- const endDate = dayjsWithPlugins_default.utc((_c = dates[1]) != null ? _c : dates[0]).endOf(precision).toISOString();
21118
+ const endDate = dayjsWithPlugins_default.utc((_f = dates[1]) != null ? _f : dates[0]).endOf(precision).toISOString();
21109
21119
  filterObj.value = `${startDate},${endDate}`;
21110
21120
  filterObj.operator = "between";
21111
21121
  filterObj.displayValue = filter3.value.replaceAll(" to ", " and ");