@datawheel/data-explorer 0.3.15 → 0.3.17

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/main.d.mts CHANGED
@@ -1,5 +1,7 @@
1
- import React, { ReactNode } from 'react';
1
+ import * as React from 'react';
2
+ import React__default, { ReactNode } from 'react';
2
3
  import { MRT_TableInstance, MRT_ColumnDef, MRT_PaginationState, MRT_TableOptions } from 'mantine-react-table';
4
+ import * as _datawheel_use_translation from '@datawheel/use-translation';
3
5
  import { TranslationDict, TranslationContextProps } from '@datawheel/use-translation';
4
6
  import { CSSObject } from '@mantine/core';
5
7
  import { Translation as Translation$1 } from '@datawheel/vizbuilder/react';
@@ -464,7 +466,7 @@ type Formatter = (value: number | null, locale?: string) => string;
464
466
  interface PanelDescriptor {
465
467
  key: string;
466
468
  label: string;
467
- component: React.ComponentType<ViewProps>;
469
+ component: React__default.ComponentType<ViewProps>;
468
470
  }
469
471
  interface ViewProps<TData extends Record<string, any> = Record<string, string | number>> {
470
472
  className?: string;
@@ -478,11 +480,11 @@ interface ViewProps<TData extends Record<string, any> = Record<string, string |
478
480
  data?: Record<string, string | number>[];
479
481
  columns?: MRT_ColumnDef<TData>[];
480
482
  pagination?: MRT_PaginationState;
481
- setPagination?: React.Dispatch<React.SetStateAction<MRT_PaginationState>>;
483
+ setPagination?: React__default.Dispatch<React__default.SetStateAction<MRT_PaginationState>>;
482
484
  }
483
485
 
484
486
  /** */
485
- declare function DebugView(props: ViewProps): React.JSX.Element;
487
+ declare function DebugView(props: ViewProps): React__default.JSX.Element;
486
488
 
487
489
  declare const explorerTranslation: {
488
490
  action_copy: string;
@@ -1036,15 +1038,15 @@ declare const defaultTranslation: {
1036
1038
  unselected_items: string;
1037
1039
  };
1038
1040
  };
1039
- declare const useTranslation: any;
1040
- declare const TranslationConsumer: any;
1041
+ declare const useTranslation: () => _datawheel_use_translation.TranslationContextProps;
1042
+ declare const TranslationConsumer: React.FC<React.ConsumerProps<_datawheel_use_translation.TranslationContextProps>>;
1041
1043
 
1042
1044
  interface ExplorerStepType extends StepType {
1043
1045
  actionBefore?: () => void;
1044
1046
  }
1045
1047
  type TourConfig = {
1046
1048
  extraSteps?: ExplorerStepType[];
1047
- introImage?: React.ReactNode;
1049
+ introImage?: React__default.ReactNode;
1048
1050
  tourProps?: Partial<TourProps>;
1049
1051
  };
1050
1052
  interface TourStepsPropsType {
@@ -1061,7 +1063,7 @@ interface ToolbarConfigType {
1061
1063
  buttons: ToolBarButtonProps[];
1062
1064
  showLabels: Boolean;
1063
1065
  }
1064
- declare function ToolbarButton({ icon, label, onClick }: ToolBarButtonProps): React.JSX.Element;
1066
+ declare function ToolbarButton({ icon, label, onClick }: ToolBarButtonProps): React__default.JSX.Element;
1065
1067
 
1066
1068
  type Pagination = {
1067
1069
  rowsLimits: number[];
@@ -1143,7 +1145,7 @@ declare function ExplorerComponent<Locale extends string>(props: {
1143
1145
  * the screen that is shown in the results panel when there is no query,
1144
1146
  * or a query has been dirtied.
1145
1147
  */
1146
- splash?: React.ComponentType<{
1148
+ splash?: React__default.ComponentType<{
1147
1149
  translation: TranslationContextProps;
1148
1150
  }>;
1149
1151
  toolbarConfig?: Partial<ToolbarConfigType>;
@@ -1178,13 +1180,13 @@ declare function ExplorerComponent<Locale extends string>(props: {
1178
1180
  * @default false
1179
1181
  */
1180
1182
  withPermalink?: boolean;
1181
- }): React.JSX.Element;
1183
+ }): React__default.JSX.Element;
1182
1184
  declare namespace ExplorerComponent {
1183
1185
  var displayName: string;
1184
1186
  }
1185
1187
 
1186
1188
  /** */
1187
- declare function PivotView<TData extends Record<string, unknown>>(props: {} & ViewProps<TData> & MRT_TableOptions<TData>): React.JSX.Element;
1189
+ declare function PivotView<TData extends Record<string, unknown>>(props: {} & ViewProps<TData> & MRT_TableOptions<TData>): React__default.JSX.Element;
1188
1190
 
1189
1191
  type TData = Record<string, any> & Record<string, string | number>;
1190
1192
  type TableView = {
@@ -1192,7 +1194,7 @@ type TableView = {
1192
1194
  getColumn(id: string): AnyResultColumn | undefined;
1193
1195
  columns: AnyResultColumn[];
1194
1196
  } & ViewProps;
1195
- declare function TableView({ table, result, isError, isLoading, data, pagination, setPagination }: TableView): React.JSX.Element;
1197
+ declare function TableView({ table, result, isError, isLoading, data, pagination, setPagination }: TableView): React__default.JSX.Element;
1196
1198
  declare namespace TableView {
1197
1199
  var displayName: string;
1198
1200
  }
@@ -1347,7 +1349,7 @@ interface SettingsContextProps {
1347
1349
  /**
1348
1350
  * A wrapper for the Consumer, for use with class components.
1349
1351
  */
1350
- declare function SettingsConsumer(props: React.ConsumerProps<SettingsContextProps>): React.JSX.Element;
1352
+ declare function SettingsConsumer(props: React__default.ConsumerProps<SettingsContextProps>): React__default.JSX.Element;
1351
1353
  /**
1352
1354
  * The React hook associated to the settings context.
1353
1355
  */
@@ -1357,8 +1359,8 @@ declare function VizbuilderView(props: {
1357
1359
  cube: TesseractCube;
1358
1360
  params: QueryParams;
1359
1361
  result: QueryResult;
1360
- }): false | React.JSX.Element;
1362
+ }): false | React__default.JSX.Element;
1361
1363
 
1362
- declare function TourStep(props: TourStepsPropsType): React.JSX.Element;
1364
+ declare function TourStep(props: TourStepsPropsType): React__default.JSX.Element;
1363
1365
 
1364
1366
  export { DebugView, ExplorerComponent as Explorer, type ExplorerState, type ExplorerStepType, PivotView, SettingsConsumer, TableView, ToolbarButton, TourStep, TranslationConsumer, type Translation as TranslationDict, type ViewProps, VizbuilderView, reducer as explorerReducer, thunkExtraArg as explorerThunkExtraArg, defaultTranslation as translationDict, useSettings, useTranslation };
package/dist/main.mjs CHANGED
@@ -4076,7 +4076,10 @@ function useTable({
4076
4076
  isId
4077
4077
  } = column;
4078
4078
  const isNumeric = valueType === "number" && columnKey !== "Year";
4079
- const formatterKey = getFormat(columnKey, isNumeric ? "Decimal" : "identity");
4079
+ const formatterKey = getFormat(
4080
+ "aggregator" in entity ? entity : columnKey,
4081
+ isNumeric ? "Decimal" : "identity"
4082
+ );
4080
4083
  const formatter2 = getFormatter(formatterKey);
4081
4084
  const mantineFilterVariantObject = getMantineFilterMultiSelectProps(isId, isNumeric, range);
4082
4085
  return {
@@ -4133,7 +4136,9 @@ function useTable({
4133
4136
  id: entity.name,
4134
4137
  dataType: valueType,
4135
4138
  accessorFn: (item) => item[columnKey],
4136
- Cell: isNumeric ? ({ cell }) => formatter2(cell.getValue()) : ({ cell, renderedCellValue, row }) => {
4139
+ Cell: isNumeric ? ({ cell }) => {
4140
+ return /* @__PURE__ */ React19__default.createElement("span", { style: { display: "block", textAlign: "right" } }, formatter2(cell.getValue()));
4141
+ } : ({ cell, renderedCellValue, row }) => {
4137
4142
  const cellId = row.original[`${cell.column.id} ID`];
4138
4143
  return /* @__PURE__ */ React19__default.createElement(Flex, { justify: "space-between", sx: { width: "100%", maxWidth: 400 }, gap: "sm" }, /* @__PURE__ */ React19__default.createElement(
4139
4144
  Text,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datawheel/data-explorer",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "main": "./dist/main.mjs",
5
5
  "types": "./dist/main.d.mts",
6
6
  "files": [
@@ -70,4 +70,4 @@
70
70
  "vite": "^5.0.0",
71
71
  "wrangler": "^3.59.0"
72
72
  }
73
- }
73
+ }