@richardmcquiston01/dashboard-widgets-toolkit 0.9.0 → 0.10.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, 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, L as Locale, f as DashboardLayout, A as AlertListWidgetData, B as BarListWidgetData, g as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, h as TextWidgetData, i as WidgetData, j as ResolveOptions, k as WidgetContext, l as WidgetProviders } from './scale-CrXxawQn.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, L as Locale, f as DashboardLayout, A as AlertListWidgetData, B as BarListWidgetData, g as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, h as TextWidgetData, i as WidgetData, j as ResolveOptions, k as WidgetContext, l as WidgetProviders } from './scale-N69bo7wo.cjs';
3
3
 
4
4
  interface WidgetCardProps {
5
5
  readonly title: string;
@@ -152,7 +152,7 @@ declare function useDetailData(definition: WidgetDefinition, load: DetailLoader
152
152
  };
153
153
 
154
154
  /** Every element that carries a stable `dwt-*` class, for `classNames`. */
155
- type DashboardClassSlot = 'dashboard' | 'hiddenBar' | 'toolbar' | 'grid' | 'card' | 'cardHeader' | 'cardTitle' | 'cardDescription' | 'cardActions' | 'cardBody' | 'cardFooter' | 'button' | 'status' | 'empty' | 'error' | 'text' | 'kpi' | 'gauge' | 'table' | 'barList' | 'alertList' | 'chart' | 'legend' | 'tooltip' | 'tableTwin' | 'detail';
155
+ type DashboardClassSlot = 'dashboard' | 'hiddenBar' | 'toolbar' | 'pageBar' | 'grid' | 'card' | 'cardHeader' | 'cardTitle' | 'cardDescription' | 'cardActions' | 'cardBody' | 'cardFooter' | 'button' | 'status' | 'empty' | 'error' | 'text' | 'kpi' | 'gauge' | 'table' | 'barList' | 'alertList' | 'chart' | 'legend' | 'tooltip' | 'tableTwin' | 'detail';
156
156
  /**
157
157
  * Extra classes per slot, appended to the `dwt-*` class (never replacing
158
158
  * it), e.g. `{ card: 'rounded-lg shadow-sm' }` for Tailwind.
@@ -190,6 +190,30 @@ interface DashboardLabels {
190
190
  readonly locked: (title: string) => string;
191
191
  /** The lock icon on a card shown to an administrator (`overrideLocks`). */
192
192
  readonly lockedForViewers: (title: string) => string;
193
+ /** Pages: names the tab list, and each tab ("Page 2 of 3: Sales"). */
194
+ readonly pageBar: string;
195
+ readonly pageTabName: (index: number, count: number, title: string) => string;
196
+ readonly previousPageButton: string;
197
+ readonly nextPageButton: string;
198
+ /** Page management while editing. */
199
+ readonly managePages: string;
200
+ readonly addPage: string;
201
+ readonly renamePage: (title: string) => string;
202
+ readonly pageTitle: string;
203
+ readonly savePageTitle: string;
204
+ readonly cancelPageTitle: string;
205
+ readonly deletePage: (title: string) => string;
206
+ readonly confirmDeletePage: (title: string) => string;
207
+ readonly movePageLeft: (title: string) => string;
208
+ readonly movePageRight: (title: string) => string;
209
+ /** The select on each card that moves it to another page. */
210
+ readonly moveToPage: (title: string) => string;
211
+ readonly moveToPagePlaceholder: string;
212
+ readonly moveToPageOption: (title: string, rowsFree: number) => string;
213
+ readonly newPageOption: string;
214
+ readonly movedToPage: (title: string, pageTitle: string) => string;
215
+ readonly pageFull: (pageTitle: string, maxRows: number) => string;
216
+ readonly emptyPage: string;
193
217
  /** Added to the accessible name of links that open in a new tab. */
194
218
  readonly opensInNewTab: string;
195
219
  /** The card's View button, opening the detail view. */
@@ -277,6 +301,19 @@ interface DashboardProps extends WidgetSettings {
277
301
  readonly defaultLayout?: DashboardLayout;
278
302
  /** Show the built-in Customize/Done/Reset toolbar (toggle mode). Default true. */
279
303
  readonly toolbar?: boolean;
304
+ /**
305
+ * The page in view (a page key) when the layout has pages. Controlled with
306
+ * `onActivePageChange`; without it the dashboard keeps its own, starting on
307
+ * `defaultActivePage` or the first page. Pages never listed fall back to
308
+ * the first.
309
+ */
310
+ readonly activePage?: string;
311
+ readonly defaultActivePage?: string;
312
+ readonly onActivePageChange?: (pageKey: string) => void;
313
+ /** Rows a page holds unless the page says otherwise. Default 4. */
314
+ readonly maxRows?: number;
315
+ /** Most pages the viewer can add while editing. Default: no limit. */
316
+ readonly maxPages?: number;
280
317
  readonly onRetry?: (key: string) => void;
281
318
  /**
282
319
  * Loads the full data for a widget's detail view (widgets whose definition
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, 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, L as Locale, f as DashboardLayout, A as AlertListWidgetData, B as BarListWidgetData, g as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, h as TextWidgetData, i as WidgetData, j as ResolveOptions, k as WidgetContext, l as WidgetProviders } from './scale-CrXxawQn.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, L as Locale, f as DashboardLayout, A as AlertListWidgetData, B as BarListWidgetData, g as GaugeWidgetData, K as KpiWidgetData, T as TableWidgetData, R as ResolvedTableControls, h as TextWidgetData, i as WidgetData, j as ResolveOptions, k as WidgetContext, l as WidgetProviders } from './scale-N69bo7wo.js';
3
3
 
4
4
  interface WidgetCardProps {
5
5
  readonly title: string;
@@ -152,7 +152,7 @@ declare function useDetailData(definition: WidgetDefinition, load: DetailLoader
152
152
  };
153
153
 
154
154
  /** Every element that carries a stable `dwt-*` class, for `classNames`. */
155
- type DashboardClassSlot = 'dashboard' | 'hiddenBar' | 'toolbar' | 'grid' | 'card' | 'cardHeader' | 'cardTitle' | 'cardDescription' | 'cardActions' | 'cardBody' | 'cardFooter' | 'button' | 'status' | 'empty' | 'error' | 'text' | 'kpi' | 'gauge' | 'table' | 'barList' | 'alertList' | 'chart' | 'legend' | 'tooltip' | 'tableTwin' | 'detail';
155
+ type DashboardClassSlot = 'dashboard' | 'hiddenBar' | 'toolbar' | 'pageBar' | 'grid' | 'card' | 'cardHeader' | 'cardTitle' | 'cardDescription' | 'cardActions' | 'cardBody' | 'cardFooter' | 'button' | 'status' | 'empty' | 'error' | 'text' | 'kpi' | 'gauge' | 'table' | 'barList' | 'alertList' | 'chart' | 'legend' | 'tooltip' | 'tableTwin' | 'detail';
156
156
  /**
157
157
  * Extra classes per slot, appended to the `dwt-*` class (never replacing
158
158
  * it), e.g. `{ card: 'rounded-lg shadow-sm' }` for Tailwind.
@@ -190,6 +190,30 @@ interface DashboardLabels {
190
190
  readonly locked: (title: string) => string;
191
191
  /** The lock icon on a card shown to an administrator (`overrideLocks`). */
192
192
  readonly lockedForViewers: (title: string) => string;
193
+ /** Pages: names the tab list, and each tab ("Page 2 of 3: Sales"). */
194
+ readonly pageBar: string;
195
+ readonly pageTabName: (index: number, count: number, title: string) => string;
196
+ readonly previousPageButton: string;
197
+ readonly nextPageButton: string;
198
+ /** Page management while editing. */
199
+ readonly managePages: string;
200
+ readonly addPage: string;
201
+ readonly renamePage: (title: string) => string;
202
+ readonly pageTitle: string;
203
+ readonly savePageTitle: string;
204
+ readonly cancelPageTitle: string;
205
+ readonly deletePage: (title: string) => string;
206
+ readonly confirmDeletePage: (title: string) => string;
207
+ readonly movePageLeft: (title: string) => string;
208
+ readonly movePageRight: (title: string) => string;
209
+ /** The select on each card that moves it to another page. */
210
+ readonly moveToPage: (title: string) => string;
211
+ readonly moveToPagePlaceholder: string;
212
+ readonly moveToPageOption: (title: string, rowsFree: number) => string;
213
+ readonly newPageOption: string;
214
+ readonly movedToPage: (title: string, pageTitle: string) => string;
215
+ readonly pageFull: (pageTitle: string, maxRows: number) => string;
216
+ readonly emptyPage: string;
193
217
  /** Added to the accessible name of links that open in a new tab. */
194
218
  readonly opensInNewTab: string;
195
219
  /** The card's View button, opening the detail view. */
@@ -277,6 +301,19 @@ interface DashboardProps extends WidgetSettings {
277
301
  readonly defaultLayout?: DashboardLayout;
278
302
  /** Show the built-in Customize/Done/Reset toolbar (toggle mode). Default true. */
279
303
  readonly toolbar?: boolean;
304
+ /**
305
+ * The page in view (a page key) when the layout has pages. Controlled with
306
+ * `onActivePageChange`; without it the dashboard keeps its own, starting on
307
+ * `defaultActivePage` or the first page. Pages never listed fall back to
308
+ * the first.
309
+ */
310
+ readonly activePage?: string;
311
+ readonly defaultActivePage?: string;
312
+ readonly onActivePageChange?: (pageKey: string) => void;
313
+ /** Rows a page holds unless the page says otherwise. Default 4. */
314
+ readonly maxRows?: number;
315
+ /** Most pages the viewer can add while editing. Default: no limit. */
316
+ readonly maxPages?: number;
280
317
  readonly onRetry?: (key: string) => void;
281
318
  /**
282
319
  * Loads the full data for a widget's detail view (widgets whose definition