@vizzly/dashboard 0.15.0 → 0.15.1-dev-bf37af9c56e45d64667fdf7b5c96aa2a9c2b02e4

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.
@@ -9,6 +9,7 @@ import { LoadedVizzlyHook } from '../../../../shared-ui/src/hooks/useVizzly';
9
9
  import { VizzlyServicesProperties } from '../../../../services/src';
10
10
  import { GlobalLibrary } from '../../../../shared-logic/src/GlobalLibrary';
11
11
  import { PersistedReport } from '@vizzly/api-client';
12
+ import { VizzlyTranslations } from '../../../../shared-logic/src/Translations/translation.types';
12
13
  declare type Params = {
13
14
  parentDashboardId: string | undefined;
14
15
  identityCallback: VizzlyServicesProperties['identity'];
@@ -20,6 +21,8 @@ declare type Params = {
20
21
  programmaticDashboard?: VizzlyServicesProperties['programmaticDashboard'];
21
22
  textOverride: TextOverride;
22
23
  isEditor?: boolean;
24
+ developerMode?: boolean;
25
+ textOverrides?: Partial<VizzlyTranslations>;
23
26
  };
24
27
  export declare type StillLoading = null;
25
28
  export declare type ErrorProvided = {
@@ -11630,7 +11630,11 @@ var buildDownloadQuery = function buildDownloadQuery(dataSet, maxCSVDownloadLimi
11630
11630
  removeAggregateMaths: true,
11631
11631
  removePercentage: true,
11632
11632
  removeConditional: true,
11633
- removeAggregateCustomBuildMetric: true
11633
+ removeAggregateCustomBuildMetric: true,
11634
+ removeRoundedNumbers: true,
11635
+ removeCustomBuildMetric: true,
11636
+ removeRuleGrouping: true,
11637
+ removeDateCalculations: true
11634
11638
  });
11635
11639
  var measure = [].concat(fields).map(function (field) {
11636
11640
  return {
@@ -12479,8 +12483,8 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
12479
12483
  },
12480
12484
  description: textOverride('number_format_option.minutes_to_hours_minutes', 'Minutes to hours & minutes')
12481
12485
  },
12482
- hour_of_day: {
12483
- description: 'Hour of the day',
12486
+ _vizzly_hour_of_day: {
12487
+ description: textOverride('number_format_option.hour_of_day', 'Hour of the day'),
12484
12488
  formatter: function formatter(value, noValueReplacement) {
12485
12489
  if (noValueReplacement === void 0) {
12486
12490
  noValueReplacement = noValue;
@@ -12489,8 +12493,8 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
12489
12493
  return format$1(value, 'hour_of_day');
12490
12494
  }
12491
12495
  },
12492
- month_of_year: {
12493
- description: 'Month of the year',
12496
+ _vizzly_month_of_year: {
12497
+ description: textOverride('number_format_option.month_of_year', 'Month of the year'),
12494
12498
  formatter: function formatter(value, noValueReplacement) {
12495
12499
  if (noValueReplacement === void 0) {
12496
12500
  noValueReplacement = noValue;
@@ -12499,8 +12503,8 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
12499
12503
  return format$1(value, 'month_of_year');
12500
12504
  }
12501
12505
  },
12502
- day_of_month: {
12503
- description: 'Day of month',
12506
+ _vizzly_day_of_month: {
12507
+ description: textOverride('number_format_option.day_of_month', 'Day of month'),
12504
12508
  formatter: function formatter(value, noValueReplacement) {
12505
12509
  if (noValueReplacement === void 0) {
12506
12510
  noValueReplacement = noValue;
@@ -12509,8 +12513,8 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
12509
12513
  return format$1(value, 'day_of_month');
12510
12514
  }
12511
12515
  },
12512
- day_of_week_iso: {
12513
- description: 'Day of week',
12516
+ _vizzly_day_of_week_iso: {
12517
+ description: textOverride('number_format_option.day_of_week', 'Day of week'),
12514
12518
  formatter: function formatter(value, noValueReplacement) {
12515
12519
  if (noValueReplacement === void 0) {
12516
12520
  noValueReplacement = noValue;
@@ -12519,8 +12523,8 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
12519
12523
  return format$1(value, 'day_of_week_iso');
12520
12524
  }
12521
12525
  },
12522
- week_of_year: {
12523
- description: 'Week of year',
12526
+ _vizzly_week_of_year: {
12527
+ description: textOverride('number_format_option.week_of_year', 'Week of year'),
12524
12528
  formatter: function formatter(value, noValueReplacement) {
12525
12529
  if (noValueReplacement === void 0) {
12526
12530
  noValueReplacement = noValue;
@@ -28661,7 +28665,7 @@ var FilterInputForm = function FilterInputForm(props) {
28661
28665
  }), props.onAddOrFilter && jsxRuntime.jsx(OrWrapper, {
28662
28666
  children: jsxRuntime.jsx(Tooltip, {
28663
28667
  tooltipContent: function tooltipContent() {
28664
- return 'Add OR filter';
28668
+ return textOverride('filters.add_or_filter', 'Add OR filter');
28665
28669
  },
28666
28670
  children: jsxRuntime.jsx(Button$2, {
28667
28671
  secondary: true,
@@ -57614,15 +57618,15 @@ function customMetricText(key, textOverride) {
57614
57618
  subtext: textOverride('custom_metric_description.conditional', 'Create a conditional field')
57615
57619
  },
57616
57620
  customBuildMetric: {
57617
- title: textOverride('custom_metric_title.caclulated_field', 'Custom Metric Builder'),
57618
- subtext: textOverride('custom_metric_description.caclulated_field', 'Create a custom build field')
57621
+ title: textOverride('custom_metric_title.calculated_field', 'Custom Metric Builder'),
57622
+ subtext: textOverride('custom_metric_description.calculated_field', 'Create a custom build field')
57619
57623
  }
57620
57624
  };
57621
57625
  return values[key];
57622
57626
  }
57623
57627
  function buildCustomMetricTitle(key, textOverride) {
57624
- return textOverride('custom_metric_modal_title', '[[custom_metric_title]] Custom Metric', {
57625
- custom_metric_title: customMetricText(key, textOverride).title
57628
+ return textOverride('custom_metric_modal_title', '[[customMetricTitle]] Custom Metric', {
57629
+ customMetricTitle: customMetricText(key, textOverride).title
57626
57630
  });
57627
57631
  }
57628
57632
 
@@ -60410,7 +60414,7 @@ var RowOptions = function RowOptions(props) {
60410
60414
  });
60411
60415
  }
60412
60416
  };
60413
- var label = textOverride('cell_options', 'Move Row') + " " + (props == null ? void 0 : props.direction);
60417
+ var label = (props == null ? void 0 : props.direction) === Direction$2.Up ? textOverride('move_row_up', 'Move Row Up') : textOverride('move_row_down', 'Move Row Down');
60414
60418
  return jsxRuntime.jsx(Tooltip, {
60415
60419
  placement: "right-start",
60416
60420
  tooltipContent: function tooltipContent() {
@@ -69397,7 +69401,7 @@ var CustomMetricModal = function CustomMetricModal(props) {
69397
69401
  onClose: props.onClose,
69398
69402
  disableDnD: true,
69399
69403
  children: [jsxRuntime.jsx(Modal.Header, {
69400
- title: "Custom Metric Builder"
69404
+ title: textOverride('custom_metric_title.calculated_field', 'Custom Metric Builder')
69401
69405
  }), jsxRuntime.jsxs(Modal.Content, {
69402
69406
  children: [jsxRuntime.jsx(PanelProperty, {
69403
69407
  children: jsxRuntime.jsx(Input, {
@@ -74285,9 +74289,9 @@ var useVizzly = function useVizzly(properties, options) {
74285
74289
  case 0:
74286
74290
  _context.prev = 0;
74287
74291
  _context.next = 3;
74288
- return Vizzly$1.load(properties, {
74292
+ return Vizzly$1.load(properties, _extends({}, options, {
74289
74293
  apiHost: (options == null ? void 0 : options.apiHost) || 'https://api.vizzly.co'
74290
- });
74294
+ }));
74291
74295
  case 3:
74292
74296
  vizzlyRef.current = _context.sent;
74293
74297
  _context.next = 6;
@@ -74713,7 +74717,9 @@ var useSessionContext = function useSessionContext(params) {
74713
74717
  dataSets: params.loadDataSetsCallback,
74714
74718
  programmaticDashboard: params.programmaticDashboard
74715
74719
  }, {
74716
- apiHost: params.apiConfig.host
74720
+ apiHost: params.apiConfig.host,
74721
+ developerMode: params.developerMode,
74722
+ textOverrides: params.textOverrides
74717
74723
  });
74718
74724
  var loadedStrategy = useDashboardStrategy(getStrategy(vizzly, params.parentDashboardId, params.dashboardId, params.isEditor), vizzly, params.programmaticDashboard);
74719
74725
  var _useScheduledReports = useScheduledReports(vizzly, loadedStrategy == null || (_loadedStrategy$dashb = loadedStrategy.dashboard) == null || (_loadedStrategy$dashb = _loadedStrategy$dashb.permission) == null ? void 0 : _loadedStrategy$dashb.token),
@@ -76170,7 +76176,7 @@ var GlobalProvider = function GlobalProvider(props) {
76170
76176
  }));
76171
76177
  };
76172
76178
  var GlobalProviderContents = function GlobalProviderContents(props) {
76173
- var _props$id, _session$identityConf, _props$dateFilterOpti, _session$vizzly$savin;
76179
+ var _props$developerTools, _props$id, _session$identityConf, _props$dateFilterOpti, _session$vizzly$savin;
76174
76180
  var implementationMeta = buildImplementationMeta(props);
76175
76181
  var apiConfig = props.vizzlyApiHost ? {
76176
76182
  host: props.vizzlyApiHost
@@ -76178,9 +76184,9 @@ var GlobalProviderContents = function GlobalProviderContents(props) {
76178
76184
  host: 'https://api.vizzly.co'
76179
76185
  };
76180
76186
  var vizzlyAPI = api(apiConfig);
76187
+ var developerMode = typeof props.developerTools === 'object' && ((_props$developerTools = props.developerTools) == null ? void 0 : _props$developerTools.translationKeys) === true;
76181
76188
  var textOverride = function textOverride(key, value, options) {
76182
- var _props$developerTools;
76183
- return generateTranslation(key, value, options, props.textOverrides, typeof props.developerTools === 'object' && ((_props$developerTools = props.developerTools) == null ? void 0 : _props$developerTools.translationKeys) === true);
76189
+ return generateTranslation(key, value, options, props.textOverrides, developerMode);
76184
76190
  };
76185
76191
  var session = useSessionContext({
76186
76192
  dashboardId: props.dashboardId,
@@ -76192,7 +76198,9 @@ var GlobalProviderContents = function GlobalProviderContents(props) {
76192
76198
  implementationMeta: implementationMeta,
76193
76199
  programmaticDashboard: props.parentDashboard,
76194
76200
  textOverride: textOverride,
76195
- isEditor: props.isEditor
76201
+ isEditor: props.isEditor,
76202
+ developerMode: developerMode,
76203
+ textOverrides: props.textOverrides
76196
76204
  });
76197
76205
  useOnDashboardLoadCallback(session, props.onDashboardLoad);
76198
76206
  var variables = useVariables(props.variables, (_props$id = props.id) != null ? _props$id : '');