@richardmcquiston01/dashboard-widgets-toolkit 0.1.0 → 0.2.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.
@@ -158,6 +158,14 @@ declare function emptyTextFor(payload: WidgetPayload): string | null;
158
158
  /** A size hint for grid layouts; renderers may map it to column spans. */
159
159
  declare const WIDGET_SIZES: readonly ["small", "medium", "large", "full"];
160
160
  type WidgetSize = (typeof WIDGET_SIZES)[number];
161
+ /**
162
+ * How a widget fills free space in a grid layout. `height` stretches it to
163
+ * the height of its row; `width` widens it to take the columns left over in
164
+ * its row; `both` does both. Absent, a widget is only as big as its content
165
+ * and `defaultSize`.
166
+ */
167
+ declare const WIDGET_FILLS: readonly ["height", "width", "both"];
168
+ type WidgetFill = (typeof WIDGET_FILLS)[number];
161
169
  /**
162
170
  * What a widget is, independent of its data. Mirrors Maker Toolkit's
163
171
  * `widget` table (`widget_key`, `title`, `description`, `view_type`,
@@ -176,6 +184,8 @@ interface WidgetDefinition {
176
184
  /** False hides it from every user. Default true. */
177
185
  readonly active?: boolean;
178
186
  readonly defaultSize?: WidgetSize;
187
+ /** Fill free space in the row (height, width or both). Default: none. */
188
+ readonly fill?: WidgetFill;
179
189
  }
180
190
  /**
181
191
  * Identity helper that keeps the literal `kind` (so typed providers can be
@@ -413,4 +423,4 @@ declare function niceDomain(values: readonly number[], tickCount?: number): Nice
413
423
  */
414
424
  declare function labelStride(count: number, maxLabels?: number): number;
415
425
 
416
- export { formatCount as $, type AlertListWidgetData as A, type BarListWidgetData as B, WIDGET_KINDS as C, type DashboardWidget as D, EMPTY_LAYOUT as E, type FormatOptions as F, type GraphWidgetData as G, WIDGET_SIZES as H, type WidgetContext as I, type WidgetDataOf as J, type KpiWidgetData as K, type Locale as L, MAX_GRAPH_SERIES as M, type NiceDomain as N, type OkWidget as O, type WidgetEmptyState as P, type WidgetProvider as Q, type ResolveOptions as R, type WidgetProviders as S, type TableWidgetData as T, type WidgetStatus as U, VALUE_FORMATS as V, type WidgetSize as W, defineWidget as X, emptyTextFor as Y, emptyWidget as Z, failedWidget as _, type DashboardLayout as a, formatPercentChange as a0, formatValue as a1, hiddenWidgets as a2, hideWidget as a3, isHidden as a4, isMinimized as a5, isWidgetEmptyState as a6, isWidgetKind as a7, isWidgetVisibleTo as a8, kpiDelta as a9, labelStride as aa, loadingWidgets as ab, minimizeWidget as ac, moveWidget as ad, moveWidgetBy as ae, moveWidgetDown as af, moveWidgetUp as ag, niceDomain as ah, niceStep as ai, parseLayout as aj, percentChange as ak, pruneLayout as al, resolvePayload as am, resolveWidget as an, resolveWidgets as ao, restoreWidget as ap, serializeLayout as aq, shareOf as ar, showWidget as as, sortDefinitions as at, toggleHidden as au, toggleMinimized as av, visibleWidgets as aw, widgetsFor as ax, type GaugeWidgetData as b, type TextWidgetData as c, type WidgetData as d, type WidgetDefinition as e, type WidgetKind as f, type WidgetPayload as g, type AlertListItem as h, type BarListItem as i, DEFAULT_COMPARISON_LABEL as j, DEFAULT_CURRENCY as k, DEFAULT_EMPTY_TEXT as l, type DeltaDirection as m, type DeltaSentiment as n, type EmptyWidget as o, type ErrorWidget as p, type GraphPoint as q, type GraphSeries as r, type KpiDelta as s, type KpiDeltaOptions as t, type LayoutItem as u, type LoadingWidget as v, type ResolvedWidget as w, type TableCell as x, type TableColumn as y, type ValueFormat as z };
426
+ export { emptyWidget as $, type AlertListWidgetData as A, type BarListWidgetData as B, type ValueFormat as C, type DashboardWidget as D, EMPTY_LAYOUT as E, type FormatOptions as F, type GraphWidgetData as G, WIDGET_FILLS as H, WIDGET_KINDS as I, WIDGET_SIZES as J, type KpiWidgetData as K, type Locale as L, MAX_GRAPH_SERIES as M, type NiceDomain as N, type OkWidget as O, type WidgetContext as P, type WidgetDataOf as Q, type ResolveOptions as R, type WidgetEmptyState as S, type TableWidgetData as T, type WidgetProvider as U, VALUE_FORMATS as V, type WidgetSize as W, type WidgetProviders as X, type WidgetStatus as Y, defineWidget as Z, emptyTextFor as _, type WidgetFill as a, failedWidget as a0, formatCount as a1, formatPercentChange as a2, formatValue as a3, hiddenWidgets as a4, hideWidget as a5, isHidden as a6, isMinimized as a7, isWidgetEmptyState as a8, isWidgetKind as a9, isWidgetVisibleTo as aa, kpiDelta as ab, labelStride as ac, loadingWidgets as ad, minimizeWidget as ae, moveWidget as af, moveWidgetBy as ag, moveWidgetDown as ah, moveWidgetUp as ai, niceDomain as aj, niceStep as ak, parseLayout as al, percentChange as am, pruneLayout as an, resolvePayload as ao, resolveWidget as ap, resolveWidgets as aq, restoreWidget as ar, serializeLayout as as, shareOf as at, showWidget as au, sortDefinitions as av, toggleHidden as aw, toggleMinimized as ax, visibleWidgets as ay, widgetsFor as az, type DashboardLayout as b, type GaugeWidgetData as c, type TextWidgetData as d, type WidgetData as e, type WidgetDefinition as f, type WidgetKind as g, type WidgetPayload as h, type AlertListItem as i, type BarListItem as j, DEFAULT_COMPARISON_LABEL as k, DEFAULT_CURRENCY as l, DEFAULT_EMPTY_TEXT as m, type DeltaDirection as n, type DeltaSentiment as o, type EmptyWidget as p, type ErrorWidget as q, type GraphPoint as r, type GraphSeries as s, type KpiDelta as t, type KpiDeltaOptions as u, type LayoutItem as v, type LoadingWidget as w, type ResolvedWidget as x, type TableCell as y, type TableColumn as z };
@@ -158,6 +158,14 @@ declare function emptyTextFor(payload: WidgetPayload): string | null;
158
158
  /** A size hint for grid layouts; renderers may map it to column spans. */
159
159
  declare const WIDGET_SIZES: readonly ["small", "medium", "large", "full"];
160
160
  type WidgetSize = (typeof WIDGET_SIZES)[number];
161
+ /**
162
+ * How a widget fills free space in a grid layout. `height` stretches it to
163
+ * the height of its row; `width` widens it to take the columns left over in
164
+ * its row; `both` does both. Absent, a widget is only as big as its content
165
+ * and `defaultSize`.
166
+ */
167
+ declare const WIDGET_FILLS: readonly ["height", "width", "both"];
168
+ type WidgetFill = (typeof WIDGET_FILLS)[number];
161
169
  /**
162
170
  * What a widget is, independent of its data. Mirrors Maker Toolkit's
163
171
  * `widget` table (`widget_key`, `title`, `description`, `view_type`,
@@ -176,6 +184,8 @@ interface WidgetDefinition {
176
184
  /** False hides it from every user. Default true. */
177
185
  readonly active?: boolean;
178
186
  readonly defaultSize?: WidgetSize;
187
+ /** Fill free space in the row (height, width or both). Default: none. */
188
+ readonly fill?: WidgetFill;
179
189
  }
180
190
  /**
181
191
  * Identity helper that keeps the literal `kind` (so typed providers can be
@@ -413,4 +423,4 @@ declare function niceDomain(values: readonly number[], tickCount?: number): Nice
413
423
  */
414
424
  declare function labelStride(count: number, maxLabels?: number): number;
415
425
 
416
- export { formatCount as $, type AlertListWidgetData as A, type BarListWidgetData as B, WIDGET_KINDS as C, type DashboardWidget as D, EMPTY_LAYOUT as E, type FormatOptions as F, type GraphWidgetData as G, WIDGET_SIZES as H, type WidgetContext as I, type WidgetDataOf as J, type KpiWidgetData as K, type Locale as L, MAX_GRAPH_SERIES as M, type NiceDomain as N, type OkWidget as O, type WidgetEmptyState as P, type WidgetProvider as Q, type ResolveOptions as R, type WidgetProviders as S, type TableWidgetData as T, type WidgetStatus as U, VALUE_FORMATS as V, type WidgetSize as W, defineWidget as X, emptyTextFor as Y, emptyWidget as Z, failedWidget as _, type DashboardLayout as a, formatPercentChange as a0, formatValue as a1, hiddenWidgets as a2, hideWidget as a3, isHidden as a4, isMinimized as a5, isWidgetEmptyState as a6, isWidgetKind as a7, isWidgetVisibleTo as a8, kpiDelta as a9, labelStride as aa, loadingWidgets as ab, minimizeWidget as ac, moveWidget as ad, moveWidgetBy as ae, moveWidgetDown as af, moveWidgetUp as ag, niceDomain as ah, niceStep as ai, parseLayout as aj, percentChange as ak, pruneLayout as al, resolvePayload as am, resolveWidget as an, resolveWidgets as ao, restoreWidget as ap, serializeLayout as aq, shareOf as ar, showWidget as as, sortDefinitions as at, toggleHidden as au, toggleMinimized as av, visibleWidgets as aw, widgetsFor as ax, type GaugeWidgetData as b, type TextWidgetData as c, type WidgetData as d, type WidgetDefinition as e, type WidgetKind as f, type WidgetPayload as g, type AlertListItem as h, type BarListItem as i, DEFAULT_COMPARISON_LABEL as j, DEFAULT_CURRENCY as k, DEFAULT_EMPTY_TEXT as l, type DeltaDirection as m, type DeltaSentiment as n, type EmptyWidget as o, type ErrorWidget as p, type GraphPoint as q, type GraphSeries as r, type KpiDelta as s, type KpiDeltaOptions as t, type LayoutItem as u, type LoadingWidget as v, type ResolvedWidget as w, type TableCell as x, type TableColumn as y, type ValueFormat as z };
426
+ export { emptyWidget as $, type AlertListWidgetData as A, type BarListWidgetData as B, type ValueFormat as C, type DashboardWidget as D, EMPTY_LAYOUT as E, type FormatOptions as F, type GraphWidgetData as G, WIDGET_FILLS as H, WIDGET_KINDS as I, WIDGET_SIZES as J, type KpiWidgetData as K, type Locale as L, MAX_GRAPH_SERIES as M, type NiceDomain as N, type OkWidget as O, type WidgetContext as P, type WidgetDataOf as Q, type ResolveOptions as R, type WidgetEmptyState as S, type TableWidgetData as T, type WidgetProvider as U, VALUE_FORMATS as V, type WidgetSize as W, type WidgetProviders as X, type WidgetStatus as Y, defineWidget as Z, emptyTextFor as _, type WidgetFill as a, failedWidget as a0, formatCount as a1, formatPercentChange as a2, formatValue as a3, hiddenWidgets as a4, hideWidget as a5, isHidden as a6, isMinimized as a7, isWidgetEmptyState as a8, isWidgetKind as a9, isWidgetVisibleTo as aa, kpiDelta as ab, labelStride as ac, loadingWidgets as ad, minimizeWidget as ae, moveWidget as af, moveWidgetBy as ag, moveWidgetDown as ah, moveWidgetUp as ai, niceDomain as aj, niceStep as ak, parseLayout as al, percentChange as am, pruneLayout as an, resolvePayload as ao, resolveWidget as ap, resolveWidgets as aq, restoreWidget as ar, serializeLayout as as, shareOf as at, showWidget as au, sortDefinitions as av, toggleHidden as aw, toggleMinimized as ax, visibleWidgets as ay, widgetsFor as az, type DashboardLayout as b, type GaugeWidgetData as c, type TextWidgetData as d, type WidgetData as e, type WidgetDefinition as f, type WidgetKind as g, type WidgetPayload as h, type AlertListItem as i, type BarListItem as j, DEFAULT_COMPARISON_LABEL as k, DEFAULT_CURRENCY as l, DEFAULT_EMPTY_TEXT as m, type DeltaDirection as n, type DeltaSentiment as o, type EmptyWidget as p, type ErrorWidget as q, type GraphPoint as r, type GraphSeries as s, type KpiDelta as t, type KpiDeltaOptions as u, type LayoutItem as v, type LoadingWidget as w, type ResolvedWidget as x, type TableCell as y, type TableColumn as z };
package/dist/styles.css CHANGED
@@ -124,6 +124,10 @@
124
124
  grid-column: span 2;
125
125
  }
126
126
 
127
+ :where(.dwt-card--fill-height) {
128
+ align-self: stretch;
129
+ }
130
+
127
131
  :where(.dwt-card--size-full) {
128
132
  grid-column: 1 / -1;
129
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@richardmcquiston01/dashboard-widgets-toolkit",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Framework-agnostic dashboard widget toolkit: typed widget definitions and data payloads (KPI, gauge, table, bar list, alert list, chart), user layout (order, hide, minimise), and React renderers. Bring your own data providers.",
5
5
  "keywords": [
6
6
  "dashboard",