@bluecopa/core 0.1.79 → 0.1.80

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.es.js CHANGED
@@ -10078,7 +10078,7 @@ const resolveBoundId = (rawId, bindings) => {
10078
10078
  return rawId;
10079
10079
  };
10080
10080
  const getData$3 = async (metricSheetId, options) => {
10081
- var _a, _b, _c, _d, _e, _f, _g;
10081
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
10082
10082
  const bindings = await fetchSolutionBindings();
10083
10083
  const resolvedMetricSheetId = resolveBoundId(metricSheetId, bindings);
10084
10084
  const worksheets = await getWorksheets([resolvedMetricSheetId]);
@@ -10086,9 +10086,7 @@ const getData$3 = async (metricSheetId, options) => {
10086
10086
  const selectedWorksheet = worksheets[0];
10087
10087
  const hydratedSheet = await hydrateWorksheet(selectedWorksheet, bindings);
10088
10088
  if (!hydratedSheet) return {};
10089
- const selectedMetricsParentIds = getSelectedMetricsParentIds([
10090
- { sheet: selectedWorksheet }
10091
- ]);
10089
+ const selectedMetricsParentIds = getSelectedMetricsParentIds([{ sheet: selectedWorksheet }]);
10092
10090
  const resolvedParentIds = selectedMetricsParentIds.map(
10093
10091
  (id) => resolveBoundId(id, bindings)
10094
10092
  );
@@ -10102,10 +10100,7 @@ const getData$3 = async (metricSheetId, options) => {
10102
10100
  if (parentSheet) {
10103
10101
  const hydratedParentSheet = await hydrateWorksheet(parentSheet, bindings);
10104
10102
  if (hydratedParentSheet == null ? void 0 : hydratedParentSheet.definitionModel) {
10105
- const {
10106
- definitionModel: parentDefinitionModel,
10107
- customModel: parentCustomModel
10108
- } = getUpdatedDefinitionCustomModel({
10103
+ const { definitionModel: parentDefinitionModel, customModel: parentCustomModel } = getUpdatedDefinitionCustomModel({
10109
10104
  metricDefinitionModel: hydratedSheet.definitionModel,
10110
10105
  parentDefinitionModel: hydratedParentSheet == null ? void 0 : hydratedParentSheet.definitionModel,
10111
10106
  parentCustomModel: hydratedParentSheet == null ? void 0 : hydratedParentSheet.customModel,
@@ -10137,21 +10132,27 @@ const getData$3 = async (metricSheetId, options) => {
10137
10132
  ...cs,
10138
10133
  hide: false
10139
10134
  }));
10135
+ const variables = dModel == null ? void 0 : dModel.variables;
10136
+ let variableName = variable;
10137
+ const calledVariable = _.find(variables, (v) => v.name === variableName);
10138
+ if (((_c = calledVariable == null ? void 0 : calledVariable.transforms[0]) == null ? void 0 : _c.type) === "View") {
10139
+ variableName = (_d = calledVariable == null ? void 0 : calledVariable.transforms[0]) == null ? void 0 : _d.table;
10140
+ }
10140
10141
  const metadata = {
10141
- variable,
10142
+ variable: variableName,
10142
10143
  parentTableVariable,
10143
10144
  inputs,
10144
10145
  datasetId: (cModel == null ? void 0 : cModel.datasetId) ?? "",
10145
10146
  datasetName: (cModel == null ? void 0 : cModel.datasetName) ?? "",
10146
10147
  columnSettings: columnSettings ?? [],
10147
10148
  filterColumnsBy: (cModel == null ? void 0 : cModel.filterColumnsBy) ?? {},
10148
- filterModel: ((_d = (_c = hydratedSheet == null ? void 0 : hydratedSheet.customModel) == null ? void 0 : _c.gridColumnState) == null ? void 0 : _d.filterModel) ?? {},
10149
+ filterModel: ((_f = (_e = hydratedSheet == null ? void 0 : hydratedSheet.customModel) == null ? void 0 : _e.gridColumnState) == null ? void 0 : _f.filterModel) ?? {},
10149
10150
  valueCols: valueCols ?? [],
10150
10151
  rowGroupCols: (gridColumnState == null ? void 0 : gridColumnState.rowGroupCols) ?? [],
10151
10152
  pivotCols: (gridColumnState == null ? void 0 : gridColumnState.pivotCols) ?? [],
10152
10153
  dateColumn: cModel == null ? void 0 : cModel.dateColumn,
10153
10154
  timeBin,
10154
- dateRange: (_e = cModel == null ? void 0 : cModel.inputs) == null ? void 0 : _e.date_range,
10155
+ dateRange: (_g = cModel == null ? void 0 : cModel.inputs) == null ? void 0 : _g.date_range,
10155
10156
  aliases,
10156
10157
  lastModifiedDate: hydratedSheet == null ? void 0 : hydratedSheet.lastModifiedDate,
10157
10158
  hierarchy: cModel == null ? void 0 : cModel.hierarchy,
@@ -10169,8 +10170,8 @@ const getData$3 = async (metricSheetId, options) => {
10169
10170
  lastModifiedDate: hydratedSheet.lastModifiedDate,
10170
10171
  promotedFiltersStoreValue: {},
10171
10172
  promotedFilters: [],
10172
- dateRangeModel: ((_f = hydratedSheet == null ? void 0 : hydratedSheet.customModel) == null ? void 0 : _f.dateRangeModel) ?? defaultDashboardDateRangeModel,
10173
- currencyModel: ((_g = hydratedSheet == null ? void 0 : hydratedSheet.customModel) == null ? void 0 : _g.currencyModel) ?? defaultCurrencyModel,
10173
+ dateRangeModel: ((_h = hydratedSheet == null ? void 0 : hydratedSheet.customModel) == null ? void 0 : _h.dateRangeModel) ?? defaultDashboardDateRangeModel,
10174
+ currencyModel: ((_i = hydratedSheet == null ? void 0 : hydratedSheet.customModel) == null ? void 0 : _i.currencyModel) ?? defaultCurrencyModel,
10174
10175
  commonFilters: []
10175
10176
  });
10176
10177
  let resultData = [];
@@ -10185,7 +10186,7 @@ const getData$3 = async (metricSheetId, options) => {
10185
10186
  id: hydratedSheet.id,
10186
10187
  lastModifiedDate: hydratedSheet.lastModifiedDate
10187
10188
  },
10188
- variable,
10189
+ variable: variableName,
10189
10190
  describe: parentTableVariable
10190
10191
  })
10191
10192
  );
@@ -10199,7 +10200,7 @@ const getData$3 = async (metricSheetId, options) => {
10199
10200
  id: hydratedSheet.id,
10200
10201
  lastModifiedDate: hydratedSheet.lastModifiedDate
10201
10202
  },
10202
- variable,
10203
+ variable: variableName,
10203
10204
  describe: parentTableVariable
10204
10205
  })).data;
10205
10206
  resultData = result.data;