@richardmcquiston01/dashboard-widgets-toolkit 0.14.0 → 0.16.0

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/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, ReactElement, RefObject } from 'react';
2
- import { D as DashboardWidget, W as WidgetSize, a as WidgetFill, G as GraphWidgetData, N as NiceDomain, b as WidgetDefinition, c as DetailProviderOptions, d as DetailData, e as DetailQuery, O as OptionValues, L as Locale, f as DashboardLayout, g as WidgetViewerSettings, h as WidgetSettingsPatch, A as AlertListWidgetData, B as BarListWidgetData, i as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, j as DetailSort, k as TextWidgetData, l as WidgetData, m as LayoutPersistence, S as StoreScope, P as PageItem, n as NormalizeOptions, o as ResolveOptions, p as WidgetContext, q as WidgetProviders } from './storage-_Eb8Y98-.cjs';
2
+ import { D as DashboardWidget, W as WidgetSize, a as WidgetFill, G as GraphWidgetData, N as NiceDomain, b as WidgetDefinition, c as DetailProviderOptions, d as DetailData, e as DetailQuery, O as OptionValues, L as Locale, f as DashboardLayout, g as WidgetViewerSettings, h as WidgetSettingsPatch, A as AlertListWidgetData, B as BarListWidgetData, i as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, j as DetailSort, k as TextWidgetData, l as WidgetData, m as LayoutPersistence, S as StoreScope, P as PageItem, n as NormalizeOptions, o as ResolveOptions, p as WidgetContext, q as WidgetProviders } from './storage-oivwB7al.cjs';
3
3
 
4
4
  interface WidgetCardProps {
5
5
  readonly title: string;
@@ -216,6 +216,18 @@ interface DashboardLabels {
216
216
  readonly menuHide: string;
217
217
  /** The card menu's item that opens the Options dialog. */
218
218
  readonly menuOptions: string;
219
+ /** Arrange menu item that makes a clone of the widget. */
220
+ readonly menuDuplicate: string;
221
+ readonly duplicate: (title: string) => string;
222
+ /** Accessible name of Duplicate when the page has no room; `reason` says why. */
223
+ readonly duplicateBlocked: (title: string, reason: string) => string;
224
+ readonly duplicated: (title: string) => string;
225
+ /** Options dialog button that deletes a clone. */
226
+ readonly optionsDelete: string;
227
+ readonly confirmDelete: string;
228
+ readonly deleted: (title: string) => string;
229
+ /** The title suggested for a clone shown with another view. */
230
+ readonly suggestedViewTitle: (title: string, viewLabel: string) => string;
219
231
  /** The Options dialog: heading, fields and buttons. */
220
232
  readonly optionsFor: (title: string) => string;
221
233
  readonly optionsTitleField: string;
@@ -225,6 +237,10 @@ interface DashboardLabels {
225
237
  /** e.g. "6 of 12 (1/2)". */
226
238
  readonly widthOption: (width: number, share: string) => string;
227
239
  readonly optionsFlexible: string;
240
+ /** Label of the View field in the Options dialog. */
241
+ readonly optionsViewField: string;
242
+ /** A view's name when it is the one shown until the viewer picks, e.g. "Table (default)". */
243
+ readonly viewDefault: (viewLabel: string) => string;
228
244
  readonly optionsDeclared: string;
229
245
  readonly apply: string;
230
246
  readonly cancel: string;
@@ -389,11 +405,18 @@ interface WidgetOptionsDialogProps {
389
405
  };
390
406
  /** Whether another widget already shows this title; the dialog refuses it. */
391
407
  readonly isTitleInUse?: (title: string) => boolean;
408
+ /**
409
+ * For a clone: its original's title, so choosing another view can suggest
410
+ * a title like "Recent Orders Line Chart".
411
+ */
412
+ readonly sourceTitle?: string;
413
+ /** For a clone: shows "Delete this widget"; called after the viewer confirms. */
414
+ readonly onDelete?: () => void;
392
415
  /** Called after the viewer confirms Apply, Reset or Revert. */
393
416
  readonly onApply: (patch: WidgetSettingsPatch) => void;
394
417
  readonly onClose: () => void;
395
418
  }
396
- declare function WidgetOptionsDialog({ definition, settings, baseline, isTitleInUse, onApply, onClose, }: WidgetOptionsDialogProps): ReactElement;
419
+ declare function WidgetOptionsDialog({ definition, settings, baseline, isTitleInUse, sourceTitle, onDelete, onApply, onClose, }: WidgetOptionsDialogProps): ReactElement;
397
420
 
398
421
  /**
399
422
  * Default colors, used as `var(--dwt-*, fallback)` so charts read correctly
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, ReactElement, RefObject } from 'react';
2
- import { D as DashboardWidget, W as WidgetSize, a as WidgetFill, G as GraphWidgetData, N as NiceDomain, b as WidgetDefinition, c as DetailProviderOptions, d as DetailData, e as DetailQuery, O as OptionValues, L as Locale, f as DashboardLayout, g as WidgetViewerSettings, h as WidgetSettingsPatch, A as AlertListWidgetData, B as BarListWidgetData, i as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, j as DetailSort, k as TextWidgetData, l as WidgetData, m as LayoutPersistence, S as StoreScope, P as PageItem, n as NormalizeOptions, o as ResolveOptions, p as WidgetContext, q as WidgetProviders } from './storage-_Eb8Y98-.js';
2
+ import { D as DashboardWidget, W as WidgetSize, a as WidgetFill, G as GraphWidgetData, N as NiceDomain, b as WidgetDefinition, c as DetailProviderOptions, d as DetailData, e as DetailQuery, O as OptionValues, L as Locale, f as DashboardLayout, g as WidgetViewerSettings, h as WidgetSettingsPatch, A as AlertListWidgetData, B as BarListWidgetData, i as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, j as DetailSort, k as TextWidgetData, l as WidgetData, m as LayoutPersistence, S as StoreScope, P as PageItem, n as NormalizeOptions, o as ResolveOptions, p as WidgetContext, q as WidgetProviders } from './storage-oivwB7al.js';
3
3
 
4
4
  interface WidgetCardProps {
5
5
  readonly title: string;
@@ -216,6 +216,18 @@ interface DashboardLabels {
216
216
  readonly menuHide: string;
217
217
  /** The card menu's item that opens the Options dialog. */
218
218
  readonly menuOptions: string;
219
+ /** Arrange menu item that makes a clone of the widget. */
220
+ readonly menuDuplicate: string;
221
+ readonly duplicate: (title: string) => string;
222
+ /** Accessible name of Duplicate when the page has no room; `reason` says why. */
223
+ readonly duplicateBlocked: (title: string, reason: string) => string;
224
+ readonly duplicated: (title: string) => string;
225
+ /** Options dialog button that deletes a clone. */
226
+ readonly optionsDelete: string;
227
+ readonly confirmDelete: string;
228
+ readonly deleted: (title: string) => string;
229
+ /** The title suggested for a clone shown with another view. */
230
+ readonly suggestedViewTitle: (title: string, viewLabel: string) => string;
219
231
  /** The Options dialog: heading, fields and buttons. */
220
232
  readonly optionsFor: (title: string) => string;
221
233
  readonly optionsTitleField: string;
@@ -225,6 +237,10 @@ interface DashboardLabels {
225
237
  /** e.g. "6 of 12 (1/2)". */
226
238
  readonly widthOption: (width: number, share: string) => string;
227
239
  readonly optionsFlexible: string;
240
+ /** Label of the View field in the Options dialog. */
241
+ readonly optionsViewField: string;
242
+ /** A view's name when it is the one shown until the viewer picks, e.g. "Table (default)". */
243
+ readonly viewDefault: (viewLabel: string) => string;
228
244
  readonly optionsDeclared: string;
229
245
  readonly apply: string;
230
246
  readonly cancel: string;
@@ -389,11 +405,18 @@ interface WidgetOptionsDialogProps {
389
405
  };
390
406
  /** Whether another widget already shows this title; the dialog refuses it. */
391
407
  readonly isTitleInUse?: (title: string) => boolean;
408
+ /**
409
+ * For a clone: its original's title, so choosing another view can suggest
410
+ * a title like "Recent Orders Line Chart".
411
+ */
412
+ readonly sourceTitle?: string;
413
+ /** For a clone: shows "Delete this widget"; called after the viewer confirms. */
414
+ readonly onDelete?: () => void;
392
415
  /** Called after the viewer confirms Apply, Reset or Revert. */
393
416
  readonly onApply: (patch: WidgetSettingsPatch) => void;
394
417
  readonly onClose: () => void;
395
418
  }
396
- declare function WidgetOptionsDialog({ definition, settings, baseline, isTitleInUse, onApply, onClose, }: WidgetOptionsDialogProps): ReactElement;
419
+ declare function WidgetOptionsDialog({ definition, settings, baseline, isTitleInUse, sourceTitle, onDelete, onApply, onClose, }: WidgetOptionsDialogProps): ReactElement;
397
420
 
398
421
  /**
399
422
  * Default colors, used as `var(--dwt-*, fallback)` so charts read correctly