@quillsql/react 2.16.12 → 2.16.13

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.cjs CHANGED
@@ -53450,12 +53450,15 @@ var CHART_TYPE_STYLES = {
53450
53450
  table: { height: "700px", width: "1000px" }
53451
53451
  };
53452
53452
  var DEFAULT_STYLE = { height: "400px", width: "600px" };
53453
- function StaticChart({
53454
- reportId,
53455
- onClickChartElement,
53456
- containerStyle,
53457
- showLegend = false
53458
- }) {
53453
+ var MIN_CHART_HEIGHT_PX = 240;
53454
+ function StaticChart(props) {
53455
+ const {
53456
+ reportId,
53457
+ onClickChartElement,
53458
+ containerStyle,
53459
+ showLegend = false,
53460
+ className
53461
+ } = props;
53459
53462
  const {
53460
53463
  report,
53461
53464
  loading,
@@ -53465,9 +53468,15 @@ function StaticChart({
53465
53468
  prevPage,
53466
53469
  sortRows
53467
53470
  } = useDashboardReportInternal(reportId);
53468
- const mergedStyle = {
53469
- ...report?.chartType ? CHART_TYPE_STYLES[report.chartType] || DEFAULT_STYLE : DEFAULT_STYLE,
53470
- ...containerStyle
53471
+ const baseStyle = report?.chartType && CHART_TYPE_STYLES[report.chartType] ? CHART_TYPE_STYLES[report.chartType] : DEFAULT_STYLE;
53472
+ const mergedStyle = className ? { ...containerStyle ?? {} } : { ...baseStyle, ...containerStyle ?? {} };
53473
+ const safeContainerStyle = {
53474
+ ...mergedStyle,
53475
+ // Avoid enforcing a fallback minHeight when a className is meant to set
53476
+ // the sizing via CSS. Only apply the safety net when className is absent.
53477
+ ...!className && {
53478
+ minHeight: mergedStyle.minHeight ?? (typeof mergedStyle.height === "number" && mergedStyle.height > 0 ? mergedStyle.height : typeof mergedStyle.height === "string" ? mergedStyle.height.trim().endsWith("%") ? `${MIN_CHART_HEIGHT_PX}px` : mergedStyle.height : `${MIN_CHART_HEIGHT_PX}px`)
53479
+ }
53471
53480
  };
53472
53481
  const onPageChange = (page) => {
53473
53482
  if (page == pageNumber - 1) {
@@ -53492,7 +53501,8 @@ function StaticChart({
53492
53501
  } : void 0,
53493
53502
  onClickChartElement,
53494
53503
  loading,
53495
- containerStyle: mergedStyle,
53504
+ className,
53505
+ containerStyle: safeContainerStyle,
53496
53506
  showLegend,
53497
53507
  onPageChange,
53498
53508
  tableRowsLoading: pageLoading,
package/dist/index.d.cts CHANGED
@@ -2503,13 +2503,22 @@ interface ChartEditorProps {
2503
2503
  */
2504
2504
  declare function ChartEditor({ isOpen, reportId, isAdmin, chartBuilderTitle, chartBuilderButtonLabel, onAddToDashboardComplete, onSubmitEditReport, onDiscardChanges, destinationDashboard, destinationSection, organizationName, isHorizontalView, onDelete, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, SubHeaderComponent, LabelComponent, TextComponent, DeleteButtonComponent, ModalComponent, CardComponent, PopoverComponent, LoadingComponent, TableComponent, ChartBuilderInputRowContainer, ChartBuilderInputColumnContainer, PivotRowContainer, PivotColumnContainer, ErrorMessageComponent, ChartBuilderFormContainer, ErrorComponent, hideDeleteButton, hideSubmitButton, showTableFormatOptions, showDashboardFilterFields, chartBuilderOptions, onClickChartElement, onClickChartError, }: ChartEditorProps): react_jsx_runtime.JSX.Element;
2505
2505
 
2506
- interface StaticChartProps {
2506
+ interface StaticChartBaseProps {
2507
2507
  reportId: string;
2508
2508
  onClickChartElement?: (data: any) => void;
2509
- containerStyle?: React.CSSProperties;
2510
2509
  showLegend?: boolean;
2511
2510
  }
2512
- declare function StaticChart({ reportId, onClickChartElement, containerStyle, showLegend, }: StaticChartProps): react_jsx_runtime.JSX.Element;
2511
+ type StaticChartProps = (StaticChartBaseProps & {
2512
+ className: string;
2513
+ containerStyle?: never;
2514
+ }) | (StaticChartBaseProps & {
2515
+ containerStyle: React.CSSProperties;
2516
+ className?: never;
2517
+ }) | (StaticChartBaseProps & {
2518
+ className?: undefined;
2519
+ containerStyle?: undefined;
2520
+ });
2521
+ declare function StaticChart(props: StaticChartProps): react_jsx_runtime.JSX.Element;
2513
2522
 
2514
2523
  declare const quillFormat: ({ value, format, }: {
2515
2524
  value: any;
package/dist/index.d.ts CHANGED
@@ -2503,13 +2503,22 @@ interface ChartEditorProps {
2503
2503
  */
2504
2504
  declare function ChartEditor({ isOpen, reportId, isAdmin, chartBuilderTitle, chartBuilderButtonLabel, onAddToDashboardComplete, onSubmitEditReport, onDiscardChanges, destinationDashboard, destinationSection, organizationName, isHorizontalView, onDelete, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, SubHeaderComponent, LabelComponent, TextComponent, DeleteButtonComponent, ModalComponent, CardComponent, PopoverComponent, LoadingComponent, TableComponent, ChartBuilderInputRowContainer, ChartBuilderInputColumnContainer, PivotRowContainer, PivotColumnContainer, ErrorMessageComponent, ChartBuilderFormContainer, ErrorComponent, hideDeleteButton, hideSubmitButton, showTableFormatOptions, showDashboardFilterFields, chartBuilderOptions, onClickChartElement, onClickChartError, }: ChartEditorProps): react_jsx_runtime.JSX.Element;
2505
2505
 
2506
- interface StaticChartProps {
2506
+ interface StaticChartBaseProps {
2507
2507
  reportId: string;
2508
2508
  onClickChartElement?: (data: any) => void;
2509
- containerStyle?: React.CSSProperties;
2510
2509
  showLegend?: boolean;
2511
2510
  }
2512
- declare function StaticChart({ reportId, onClickChartElement, containerStyle, showLegend, }: StaticChartProps): react_jsx_runtime.JSX.Element;
2511
+ type StaticChartProps = (StaticChartBaseProps & {
2512
+ className: string;
2513
+ containerStyle?: never;
2514
+ }) | (StaticChartBaseProps & {
2515
+ containerStyle: React.CSSProperties;
2516
+ className?: never;
2517
+ }) | (StaticChartBaseProps & {
2518
+ className?: undefined;
2519
+ containerStyle?: undefined;
2520
+ });
2521
+ declare function StaticChart(props: StaticChartProps): react_jsx_runtime.JSX.Element;
2513
2522
 
2514
2523
  declare const quillFormat: ({ value, format, }: {
2515
2524
  value: any;
package/dist/index.js CHANGED
@@ -53643,12 +53643,15 @@ var CHART_TYPE_STYLES = {
53643
53643
  table: { height: "700px", width: "1000px" }
53644
53644
  };
53645
53645
  var DEFAULT_STYLE = { height: "400px", width: "600px" };
53646
- function StaticChart({
53647
- reportId,
53648
- onClickChartElement,
53649
- containerStyle,
53650
- showLegend = false
53651
- }) {
53646
+ var MIN_CHART_HEIGHT_PX = 240;
53647
+ function StaticChart(props) {
53648
+ const {
53649
+ reportId,
53650
+ onClickChartElement,
53651
+ containerStyle,
53652
+ showLegend = false,
53653
+ className
53654
+ } = props;
53652
53655
  const {
53653
53656
  report,
53654
53657
  loading,
@@ -53658,9 +53661,15 @@ function StaticChart({
53658
53661
  prevPage,
53659
53662
  sortRows
53660
53663
  } = useDashboardReportInternal(reportId);
53661
- const mergedStyle = {
53662
- ...report?.chartType ? CHART_TYPE_STYLES[report.chartType] || DEFAULT_STYLE : DEFAULT_STYLE,
53663
- ...containerStyle
53664
+ const baseStyle = report?.chartType && CHART_TYPE_STYLES[report.chartType] ? CHART_TYPE_STYLES[report.chartType] : DEFAULT_STYLE;
53665
+ const mergedStyle = className ? { ...containerStyle ?? {} } : { ...baseStyle, ...containerStyle ?? {} };
53666
+ const safeContainerStyle = {
53667
+ ...mergedStyle,
53668
+ // Avoid enforcing a fallback minHeight when a className is meant to set
53669
+ // the sizing via CSS. Only apply the safety net when className is absent.
53670
+ ...!className && {
53671
+ minHeight: mergedStyle.minHeight ?? (typeof mergedStyle.height === "number" && mergedStyle.height > 0 ? mergedStyle.height : typeof mergedStyle.height === "string" ? mergedStyle.height.trim().endsWith("%") ? `${MIN_CHART_HEIGHT_PX}px` : mergedStyle.height : `${MIN_CHART_HEIGHT_PX}px`)
53672
+ }
53664
53673
  };
53665
53674
  const onPageChange = (page) => {
53666
53675
  if (page == pageNumber - 1) {
@@ -53685,7 +53694,8 @@ function StaticChart({
53685
53694
  } : void 0,
53686
53695
  onClickChartElement,
53687
53696
  loading,
53688
- containerStyle: mergedStyle,
53697
+ className,
53698
+ containerStyle: safeContainerStyle,
53689
53699
  showLegend,
53690
53700
  onPageChange,
53691
53701
  tableRowsLoading: pageLoading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.16.12",
3
+ "version": "2.16.13",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {