@dashspec/renderer 0.1.9 → 0.1.10
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/CHANGELOG.md +11 -1
- package/README.md +1 -1
- package/dist/{chunk-5EYC4E5K.js → chunk-TAOP57T2.js} +29 -6
- package/dist/chunk-TAOP57T2.js.map +1 -0
- package/dist/{core-BBSo3c1f.d.ts → core-CYeLBFK9.d.ts} +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +66 -3
- package/dist/index.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/api.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/widgets.md +6 -4
- package/package.json +1 -1
- package/dist/chunk-5EYC4E5K.js.map +0 -1
package/docs/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| Page | What it covers |
|
|
10
10
|
|---|---|
|
|
11
11
|
| [Getting started](getting-started.md) | Install, a first dashboard, loading JSON from your API, validating with `loadDocument`, what viewers see for invalid documents |
|
|
12
|
-
| [Widgets](widgets.md) | The
|
|
12
|
+
| [Widgets](widgets.md) | The 31 built-in widgets and their props, nesting with slots, and writing your own with `wrapComponent`, `defineWidget` and `lazyWidget` |
|
|
13
13
|
| [Data](data.md) | Connections and auth, every datasource type, transforms, refresh and cache, `${…}` templates, the expression language and its helpers, custom datasource types, errors |
|
|
14
14
|
| [State and events](state-and-events.md) | The state tree, widget events, every action with an example, named actions, `watch`, host actions, scripts, driving a dashboard from your app, URL sync |
|
|
15
15
|
| [Design systems](design-systems.md) | Bringing your own components, filter controls, empty / error / loading states and custom filter kinds; combining design systems; aliasing built-ins |
|
package/docs/api.md
CHANGED
|
@@ -408,7 +408,7 @@ See [Widgets](widgets.md) for a guide.
|
|
|
408
408
|
| `wrapComponent(Component, options)` | Turns any React component into a widget by mapping props, events, state writes and slots (`WrapOptions`) |
|
|
409
409
|
| `lazyWidget(def)` | A widget whose code downloads only when a dashboard uses it (`load: () => import(…)`, optional `fallback`) |
|
|
410
410
|
| `checkWidget(def)` | Returns a list of contract problems (empty when fine). Use it in your tests |
|
|
411
|
-
| `builtInWidgets` | The
|
|
411
|
+
| `builtInWidgets` | The 31 built-in widget definitions |
|
|
412
412
|
| `createWidgetRegistry(builtIns, extra, aliases)` | Builds the kind → widget map the renderer uses (throws on un-namespaced or duplicate kinds). `WidgetRegistry` type |
|
|
413
413
|
|
|
414
414
|
Types: `WidgetDefinition`, `AnyWidgetDefinition` (for lists of widgets with different
|
package/docs/getting-started.md
CHANGED
|
@@ -231,7 +231,7 @@ Report these to your monitoring with `onError`:
|
|
|
231
231
|
|
|
232
232
|
## Next steps
|
|
233
233
|
|
|
234
|
-
- [Widgets](widgets.md): the
|
|
234
|
+
- [Widgets](widgets.md): the 31 built-in widgets, nesting, and writing your own.
|
|
235
235
|
- [Data](data.md): connections, auth, datasources, templates and expressions.
|
|
236
236
|
- [State and events](state-and-events.md): clicks, actions, filters, and driving a dashboard from your app.
|
|
237
237
|
- [Design systems](design-systems.md): use your own components and controls.
|
package/docs/widgets.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Widgets
|
|
2
2
|
|
|
3
3
|
Every box on a dashboard is a **node** in `spec.panels`: a `kind` (which widget) and a
|
|
4
|
-
`spec` (that widget's props). The renderer ships
|
|
4
|
+
`spec` (that widget's props). The renderer ships 31 built-in widgets, and you can add
|
|
5
5
|
your own.
|
|
6
6
|
|
|
7
7
|
```json
|
|
@@ -19,7 +19,7 @@ your own.
|
|
|
19
19
|
## Props every widget shares
|
|
20
20
|
|
|
21
21
|
Besides its own props, every built-in widget except the atoms (Text, Value, Progress,
|
|
22
|
-
Icon, Divider) accepts these in `spec`:
|
|
22
|
+
Icon, Divider, Button) accepts these in `spec`:
|
|
23
23
|
|
|
24
24
|
| Prop | Type | What it does |
|
|
25
25
|
|---|---|---|
|
|
@@ -292,6 +292,7 @@ Small pieces for building your own cards inside `Card`, `Row` or a header slot.
|
|
|
292
292
|
| `Progress` | A progress bar | `field`, `max`, `color`, `goodFrom`, `showPercent`, `thickness` | none |
|
|
293
293
|
| `Icon` | An icon: `bolt`, `fire`, `factory`, `clock`, `check`, `alert`, `up`, `down`, `gauge`, `box`, `user`, `money` | `icon`, `size`, `color`, `background` | `click` |
|
|
294
294
|
| `Divider` | A line | `direction`, `dashed` | none |
|
|
295
|
+
| `Button` | A button that runs the panel's `on.click` | `label`, `icon` (incl. `arrow-left`, `arrow-right`), `iconAfter`, `variant` (`primary` / `secondary` / `subtle` / `link`), `size` (`sm` / `md`), `disabled` (e.g. `"${datasources.trend.data.meta.prev == null}"`), `ariaLabel` | `click` |
|
|
295
296
|
|
|
296
297
|
```json
|
|
297
298
|
"revenueCard": {
|
|
@@ -330,8 +331,9 @@ top-level nodes go in `layouts`; nested ones live only in their parent's slot.
|
|
|
330
331
|
|
|
331
332
|
The rules:
|
|
332
333
|
|
|
333
|
-
- **Every node** has a `header` slot (next to the title)
|
|
334
|
-
|
|
334
|
+
- **Every node** has a `header` slot (next to the title), a `toolbar` slot (a row under the
|
|
335
|
+
title, above the body: navigation, actions, notes) and a `footer` slot (under the body).
|
|
336
|
+
The header takes only small widgets: atoms, `Status`, `Content`, `Filter`.
|
|
335
337
|
- Layout widgets add their own: `items` (Container, Row, Column), `body` (Card), one
|
|
336
338
|
slot per tab `key` (Tabs), `item` (Repeater).
|
|
337
339
|
- A node sits in **one place**: on the grid or in one slot.
|