@datarails-ai/dr-appspace-cli 0.10.17 → 0.10.19
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/cli.js +239 -44
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { fileURLToPath as fileURLToPath6 } from "url";
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "@datarails-ai/dr-appspace-cli",
|
|
16
|
-
version: "0.10.
|
|
16
|
+
version: "0.10.19",
|
|
17
17
|
description: "Datarails App Space CLI \u2014 build, try, push and publish App Space apps",
|
|
18
18
|
type: "module",
|
|
19
19
|
engines: {
|
|
@@ -57,7 +57,7 @@ var package_default = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
// src/buildInfo.ts
|
|
60
|
-
var BUILD_TIME = "2026-10-
|
|
60
|
+
var BUILD_TIME = "2026-10-01T13:34:51.381Z";
|
|
61
61
|
function formatBuildTime(iso) {
|
|
62
62
|
if (iso === "") return "";
|
|
63
63
|
const d = new Date(iso);
|
|
@@ -5928,6 +5928,7 @@ __export(components_gen_exports, {
|
|
|
5928
5928
|
PLATFORM_FORMAT: () => PLATFORM_FORMAT,
|
|
5929
5929
|
PLATFORM_NUMBERS: () => PLATFORM_NUMBERS,
|
|
5930
5930
|
PROPS_SCHEMAS: () => PROPS_SCHEMAS,
|
|
5931
|
+
PROPS_SINCE: () => PROPS_SINCE,
|
|
5931
5932
|
REGISTRY_VERSION: () => REGISTRY_VERSION,
|
|
5932
5933
|
ROW_ACTION_WHEN: () => ROW_ACTION_WHEN,
|
|
5933
5934
|
SMART_COMPARES: () => SMART_COMPARES,
|
|
@@ -5937,10 +5938,10 @@ __export(components_gen_exports, {
|
|
|
5937
5938
|
TITLED_TYPES: () => TITLED_TYPES,
|
|
5938
5939
|
WIDGET_KINDS: () => WIDGET_KINDS
|
|
5939
5940
|
});
|
|
5940
|
-
var REGISTRY_VERSION = Object.freeze(
|
|
5941
|
-
var ELEMENT_TYPES = Object.freeze(["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
5942
|
-
var COMPONENT_TYPES = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
5943
|
-
var APP_TYPES = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
5941
|
+
var REGISTRY_VERSION = Object.freeze(9);
|
|
5942
|
+
var ELEMENT_TYPES = Object.freeze(["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
5943
|
+
var COMPONENT_TYPES = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
5944
|
+
var APP_TYPES = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
5944
5945
|
var DASHBOARD_TYPES = Object.freeze(["region", "grid", "control", "nav", "tab", "slot"]);
|
|
5945
5946
|
var COMPONENT_ATTRIBUTES = Object.freeze(["data-dr-component", "data-dr-entity", "data-dr-action", "data-dr-source", "data-dr-field", "data-dr-param", "data-dr-role", "data-dr-filter", "data-dr-id", "data-dr-label", "data-dr-measure", "data-dr-tone", "data-dr-kind", "data-dr-x", "data-dr-y", "data-dr-series", "data-dr-format", "data-dr-negative", "data-dr-module", "data-dr-args", "data-dr-props", "data-dr-declares", "data-dr-when"]);
|
|
5946
5947
|
var COMPONENT_PROPS = Object.freeze([["data-dr-entity", "entity"], ["data-dr-action", "action"], ["data-dr-source", "source"], ["data-dr-field", "field"], ["data-dr-param", "param"], ["data-dr-role", "role"], ["data-dr-id", "id"], ["data-dr-label", "label"], ["data-dr-measure", "measure"], ["data-dr-tone", "tone"], ["data-dr-kind", "kind"], ["data-dr-x", "x"], ["data-dr-y", "y"], ["data-dr-series", "series"], ["data-dr-format", "format"], ["data-dr-negative", "negative"], ["data-dr-module", "module"]]);
|
|
@@ -5953,7 +5954,8 @@ var NEGATIVE_MODES = Object.freeze(["minus", "red_minus", "absolute", "red_absol
|
|
|
5953
5954
|
var FORMAT_PATTERNS = Object.freeze({ "currency": "$#,###", "number": "#,###", "percent": '#,###.#"%"' });
|
|
5954
5955
|
var PLATFORM_NUMBERS = Object.freeze({ "dr-app-runtime": "1.8.0", "dr-app-widgets": "1.2.0", "dr-components": "1.2.0", "dr-components-controls": "1.1.0" });
|
|
5955
5956
|
var ROW_ACTION_WHEN = Object.freeze({ "dr-components": "1.2.0" });
|
|
5956
|
-
var
|
|
5957
|
+
var PROPS_SINCE = Object.freeze({ "select": { "multiple": "1.3.0", "searchable": "1.3.0", "group_by": "1.3.0", "values": "1.3.0", "options[].group": "1.3.0" }, "data_grid": { "theme": "1.3.0", "hierarchy": "1.3.0", "totals": "1.3.0", "pin": "1.3.0", "csv_params": "1.3.0", "columns[].cell": "1.3.0", "columns[].badge_map": "1.3.0", "columns[].status_map": "1.3.0", "columns[].link_field": "1.3.0", "columns[].call": "1.3.0" } });
|
|
5958
|
+
var MODULE_OF = Object.freeze({ "widget": "dr-app-widgets", "form": "dr-app-runtime", "list": "dr-app-runtime", "detail": "dr-app-runtime", "queue": "dr-app-runtime", "action": "dr-app-runtime", "filter": "dr-app-runtime", "stat": "dr-app-runtime", "chart": "dr-app-runtime", "custom": "dr-app-runtime", "field": "dr-app-runtime", "number_input": "dr-components", "tabs": "dr-components", "tab_panel": "dr-components", "select": "dr-components", "date_picker": "dr-components", "data_grid": "dr-components", "dialog": "dr-components", "variance_table": "dr-components", "toggle": "dr-components", "control_group": "dr-components", "callout": "dr-components", "scenario_columns": "dr-components", "slider": "dr-components-controls", "button": "dr-components", "status": "dr-components", "badge": "dr-components", "tag": "dr-components", "empty_state": "dr-components", "stepper": "dr-components", "alert": "dr-components", "checkbox": "dr-components", "radio_group": "dr-components", "file_upload": "dr-components", "skeleton": "dr-components", "progress": "dr-components", "accordion": "dr-components", "tooltip_info": "dr-components", "filter_bar": "dr-components", "filter_chip": "dr-components", "date_range": "dr-components", "fiscal_month": "dr-components" });
|
|
5957
5959
|
var STAT_TONES = Object.freeze(["default", "positive", "warning", "negative"]);
|
|
5958
5960
|
var WIDGET_KINDS = Object.freeze(["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative"]);
|
|
5959
5961
|
var KIND_READS = Object.freeze({ "line": ["series"], "area": ["series"], "bar": ["series", "breakdown"], "stacked": ["series"], "pie": ["breakdown"], "donut": ["breakdown"], "kpi": ["kpi"], "candle": ["ohlc"], "bubble": ["scatter"], "table": ["table"], "narrative": ["narrative"] });
|
|
@@ -5961,14 +5963,14 @@ var APP_WIDGET_KINDS = Object.freeze(["waterfall", "waterfall-breakdown", "water
|
|
|
5961
5963
|
var APP_KIND_READS = Object.freeze({ "waterfall": ["breakdown", "series"], "waterfall-breakdown": ["breakdown", "series"], "waterfall-walkthrough": ["breakdown", "series"], "line-forecast": ["series"], "heatmap": ["series"], "combo": ["series"], "stacked-percent": ["series"], "gauge": ["kpi"] });
|
|
5962
5964
|
var SMART_COMPARES = Object.freeze(["BvA", "AvF", "vs_prev_period"]);
|
|
5963
5965
|
var PLATFORM_FINANCE = Object.freeze({ "dr-app-widgets": "1.2.0" });
|
|
5964
|
-
var STRICT_TYPES = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
5965
|
-
var PROPS_SCHEMAS = Object.freeze({ "region": { "type": "object", "properties": {} }, "grid": { "type": "object", "properties": {} }, "widget": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the card's title on an app page" }, "role": { "type": "string", "description": "data-dr-role: the app role this card is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "kind": { "enum": ["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative", "waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"], "description": "data-dr-kind on an app page, the widget kind on a dashboard. The last eight (the finance kinds: waterfall ... gauge) are app pages only, from dr-app-widgets 1.2.0; a dashboard card takes one of the first eleven" }, "source": { "type": "string", "description": "the handler whose payload an app card draws (data-dr-source), or the SPEC key a dashboard card draws" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the card's numbers read" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "props": { "type": "object", "additionalProperties": false, "properties": { "variant": { "enum": ["smart"], "description": "a kpi card's variant: smart is the platform's smart KPI, one comparison pill (compare) in the platform's status colours; app pages, dr-app-widgets 1.2.0 on" }, "compare": { "enum": ["BvA", "AvF", "vs_prev_period"], "description": "a smart kpi's comparison: BvA / AvF read the kpi source's compare (budget / forecast), vs_prev_period its delta; default BvA when the source compares, else vs_prev_period" }, "color_rule": { "enum": ["higher_is_better", "lower_is_better"], "description": "which way is good for a smart kpi's delta and a gauge's goal: lower_is_better for a cost; default higher_is_better" }, "goal": { "type": "number", "description": "a gauge's goal, in the figure's units; absent, the kpi source's compare value" }, "total": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall's closing bar: {label}, default Total" }, "variance": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall-breakdown's unexplained bar: {label}, default Variance" }, "forecast_from": { "type": "string", "description": "a line-forecast over ONE series: the period on the x axis the forecast starts at" }, "dual_axis": { "type": "boolean", "description": "a combo: false keeps the line on the columns' axis; default true (a second axis)" } }, "description": "data-dr-props: an APP card's typed props (dr-app-widgets 1.2.0 on), sorted JSON on the page, read back by the extractor: a smart kpi's variant, compare and color_rule; a gauge's goal and color_rule; a waterfall's total and variance; a line-forecast's forecast_from; a combo's dual_axis" }, "title": { "type": "string", "description": "a dashboard card's title" }, "subtitle": { "type": "string", "description": "the line under a dashboard card's title" }, "description": { "type": "string", "description": "what a dashboard card shows, in words" }, "params": { "type": "array", "description": "the params a dashboard card honours" } } }, "control": { "type": "object", "properties": { "param": { "type": "string", "description": "the param it moves" }, "control_kind": { "type": "string", "description": "the control's kind" }, "type": { "type": "string", "description": "the input type" }, "min": { "type": "string", "description": "the lowest value" }, "max": { "type": "string", "description": "the highest value" }, "step": { "type": "string", "description": "the step" }, "value": { "type": "string", "description": "the starting value" }, "label": { "type": "string", "description": "the label" } } }, "nav": { "type": "object", "properties": { "aria_label": { "type": "string", "description": "the nav's accessible name" } } }, "tab": { "type": "object", "properties": { "current": { "type": "boolean", "description": "true on the page it names" }, "href": { "type": "string", "description": "the page it links to" }, "label": { "type": "string", "description": "the text it shows" } } }, "slot": { "type": "object", "properties": {} }, "form": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the form writes" }, "action": { "type": "string", "description": "data-dr-action: the handler that saves it" } } }, "list": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table listed" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers the rows" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "detail": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the row is from" }, "action": { "type": "string", "description": "data-dr-action: the handler it acts through" } } }, "queue": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table queued" }, "source": { "type": "string", "description": "data-dr-source: the inbox handler" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "action": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "action": { "type": "string", "description": "data-dr-action: the handler it runs" }, "param": { "type": "string", "description": "data-dr-param: the argument it passes" }, "entity": { "type": "string", "description": "data-dr-entity: the table the handler acts on" }, "when": { "type": "object", "description": 'data-dr-when: the states a ROW ACTION is drawn in, one JSON object of column to the values the row may hold ({"status": ["open", "in_progress"]}), every column matched; a row without the column keeps the action. It hides a button and refuses nothing: the handler still has to (dr-app-runtime 1.7.1 on an action in a list or a queue; dr-components 1.2.0 on a data_grid row action)' } } }, "filter": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "field": { "type": "string", "description": "data-dr-field: the column filtered" }, "entity": { "type": "string", "description": "data-dr-entity: the table filtered" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "stat": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the summary handler" }, "measure": { "type": "string", "description": "data-dr-measure: the key of the number shown" }, "tone": { "type": "string", "description": "data-dr-tone: default | positive | warning | negative" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the figure reads: a word or a platform format string" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "chart": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows it draws" }, "kind": { "enum": ["line", "bar", "area"], "description": "data-dr-kind: what it draws" }, "x": { "type": "string", "description": "data-dr-x: the column on the category axis" }, "y": { "type": "string", "description": "data-dr-y: the one numeric column drawn" }, "series": { "type": "string", "description": "data-dr-series: the column whose distinct values are one line each" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how a number reads; percent is a value already in percent units" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "custom": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose answer the module receives" }, "module": { "type": "string", "pattern": "^components/[a-z][a-z0-9_-]*\\.js$", "description": "data-dr-module: the file that draws it" }, "args": { "type": "object", "description": "data-dr-args: one JSON object handed to the module as ui.args; absent means {}" }, "declares": { "type": "object", "description": "data-dr-declares: what the module does, stated for graders and app-space test \u2014 nothing draws from it and the runtime never reads it. Every key is optional; a name it lists must be one the contract declares (custom_declares)", "additionalProperties": false, "properties": { "reads": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the data.sources entries and handlers whose answers it draws" }, "calls": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the handlers it calls through ui.call; app-space test reports a call to any other (custom-undeclared-call)" }, "produces": { "type": "object", "description": `per called handler, the payload keys it sends \u2014 {"project": ["growth", "hires"]}; for a handler it does not list, app-space test reads the keys off the module's ui.call object literal`, "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "shows": { "type": "array", "description": "the numbers it displays; the module projects each one on the element that shows it (data-dr-field, data-dr-value, data-dr-format), which app-space test harvests into the element's values", "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the field the number is, as its data-dr-field names it" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how it reads, as its data-dr-format says" }, "scale": { "enum": ["fraction"], "description": "fraction: the value is a share (0.04) shown as a percent (4%)" } } } } } } } }, "field": { "type": "object", "properties": { "entity": { "type": "string", "description": "data-dr-entity: the table the column is in" }, "field": { "type": "string", "description": "data-dr-field: the column" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers its choices" }, "label": { "type": "string", "description": "the field's label" }, "required": { "type": "boolean", "description": "true when the form cannot be saved without it" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "slider": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this slider writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this slider reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "min": { "type": "number", "description": "the track's low end, in stored units; default the page param's min (param mode), else 0" }, "max": { "type": "number", "description": "the track's high end, in stored units; default the page param's max (param mode). Required one way or the other: a slider with neither draws its 'slider needs a max' panel (1.0.1) and the compiler refuses it (part_bounds)" }, "step": { "type": "number", "description": "the increment the value moves by, in stored units; every value set is a multiple of it from min; default the page param's step, else 1" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value beside the track reads; default number" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value beside the track shows a figure below zero: the platform's negative-number mode: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components-controls 1.1.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "show_value": { "type": "boolean", "description": "whether the formatted value is drawn beside the track; default true" }, "marks": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "number", "description": "where the mark sits, in stored units" }, "label": { "type": "string", "description": "what the mark says; default the value, formatted" } } }, "description": "labelled ticks under the track" }, "value": { "type": "number", "description": "field mode: the value it starts on; default min. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the slider's label; default the page param's label (param mode), else the element's label" } }, "description": "data-dr-props: the slider part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } } });
|
|
5966
|
-
var LIBRARY_TYPES = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
5967
|
-
var LIBRARY_PROPS_SCHEMAS = Object.freeze({ "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } } });
|
|
5966
|
+
var STRICT_TYPES = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
5967
|
+
var PROPS_SCHEMAS = Object.freeze({ "region": { "type": "object", "properties": {} }, "grid": { "type": "object", "properties": {} }, "widget": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the card's title on an app page" }, "role": { "type": "string", "description": "data-dr-role: the app role this card is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "kind": { "enum": ["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative", "waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"], "description": "data-dr-kind on an app page, the widget kind on a dashboard. The last eight (the finance kinds: waterfall ... gauge) are app pages only, from dr-app-widgets 1.2.0; a dashboard card takes one of the first eleven" }, "source": { "type": "string", "description": "the handler whose payload an app card draws (data-dr-source), or the SPEC key a dashboard card draws" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the card's numbers read" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "props": { "type": "object", "additionalProperties": false, "properties": { "variant": { "enum": ["smart"], "description": "a kpi card's variant: smart is the platform's smart KPI, one comparison pill (compare) in the platform's status colours; app pages, dr-app-widgets 1.2.0 on" }, "compare": { "enum": ["BvA", "AvF", "vs_prev_period"], "description": "a smart kpi's comparison: BvA / AvF read the kpi source's compare (budget / forecast), vs_prev_period its delta; default BvA when the source compares, else vs_prev_period" }, "color_rule": { "enum": ["higher_is_better", "lower_is_better"], "description": "which way is good for a smart kpi's delta and a gauge's goal: lower_is_better for a cost; default higher_is_better" }, "goal": { "type": "number", "description": "a gauge's goal, in the figure's units; absent, the kpi source's compare value" }, "total": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall's closing bar: {label}, default Total" }, "variance": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall-breakdown's unexplained bar: {label}, default Variance" }, "forecast_from": { "type": "string", "description": "a line-forecast over ONE series: the period on the x axis the forecast starts at" }, "dual_axis": { "type": "boolean", "description": "a combo: false keeps the line on the columns' axis; default true (a second axis)" } }, "description": "data-dr-props: an APP card's typed props (dr-app-widgets 1.2.0 on), sorted JSON on the page, read back by the extractor: a smart kpi's variant, compare and color_rule; a gauge's goal and color_rule; a waterfall's total and variance; a line-forecast's forecast_from; a combo's dual_axis" }, "title": { "type": "string", "description": "a dashboard card's title" }, "subtitle": { "type": "string", "description": "the line under a dashboard card's title" }, "description": { "type": "string", "description": "what a dashboard card shows, in words" }, "params": { "type": "array", "description": "the params a dashboard card honours" } } }, "control": { "type": "object", "properties": { "param": { "type": "string", "description": "the param it moves" }, "control_kind": { "type": "string", "description": "the control's kind" }, "type": { "type": "string", "description": "the input type" }, "min": { "type": "string", "description": "the lowest value" }, "max": { "type": "string", "description": "the highest value" }, "step": { "type": "string", "description": "the step" }, "value": { "type": "string", "description": "the starting value" }, "label": { "type": "string", "description": "the label" } } }, "nav": { "type": "object", "properties": { "aria_label": { "type": "string", "description": "the nav's accessible name" } } }, "tab": { "type": "object", "properties": { "current": { "type": "boolean", "description": "true on the page it names" }, "href": { "type": "string", "description": "the page it links to" }, "label": { "type": "string", "description": "the text it shows" } } }, "slot": { "type": "object", "properties": {} }, "form": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the form writes" }, "action": { "type": "string", "description": "data-dr-action: the handler that saves it" } } }, "list": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table listed" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers the rows" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "detail": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the row is from" }, "action": { "type": "string", "description": "data-dr-action: the handler it acts through" } } }, "queue": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table queued" }, "source": { "type": "string", "description": "data-dr-source: the inbox handler" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "action": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "action": { "type": "string", "description": "data-dr-action: the handler it runs" }, "param": { "type": "string", "description": "data-dr-param: the argument it passes" }, "entity": { "type": "string", "description": "data-dr-entity: the table the handler acts on" }, "when": { "type": "object", "description": 'data-dr-when: the states a ROW ACTION is drawn in, one JSON object of column to the values the row may hold ({"status": ["open", "in_progress"]}), every column matched; a row without the column keeps the action. It hides a button and refuses nothing: the handler still has to (dr-app-runtime 1.7.1 on an action in a list or a queue; dr-components 1.2.0 on a data_grid row action)' } } }, "filter": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "field": { "type": "string", "description": "data-dr-field: the column filtered" }, "entity": { "type": "string", "description": "data-dr-entity: the table filtered" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "stat": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the summary handler" }, "measure": { "type": "string", "description": "data-dr-measure: the key of the number shown" }, "tone": { "type": "string", "description": "data-dr-tone: default | positive | warning | negative" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the figure reads: a word or a platform format string" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "chart": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows it draws" }, "kind": { "enum": ["line", "bar", "area"], "description": "data-dr-kind: what it draws" }, "x": { "type": "string", "description": "data-dr-x: the column on the category axis" }, "y": { "type": "string", "description": "data-dr-y: the one numeric column drawn" }, "series": { "type": "string", "description": "data-dr-series: the column whose distinct values are one line each" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how a number reads; percent is a value already in percent units" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "custom": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose answer the module receives" }, "module": { "type": "string", "pattern": "^components/[a-z][a-z0-9_-]*\\.js$", "description": "data-dr-module: the file that draws it" }, "args": { "type": "object", "description": "data-dr-args: one JSON object handed to the module as ui.args; absent means {}" }, "declares": { "type": "object", "description": "data-dr-declares: what the module does, stated for graders and app-space test \u2014 nothing draws from it and the runtime never reads it. Every key is optional; a name it lists must be one the contract declares (custom_declares)", "additionalProperties": false, "properties": { "reads": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the data.sources entries and handlers whose answers it draws" }, "calls": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the handlers it calls through ui.call; app-space test reports a call to any other (custom-undeclared-call)" }, "produces": { "type": "object", "description": `per called handler, the payload keys it sends \u2014 {"project": ["growth", "hires"]}; for a handler it does not list, app-space test reads the keys off the module's ui.call object literal`, "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "shows": { "type": "array", "description": "the numbers it displays; the module projects each one on the element that shows it (data-dr-field, data-dr-value, data-dr-format), which app-space test harvests into the element's values", "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the field the number is, as its data-dr-field names it" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how it reads, as its data-dr-format says" }, "scale": { "enum": ["fraction"], "description": "fraction: the value is a share (0.04) shown as a percent (4%)" } } } } } } } }, "field": { "type": "object", "properties": { "entity": { "type": "string", "description": "data-dr-entity: the table the column is in" }, "field": { "type": "string", "description": "data-dr-field: the column" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers its choices" }, "label": { "type": "string", "description": "the field's label" }, "required": { "type": "boolean", "description": "true when the form cannot be saved without it" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group"); dr-components 1.3.0' } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "values": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "field mode with multiple: the options chosen first; default none (dr-components 1.3.0)" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" }, "multiple": { "type": "boolean", "description": "many values: field mode writes them as one list (a dialog posts the list), param mode moves a multi param; default false, one value (dr-components 1.3.0)" }, "searchable": { "type": "boolean", "description": "a search box over the list, filtering by label; default false (dr-components 1.3.0)" }, "group_by": { "type": "string", "minLength": 1, "description": "the key the list is grouped under: a source row's column, or group on a stated option; default none (dr-components 1.3.0)" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" }, "cell": { "enum": ["badge", "status", "chip", "link", "toggle"], "description": "how the value draws instead of text (dr-components 1.3.0, the dr-grid cell renderers): badge (a dr-badge, its colour from badge_map), status (a dr-status, its type from status_map), chip (the value, or each value of a list, as a chip), link (the value as a link: to link_field's URL, else opening the row through on_row), toggle (a switch over a boolean; call flips it, without it the switch is read-only)" }, "badge_map": { "type": "object", "additionalProperties": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "a dr-badge colour" }, "description": "cell badge: value \u2192 dr-badge colour; an unmapped value is stone (dr-components 1.3.0)" }, "status_map": { "type": "object", "additionalProperties": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "a dr-status type" }, "description": "cell status: value \u2192 dr-status type; an unmapped value is default (dr-components 1.3.0)" }, "link_field": { "type": "string", "minLength": 1, "description": "cell link: the row column holding the link's URL (same-origin path, #hash, or http(s)); default none: the link opens the row (on_row) (dr-components 1.3.0)" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "cell toggle: a handler called with {id, row, field, value} when the reader flips the switch; the page re-reads after. Without it the switch is read-only (dr-components 1.3.0)" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "theme": { "enum": ["default", "borderless", "editable", "inside-card"], "description": "the dr-grid theme (dr-components 1.3.0): default (rows and header 56px), borderless (40px, no row lines), editable (40px, a focus ring on the cell), inside-card (rows 56px, a 32px header, for a grid inside a card); default default" }, "hierarchy": { "type": "object", "additionalProperties": false, "required": ["parent", "label"], "properties": { "parent": { "type": "string", "minLength": 1, "description": "the column holding each row's parent row key (the key column's value); empty for a top row" }, "label": { "type": "string", "minLength": 1, "description": "the column drawn as the tree: indented by depth, with expand / collapse on a parent" }, "expanded": { "type": "boolean", "description": "whether parents start open; default true" } }, "description": "tree rows (dr-components 1.3.0): a P&L's accounts under their parents, each parent's number columns the sum of its children's unless the source answers the parent's own; sorting orders siblings" }, "totals": { "enum": ["top", "bottom", "none"], "description": "a totals row, summing the top rows' number columns (currency, number, a platform format string; a percent is left blank), pinned above or below the rows (dr-components 1.3.0); default none" }, "pin": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "the leading columns (fields) that stay in view while the grid scrolls sideways, in column order (dr-components 1.3.0)" }, "csv_params": { "type": "object", "additionalProperties": false, "properties": { "file_name": { "type": "string", "minLength": 1, "description": "the downloaded file's name; default the element id, .csv" } }, "description": "draws an Export CSV button (dr-grid-toolbar csvParams, dr-components 1.3.0): every row in the grid's order, parents and totals included, numbers raw, headers as shown" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "slider": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this slider writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this slider reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "min": { "type": "number", "description": "the track's low end, in stored units; default the page param's min (param mode), else 0" }, "max": { "type": "number", "description": "the track's high end, in stored units; default the page param's max (param mode). Required one way or the other: a slider with neither draws its 'slider needs a max' panel (1.0.1) and the compiler refuses it (part_bounds)" }, "step": { "type": "number", "description": "the increment the value moves by, in stored units; every value set is a multiple of it from min; default the page param's step, else 1" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value beside the track reads; default number" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value beside the track shows a figure below zero: the platform's negative-number mode: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components-controls 1.1.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "show_value": { "type": "boolean", "description": "whether the formatted value is drawn beside the track; default true" }, "marks": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "number", "description": "where the mark sits, in stored units" }, "label": { "type": "string", "description": "what the mark says; default the value, formatted" } } }, "description": "labelled ticks under the track" }, "value": { "type": "number", "description": "field mode: the value it starts on; default min. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the slider's label; default the page param's label (param mode), else the element's label" } }, "description": "data-dr-props: the slider part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } }, "filter_bar": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["filters"], "properties": { "filters": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "mandatory": { "type": "boolean", "description": "always shown, never under More, no remove (\xD7); default false. A filter is also shown when it starts active" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } } }, "description": "the filters, in order: each a chip over a page param" }, "filters_label": { "type": "string", "description": "words before the chips (Filters:); default none" }, "more_label": { "type": "string", "description": "the button that adds an optional filter that is not shown; default More" }, "add_filters_title": { "type": "string", "description": "the title of More's list; default Add Filters" }, "clear_tooltip": { "type": "string", "description": "the clear-all button's name; default Clear filters" }, "clearable": { "type": "boolean", "description": "draws the clear-all button while any filter narrows; default true" } }, "description": "data-dr-props: the filter_bar part's typed props, handed to it as PartProps.props" } } }, "filter_chip": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "removable": { "type": "boolean", "description": "draws a remove (\xD7) that clears the filter; default false" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } }, "description": "data-dr-props: the filter_chip part's typed props, handed to it as PartProps.props" } } }, "date_range": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the From date is written under (a hidden input of that name), with field_to; exactly one of field and param" }, "field_to": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the To date is written under; required with field" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param the From date moves (a period or month param), with param_to; exactly one of field and param" }, "param_to": { "type": "string", "minLength": 1, "description": "param mode: the page param the To date moves, the same kind as param; required with param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over month params is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the From date it starts on; default none" }, "value_to": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the To date it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the From param's label (param mode), else the element's label" }, "label_from": { "type": "string", "description": "the From picker's label; default From" }, "label_to": { "type": "string", "description": "the To picker's label; default To" }, "placeholder_from": { "type": "string", "description": "what From says before a pick; default Select\u2026" }, "placeholder_to": { "type": "string", "description": "what To says before a pick; default Select\u2026" }, "column": { "type": "boolean", "description": "From above To instead of side by side; default false" } }, "description": "data-dr-props: the date_range part's typed props, handed to it as PartProps.props" } } }, "fiscal_month": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes, the calendar month as YYYY-MM; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (a month or period param) it moves with the calendar month as YYYY-MM; exactly one of field and param" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "how many months after January the fiscal year starts (3: April, so April is the fiscal year's first month); default 0, a calendar year" }, "fiscal_year_back": { "type": "boolean", "description": "the fiscal year is named by the calendar year it starts in; default false: by the year it ends in (an April 2026 start is FY2027)" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}$", "description": "field mode: the calendar month it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Select\u2026" } }, "description": "data-dr-props: the fiscal_month part's typed props, handed to it as PartProps.props" } } } });
|
|
5968
|
+
var LIBRARY_TYPES = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
5969
|
+
var LIBRARY_PROPS_SCHEMAS = Object.freeze({ "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group"); dr-components 1.3.0' } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "values": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "field mode with multiple: the options chosen first; default none (dr-components 1.3.0)" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" }, "multiple": { "type": "boolean", "description": "many values: field mode writes them as one list (a dialog posts the list), param mode moves a multi param; default false, one value (dr-components 1.3.0)" }, "searchable": { "type": "boolean", "description": "a search box over the list, filtering by label; default false (dr-components 1.3.0)" }, "group_by": { "type": "string", "minLength": 1, "description": "the key the list is grouped under: a source row's column, or group on a stated option; default none (dr-components 1.3.0)" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" }, "cell": { "enum": ["badge", "status", "chip", "link", "toggle"], "description": "how the value draws instead of text (dr-components 1.3.0, the dr-grid cell renderers): badge (a dr-badge, its colour from badge_map), status (a dr-status, its type from status_map), chip (the value, or each value of a list, as a chip), link (the value as a link: to link_field's URL, else opening the row through on_row), toggle (a switch over a boolean; call flips it, without it the switch is read-only)" }, "badge_map": { "type": "object", "additionalProperties": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "a dr-badge colour" }, "description": "cell badge: value \u2192 dr-badge colour; an unmapped value is stone (dr-components 1.3.0)" }, "status_map": { "type": "object", "additionalProperties": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "a dr-status type" }, "description": "cell status: value \u2192 dr-status type; an unmapped value is default (dr-components 1.3.0)" }, "link_field": { "type": "string", "minLength": 1, "description": "cell link: the row column holding the link's URL (same-origin path, #hash, or http(s)); default none: the link opens the row (on_row) (dr-components 1.3.0)" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "cell toggle: a handler called with {id, row, field, value} when the reader flips the switch; the page re-reads after. Without it the switch is read-only (dr-components 1.3.0)" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "theme": { "enum": ["default", "borderless", "editable", "inside-card"], "description": "the dr-grid theme (dr-components 1.3.0): default (rows and header 56px), borderless (40px, no row lines), editable (40px, a focus ring on the cell), inside-card (rows 56px, a 32px header, for a grid inside a card); default default" }, "hierarchy": { "type": "object", "additionalProperties": false, "required": ["parent", "label"], "properties": { "parent": { "type": "string", "minLength": 1, "description": "the column holding each row's parent row key (the key column's value); empty for a top row" }, "label": { "type": "string", "minLength": 1, "description": "the column drawn as the tree: indented by depth, with expand / collapse on a parent" }, "expanded": { "type": "boolean", "description": "whether parents start open; default true" } }, "description": "tree rows (dr-components 1.3.0): a P&L's accounts under their parents, each parent's number columns the sum of its children's unless the source answers the parent's own; sorting orders siblings" }, "totals": { "enum": ["top", "bottom", "none"], "description": "a totals row, summing the top rows' number columns (currency, number, a platform format string; a percent is left blank), pinned above or below the rows (dr-components 1.3.0); default none" }, "pin": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "the leading columns (fields) that stay in view while the grid scrolls sideways, in column order (dr-components 1.3.0)" }, "csv_params": { "type": "object", "additionalProperties": false, "properties": { "file_name": { "type": "string", "minLength": 1, "description": "the downloaded file's name; default the element id, .csv" } }, "description": "draws an Export CSV button (dr-grid-toolbar csvParams, dr-components 1.3.0): every row in the grid's order, parents and totals included, numbers raw, headers as shown" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } }, "filter_bar": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["filters"], "properties": { "filters": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "mandatory": { "type": "boolean", "description": "always shown, never under More, no remove (\xD7); default false. A filter is also shown when it starts active" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } } }, "description": "the filters, in order: each a chip over a page param" }, "filters_label": { "type": "string", "description": "words before the chips (Filters:); default none" }, "more_label": { "type": "string", "description": "the button that adds an optional filter that is not shown; default More" }, "add_filters_title": { "type": "string", "description": "the title of More's list; default Add Filters" }, "clear_tooltip": { "type": "string", "description": "the clear-all button's name; default Clear filters" }, "clearable": { "type": "boolean", "description": "draws the clear-all button while any filter narrows; default true" } }, "description": "data-dr-props: the filter_bar part's typed props, handed to it as PartProps.props" } } }, "filter_chip": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "removable": { "type": "boolean", "description": "draws a remove (\xD7) that clears the filter; default false" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } }, "description": "data-dr-props: the filter_chip part's typed props, handed to it as PartProps.props" } } }, "date_range": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the From date is written under (a hidden input of that name), with field_to; exactly one of field and param" }, "field_to": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the To date is written under; required with field" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param the From date moves (a period or month param), with param_to; exactly one of field and param" }, "param_to": { "type": "string", "minLength": 1, "description": "param mode: the page param the To date moves, the same kind as param; required with param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over month params is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the From date it starts on; default none" }, "value_to": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the To date it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the From param's label (param mode), else the element's label" }, "label_from": { "type": "string", "description": "the From picker's label; default From" }, "label_to": { "type": "string", "description": "the To picker's label; default To" }, "placeholder_from": { "type": "string", "description": "what From says before a pick; default Select\u2026" }, "placeholder_to": { "type": "string", "description": "what To says before a pick; default Select\u2026" }, "column": { "type": "boolean", "description": "From above To instead of side by side; default false" } }, "description": "data-dr-props: the date_range part's typed props, handed to it as PartProps.props" } } }, "fiscal_month": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes, the calendar month as YYYY-MM; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (a month or period param) it moves with the calendar month as YYYY-MM; exactly one of field and param" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "how many months after January the fiscal year starts (3: April, so April is the fiscal year's first month); default 0, a calendar year" }, "fiscal_year_back": { "type": "boolean", "description": "the fiscal year is named by the calendar year it starts in; default false: by the year it ends in (an April 2026 start is FY2027)" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}$", "description": "field mode: the calendar month it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Select\u2026" } }, "description": "data-dr-props: the fiscal_month part's typed props, handed to it as PartProps.props" } } } });
|
|
5968
5970
|
var CONTROLS_TYPES = Object.freeze(["slider"]);
|
|
5969
|
-
var PARTS = Object.freeze({ "number_input": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "tabs": { "module": "dr-components", "reads": null, "children": ["tab_panel"], "events": {}, "empty": null }, "tab_panel": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "select": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": null }, "date_picker": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "data_grid": { "module": "dr-components", "reads": { "roles": ["list", "inbox", "custom"], "as": "rows" }, "children": "none", "events": { "on_row": ["custom", "decide"], "on_row_action": ["remove", "decide", "custom", "submit", "save"] }, "empty": "Nothing to show." }, "dialog": { "module": "dr-components", "reads": null, "children": "any", "events": { "on_confirm": ["custom", "save", "submit", "decide"] }, "empty": null }, "variance_table": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "toggle": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "control_group": { "module": "dr-components", "reads": null, "children": ["number_input", "select", "date_picker", "toggle", "slider", "checkbox", "radio_group"], "events": {}, "empty": null }, "callout": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "scenario_columns": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "slider": { "module": "dr-components-controls", "reads": null, "children": "none", "events": {}, "empty": null }, "button": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_click": ["custom", "submit"] }, "empty": null }, "status": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "badge": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "tag": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "empty_state": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_action": ["custom", "submit"] }, "empty": null }, "stepper": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": { "on_step": ["custom", "submit"] }, "empty": null }, "alert": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "checkbox": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "radio_group": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "file_upload": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_upload": ["custom", "save", "submit"] }, "empty": null }, "skeleton": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "progress": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "accordion": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "tooltip_info": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null } });
|
|
5970
|
-
var TITLED_TYPES = Object.freeze(["widget", "form", "list", "queue", "stat", "chart", "custom", "number_input", "select", "date_picker", "dialog"]);
|
|
5971
|
-
var CONTROL_PARTS = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider", "checkbox", "radio_group"]);
|
|
5971
|
+
var PARTS = Object.freeze({ "number_input": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "tabs": { "module": "dr-components", "reads": null, "children": ["tab_panel"], "events": {}, "empty": null }, "tab_panel": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "select": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": null }, "date_picker": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "data_grid": { "module": "dr-components", "reads": { "roles": ["list", "inbox", "custom"], "as": "rows" }, "children": "none", "events": { "on_row": ["custom", "decide"], "on_row_action": ["remove", "decide", "custom", "submit", "save"] }, "empty": "Nothing to show." }, "dialog": { "module": "dr-components", "reads": null, "children": "any", "events": { "on_confirm": ["custom", "save", "submit", "decide"] }, "empty": null }, "variance_table": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "toggle": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "control_group": { "module": "dr-components", "reads": null, "children": ["number_input", "select", "date_picker", "toggle", "slider", "checkbox", "radio_group", "date_range", "fiscal_month"], "events": {}, "empty": null }, "callout": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "scenario_columns": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "slider": { "module": "dr-components-controls", "reads": null, "children": "none", "events": {}, "empty": null }, "button": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_click": ["custom", "submit"] }, "empty": null }, "status": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "badge": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "tag": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "empty_state": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_action": ["custom", "submit"] }, "empty": null }, "stepper": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": { "on_step": ["custom", "submit"] }, "empty": null }, "alert": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "checkbox": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "radio_group": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "file_upload": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_upload": ["custom", "save", "submit"] }, "empty": null }, "skeleton": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "progress": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "accordion": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "tooltip_info": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "filter_bar": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "filter_chip": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "date_range": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "fiscal_month": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null } });
|
|
5972
|
+
var TITLED_TYPES = Object.freeze(["widget", "form", "list", "queue", "stat", "chart", "custom", "number_input", "select", "date_picker", "dialog", "date_range", "fiscal_month"]);
|
|
5973
|
+
var CONTROL_PARTS = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider", "checkbox", "radio_group", "date_range", "fiscal_month"]);
|
|
5972
5974
|
|
|
5973
5975
|
// ../flows/insights-builder/kit/contract/bundleScan.mjs
|
|
5974
5976
|
var COMPONENT_ATTR = "data-dr-component";
|
|
@@ -6026,6 +6028,7 @@ var OWN_RULES = /* @__PURE__ */ new Set(["filter", "args", "props", "declares"])
|
|
|
6026
6028
|
var ARGS_RULE_ATTRIBUTES = Object.freeze(STRUCTURED_ATTRIBUTES2.filter(([, prop]) => !OWN_RULES.has(prop)));
|
|
6027
6029
|
var WHEN_ATTR = STRUCTURED_ATTRIBUTES2.find(([, prop]) => prop === "when")?.[0];
|
|
6028
6030
|
var ROW_ACTION_WHEN2 = ROW_ACTION_WHEN;
|
|
6031
|
+
var PROPS_SINCE2 = PROPS_SINCE;
|
|
6029
6032
|
function parseFilter(raw) {
|
|
6030
6033
|
const filter = {};
|
|
6031
6034
|
for (const part of String(raw).split(/[;,]/)) {
|
|
@@ -6587,6 +6590,9 @@ function partCalls(element) {
|
|
|
6587
6590
|
for (const action of Array.isArray(typed.row_actions) ? typed.row_actions : []) {
|
|
6588
6591
|
if (action && typeof action === "object" && named(action.call)) out.push(action.call);
|
|
6589
6592
|
}
|
|
6593
|
+
for (const column of Array.isArray(typed.columns) ? typed.columns : []) {
|
|
6594
|
+
if (column && typeof column === "object" && column.cell === "toggle" && named(column.call)) out.push(column.call);
|
|
6595
|
+
}
|
|
6590
6596
|
return out;
|
|
6591
6597
|
}
|
|
6592
6598
|
function isPart(element) {
|
|
@@ -9919,13 +9925,17 @@ var contract_schema_default = {
|
|
|
9919
9925
|
{ properties: { type: { const: "progress" }, props: { $ref: "#/$defs/props_progress" } } },
|
|
9920
9926
|
{ properties: { type: { const: "accordion" }, props: { $ref: "#/$defs/props_accordion" } } },
|
|
9921
9927
|
{ properties: { type: { const: "tooltip_info" }, props: { $ref: "#/$defs/props_tooltip_info" } } },
|
|
9928
|
+
{ properties: { type: { const: "filter_bar" }, props: { $ref: "#/$defs/props_filter_bar" } } },
|
|
9929
|
+
{ properties: { type: { const: "filter_chip" }, props: { $ref: "#/$defs/props_filter_chip" } } },
|
|
9930
|
+
{ properties: { type: { const: "date_range" }, props: { $ref: "#/$defs/props_date_range" } } },
|
|
9931
|
+
{ properties: { type: { const: "fiscal_month" }, props: { $ref: "#/$defs/props_fiscal_month" } } },
|
|
9922
9932
|
{ properties: { type: { enum: ["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field"] }, props: { type: "object" } } }
|
|
9923
9933
|
],
|
|
9924
9934
|
properties: {
|
|
9925
9935
|
uid: { type: "string" },
|
|
9926
9936
|
page: { type: "string" },
|
|
9927
9937
|
type: {
|
|
9928
|
-
enum: ["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"],
|
|
9938
|
+
enum: ["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"],
|
|
9929
9939
|
description: "the dashboard vocabulary (region, grid, widget, control, nav, tab, slot) and the App Builder's component vocabulary (form, list, detail, queue, action, filter, the stat tile that reads one measure out of a summary handler, the chart that draws the rows one list, inbox or custom handler answers, the custom component a module under ui/components draws, and the field that sits inside one). widget is shared: on an app page it is a dashboard card too, drawn by dr-app-widgets in the kind data-dr-kind names, over the one widget payload the handler data-dr-source names answers"
|
|
9930
9940
|
},
|
|
9931
9941
|
role: { type: ["string", "null"], description: "a region's data-dr-kit (header, asof, refresh, nav, filters, controls), a widget's kind, a control's kind, a slot's name. Null for a component: its kind IS its type, and the role it is meant for is props.role." },
|
|
@@ -10222,7 +10232,7 @@ var contract_schema_default = {
|
|
|
10222
10232
|
additionalProperties: false,
|
|
10223
10233
|
properties: {
|
|
10224
10234
|
page: { type: "string" },
|
|
10225
|
-
component: { enum: ["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"] },
|
|
10235
|
+
component: { enum: ["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"] },
|
|
10226
10236
|
id: { type: ["string", "null"] },
|
|
10227
10237
|
entity: { type: ["string", "null"] },
|
|
10228
10238
|
handler: { type: ["string", "null"] }
|
|
@@ -10433,9 +10443,9 @@ var contract_schema_default = {
|
|
|
10433
10443
|
props_number_input: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["format"], properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, param: { type: "string", minLength: 1, description: "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, format: { anyOf: [{ enum: ["currency", "number", "percent"] }, { type: "string", maxLength: 64, pattern: "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", description: "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], description: "what the number is: the unit shown beside the input" }, negative: { enum: ["minus", "red_minus", "absolute", "red_absolute"], description: "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, scale: { enum: ["units", "fraction"], description: "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, currency: { type: "string", pattern: "^[A-Z]{3}$", description: "currency only: the ISO code; default USD" }, min: { type: "number", description: "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, max: { type: "number", description: "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, step: { type: "number", description: "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, decimals: { type: "integer", minimum: 0, description: "the decimals the STORED value is rounded to, after scaling; default as typed" }, value: { type: "number", description: "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, label: { type: "string", description: "the input's label; default the page param's label (param mode), else the element's label" }, placeholder: { type: "string", description: "the hint shown while the input is empty" } }, description: "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } },
|
|
10434
10444
|
props_tabs: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["tabs"], properties: { tabs: { type: "array", minItems: 1, items: { type: "object", additionalProperties: false, required: ["id", "label"], properties: { id: { type: "string", pattern: "^[a-z0-9][a-z0-9_-]*$", description: "the tab's id, which a tab_panel's tab names" }, label: { type: "string", minLength: 1, description: "the text on the tab" } } }, description: "the tabs, in order" }, default: { type: "string", description: "the id of the tab open first; default the first tab" } }, description: "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } },
|
|
10435
10445
|
props_tab_panel: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["tab"], properties: { tab: { type: "string", pattern: "^[a-z0-9][a-z0-9_-]*$", description: "the id of the tab (in the enclosing tabs) this panel belongs to" } }, description: "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } },
|
|
10436
|
-
props_select: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, source: { type: "string", description: "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, props: { type: "object", additionalProperties: false, properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, param: { type: "string", minLength: 1, description: "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, options: { type: "array", items: { type: "object", additionalProperties: false, required: ["value", "label"], properties: { value: { type: "string", minLength: 1, description: "what is stored" }, label: { type: "string", description: "what the reader sees" } } }, description: "the options; when absent they are the page param's values (param mode), else the source rows" }, option_value: { type: "string", description: "with a source: the row column that is stored; default id" }, option_label: { type: "string", description: "with a source: the row column the reader sees; default the value column" }, value: { type: "string", description: "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, label: { type: "string", description: "the control's label; default the page param's label (param mode), else the element's label" }, placeholder: { type: "string", description: "what the control says before a choice; default Choose\u2026" } }, description: "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } },
|
|
10446
|
+
props_select: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, source: { type: "string", description: "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, props: { type: "object", additionalProperties: false, properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, param: { type: "string", minLength: 1, description: "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, options: { type: "array", items: { type: "object", additionalProperties: false, required: ["value", "label"], properties: { value: { type: "string", minLength: 1, description: "what is stored" }, label: { type: "string", description: "what the reader sees" }, group: { type: "string", description: 'the heading the option sits under when the list is grouped (group_by: "group"); dr-components 1.3.0' } } }, description: "the options; when absent they are the page param's values (param mode), else the source rows" }, option_value: { type: "string", description: "with a source: the row column that is stored; default id" }, option_label: { type: "string", description: "with a source: the row column the reader sees; default the value column" }, value: { type: "string", description: "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, values: { type: "array", items: { type: "string", minLength: 1 }, description: "field mode with multiple: the options chosen first; default none (dr-components 1.3.0)" }, label: { type: "string", description: "the control's label; default the page param's label (param mode), else the element's label" }, placeholder: { type: "string", description: "what the control says before a choice; default Choose\u2026" }, multiple: { type: "boolean", description: "many values: field mode writes them as one list (a dialog posts the list), param mode moves a multi param; default false, one value (dr-components 1.3.0)" }, searchable: { type: "boolean", description: "a search box over the list, filtering by label; default false (dr-components 1.3.0)" }, group_by: { type: "string", minLength: 1, description: "the key the list is grouped under: a source row's column, or group on a stated option; default none (dr-components 1.3.0)" } }, description: "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } },
|
|
10437
10447
|
props_date_picker: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, param: { type: "string", minLength: 1, description: "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, mode: { enum: ["date", "month"], description: "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, value: { type: "string", pattern: "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", description: "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, label: { type: "string", description: "the control's label; default the page param's label (param mode), else the element's label" }, placeholder: { type: "string", description: "what the control says before a pick; default Pick a date / Pick a month" } }, description: "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } },
|
|
10438
|
-
props_data_grid: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, source: { type: "string", description: "data-dr-source: the handler whose rows the grid shows" }, props: { type: "object", additionalProperties: false, required: ["columns"], properties: { columns: { type: "array", minItems: 1, items: { type: "object", additionalProperties: false, required: ["field"], properties: { field: { type: "string", minLength: 1, description: "the row key the column shows" }, label: { type: "string", description: "the header; default the field, humanised" }, format: { anyOf: [{ enum: ["currency", "number", "percent", "text", "date"] }, { type: "string", maxLength: 64, pattern: "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", description: "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], description: "how the value reads; default text" }, negative: { enum: ["minus", "red_minus", "absolute", "red_absolute"], description: "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, scale: { enum: ["units", "fraction"], description: "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, currency: { type: "string", pattern: "^[A-Z]{3}$", description: "currency only: the ISO code; default USD" }, align: { enum: ["start", "end"], description: "default end for currency, number and percent, start otherwise" }, sortable: { type: "boolean", description: "whether the header sorts; default true" } } }, description: "the columns, in order" }, key: { type: "string", description: "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, page_size: { type: "integer", minimum: 5, description: "rows per page; default 10" }, sort: { type: "object", additionalProperties: false, required: ["field"], properties: { field: { type: "string", minLength: 1, description: "the column sorted first" }, dir: { enum: ["asc", "desc"], description: "default asc" } }, description: "the order the rows start in; default the order the handler answered" }, on_row: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*$", description: "a handler called with {row} when a reader opens a row; the page re-reads after it" }, row_actions: { type: "array", minItems: 1, items: { oneOf: [{ type: "object", additionalProperties: false, required: ["label", "dialog"], properties: { label: { type: "string", minLength: 1, description: "the text on the row's button" }, dialog: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_-]*$", description: "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, role: { type: "string", minLength: 1, description: "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, when: { type: "object", additionalProperties: { type: "array", minItems: 1, items: { type: "string", minLength: 1 } }, description: "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { type: "object", additionalProperties: false, required: ["label", "call"], properties: { label: { type: "string", minLength: 1, description: "the text on the row's button" }, call: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*$", description: "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, confirm: { type: "string", minLength: 1, description: "the question asked before the call runs (Confirm / Cancel); default none" }, role: { type: "string", minLength: 1, description: "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, when: { type: "object", additionalProperties: { type: "array", minItems: 1, items: { type: "string", minLength: 1 } }, description: "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, description: "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, empty_text: { type: "string", description: "what the empty state says; default the registry's sentence, Nothing to show." } }, description: "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } },
|
|
10448
|
+
props_data_grid: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, source: { type: "string", description: "data-dr-source: the handler whose rows the grid shows" }, props: { type: "object", additionalProperties: false, required: ["columns"], properties: { columns: { type: "array", minItems: 1, items: { type: "object", additionalProperties: false, required: ["field"], properties: { field: { type: "string", minLength: 1, description: "the row key the column shows" }, label: { type: "string", description: "the header; default the field, humanised" }, format: { anyOf: [{ enum: ["currency", "number", "percent", "text", "date"] }, { type: "string", maxLength: 64, pattern: "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", description: "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], description: "how the value reads; default text" }, negative: { enum: ["minus", "red_minus", "absolute", "red_absolute"], description: "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, scale: { enum: ["units", "fraction"], description: "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, currency: { type: "string", pattern: "^[A-Z]{3}$", description: "currency only: the ISO code; default USD" }, align: { enum: ["start", "end"], description: "default end for currency, number and percent, start otherwise" }, sortable: { type: "boolean", description: "whether the header sorts; default true" }, cell: { enum: ["badge", "status", "chip", "link", "toggle"], description: "how the value draws instead of text (dr-components 1.3.0, the dr-grid cell renderers): badge (a dr-badge, its colour from badge_map), status (a dr-status, its type from status_map), chip (the value, or each value of a list, as a chip), link (the value as a link: to link_field's URL, else opening the row through on_row), toggle (a switch over a boolean; call flips it, without it the switch is read-only)" }, badge_map: { type: "object", additionalProperties: { enum: ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], description: "a dr-badge colour" }, description: "cell badge: value \u2192 dr-badge colour; an unmapped value is stone (dr-components 1.3.0)" }, status_map: { type: "object", additionalProperties: { enum: ["info", "progress", "error", "warning", "success", "default"], description: "a dr-status type" }, description: "cell status: value \u2192 dr-status type; an unmapped value is default (dr-components 1.3.0)" }, link_field: { type: "string", minLength: 1, description: "cell link: the row column holding the link's URL (same-origin path, #hash, or http(s)); default none: the link opens the row (on_row) (dr-components 1.3.0)" }, call: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*$", description: "cell toggle: a handler called with {id, row, field, value} when the reader flips the switch; the page re-reads after. Without it the switch is read-only (dr-components 1.3.0)" } } }, description: "the columns, in order" }, key: { type: "string", description: "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, theme: { enum: ["default", "borderless", "editable", "inside-card"], description: "the dr-grid theme (dr-components 1.3.0): default (rows and header 56px), borderless (40px, no row lines), editable (40px, a focus ring on the cell), inside-card (rows 56px, a 32px header, for a grid inside a card); default default" }, hierarchy: { type: "object", additionalProperties: false, required: ["parent", "label"], properties: { parent: { type: "string", minLength: 1, description: "the column holding each row's parent row key (the key column's value); empty for a top row" }, label: { type: "string", minLength: 1, description: "the column drawn as the tree: indented by depth, with expand / collapse on a parent" }, expanded: { type: "boolean", description: "whether parents start open; default true" } }, description: "tree rows (dr-components 1.3.0): a P&L's accounts under their parents, each parent's number columns the sum of its children's unless the source answers the parent's own; sorting orders siblings" }, totals: { enum: ["top", "bottom", "none"], description: "a totals row, summing the top rows' number columns (currency, number, a platform format string; a percent is left blank), pinned above or below the rows (dr-components 1.3.0); default none" }, pin: { type: "array", minItems: 1, items: { type: "string", minLength: 1 }, description: "the leading columns (fields) that stay in view while the grid scrolls sideways, in column order (dr-components 1.3.0)" }, csv_params: { type: "object", additionalProperties: false, properties: { file_name: { type: "string", minLength: 1, description: "the downloaded file's name; default the element id, .csv" } }, description: "draws an Export CSV button (dr-grid-toolbar csvParams, dr-components 1.3.0): every row in the grid's order, parents and totals included, numbers raw, headers as shown" }, page_size: { type: "integer", minimum: 5, description: "rows per page; default 10" }, sort: { type: "object", additionalProperties: false, required: ["field"], properties: { field: { type: "string", minLength: 1, description: "the column sorted first" }, dir: { enum: ["asc", "desc"], description: "default asc" } }, description: "the order the rows start in; default the order the handler answered" }, on_row: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*$", description: "a handler called with {row} when a reader opens a row; the page re-reads after it" }, row_actions: { type: "array", minItems: 1, items: { oneOf: [{ type: "object", additionalProperties: false, required: ["label", "dialog"], properties: { label: { type: "string", minLength: 1, description: "the text on the row's button" }, dialog: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_-]*$", description: "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, role: { type: "string", minLength: 1, description: "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, when: { type: "object", additionalProperties: { type: "array", minItems: 1, items: { type: "string", minLength: 1 } }, description: "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { type: "object", additionalProperties: false, required: ["label", "call"], properties: { label: { type: "string", minLength: 1, description: "the text on the row's button" }, call: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*$", description: "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, confirm: { type: "string", minLength: 1, description: "the question asked before the call runs (Confirm / Cancel); default none" }, role: { type: "string", minLength: 1, description: "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, when: { type: "object", additionalProperties: { type: "array", minItems: 1, items: { type: "string", minLength: 1 } }, description: "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, description: "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, empty_text: { type: "string", description: "what the empty state says; default the registry's sentence, Nothing to show." } }, description: "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } },
|
|
10439
10449
|
props_dialog: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, properties: { trigger: { type: "string", minLength: 1, description: "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, title: { type: "string", description: "the dialog's title; default the element's label" }, description: { type: "string", description: "one line under the title" }, confirm: { type: "string", description: "the text on the confirm button; default Confirm" }, on_confirm: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*$", description: "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, values_from: { enum: ["row"], description: "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, key: { type: "string", minLength: 1, description: "with values_from row: the row column posted as id; default the grid's key, else id" } }, description: "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } },
|
|
10440
10450
|
props_variance_table: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, source: { type: "string", description: "data-dr-source: the handler whose rows are the lines" }, props: { type: "object", additionalProperties: false, required: ["row", "actual", "plan"], properties: { row: { type: "string", minLength: 1, description: "the column naming each line; its value is the line's data-dr-row" }, actual: { type: "string", minLength: 1, description: "the column holding the actual figure" }, plan: { type: "string", minLength: 1, description: "the column holding the plan (budget) figure" }, format: { anyOf: [{ enum: ["currency", "number", "percent"] }, { type: "string", maxLength: 64, pattern: "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", description: "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], description: "how actual, plan and variance read; default currency" }, negative: { enum: ["minus", "red_minus", "absolute", "red_absolute"], description: "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, scale: { enum: ["units", "fraction"], description: "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, currency: { type: "string", pattern: "^[A-Z]{3}$", description: "currency only: the ISO code; default USD" }, favorable: { enum: ["higher", "lower"], description: "which way is good: higher (the default) for revenue, lower for cost" }, threshold: { type: "object", additionalProperties: false, required: [], properties: { abs: { type: "number", minimum: 0, description: "a variance smaller than this, in the figures' units, is neutral" }, pct: { type: "number", minimum: 0, description: "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, description: "below both limits a variance is neutral rather than toned; default none" }, empty_text: { type: "string", description: "what the empty state says; default the registry's sentence, Nothing to show." } }, description: "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } },
|
|
10441
10451
|
props_toggle: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, param: { type: "string", minLength: 1, description: "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, value: { type: "boolean", description: "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, label: { type: "string", description: "the switch's label; default the page param's label (param mode), else the element's label" }, description: { type: "string", description: "one line under the label" } }, description: "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } },
|
|
@@ -10456,7 +10466,11 @@ var contract_schema_default = {
|
|
|
10456
10466
|
props_skeleton: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, properties: { appearance: { enum: ["rectangle", "title-line", "text-line", "chip", "avatar"], description: "the shape; default rectangle" }, count: { type: "integer", minimum: 1, description: "how many, one under the other; default 1 (at most 12)" }, width: { type: "string", pattern: "^\\d+(\\.\\d+)?(px|%|rem)$", description: "a CSS length: 100%, 240px, 12rem; default the appearance's" }, height: { type: "string", pattern: "^\\d+(\\.\\d+)?(px|rem)$", description: "a CSS length; default the appearance's" } }, description: "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } },
|
|
10457
10467
|
props_progress: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, source: { type: "string", description: "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, props: { type: "object", additionalProperties: false, properties: { progress: { type: "number", minimum: 0, description: "how much is done; default the value at path" }, total: { type: "number", minimum: 0, description: "what done means; default the value at total_path, else 100" }, path: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", description: "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, total_path: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", description: "a dotted path to the total in the source's answer" }, show_value: { type: "boolean", description: "the percent beside the bar; default true" }, type: { enum: ["light", "dark"], description: "the dr-progress-bar type; default light" }, label: { type: "string", description: "the words above the bar; default the element's label" } }, description: "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } },
|
|
10458
10468
|
props_accordion: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["items"], properties: { items: { type: "array", minItems: 1, items: { type: "object", additionalProperties: false, required: ["title"], properties: { title: { type: "string", minLength: 1, description: "the section's header" }, open: { type: "boolean", description: "whether it starts open; default false" } } }, description: "the sections, in order: child i of the element fills item i" }, multi: { type: "boolean", description: "several may be open at once; default false" }, theme: { enum: ["regular", "borderless"], description: "the dr-accordion theme; default regular" } }, description: "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } },
|
|
10459
|
-
props_tooltip_info: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["text"], properties: { text: { type: "string", minLength: 1, description: "the explanation" }, label: { type: "string", description: "words before the mark; default none" }, position: { enum: ["top", "bottom", "left", "right"], description: "where the explanation opens; default top" } }, description: "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } }
|
|
10469
|
+
props_tooltip_info: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["text"], properties: { text: { type: "string", minLength: 1, description: "the explanation" }, label: { type: "string", description: "words before the mark; default none" }, position: { enum: ["top", "bottom", "left", "right"], description: "where the explanation opens; default top" } }, description: "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } },
|
|
10470
|
+
props_filter_bar: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["filters"], properties: { filters: { type: "array", minItems: 1, items: { type: "object", additionalProperties: false, required: ["kind", "param"], properties: { kind: { enum: ["option", "date-range", "fiscal-month"], description: "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, param: { type: "string", minLength: 1, description: "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, param_to: { type: "string", minLength: 1, description: "date-range only: the To param (period or month, the same kind as param)" }, label: { type: "string", description: "the chip's label (Label: value); default the page param's label, else its name" }, mandatory: { type: "boolean", description: "always shown, never under More, no remove (\xD7); default false. A filter is also shown when it starts active" }, disabled: { type: "boolean", description: "drawn but not interactive; default false" }, multiple: { type: "boolean", description: "option only: many values (a multi param), default false: one value" }, searchable: { type: "boolean", description: "option only: a search box above the list; default false" }, group_by: { type: "string", minLength: 1, description: "option only: the key each option is grouped under (group, on a stated option)" }, options: { type: "array", items: { type: "object", additionalProperties: false, required: ["value", "label"], properties: { value: { type: "string", minLength: 1, description: "what is stored" }, label: { type: "string", description: "what the reader sees" }, group: { type: "string", description: 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, description: "option only: the options; default the page param's declared values" }, label_from: { type: "string", description: "date-range only: the From picker's label; default From" }, label_to: { type: "string", description: "date-range only: the To picker's label; default To" }, fiscal_year_months_modifier: { type: "integer", minimum: 0, description: "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, fiscal_year_back: { type: "boolean", description: "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } } }, description: "the filters, in order: each a chip over a page param" }, filters_label: { type: "string", description: "words before the chips (Filters:); default none" }, more_label: { type: "string", description: "the button that adds an optional filter that is not shown; default More" }, add_filters_title: { type: "string", description: "the title of More's list; default Add Filters" }, clear_tooltip: { type: "string", description: "the clear-all button's name; default Clear filters" }, clearable: { type: "boolean", description: "draws the clear-all button while any filter narrows; default true" } }, description: "data-dr-props: the filter_bar part's typed props, handed to it as PartProps.props" } } },
|
|
10471
|
+
props_filter_chip: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, required: ["kind", "param"], properties: { kind: { enum: ["option", "date-range", "fiscal-month"], description: "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, param: { type: "string", minLength: 1, description: "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, param_to: { type: "string", minLength: 1, description: "date-range only: the To param (period or month, the same kind as param)" }, label: { type: "string", description: "the chip's label (Label: value); default the page param's label, else its name" }, removable: { type: "boolean", description: "draws a remove (\xD7) that clears the filter; default false" }, disabled: { type: "boolean", description: "drawn but not interactive; default false" }, multiple: { type: "boolean", description: "option only: many values (a multi param), default false: one value" }, searchable: { type: "boolean", description: "option only: a search box above the list; default false" }, group_by: { type: "string", minLength: 1, description: "option only: the key each option is grouped under (group, on a stated option)" }, options: { type: "array", items: { type: "object", additionalProperties: false, required: ["value", "label"], properties: { value: { type: "string", minLength: 1, description: "what is stored" }, label: { type: "string", description: "what the reader sees" }, group: { type: "string", description: 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, description: "option only: the options; default the page param's declared values" }, label_from: { type: "string", description: "date-range only: the From picker's label; default From" }, label_to: { type: "string", description: "date-range only: the To picker's label; default To" }, fiscal_year_months_modifier: { type: "integer", minimum: 0, description: "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, fiscal_year_back: { type: "boolean", description: "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } }, description: "data-dr-props: the filter_chip part's typed props, handed to it as PartProps.props" } } },
|
|
10472
|
+
props_date_range: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key the From date is written under (a hidden input of that name), with field_to; exactly one of field and param" }, field_to: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key the To date is written under; required with field" }, param: { type: "string", minLength: 1, description: "param mode: the page param the From date moves (a period or month param), with param_to; exactly one of field and param" }, param_to: { type: "string", minLength: 1, description: "param mode: the page param the To date moves, the same kind as param; required with param" }, mode: { enum: ["date", "month"], description: "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over month params is month" }, value: { type: "string", pattern: "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", description: "field mode: the From date it starts on; default none" }, value_to: { type: "string", pattern: "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", description: "field mode: the To date it starts on; default none" }, label: { type: "string", description: "the control's label; default the From param's label (param mode), else the element's label" }, label_from: { type: "string", description: "the From picker's label; default From" }, label_to: { type: "string", description: "the To picker's label; default To" }, placeholder_from: { type: "string", description: "what From says before a pick; default Select\u2026" }, placeholder_to: { type: "string", description: "what To says before a pick; default Select\u2026" }, column: { type: "boolean", description: "From above To instead of side by side; default false" } }, description: "data-dr-props: the date_range part's typed props, handed to it as PartProps.props" } } },
|
|
10473
|
+
props_fiscal_month: { type: "object", additionalProperties: false, required: ["props"], properties: { id: { type: "string", description: "data-dr-id: the element's stable id, unique on its page" }, label: { type: "string", description: "data-dr-label: the title a reader sees" }, role: { type: "string", description: "data-dr-role: the app role this element is meant for; absent means every role" }, span: { type: "integer", description: "data-dr-span: columns of the kit's twelve" }, section: { type: "string", description: "the page section the element sits in (the nearest data-dr-section)" }, props: { type: "object", additionalProperties: false, properties: { field: { type: "string", pattern: "^[a-z][a-z0-9_]*$", description: "field mode: the payload key this picker writes, the calendar month as YYYY-MM; exactly one of field and param" }, param: { type: "string", minLength: 1, description: "param mode: the page param (a month or period param) it moves with the calendar month as YYYY-MM; exactly one of field and param" }, fiscal_year_months_modifier: { type: "integer", minimum: 0, description: "how many months after January the fiscal year starts (3: April, so April is the fiscal year's first month); default 0, a calendar year" }, fiscal_year_back: { type: "boolean", description: "the fiscal year is named by the calendar year it starts in; default false: by the year it ends in (an April 2026 start is FY2027)" }, value: { type: "string", pattern: "^[0-9]{4}-[0-9]{2}$", description: "field mode: the calendar month it starts on; default none" }, label: { type: "string", description: "the control's label; default the page param's label (param mode), else the element's label" }, placeholder: { type: "string", description: "what the control says before a pick; default Select\u2026" } }, description: "data-dr-props: the fiscal_month part's typed props, handed to it as PartProps.props" } } }
|
|
10460
10474
|
}
|
|
10461
10475
|
};
|
|
10462
10476
|
|
|
@@ -10903,6 +10917,9 @@ function payloadProducers(contract, { moduleSource = () => void 0, pageSource =
|
|
|
10903
10917
|
for (const action of Array.isArray(typed.row_actions) ? typed.row_actions : []) {
|
|
10904
10918
|
if (isPlainObject3(action) && named2(action.call)) add(action.call, { page, uid, what: "data_grid", keys: ["id", "row"] });
|
|
10905
10919
|
}
|
|
10920
|
+
for (const column of Array.isArray(typed.columns) ? typed.columns : []) {
|
|
10921
|
+
if (isPlainObject3(column) && column.cell === "toggle" && named2(column.call)) add(column.call, { page, uid, what: "data_grid", keys: ["id", "row", "field", "value"] });
|
|
10922
|
+
}
|
|
10906
10923
|
break;
|
|
10907
10924
|
case "action": {
|
|
10908
10925
|
const keys2 = [];
|
|
@@ -12081,8 +12098,8 @@ var CHARTS = "echarts@5.6.0";
|
|
|
12081
12098
|
var FMT = "dr-fmt@2.0.1";
|
|
12082
12099
|
var TOKENS = "dr-tokens@1.0.0";
|
|
12083
12100
|
var WIDGETS = "dr-app-widgets@1.2.0";
|
|
12084
|
-
var COMPONENTS = "dr-components@1.
|
|
12085
|
-
var CONTROLS = "dr-components-controls@1.
|
|
12101
|
+
var COMPONENTS = "dr-components@1.3.0";
|
|
12102
|
+
var CONTROLS = "dr-components-controls@1.2.0";
|
|
12086
12103
|
var PART_FILES = {
|
|
12087
12104
|
"dr-components": { css: "components.css", js: "components.js" },
|
|
12088
12105
|
"dr-components-controls": { css: "controls.css", js: "controls.js" }
|
|
@@ -13150,10 +13167,11 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
|
|
|
13150
13167
|
problems.push(...numberProblems(declared));
|
|
13151
13168
|
problems.push(...numberPinProblems(declared, { "dr-app-runtime": runtime, "dr-app-widgets": appWidgets, "dr-components": appComponents, "dr-components-controls": appControls }));
|
|
13152
13169
|
problems.push(...whenPinProblems(declared, { "dr-components": appComponents }));
|
|
13170
|
+
problems.push(...propsPinProblems(declared, { "dr-components": appComponents, "dr-components-controls": appControls }));
|
|
13153
13171
|
const widgetFindings = tree.problems.length === 0 ? widgetProblems(declared, tree, handlers, contract?.data?.sources, appWidgets) : [];
|
|
13154
13172
|
const warnings = [...sourceFindings, ...widgetFindings].filter((one) => one.advisory).map(({ advisory: _advisory, ...one }) => one);
|
|
13155
13173
|
problems.push(...widgetFindings.filter((one) => !one.advisory));
|
|
13156
|
-
if (tree.problems.length === 0) problems.push(...partProblems(declared, tree, handlers, sources, contract?.pages, model));
|
|
13174
|
+
if (tree.problems.length === 0) problems.push(...partProblems(declared, tree, handlers, sources, contract?.pages, model, { "dr-components": appComponents }));
|
|
13157
13175
|
if (problems.length > 0) return { files: {}, problems, contract, warnings };
|
|
13158
13176
|
if (sources !== stated2) contract = { ...contract, data: { ...contract.data, sources } };
|
|
13159
13177
|
const parented = dropEmptyArgs(fillChartFormats(fillParents(declared, tree), handlers, model));
|
|
@@ -13958,6 +13976,41 @@ function whenPinProblems(elements, pins) {
|
|
|
13958
13976
|
}
|
|
13959
13977
|
return problems;
|
|
13960
13978
|
}
|
|
13979
|
+
function propsPinProblems(elements, pins) {
|
|
13980
|
+
const problems = [];
|
|
13981
|
+
for (const uid of Object.keys(elements).sort(natural3)) {
|
|
13982
|
+
const element = elements[uid] ?? {};
|
|
13983
|
+
const gates = PROPS_SINCE2?.[element.type];
|
|
13984
|
+
if (!isPlainObject5(gates)) continue;
|
|
13985
|
+
const module = MODULE_OF2[element.type];
|
|
13986
|
+
const pin = pins[module];
|
|
13987
|
+
if (typeof pin !== "string") continue;
|
|
13988
|
+
for (const [path3, first] of Object.entries(gates)) {
|
|
13989
|
+
if (pinAtLeast(pin, first)) continue;
|
|
13990
|
+
let reached = [[`/elements/${escapePointer3(uid)}/props/props`, element.props?.props]];
|
|
13991
|
+
for (const step of path3.split(".")) {
|
|
13992
|
+
const many = step.endsWith("[]");
|
|
13993
|
+
const key = many ? step.slice(0, -2) : step;
|
|
13994
|
+
const next = [];
|
|
13995
|
+
for (const [at, node] of reached) {
|
|
13996
|
+
if (!isPlainObject5(node) || node[key] === void 0 || node[key] === null) continue;
|
|
13997
|
+
const pointer2 = `${at}/${escapePointer3(key)}`;
|
|
13998
|
+
if (!many) next.push([pointer2, node[key]]);
|
|
13999
|
+
else if (Array.isArray(node[key])) node[key].forEach((item, i) => next.push([`${pointer2}/${i}`, item]));
|
|
14000
|
+
}
|
|
14001
|
+
reached = next;
|
|
14002
|
+
}
|
|
14003
|
+
for (const [pointer2] of reached) {
|
|
14004
|
+
problems.push({
|
|
14005
|
+
code: "prop_unsupported",
|
|
14006
|
+
pointer: pointer2,
|
|
14007
|
+
message: `${element.type} "${element.props?.id ?? uid}" states props.${path3}, and ${module}@${first} is the first release that draws it; the pinned version is ${pin.slice(pin.lastIndexOf("@") + 1)}, which would draw the ${element.type} without it \u2014 drop it for now`
|
|
14008
|
+
});
|
|
14009
|
+
}
|
|
14010
|
+
}
|
|
14011
|
+
}
|
|
14012
|
+
return problems;
|
|
14013
|
+
}
|
|
13961
14014
|
function pinAtLeast(pin, first) {
|
|
13962
14015
|
const semver3 = (v) => String(v).split(".").map((n) => Number.parseInt(n, 10) || 0);
|
|
13963
14016
|
const [a, b] = [semver3(pin.slice(pin.lastIndexOf("@") + 1)), semver3(first)];
|
|
@@ -14181,8 +14234,12 @@ var CONTROL_KINDS2 = {
|
|
|
14181
14234
|
slider: ["slider", "number"],
|
|
14182
14235
|
select: ["select", "period", "month"],
|
|
14183
14236
|
date_picker: ["month", "period"],
|
|
14184
|
-
toggle: ["toggle"]
|
|
14237
|
+
toggle: ["toggle"],
|
|
14238
|
+
// dr-components 1.3.0.
|
|
14239
|
+
date_range: ["period", "month"],
|
|
14240
|
+
fiscal_month: ["month", "period"]
|
|
14185
14241
|
};
|
|
14242
|
+
var TOGGLE_CALL_ROLES = ["custom"];
|
|
14186
14243
|
function rowTableOf(source, handlers, sources, model) {
|
|
14187
14244
|
if (!model || !named4(source)) return null;
|
|
14188
14245
|
let table = null;
|
|
@@ -14206,7 +14263,7 @@ function primaryKeyOf(model, table) {
|
|
|
14206
14263
|
const pks = Object.entries(model.tables[table]?.columns ?? {}).filter(([, column]) => column?.pk);
|
|
14207
14264
|
return pks.length === 1 ? pks[0][0] : null;
|
|
14208
14265
|
}
|
|
14209
|
-
function partProblems(elements, tree, handlers, sources, pages = [], model = null) {
|
|
14266
|
+
function partProblems(elements, tree, handlers, sources, pages = [], model = null, pins = {}) {
|
|
14210
14267
|
const problems = [];
|
|
14211
14268
|
const declaredSources = isPlainObject5(sources) ? sources : {};
|
|
14212
14269
|
const paramsOf4 = (path3) => {
|
|
@@ -14262,7 +14319,8 @@ function partProblems(elements, tree, handlers, sources, pages = [], model = nul
|
|
|
14262
14319
|
} else if (param) {
|
|
14263
14320
|
const declared = paramsOf4(element.page);
|
|
14264
14321
|
const one = declared.find((candidate) => candidate.name === typedProps.param);
|
|
14265
|
-
const
|
|
14322
|
+
const multiple = type === "select" && typedProps.multiple === true && pinAtLeast(pins["dr-components"] ?? "", PROPS_SINCE2?.select?.multiple ?? "");
|
|
14323
|
+
const kinds = multiple ? ["multi"] : CONTROL_KINDS2[type] ?? [];
|
|
14266
14324
|
if (!one) {
|
|
14267
14325
|
const names = declared.map((candidate) => `"${candidate.name}"`);
|
|
14268
14326
|
say(
|
|
@@ -14446,6 +14504,109 @@ function partProblems(elements, tree, handlers, sources, pages = [], model = nul
|
|
|
14446
14504
|
}
|
|
14447
14505
|
});
|
|
14448
14506
|
}
|
|
14507
|
+
if (type === "date_range") {
|
|
14508
|
+
const inField = stated(typedProps.field);
|
|
14509
|
+
const inParam = stated(typedProps.param);
|
|
14510
|
+
if (inField && !inParam && !stated(typedProps.field_to)) {
|
|
14511
|
+
say("part_mode", `${at}/props/props`, `writes its From date under field "${typedProps.field}" and states no field_to; a date range writes two fields \u2014 name the To one (field_to)`);
|
|
14512
|
+
}
|
|
14513
|
+
if (inParam && !inField) {
|
|
14514
|
+
if (!stated(typedProps.param_to)) {
|
|
14515
|
+
say("part_mode", `${at}/props/props`, `moves page param "${typedProps.param}" for its From end and states no param_to; a date range moves two page params \u2014 name the To one (param_to), declared in pages[].params with the same kind`);
|
|
14516
|
+
} else {
|
|
14517
|
+
const declared = paramsOf4(element.page);
|
|
14518
|
+
const from = declared.find((one) => one.name === typedProps.param);
|
|
14519
|
+
const to = declared.find((one) => one.name === typedProps.param_to);
|
|
14520
|
+
if (!to) {
|
|
14521
|
+
say("part_param_undeclared", `${at}/props/props/param_to`, `moves page param "${typedProps.param_to}" for its To end, which ${element.page} does not declare; declare it in pages[].params (a ${from?.kind ?? "period or month"} param, as "${typedProps.param}" is), or name one it declares`);
|
|
14522
|
+
} else if (from && to.kind !== from.kind) {
|
|
14523
|
+
say("part_param_kind", `${at}/props/props/param_to`, `moves page param "${typedProps.param_to}", a ${to.kind}, for its To end, and "${typedProps.param}" is a ${from.kind}; both ends are one kind \u2014 make "${typedProps.param_to}" a ${from.kind} param`);
|
|
14524
|
+
}
|
|
14525
|
+
}
|
|
14526
|
+
}
|
|
14527
|
+
}
|
|
14528
|
+
if (type === "filter_bar" || type === "filter_chip") {
|
|
14529
|
+
const declared = paramsOf4(element.page);
|
|
14530
|
+
const names = declared.map((one) => `"${one.name}"`);
|
|
14531
|
+
const filters = type === "filter_bar" ? Array.isArray(typedProps.filters) ? typedProps.filters.map((filter, i) => [filter, `${at}/props/props/filters/${i}`]) : [] : [[typedProps, `${at}/props/props`]];
|
|
14532
|
+
for (const [filter, base] of filters) {
|
|
14533
|
+
if (!isPlainObject5(filter) || !stated(filter.param)) continue;
|
|
14534
|
+
const who = type === "filter_bar" ? `filter "${filter.label ?? filter.param}"` : "filter";
|
|
14535
|
+
const multiple = filter.kind === "option" && filter.multiple === true;
|
|
14536
|
+
const kinds = filter.kind === "option" ? multiple ? ["multi"] : ["select", "period", "month"] : filter.kind === "date-range" ? ["period", "month"] : ["month", "period"];
|
|
14537
|
+
const ends = [["param", filter.param]];
|
|
14538
|
+
if (filter.kind === "date-range") {
|
|
14539
|
+
if (!stated(filter.param_to)) {
|
|
14540
|
+
say("part_mode", base, `${who} is a date-range over "${filter.param}" and states no param_to; a date range moves two page params \u2014 name the To one (param_to), declared in pages[].params with the same kind`);
|
|
14541
|
+
} else ends.push(["param_to", filter.param_to]);
|
|
14542
|
+
}
|
|
14543
|
+
const found = [];
|
|
14544
|
+
for (const [key, name] of ends) {
|
|
14545
|
+
const one = declared.find((candidate) => candidate.name === name);
|
|
14546
|
+
if (!one) {
|
|
14547
|
+
say("part_param_undeclared", `${base}/${key}`, `${who} moves page param "${name}", which ${element.page} does not declare (${names.length === 0 ? "it declares no params" : `it declares ${names.join(", ")}`}); declare it in pages[].params (a ${either3(kinds)} param), or name one it declares`);
|
|
14548
|
+
continue;
|
|
14549
|
+
}
|
|
14550
|
+
if (!kinds.includes(one.kind)) {
|
|
14551
|
+
say("part_param_kind", `${base}/${key}`, `${who} moves page param "${name}", a ${one.kind}; ${filter.kind === "option" ? "an" : "a"} ${filter.kind}${multiple ? " filter with multiple" : " filter"} moves a ${either3(kinds)} param`);
|
|
14552
|
+
continue;
|
|
14553
|
+
}
|
|
14554
|
+
found.push([key, one]);
|
|
14555
|
+
}
|
|
14556
|
+
if (found.length === 2 && found[0][1].kind !== found[1][1].kind) {
|
|
14557
|
+
say("part_param_kind", `${base}/param_to`, `${who} is a date-range over "${found[0][1].name}", a ${found[0][1].kind}, and "${found[1][1].name}", a ${found[1][1].kind}; both ends are one kind \u2014 make "${found[1][1].name}" a ${found[0][1].kind} param`);
|
|
14558
|
+
}
|
|
14559
|
+
const optional = type === "filter_bar" ? filter.mandatory !== true : filter.removable === true;
|
|
14560
|
+
if (optional && !multiple) {
|
|
14561
|
+
for (const [key, one] of found) {
|
|
14562
|
+
if (one.default !== void 0 && one.default !== null) continue;
|
|
14563
|
+
say(
|
|
14564
|
+
"part_param_default",
|
|
14565
|
+
`${base}/${key}`,
|
|
14566
|
+
`${who} is optional (${type === "filter_bar" ? "not mandatory" : "removable"}) over page param "${one.name}", which declares no default; an optional filter clears to its param's default, so with none its \xD7 and clear-all cannot reset it \u2014 give "${one.name}" a default in pages[].params (the value that narrows nothing, such as "all"), or make the filter ${type === "filter_bar" ? "mandatory" : "not removable"}`
|
|
14567
|
+
);
|
|
14568
|
+
}
|
|
14569
|
+
}
|
|
14570
|
+
}
|
|
14571
|
+
}
|
|
14572
|
+
if (type === "data_grid") {
|
|
14573
|
+
const columns = Array.isArray(typedProps.columns) ? typedProps.columns : [];
|
|
14574
|
+
const rowTable = rowTableOf(props.source, handlers, declaredSources, model);
|
|
14575
|
+
const carries = (column) => rowTable === null || hasColumn(model, rowTable, column);
|
|
14576
|
+
const hierarchy = isPlainObject5(typedProps.hierarchy) ? typedProps.hierarchy : null;
|
|
14577
|
+
if (hierarchy) {
|
|
14578
|
+
const hp = `${at}/props/props/hierarchy`;
|
|
14579
|
+
if (stated(hierarchy.label) && !columns.some((column) => column?.field === hierarchy.label)) {
|
|
14580
|
+
say("part_hierarchy", `${hp}/label`, `draws its tree in column "${hierarchy.label}", which is none of its columns; add a column with field "${hierarchy.label}", or name one of the columns it draws (${columns.map((column) => `"${column?.field}"`).join(", ")})`);
|
|
14581
|
+
}
|
|
14582
|
+
for (const key2 of ["parent", "label"]) {
|
|
14583
|
+
if (stated(hierarchy[key2]) && !carries(hierarchy[key2])) {
|
|
14584
|
+
say("part_hierarchy", `${hp}/${key2}`, `nests its rows by hierarchy.${key2} "${hierarchy[key2]}", and the rows "${props.source}" answers (table ${rowTable}) carry no such column; name a column of ${rowTable}`);
|
|
14585
|
+
}
|
|
14586
|
+
}
|
|
14587
|
+
const key = stated(typedProps.key) ? typedProps.key : "id";
|
|
14588
|
+
if (!carries(key)) {
|
|
14589
|
+
say("part_hierarchy", `${at}/props/props/${stated(typedProps.key) ? "key" : "hierarchy"}`, `nests rows under the row whose key ("${key}") a child's ${hierarchy.parent ?? "parent"} names, and the rows "${props.source}" answers (table ${rowTable}) carry no column "${key}"; state props.key, a column of ${rowTable} the parent column points at`);
|
|
14590
|
+
}
|
|
14591
|
+
}
|
|
14592
|
+
columns.forEach((column, index) => {
|
|
14593
|
+
if (!isPlainObject5(column)) return;
|
|
14594
|
+
const cp2 = `${at}/props/props/columns/${index}`;
|
|
14595
|
+
if (stated(column.link_field)) {
|
|
14596
|
+
if (column.cell !== "link") say("part_cell", `${cp2}/link_field`, `column "${column.field}" states link_field and draws no link; add cell: "link", or drop link_field`);
|
|
14597
|
+
else if (!carries(column.link_field)) say("part_cell", `${cp2}/link_field`, `column "${column.field}" links to link_field "${column.link_field}", and the rows "${props.source}" answers (table ${rowTable}) carry no such column; name the column of ${rowTable} that holds each row's URL`);
|
|
14598
|
+
}
|
|
14599
|
+
if (stated(column.call)) {
|
|
14600
|
+
if (column.cell !== "toggle") {
|
|
14601
|
+
say("part_cell", `${cp2}/call`, `column "${column.field}" states call and draws no toggle; add cell: "toggle", or drop call`);
|
|
14602
|
+
} else if (!Object.prototype.hasOwnProperty.call(handlers, column.call)) {
|
|
14603
|
+
say("part_handler_missing", `${cp2}/call`, `column "${column.field}"'s toggle calls "${column.call}", which data.app.handlers does not declare; declare it (a custom handler: it gets {id, row, field, value}), or drop call to draw the toggle read-only`);
|
|
14604
|
+
} else if (!TOGGLE_CALL_ROLES.includes(handlers[column.call]?.role)) {
|
|
14605
|
+
say("part_handler_missing", `${cp2}/call`, `column "${column.field}"'s toggle calls "${column.call}", and it has role ${handlers[column.call]?.role ?? "none"}; a toggle cell posts {id, row, field, value}, which only a custom handler reads \u2014 make it a ${either3(TOGGLE_CALL_ROLES)} handler`);
|
|
14606
|
+
}
|
|
14607
|
+
}
|
|
14608
|
+
});
|
|
14609
|
+
}
|
|
14449
14610
|
if (entry.reads?.as === "payload") {
|
|
14450
14611
|
const source = props.source;
|
|
14451
14612
|
if (!stated(source)) {
|
|
@@ -16061,7 +16222,8 @@ function widgetsOn(page, elements) {
|
|
|
16061
16222
|
var ICON_RE = /(^|[^a-z0-9-])dr-icon-[a-z0-9]/;
|
|
16062
16223
|
var TOKEN_PARTS = /* @__PURE__ */ new Set(["badge"]);
|
|
16063
16224
|
function tokensOn(page, elements) {
|
|
16064
|
-
|
|
16225
|
+
const badgeCells = (element) => element.type === "data_grid" && Array.isArray(element.props?.props?.columns) && element.props.props.columns.some((column) => column?.cell === "badge");
|
|
16226
|
+
return Object.values(elements).some((element) => element?.page === page.path && (TOKEN_PARTS.has(element.type) || badgeCells(element)));
|
|
16065
16227
|
}
|
|
16066
16228
|
function iconsOn(page, elements, extra) {
|
|
16067
16229
|
for (const element of Object.values(elements)) {
|
|
@@ -20036,10 +20198,10 @@ function parseAttrs2(raw) {
|
|
|
20036
20198
|
}
|
|
20037
20199
|
|
|
20038
20200
|
// ../flows/appspace-builder/kit/contract/components.gen.mjs
|
|
20039
|
-
var REGISTRY_VERSION2 = Object.freeze(
|
|
20040
|
-
var ELEMENT_TYPES3 = Object.freeze(["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
20041
|
-
var COMPONENT_TYPES4 = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
20042
|
-
var APP_TYPES2 = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
20201
|
+
var REGISTRY_VERSION2 = Object.freeze(9);
|
|
20202
|
+
var ELEMENT_TYPES3 = Object.freeze(["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
20203
|
+
var COMPONENT_TYPES4 = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
20204
|
+
var APP_TYPES2 = Object.freeze(["widget", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field", "number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
20043
20205
|
var DASHBOARD_TYPES2 = Object.freeze(["region", "grid", "control", "nav", "tab", "slot"]);
|
|
20044
20206
|
var COMPONENT_ATTRIBUTES3 = Object.freeze(["data-dr-component", "data-dr-entity", "data-dr-action", "data-dr-source", "data-dr-field", "data-dr-param", "data-dr-role", "data-dr-filter", "data-dr-id", "data-dr-label", "data-dr-measure", "data-dr-tone", "data-dr-kind", "data-dr-x", "data-dr-y", "data-dr-series", "data-dr-format", "data-dr-negative", "data-dr-module", "data-dr-args", "data-dr-props", "data-dr-declares", "data-dr-when"]);
|
|
20045
20207
|
var COMPONENT_PROPS4 = Object.freeze([["data-dr-entity", "entity"], ["data-dr-action", "action"], ["data-dr-source", "source"], ["data-dr-field", "field"], ["data-dr-param", "param"], ["data-dr-role", "role"], ["data-dr-id", "id"], ["data-dr-label", "label"], ["data-dr-measure", "measure"], ["data-dr-tone", "tone"], ["data-dr-kind", "kind"], ["data-dr-x", "x"], ["data-dr-y", "y"], ["data-dr-series", "series"], ["data-dr-format", "format"], ["data-dr-negative", "negative"], ["data-dr-module", "module"]]);
|
|
@@ -20052,7 +20214,8 @@ var NEGATIVE_MODES3 = Object.freeze(["minus", "red_minus", "absolute", "red_abso
|
|
|
20052
20214
|
var FORMAT_PATTERNS3 = Object.freeze({ "currency": "$#,###", "number": "#,###", "percent": '#,###.#"%"' });
|
|
20053
20215
|
var PLATFORM_NUMBERS3 = Object.freeze({ "dr-app-runtime": "1.8.0", "dr-app-widgets": "1.2.0", "dr-components": "1.2.0", "dr-components-controls": "1.1.0" });
|
|
20054
20216
|
var ROW_ACTION_WHEN3 = Object.freeze({ "dr-components": "1.2.0" });
|
|
20055
|
-
var
|
|
20217
|
+
var PROPS_SINCE3 = Object.freeze({ "select": { "multiple": "1.3.0", "searchable": "1.3.0", "group_by": "1.3.0", "values": "1.3.0", "options[].group": "1.3.0" }, "data_grid": { "theme": "1.3.0", "hierarchy": "1.3.0", "totals": "1.3.0", "pin": "1.3.0", "csv_params": "1.3.0", "columns[].cell": "1.3.0", "columns[].badge_map": "1.3.0", "columns[].status_map": "1.3.0", "columns[].link_field": "1.3.0", "columns[].call": "1.3.0" } });
|
|
20218
|
+
var MODULE_OF3 = Object.freeze({ "widget": "dr-app-widgets", "form": "dr-app-runtime", "list": "dr-app-runtime", "detail": "dr-app-runtime", "queue": "dr-app-runtime", "action": "dr-app-runtime", "filter": "dr-app-runtime", "stat": "dr-app-runtime", "chart": "dr-app-runtime", "custom": "dr-app-runtime", "field": "dr-app-runtime", "number_input": "dr-components", "tabs": "dr-components", "tab_panel": "dr-components", "select": "dr-components", "date_picker": "dr-components", "data_grid": "dr-components", "dialog": "dr-components", "variance_table": "dr-components", "toggle": "dr-components", "control_group": "dr-components", "callout": "dr-components", "scenario_columns": "dr-components", "slider": "dr-components-controls", "button": "dr-components", "status": "dr-components", "badge": "dr-components", "tag": "dr-components", "empty_state": "dr-components", "stepper": "dr-components", "alert": "dr-components", "checkbox": "dr-components", "radio_group": "dr-components", "file_upload": "dr-components", "skeleton": "dr-components", "progress": "dr-components", "accordion": "dr-components", "tooltip_info": "dr-components", "filter_bar": "dr-components", "filter_chip": "dr-components", "date_range": "dr-components", "fiscal_month": "dr-components" });
|
|
20056
20219
|
var STAT_TONES3 = Object.freeze(["default", "positive", "warning", "negative"]);
|
|
20057
20220
|
var WIDGET_KINDS4 = Object.freeze(["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative"]);
|
|
20058
20221
|
var KIND_READS4 = Object.freeze({ "line": ["series"], "area": ["series"], "bar": ["series", "breakdown"], "stacked": ["series"], "pie": ["breakdown"], "donut": ["breakdown"], "kpi": ["kpi"], "candle": ["ohlc"], "bubble": ["scatter"], "table": ["table"], "narrative": ["narrative"] });
|
|
@@ -20060,14 +20223,14 @@ var APP_WIDGET_KINDS4 = Object.freeze(["waterfall", "waterfall-breakdown", "wate
|
|
|
20060
20223
|
var APP_KIND_READS4 = Object.freeze({ "waterfall": ["breakdown", "series"], "waterfall-breakdown": ["breakdown", "series"], "waterfall-walkthrough": ["breakdown", "series"], "line-forecast": ["series"], "heatmap": ["series"], "combo": ["series"], "stacked-percent": ["series"], "gauge": ["kpi"] });
|
|
20061
20224
|
var SMART_COMPARES3 = Object.freeze(["BvA", "AvF", "vs_prev_period"]);
|
|
20062
20225
|
var PLATFORM_FINANCE3 = Object.freeze({ "dr-app-widgets": "1.2.0" });
|
|
20063
|
-
var STRICT_TYPES3 = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
20064
|
-
var PROPS_SCHEMAS3 = Object.freeze({ "region": { "type": "object", "properties": {} }, "grid": { "type": "object", "properties": {} }, "widget": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the card's title on an app page" }, "role": { "type": "string", "description": "data-dr-role: the app role this card is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "kind": { "enum": ["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative", "waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"], "description": "data-dr-kind on an app page, the widget kind on a dashboard. The last eight (the finance kinds: waterfall ... gauge) are app pages only, from dr-app-widgets 1.2.0; a dashboard card takes one of the first eleven" }, "source": { "type": "string", "description": "the handler whose payload an app card draws (data-dr-source), or the SPEC key a dashboard card draws" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the card's numbers read" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "props": { "type": "object", "additionalProperties": false, "properties": { "variant": { "enum": ["smart"], "description": "a kpi card's variant: smart is the platform's smart KPI, one comparison pill (compare) in the platform's status colours; app pages, dr-app-widgets 1.2.0 on" }, "compare": { "enum": ["BvA", "AvF", "vs_prev_period"], "description": "a smart kpi's comparison: BvA / AvF read the kpi source's compare (budget / forecast), vs_prev_period its delta; default BvA when the source compares, else vs_prev_period" }, "color_rule": { "enum": ["higher_is_better", "lower_is_better"], "description": "which way is good for a smart kpi's delta and a gauge's goal: lower_is_better for a cost; default higher_is_better" }, "goal": { "type": "number", "description": "a gauge's goal, in the figure's units; absent, the kpi source's compare value" }, "total": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall's closing bar: {label}, default Total" }, "variance": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall-breakdown's unexplained bar: {label}, default Variance" }, "forecast_from": { "type": "string", "description": "a line-forecast over ONE series: the period on the x axis the forecast starts at" }, "dual_axis": { "type": "boolean", "description": "a combo: false keeps the line on the columns' axis; default true (a second axis)" } }, "description": "data-dr-props: an APP card's typed props (dr-app-widgets 1.2.0 on), sorted JSON on the page, read back by the extractor: a smart kpi's variant, compare and color_rule; a gauge's goal and color_rule; a waterfall's total and variance; a line-forecast's forecast_from; a combo's dual_axis" }, "title": { "type": "string", "description": "a dashboard card's title" }, "subtitle": { "type": "string", "description": "the line under a dashboard card's title" }, "description": { "type": "string", "description": "what a dashboard card shows, in words" }, "params": { "type": "array", "description": "the params a dashboard card honours" } } }, "control": { "type": "object", "properties": { "param": { "type": "string", "description": "the param it moves" }, "control_kind": { "type": "string", "description": "the control's kind" }, "type": { "type": "string", "description": "the input type" }, "min": { "type": "string", "description": "the lowest value" }, "max": { "type": "string", "description": "the highest value" }, "step": { "type": "string", "description": "the step" }, "value": { "type": "string", "description": "the starting value" }, "label": { "type": "string", "description": "the label" } } }, "nav": { "type": "object", "properties": { "aria_label": { "type": "string", "description": "the nav's accessible name" } } }, "tab": { "type": "object", "properties": { "current": { "type": "boolean", "description": "true on the page it names" }, "href": { "type": "string", "description": "the page it links to" }, "label": { "type": "string", "description": "the text it shows" } } }, "slot": { "type": "object", "properties": {} }, "form": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the form writes" }, "action": { "type": "string", "description": "data-dr-action: the handler that saves it" } } }, "list": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table listed" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers the rows" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "detail": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the row is from" }, "action": { "type": "string", "description": "data-dr-action: the handler it acts through" } } }, "queue": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table queued" }, "source": { "type": "string", "description": "data-dr-source: the inbox handler" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "action": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "action": { "type": "string", "description": "data-dr-action: the handler it runs" }, "param": { "type": "string", "description": "data-dr-param: the argument it passes" }, "entity": { "type": "string", "description": "data-dr-entity: the table the handler acts on" }, "when": { "type": "object", "description": 'data-dr-when: the states a ROW ACTION is drawn in, one JSON object of column to the values the row may hold ({"status": ["open", "in_progress"]}), every column matched; a row without the column keeps the action. It hides a button and refuses nothing: the handler still has to (dr-app-runtime 1.7.1 on an action in a list or a queue; dr-components 1.2.0 on a data_grid row action)' } } }, "filter": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "field": { "type": "string", "description": "data-dr-field: the column filtered" }, "entity": { "type": "string", "description": "data-dr-entity: the table filtered" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "stat": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the summary handler" }, "measure": { "type": "string", "description": "data-dr-measure: the key of the number shown" }, "tone": { "type": "string", "description": "data-dr-tone: default | positive | warning | negative" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the figure reads: a word or a platform format string" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "chart": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows it draws" }, "kind": { "enum": ["line", "bar", "area"], "description": "data-dr-kind: what it draws" }, "x": { "type": "string", "description": "data-dr-x: the column on the category axis" }, "y": { "type": "string", "description": "data-dr-y: the one numeric column drawn" }, "series": { "type": "string", "description": "data-dr-series: the column whose distinct values are one line each" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how a number reads; percent is a value already in percent units" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "custom": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose answer the module receives" }, "module": { "type": "string", "pattern": "^components/[a-z][a-z0-9_-]*\\.js$", "description": "data-dr-module: the file that draws it" }, "args": { "type": "object", "description": "data-dr-args: one JSON object handed to the module as ui.args; absent means {}" }, "declares": { "type": "object", "description": "data-dr-declares: what the module does, stated for graders and app-space test \u2014 nothing draws from it and the runtime never reads it. Every key is optional; a name it lists must be one the contract declares (custom_declares)", "additionalProperties": false, "properties": { "reads": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the data.sources entries and handlers whose answers it draws" }, "calls": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the handlers it calls through ui.call; app-space test reports a call to any other (custom-undeclared-call)" }, "produces": { "type": "object", "description": `per called handler, the payload keys it sends \u2014 {"project": ["growth", "hires"]}; for a handler it does not list, app-space test reads the keys off the module's ui.call object literal`, "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "shows": { "type": "array", "description": "the numbers it displays; the module projects each one on the element that shows it (data-dr-field, data-dr-value, data-dr-format), which app-space test harvests into the element's values", "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the field the number is, as its data-dr-field names it" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how it reads, as its data-dr-format says" }, "scale": { "enum": ["fraction"], "description": "fraction: the value is a share (0.04) shown as a percent (4%)" } } } } } } } }, "field": { "type": "object", "properties": { "entity": { "type": "string", "description": "data-dr-entity: the table the column is in" }, "field": { "type": "string", "description": "data-dr-field: the column" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers its choices" }, "label": { "type": "string", "description": "the field's label" }, "required": { "type": "boolean", "description": "true when the form cannot be saved without it" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "slider": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this slider writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this slider reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "min": { "type": "number", "description": "the track's low end, in stored units; default the page param's min (param mode), else 0" }, "max": { "type": "number", "description": "the track's high end, in stored units; default the page param's max (param mode). Required one way or the other: a slider with neither draws its 'slider needs a max' panel (1.0.1) and the compiler refuses it (part_bounds)" }, "step": { "type": "number", "description": "the increment the value moves by, in stored units; every value set is a multiple of it from min; default the page param's step, else 1" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value beside the track reads; default number" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value beside the track shows a figure below zero: the platform's negative-number mode: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components-controls 1.1.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "show_value": { "type": "boolean", "description": "whether the formatted value is drawn beside the track; default true" }, "marks": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "number", "description": "where the mark sits, in stored units" }, "label": { "type": "string", "description": "what the mark says; default the value, formatted" } } }, "description": "labelled ticks under the track" }, "value": { "type": "number", "description": "field mode: the value it starts on; default min. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the slider's label; default the page param's label (param mode), else the element's label" } }, "description": "data-dr-props: the slider part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } } });
|
|
20065
|
-
var LIBRARY_TYPES2 = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info"]);
|
|
20066
|
-
var LIBRARY_PROPS_SCHEMAS2 = Object.freeze({ "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } } });
|
|
20226
|
+
var STRICT_TYPES3 = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "slider", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
20227
|
+
var PROPS_SCHEMAS3 = Object.freeze({ "region": { "type": "object", "properties": {} }, "grid": { "type": "object", "properties": {} }, "widget": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the card's title on an app page" }, "role": { "type": "string", "description": "data-dr-role: the app role this card is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "kind": { "enum": ["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative", "waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"], "description": "data-dr-kind on an app page, the widget kind on a dashboard. The last eight (the finance kinds: waterfall ... gauge) are app pages only, from dr-app-widgets 1.2.0; a dashboard card takes one of the first eleven" }, "source": { "type": "string", "description": "the handler whose payload an app card draws (data-dr-source), or the SPEC key a dashboard card draws" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the card's numbers read" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "props": { "type": "object", "additionalProperties": false, "properties": { "variant": { "enum": ["smart"], "description": "a kpi card's variant: smart is the platform's smart KPI, one comparison pill (compare) in the platform's status colours; app pages, dr-app-widgets 1.2.0 on" }, "compare": { "enum": ["BvA", "AvF", "vs_prev_period"], "description": "a smart kpi's comparison: BvA / AvF read the kpi source's compare (budget / forecast), vs_prev_period its delta; default BvA when the source compares, else vs_prev_period" }, "color_rule": { "enum": ["higher_is_better", "lower_is_better"], "description": "which way is good for a smart kpi's delta and a gauge's goal: lower_is_better for a cost; default higher_is_better" }, "goal": { "type": "number", "description": "a gauge's goal, in the figure's units; absent, the kpi source's compare value" }, "total": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall's closing bar: {label}, default Total" }, "variance": { "type": "object", "properties": { "label": { "type": "string" } }, "description": "a waterfall-breakdown's unexplained bar: {label}, default Variance" }, "forecast_from": { "type": "string", "description": "a line-forecast over ONE series: the period on the x axis the forecast starts at" }, "dual_axis": { "type": "boolean", "description": "a combo: false keeps the line on the columns' axis; default true (a second axis)" } }, "description": "data-dr-props: an APP card's typed props (dr-app-widgets 1.2.0 on), sorted JSON on the page, read back by the extractor: a smart kpi's variant, compare and color_rule; a gauge's goal and color_rule; a waterfall's total and variance; a line-forecast's forecast_from; a combo's dual_axis" }, "title": { "type": "string", "description": "a dashboard card's title" }, "subtitle": { "type": "string", "description": "the line under a dashboard card's title" }, "description": { "type": "string", "description": "what a dashboard card shows, in words" }, "params": { "type": "array", "description": "the params a dashboard card honours" } } }, "control": { "type": "object", "properties": { "param": { "type": "string", "description": "the param it moves" }, "control_kind": { "type": "string", "description": "the control's kind" }, "type": { "type": "string", "description": "the input type" }, "min": { "type": "string", "description": "the lowest value" }, "max": { "type": "string", "description": "the highest value" }, "step": { "type": "string", "description": "the step" }, "value": { "type": "string", "description": "the starting value" }, "label": { "type": "string", "description": "the label" } } }, "nav": { "type": "object", "properties": { "aria_label": { "type": "string", "description": "the nav's accessible name" } } }, "tab": { "type": "object", "properties": { "current": { "type": "boolean", "description": "true on the page it names" }, "href": { "type": "string", "description": "the page it links to" }, "label": { "type": "string", "description": "the text it shows" } } }, "slot": { "type": "object", "properties": {} }, "form": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the form writes" }, "action": { "type": "string", "description": "data-dr-action: the handler that saves it" } } }, "list": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table listed" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers the rows" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "detail": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table the row is from" }, "action": { "type": "string", "description": "data-dr-action: the handler it acts through" } } }, "queue": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "entity": { "type": "string", "description": "data-dr-entity: the table queued" }, "source": { "type": "string", "description": "data-dr-source: the inbox handler" }, "filter": { "description": "data-dr-filter, parsed from `col=value` into an object" } } }, "action": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "action": { "type": "string", "description": "data-dr-action: the handler it runs" }, "param": { "type": "string", "description": "data-dr-param: the argument it passes" }, "entity": { "type": "string", "description": "data-dr-entity: the table the handler acts on" }, "when": { "type": "object", "description": 'data-dr-when: the states a ROW ACTION is drawn in, one JSON object of column to the values the row may hold ({"status": ["open", "in_progress"]}), every column matched; a row without the column keeps the action. It hides a button and refuses nothing: the handler still has to (dr-app-runtime 1.7.1 on an action in a list or a queue; dr-components 1.2.0 on a data_grid row action)' } } }, "filter": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "field": { "type": "string", "description": "data-dr-field: the column filtered" }, "entity": { "type": "string", "description": "data-dr-entity: the table filtered" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "stat": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the summary handler" }, "measure": { "type": "string", "description": "data-dr-measure: the key of the number shown" }, "tone": { "type": "string", "description": "data-dr-tone: default | positive | warning | negative" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how the figure reads: a word or a platform format string" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "chart": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows it draws" }, "kind": { "enum": ["line", "bar", "area"], "description": "data-dr-kind: what it draws" }, "x": { "type": "string", "description": "data-dr-x: the column on the category axis" }, "y": { "type": "string", "description": "data-dr-y: the one numeric column drawn" }, "series": { "type": "string", "description": "data-dr-series: the column whose distinct values are one line each" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "data-dr-format: how a number reads; percent is a value already in percent units" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "data-dr-negative: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" } } }, "custom": { "type": "object", "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose answer the module receives" }, "module": { "type": "string", "pattern": "^components/[a-z][a-z0-9_-]*\\.js$", "description": "data-dr-module: the file that draws it" }, "args": { "type": "object", "description": "data-dr-args: one JSON object handed to the module as ui.args; absent means {}" }, "declares": { "type": "object", "description": "data-dr-declares: what the module does, stated for graders and app-space test \u2014 nothing draws from it and the runtime never reads it. Every key is optional; a name it lists must be one the contract declares (custom_declares)", "additionalProperties": false, "properties": { "reads": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the data.sources entries and handlers whose answers it draws" }, "calls": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "the handlers it calls through ui.call; app-space test reports a call to any other (custom-undeclared-call)" }, "produces": { "type": "object", "description": `per called handler, the payload keys it sends \u2014 {"project": ["growth", "hires"]}; for a handler it does not list, app-space test reads the keys off the module's ui.call object literal`, "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "shows": { "type": "array", "description": "the numbers it displays; the module projects each one on the element that shows it (data-dr-field, data-dr-value, data-dr-format), which app-space test harvests into the element's values", "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the field the number is, as its data-dr-field names it" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how it reads, as its data-dr-format says" }, "scale": { "enum": ["fraction"], "description": "fraction: the value is a share (0.04) shown as a percent (4%)" } } } } } } } }, "field": { "type": "object", "properties": { "entity": { "type": "string", "description": "data-dr-entity: the table the column is in" }, "field": { "type": "string", "description": "data-dr-field: the column" }, "source": { "type": "string", "description": "data-dr-source: the handler that answers its choices" }, "label": { "type": "string", "description": "the field's label" }, "required": { "type": "boolean", "description": "true when the form cannot be saved without it" }, "input_type": { "type": "string", "description": "the input's type" }, "options": { "type": "array", "description": "the choices offered" } } }, "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group"); dr-components 1.3.0' } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "values": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "field mode with multiple: the options chosen first; default none (dr-components 1.3.0)" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" }, "multiple": { "type": "boolean", "description": "many values: field mode writes them as one list (a dialog posts the list), param mode moves a multi param; default false, one value (dr-components 1.3.0)" }, "searchable": { "type": "boolean", "description": "a search box over the list, filtering by label; default false (dr-components 1.3.0)" }, "group_by": { "type": "string", "minLength": 1, "description": "the key the list is grouped under: a source row's column, or group on a stated option; default none (dr-components 1.3.0)" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" }, "cell": { "enum": ["badge", "status", "chip", "link", "toggle"], "description": "how the value draws instead of text (dr-components 1.3.0, the dr-grid cell renderers): badge (a dr-badge, its colour from badge_map), status (a dr-status, its type from status_map), chip (the value, or each value of a list, as a chip), link (the value as a link: to link_field's URL, else opening the row through on_row), toggle (a switch over a boolean; call flips it, without it the switch is read-only)" }, "badge_map": { "type": "object", "additionalProperties": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "a dr-badge colour" }, "description": "cell badge: value \u2192 dr-badge colour; an unmapped value is stone (dr-components 1.3.0)" }, "status_map": { "type": "object", "additionalProperties": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "a dr-status type" }, "description": "cell status: value \u2192 dr-status type; an unmapped value is default (dr-components 1.3.0)" }, "link_field": { "type": "string", "minLength": 1, "description": "cell link: the row column holding the link's URL (same-origin path, #hash, or http(s)); default none: the link opens the row (on_row) (dr-components 1.3.0)" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "cell toggle: a handler called with {id, row, field, value} when the reader flips the switch; the page re-reads after. Without it the switch is read-only (dr-components 1.3.0)" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "theme": { "enum": ["default", "borderless", "editable", "inside-card"], "description": "the dr-grid theme (dr-components 1.3.0): default (rows and header 56px), borderless (40px, no row lines), editable (40px, a focus ring on the cell), inside-card (rows 56px, a 32px header, for a grid inside a card); default default" }, "hierarchy": { "type": "object", "additionalProperties": false, "required": ["parent", "label"], "properties": { "parent": { "type": "string", "minLength": 1, "description": "the column holding each row's parent row key (the key column's value); empty for a top row" }, "label": { "type": "string", "minLength": 1, "description": "the column drawn as the tree: indented by depth, with expand / collapse on a parent" }, "expanded": { "type": "boolean", "description": "whether parents start open; default true" } }, "description": "tree rows (dr-components 1.3.0): a P&L's accounts under their parents, each parent's number columns the sum of its children's unless the source answers the parent's own; sorting orders siblings" }, "totals": { "enum": ["top", "bottom", "none"], "description": "a totals row, summing the top rows' number columns (currency, number, a platform format string; a percent is left blank), pinned above or below the rows (dr-components 1.3.0); default none" }, "pin": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "the leading columns (fields) that stay in view while the grid scrolls sideways, in column order (dr-components 1.3.0)" }, "csv_params": { "type": "object", "additionalProperties": false, "properties": { "file_name": { "type": "string", "minLength": 1, "description": "the downloaded file's name; default the element id, .csv" } }, "description": "draws an Export CSV button (dr-grid-toolbar csvParams, dr-components 1.3.0): every row in the grid's order, parents and totals included, numbers raw, headers as shown" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "slider": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this slider writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this slider reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "min": { "type": "number", "description": "the track's low end, in stored units; default the page param's min (param mode), else 0" }, "max": { "type": "number", "description": "the track's high end, in stored units; default the page param's max (param mode). Required one way or the other: a slider with neither draws its 'slider needs a max' panel (1.0.1) and the compiler refuses it (part_bounds)" }, "step": { "type": "number", "description": "the increment the value moves by, in stored units; every value set is a multiple of it from min; default the page param's step, else 1" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value beside the track reads; default number" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value beside the track shows a figure below zero: the platform's negative-number mode: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components-controls 1.1.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "show_value": { "type": "boolean", "description": "whether the formatted value is drawn beside the track; default true" }, "marks": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "number", "description": "where the mark sits, in stored units" }, "label": { "type": "string", "description": "what the mark says; default the value, formatted" } } }, "description": "labelled ticks under the track" }, "value": { "type": "number", "description": "field mode: the value it starts on; default min. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the slider's label; default the page param's label (param mode), else the element's label" } }, "description": "data-dr-props: the slider part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } }, "filter_bar": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["filters"], "properties": { "filters": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "mandatory": { "type": "boolean", "description": "always shown, never under More, no remove (\xD7); default false. A filter is also shown when it starts active" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } } }, "description": "the filters, in order: each a chip over a page param" }, "filters_label": { "type": "string", "description": "words before the chips (Filters:); default none" }, "more_label": { "type": "string", "description": "the button that adds an optional filter that is not shown; default More" }, "add_filters_title": { "type": "string", "description": "the title of More's list; default Add Filters" }, "clear_tooltip": { "type": "string", "description": "the clear-all button's name; default Clear filters" }, "clearable": { "type": "boolean", "description": "draws the clear-all button while any filter narrows; default true" } }, "description": "data-dr-props: the filter_bar part's typed props, handed to it as PartProps.props" } } }, "filter_chip": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "removable": { "type": "boolean", "description": "draws a remove (\xD7) that clears the filter; default false" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } }, "description": "data-dr-props: the filter_chip part's typed props, handed to it as PartProps.props" } } }, "date_range": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the From date is written under (a hidden input of that name), with field_to; exactly one of field and param" }, "field_to": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the To date is written under; required with field" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param the From date moves (a period or month param), with param_to; exactly one of field and param" }, "param_to": { "type": "string", "minLength": 1, "description": "param mode: the page param the To date moves, the same kind as param; required with param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over month params is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the From date it starts on; default none" }, "value_to": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the To date it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the From param's label (param mode), else the element's label" }, "label_from": { "type": "string", "description": "the From picker's label; default From" }, "label_to": { "type": "string", "description": "the To picker's label; default To" }, "placeholder_from": { "type": "string", "description": "what From says before a pick; default Select\u2026" }, "placeholder_to": { "type": "string", "description": "what To says before a pick; default Select\u2026" }, "column": { "type": "boolean", "description": "From above To instead of side by side; default false" } }, "description": "data-dr-props: the date_range part's typed props, handed to it as PartProps.props" } } }, "fiscal_month": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes, the calendar month as YYYY-MM; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (a month or period param) it moves with the calendar month as YYYY-MM; exactly one of field and param" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "how many months after January the fiscal year starts (3: April, so April is the fiscal year's first month); default 0, a calendar year" }, "fiscal_year_back": { "type": "boolean", "description": "the fiscal year is named by the calendar year it starts in; default false: by the year it ends in (an April 2026 start is FY2027)" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}$", "description": "field mode: the calendar month it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Select\u2026" } }, "description": "data-dr-props: the fiscal_month part's typed props, handed to it as PartProps.props" } } } });
|
|
20228
|
+
var LIBRARY_TYPES2 = Object.freeze(["number_input", "tabs", "tab_panel", "select", "date_picker", "data_grid", "dialog", "variance_table", "toggle", "control_group", "callout", "scenario_columns", "button", "status", "badge", "tag", "empty_state", "stepper", "alert", "checkbox", "radio_group", "file_upload", "skeleton", "progress", "accordion", "tooltip_info", "filter_bar", "filter_chip", "date_range", "fiscal_month"]);
|
|
20229
|
+
var LIBRARY_PROPS_SCHEMAS2 = Object.freeze({ "number_input": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["format"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this input writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this input reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "what the number is: the unit shown beside the input" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the reading beside the input shows a figure below zero: the platform's negative-number mode (NegativeNumbersFormat): minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus (dr-components 1.2.0)" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "min": { "type": "number", "description": "the lowest number a reader may type, in the units they type it in; param mode: default the page param's min" }, "max": { "type": "number", "description": "the highest number a reader may type, in the units they type it in; param mode: default the page param's max" }, "step": { "type": "number", "description": "the increment the arrow keys move by, in the units typed; default 1 (param mode: the page param's step). In param mode a typed value is rounded to it before it is set" }, "decimals": { "type": "integer", "minimum": 0, "description": "the decimals the STORED value is rounded to, after scaling; default as typed" }, "value": { "type": "number", "description": "field mode: the stored value the input starts from (0.04, not 4, under fraction); default empty. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the input's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "the hint shown while the input is empty" } }, "description": "data-dr-props: the number_input part's typed props, handed to it as PartProps.props" } } }, "tabs": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tabs"], "properties": { "tabs": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the tab's id, which a tab_panel's tab names" }, "label": { "type": "string", "minLength": 1, "description": "the text on the tab" } } }, "description": "the tabs, in order" }, "default": { "type": "string", "description": "the id of the tab open first; default the first tab" } }, "description": "data-dr-props: the tabs part's typed props, handed to it as PartProps.props" } } }, "tab_panel": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["tab"], "properties": { "tab": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "the id of the tab (in the enclosing tabs) this panel belongs to" } }, "description": "data-dr-props: the tab_panel part's typed props, handed to it as PartProps.props" } } }, "select": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: optional; the handler whose rows are the options when props.options is absent" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this select writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this select reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group"); dr-components 1.3.0' } } }, "description": "the options; when absent they are the page param's values (param mode), else the source rows" }, "option_value": { "type": "string", "description": "with a source: the row column that is stored; default id" }, "option_label": { "type": "string", "description": "with a source: the row column the reader sees; default the value column" }, "value": { "type": "string", "description": "field mode: the option chosen first; default none. Param mode reads ctx.params instead" }, "values": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "field mode with multiple: the options chosen first; default none (dr-components 1.3.0)" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a choice; default Choose\u2026" }, "multiple": { "type": "boolean", "description": "many values: field mode writes them as one list (a dialog posts the list), param mode moves a multi param; default false, one value (dr-components 1.3.0)" }, "searchable": { "type": "boolean", "description": "a search box over the list, filtering by label; default false (dr-components 1.3.0)" }, "group_by": { "type": "string", "minLength": 1, "description": "the key the list is grouped under: a source row's column, or group on a stated option; default none (dr-components 1.3.0)" } }, "description": "data-dr-props: the select part's typed props, handed to it as PartProps.props" } } }, "date_picker": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this picker reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over a month param is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the date or month the picker starts on; default none. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Pick a date / Pick a month" } }, "description": "data-dr-props: the date_picker part's typed props, handed to it as PartProps.props" } } }, "data_grid": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows the grid shows" }, "props": { "type": "object", "additionalProperties": false, "required": ["columns"], "properties": { "columns": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row key the column shows" }, "label": { "type": "string", "description": "the header; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent", "text", "date"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads; default text" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "align": { "enum": ["start", "end"], "description": "default end for currency, number and percent, start otherwise" }, "sortable": { "type": "boolean", "description": "whether the header sorts; default true" }, "cell": { "enum": ["badge", "status", "chip", "link", "toggle"], "description": "how the value draws instead of text (dr-components 1.3.0, the dr-grid cell renderers): badge (a dr-badge, its colour from badge_map), status (a dr-status, its type from status_map), chip (the value, or each value of a list, as a chip), link (the value as a link: to link_field's URL, else opening the row through on_row), toggle (a switch over a boolean; call flips it, without it the switch is read-only)" }, "badge_map": { "type": "object", "additionalProperties": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "a dr-badge colour" }, "description": "cell badge: value \u2192 dr-badge colour; an unmapped value is stone (dr-components 1.3.0)" }, "status_map": { "type": "object", "additionalProperties": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "a dr-status type" }, "description": "cell status: value \u2192 dr-status type; an unmapped value is default (dr-components 1.3.0)" }, "link_field": { "type": "string", "minLength": 1, "description": "cell link: the row column holding the link's URL (same-origin path, #hash, or http(s)); default none: the link opens the row (on_row) (dr-components 1.3.0)" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "cell toggle: a handler called with {id, row, field, value} when the reader flips the switch; the page re-reads after. Without it the switch is read-only (dr-components 1.3.0)" } } }, "description": "the columns, in order" }, "key": { "type": "string", "description": "the column whose value is each row's data-dr-row, and the id a row action posts; default id. A row without it projects its position as data-dr-row and draws no row actions (1.1.1); with row_actions the compiler requires it stated and a column the source's rows carry, and, where a row action writes through a remove, save or decide handler, that table's primary key (part_row_key)" }, "theme": { "enum": ["default", "borderless", "editable", "inside-card"], "description": "the dr-grid theme (dr-components 1.3.0): default (rows and header 56px), borderless (40px, no row lines), editable (40px, a focus ring on the cell), inside-card (rows 56px, a 32px header, for a grid inside a card); default default" }, "hierarchy": { "type": "object", "additionalProperties": false, "required": ["parent", "label"], "properties": { "parent": { "type": "string", "minLength": 1, "description": "the column holding each row's parent row key (the key column's value); empty for a top row" }, "label": { "type": "string", "minLength": 1, "description": "the column drawn as the tree: indented by depth, with expand / collapse on a parent" }, "expanded": { "type": "boolean", "description": "whether parents start open; default true" } }, "description": "tree rows (dr-components 1.3.0): a P&L's accounts under their parents, each parent's number columns the sum of its children's unless the source answers the parent's own; sorting orders siblings" }, "totals": { "enum": ["top", "bottom", "none"], "description": "a totals row, summing the top rows' number columns (currency, number, a platform format string; a percent is left blank), pinned above or below the rows (dr-components 1.3.0); default none" }, "pin": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "the leading columns (fields) that stay in view while the grid scrolls sideways, in column order (dr-components 1.3.0)" }, "csv_params": { "type": "object", "additionalProperties": false, "properties": { "file_name": { "type": "string", "minLength": 1, "description": "the downloaded file's name; default the element id, .csv" } }, "description": "draws an Export CSV button (dr-grid-toolbar csvParams, dr-components 1.3.0): every row in the grid's order, parents and totals included, numbers raw, headers as shown" }, "page_size": { "type": "integer", "minimum": 5, "description": "rows per page; default 10" }, "sort": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the column sorted first" }, "dir": { "enum": ["asc", "desc"], "description": "default asc" } }, "description": "the order the rows start in; default the order the handler answered" }, "on_row": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {row} when a reader opens a row; the page re-reads after it" }, "row_actions": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["label", "dialog"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "dialog": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$", "description": "the id of a dialog on this page whose values_from is row: it opens over the row, its inputs prefilled, and posts id with its fields" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }, { "type": "object", "additionalProperties": false, "required": ["label", "call"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the text on the row's button" }, "call": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "a handler called with {id, row} (id: the row's key column); the page re-reads after it" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked before the call runs (Confirm / Cancel); default none" }, "role": { "type": "string", "minLength": 1, "description": "the one app role that sees this action; absent means every role (the handler's own requiresRole is the control)" }, "when": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "description": "the states this action is drawn in: {column: [values]}, every column matched; a row without the column keeps it (dr-components 1.2.0, the rule an action in a list follows). Hides the button only: the handler still refuses" } } }] }, "description": "a button per row for each action, after the columns: open a dialog over the row, or call a handler with it" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the data_grid part's typed props, handed to it as PartProps.props" } } }, "dialog": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "trigger": { "type": "string", "minLength": 1, "description": "the text on the button that opens it; default the element's label, else its title \u2014 the compiler writes it into the page (foldDialogTriggers). A dialog with none of the three and no values_from row is refused (part_mode); a row dialog (values_from row) takes none, a row action opens it" }, "title": { "type": "string", "description": "the dialog's title; default the element's label" }, "description": { "type": "string", "description": "one line under the title" }, "confirm": { "type": "string", "description": "the text on the confirm button; default Confirm" }, "on_confirm": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler Confirm calls with the fields of the inputs inside; without one, Confirm only closes" }, "values_from": { "enum": ["row"], "description": "row: a data_grid row action opens it over one row \u2014 the inputs inside start from that row's values, and Confirm posts id (the row's key) with their fields, to a save handler" }, "key": { "type": "string", "minLength": 1, "description": "with values_from row: the row column posted as id; default the grid's key, else id" } }, "description": "data-dr-props: the dialog part's typed props, handed to it as PartProps.props" } } }, "variance_table": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler whose rows are the lines" }, "props": { "type": "object", "additionalProperties": false, "required": ["row", "actual", "plan"], "properties": { "row": { "type": "string", "minLength": 1, "description": "the column naming each line; its value is the line's data-dr-row" }, "actual": { "type": "string", "minLength": 1, "description": "the column holding the actual figure" }, "plan": { "type": "string", "minLength": 1, "description": "the column holding the plan (budget) figure" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how actual, plan and variance read; default currency" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how actual, plan and variance read below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good: higher (the default) for revenue, lower for cost" }, "threshold": { "type": "object", "additionalProperties": false, "required": [], "properties": { "abs": { "type": "number", "minimum": 0, "description": "a variance smaller than this, in the figures' units, is neutral" }, "pct": { "type": "number", "minimum": 0, "description": "a variance share smaller than this fraction (0.05 is 5%) is neutral" } }, "description": "below both limits a variance is neutral rather than toned; default none" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the variance_table part's typed props, handed to it as PartProps.props" } } }, "toggle": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this switch writes \u2014 a hidden input of that name carries the raw value, and the form or dialog it sits in posts it; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (pages[].params[].name) this switch reads from ctx.params and moves with ctx.setParam \u2014 it writes no hidden input, and the page's readers re-read when it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts on; default off. Param mode reads ctx.params instead" }, "label": { "type": "string", "description": "the switch's label; default the page param's label (param mode), else the element's label" }, "description": { "type": "string", "description": "one line under the label" } }, "description": "data-dr-props: the toggle part's typed props, handed to it as PartProps.props" } } }, "control_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "columns": { "enum": [1, 2, 3, 4], "description": "how many controls sit side by side; default 1 (under 640px always 1)" }, "label_position": { "enum": ["top", "start"], "description": "top (the default): each label above its control; start: every label in one column before its control" }, "description": { "type": "string", "description": "one line above the controls" } }, "description": "data-dr-props: the control_group part's typed props, handed to it as PartProps.props" } } }, "callout": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer the rules read \u2014 a summary's measures, a KPI, or rows" }, "props": { "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["when", "tone", "text"], "properties": { "when": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["path", "gte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "gte": { "type": "number", "description": "matches when the value is at least this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "lte"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "lte": { "type": "number", "description": "matches when the value is at most this" } } }, { "type": "object", "additionalProperties": false, "required": ["path", "eq"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer: current_arr, kpi.value, rows.0.arr" }, "eq": { "type": ["string", "number", "boolean"], "description": "matches when the value is exactly this" } } }], "description": "the condition: one path and one of gte, lte, eq" }, "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } } }, "description": "tried in order; the first whose when holds is the sentence" }, "default": { "type": "object", "additionalProperties": false, "required": ["tone", "text"], "properties": { "tone": { "enum": ["positive", "neutral", "warning", "negative"], "description": "the callout's tone" }, "text": { "type": "string", "minLength": 1, "description": "the sentence, a template: {path} is the value as text, {path|currency}, {path|number} and {path|percent} a graded number (data-dr-field, data-dr-value, data-dr-format)" } }, "description": "what it says when no rule holds; default nothing" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" } }, "description": "data-dr-props: the callout part's typed props, handed to it as PartProps.props" } } }, "scenario_columns": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose rows are the scenarios" }, "props": { "type": "object", "additionalProperties": false, "required": ["key", "label_field", "metrics"], "properties": { "key": { "type": "string", "minLength": 1, "description": "the column naming each row uniquely; its value is the column's data-dr-row" }, "label_field": { "type": "string", "minLength": 1, "description": "the column whose value heads each scenario's column" }, "metrics": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "minLength": 1, "description": "the row column the line shows" }, "label": { "type": "string", "description": "the line's name; default the field, humanised" }, "format": { "anyOf": [{ "enum": ["currency", "number", "percent"] }, { "type": "string", "maxLength": 64, "pattern": "^(General|[^\\u0000-\\u001f]*[#0][^\\u0000-\\u001f]*)$", "description": "a platform values_format string, as a Datarails dashboard writes it: #,### $#,###.## #,###.#[kilo]k #,###;[Red](#,###); drawn by dr-fmt 2" }], "description": "how the value reads" }, "negative": { "enum": ["minus", "red_minus", "absolute", "red_absolute"], "description": "how the value reads below zero: the platform's negative-number mode (NegativeNumbersFormat), applied below zero only: minus -1,234 | red_minus in red | absolute (1,234) | red_absolute (1,234) in red; default minus" }, "scale": { "enum": ["units", "fraction"], "description": "percent only: units (the default) means 4 is 4%; fraction means 0.04 is 4%" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "currency only: the ISO code; default USD" }, "favorable": { "enum": ["higher", "lower"], "description": "which way is good for the delta's tone: higher (the default) or lower" } } }, "description": "the lines, in order" }, "max": { "type": "integer", "minimum": 1, "description": "how many rows may be ticked at once; default 3 (at most 6)" }, "baseline": { "type": "string", "minLength": 1, "description": "the key value of the row every delta is against; default the first row" }, "empty_text": { "type": "string", "description": "what the empty state says; default the registry's sentence, Nothing to show." } }, "description": "data-dr-props: the scenario_columns part's typed props, handed to it as PartProps.props" } } }, "button": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the words on the button" }, "theme": { "enum": ["primary", "secondary", "ghost", "danger", "positive", "negative", "link"], "description": "the dr-button theme; default primary. danger and negative always ask before the call" }, "size": { "enum": ["regular", "small"], "description": "regular (32px, the platform pill) or small (28px); default regular" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph before the label" }, "icon_after": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph after the label" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler a click calls with {} (and reason, when asked); the page re-reads after it. Without one the button draws disabled" }, "confirm": { "type": "string", "minLength": 1, "description": 'the question asked first (Confirm / Cancel); default none, and "<label>?" on a danger or negative button, which always asks' }, "reason": { "enum": ["required", "optional"], "description": "a reason box in the confirm dialog, posted as reason; required keeps Confirm disabled until it holds text" }, "split": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["label", "on_click"], "properties": { "label": { "type": "string", "minLength": 1, "description": "the menu entry" }, "on_click": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler it calls with {}" }, "confirm": { "type": "string", "minLength": 1, "description": "the question asked first" } } }, "description": "more calls behind the button's arrow (dr-split-button)" }, "disabled": { "type": "boolean", "description": "drawn disabled; default false" } }, "description": "data-dr-props: the button part's typed props, handed to it as PartProps.props" } } }, "status": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the dr-status type (its colour); default default. A map entry that matches wins" }, "label": { "type": "string", "description": "the words; default the value at path" }, "icon": { "type": "string", "pattern": "^dr-icon-[a-z0-9-]+$", "description": "a dr-icon-* glyph in place of the dot" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "type"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "type": { "enum": ["info", "progress", "error", "warning", "success", "default"], "description": "the type it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 type and words, tried in order" } }, "description": "data-dr-props: the status part's typed props, handed to it as PartProps.props" } } }, "badge": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "the words; default the value at path" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the dr-badge colour; default stone" }, "size": { "enum": ["medium", "small"], "description": "default medium" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "map": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value", "color"], "properties": { "value": { "type": ["string", "number", "boolean"], "description": "the value at path this entry matches" }, "color": { "enum": ["stone", "water", "baby-blue", "baby-pink", "light-purple", "purple", "light-turquoise", "bright-green", "peach", "soft-coral", "pale-yellow", "pastel-olive", "powder-blue-grey", "muted-plum"], "description": "the colour it draws" }, "label": { "type": "string", "description": "the words it says; default the value" } } }, "description": "value \u2192 colour and words, tried in order" } }, "description": "data-dr-props: the badge part's typed props, handed to it as PartProps.props" } } }, "tag": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["month", "quarter", "year", "forecast"], "description": "what the value is" }, "value": { "type": ["string", "number"], "description": "the period: 2026-03, 2026-Q1, 2026, 3 (a forecast's closed months) or 3+9" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "fiscal": { "type": "boolean", "description": "year only: prefix FY; default true" } }, "description": "data-dr-props: the tag part's typed props, handed to it as PartProps.props" } } }, "empty_state": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["noData", "noPermissions", "noResults", "noNotifications", "custom"], "description": "the platform's empty-state type: its icon and default words; default custom" }, "title": { "type": "string", "description": "the title; default the type's" }, "description": { "type": "string", "description": "the line under it; default the type's" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; with on_action" }, "on_action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler the button calls with {}; the page re-reads after it" } }, "description": "data-dr-props: the empty_state part's typed props, handed to it as PartProps.props" } } }, "stepper": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "label"], "properties": { "id": { "type": "string", "minLength": 1, "description": "the value current (or the value at path) names this step by" }, "label": { "type": "string", "minLength": 1, "description": "the step's name" }, "description": { "type": "string", "description": "one line under the name" }, "action": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler that moves the flow on from this step, called with {step: <id>} when it is current; every step but the last needs one (A3.29)" }, "action_label": { "type": "string", "minLength": 1, "description": "the button's words; default Continue" } } }, "description": "the steps, in order" }, "current": { "type": "string", "minLength": 1, "description": "the id of the step the flow is at; default the value at path, else the first step" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "vertical": { "type": "boolean", "description": "steps top to bottom; default left to right" } }, "description": "data-dr-props: the stepper part's typed props, handed to it as PartProps.props" } } }, "alert": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "theme": { "enum": ["success", "error", "bold-error", "warning", "info", "tip"], "description": "the dr-alert type; default info" }, "title": { "type": "string", "description": "the bold first line" }, "text": { "type": "string", "minLength": 1, "description": "the notice" } }, "description": "data-dr-props: the alert part's typed props, handed to it as PartProps.props" } } }, "checkbox": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this box writes (true / false); exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the toggle page param it moves; exactly one of field and param" }, "value": { "type": "boolean", "description": "field mode: whether it starts ticked; default false. Param mode reads ctx.params" }, "label": { "type": "string", "description": "the words beside the box; default the page param's label, else the element's label" }, "description": { "type": "string", "description": "a line under it" } }, "description": "data-dr-props: the checkbox part's typed props, handed to it as PartProps.props" } } }, "radio_group": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this choice writes; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the select (or period / month) page param it moves; exactly one of field and param" }, "options": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees; default the value" } } }, "description": "the options, in order; param mode: default the page param's values" }, "value": { "type": "string", "description": "field mode: the option it starts on; default none" }, "label": { "type": "string", "description": "the group's label; default the page param's label, else the element's label" }, "direction": { "enum": ["vertical", "horizontal"], "description": "default vertical" } }, "description": "data-dr-props: the radio_group part's typed props, handed to it as PartProps.props" } } }, "file_upload": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["field"], "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "the payload key the stored file is written under, as {upload, filename, mime_type, size}" }, "accept": { "type": "string", "description": "the file types the picker offers, as an input accept list: .pdf,.xlsx; default any" }, "max_size_mb": { "type": "number", "minimum": 0, "description": "a larger file is refused before it is sent (client-side only: the platform's own limit still answers 413); 0 or less is no limit of its own; default the platform's own limit" }, "label": { "type": "string", "description": "the label above the zone; default the element's label" }, "dropzone_text": { "type": "string", "description": "the zone's first line; default Drop a file here, or browse" }, "dropzone_subtext": { "type": "string", "description": "the zone's second line; default the accepted types" }, "on_upload": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "the handler called with {<field>: {upload, filename, mime_type, size}} once the file is stored (the parser hand-off); the page re-reads after it. Without one the value waits for the dialog around it" } }, "description": "data-dr-props: the file_upload part's typed props, handed to it as PartProps.props" } } }, "skeleton": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "appearance": { "enum": ["rectangle", "title-line", "text-line", "chip", "avatar"], "description": "the shape; default rectangle" }, "count": { "type": "integer", "minimum": 1, "description": "how many, one under the other; default 1 (at most 12)" }, "width": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|%|rem)$", "description": "a CSS length: 100%, 240px, 12rem; default the appearance's" }, "height": { "type": "string", "pattern": "^\\d+(\\.\\d+)?(px|rem)$", "description": "a CSS length; default the appearance's" } }, "description": "data-dr-props: the skeleton part's typed props, handed to it as PartProps.props" } } }, "progress": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "source": { "type": "string", "description": "data-dr-source: the handler (or data.sources entry) whose answer `path` reads \u2014 a summary's measures, a record, or rows (rows.0.status)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "progress": { "type": "number", "minimum": 0, "description": "how much is done; default the value at path" }, "total": { "type": "number", "minimum": 0, "description": "what done means; default the value at total_path, else 100" }, "path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path into the source's answer whose value the part shows: status, kpi.state, rows.0.status" }, "total_path": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)*$", "description": "a dotted path to the total in the source's answer" }, "show_value": { "type": "boolean", "description": "the percent beside the bar; default true" }, "type": { "enum": ["light", "dark"], "description": "the dr-progress-bar type; default light" }, "label": { "type": "string", "description": "the words above the bar; default the element's label" } }, "description": "data-dr-props: the progress part's typed props, handed to it as PartProps.props" } } }, "accordion": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "description": "the section's header" }, "open": { "type": "boolean", "description": "whether it starts open; default false" } } }, "description": "the sections, in order: child i of the element fills item i" }, "multi": { "type": "boolean", "description": "several may be open at once; default false" }, "theme": { "enum": ["regular", "borderless"], "description": "the dr-accordion theme; default regular" } }, "description": "data-dr-props: the accordion part's typed props, handed to it as PartProps.props" } } }, "tooltip_info": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "text": { "type": "string", "minLength": 1, "description": "the explanation" }, "label": { "type": "string", "description": "words before the mark; default none" }, "position": { "enum": ["top", "bottom", "left", "right"], "description": "where the explanation opens; default top" } }, "description": "data-dr-props: the tooltip_info part's typed props, handed to it as PartProps.props" } } }, "filter_bar": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["filters"], "properties": { "filters": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "mandatory": { "type": "boolean", "description": "always shown, never under More, no remove (\xD7); default false. A filter is also shown when it starts active" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } } }, "description": "the filters, in order: each a chip over a page param" }, "filters_label": { "type": "string", "description": "words before the chips (Filters:); default none" }, "more_label": { "type": "string", "description": "the button that adds an optional filter that is not shown; default More" }, "add_filters_title": { "type": "string", "description": "the title of More's list; default Add Filters" }, "clear_tooltip": { "type": "string", "description": "the clear-all button's name; default Clear filters" }, "clearable": { "type": "boolean", "description": "draws the clear-all button while any filter narrows; default true" } }, "description": "data-dr-props: the filter_bar part's typed props, handed to it as PartProps.props" } } }, "filter_chip": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "required": ["kind", "param"], "properties": { "kind": { "enum": ["option", "date-range", "fiscal-month"], "description": "the dr-filter-bar kind: option (a select over the param, one value or many with multiple), date-range (From/To over param and param_to), fiscal-month (a fiscal month over the param)" }, "param": { "type": "string", "minLength": 1, "description": "the page param (pages[].params[].name) this filter reads from ctx.params and moves with ctx.setParam: a select, multi (multiple), period or month param for option; the From param (period or month) for date-range; a month or period param for fiscal-month. A filter bound to no declared param is refused" }, "param_to": { "type": "string", "minLength": 1, "description": "date-range only: the To param (period or month, the same kind as param)" }, "label": { "type": "string", "description": "the chip's label (Label: value); default the page param's label, else its name" }, "removable": { "type": "boolean", "description": "draws a remove (\xD7) that clears the filter; default false" }, "disabled": { "type": "boolean", "description": "drawn but not interactive; default false" }, "multiple": { "type": "boolean", "description": "option only: many values (a multi param), default false: one value" }, "searchable": { "type": "boolean", "description": "option only: a search box above the list; default false" }, "group_by": { "type": "string", "minLength": 1, "description": "option only: the key each option is grouped under (group, on a stated option)" }, "options": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["value", "label"], "properties": { "value": { "type": "string", "minLength": 1, "description": "what is stored" }, "label": { "type": "string", "description": "what the reader sees" }, "group": { "type": "string", "description": 'the heading the option sits under when the list is grouped (group_by: "group")' } } }, "description": "option only: the options; default the page param's declared values" }, "label_from": { "type": "string", "description": "date-range only: the From picker's label; default From" }, "label_to": { "type": "string", "description": "date-range only: the To picker's label; default To" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "fiscal-month only: how many months after January the fiscal year starts (3: April); default 0" }, "fiscal_year_back": { "type": "boolean", "description": "fiscal-month only: the fiscal year is named by the calendar year it starts in; default false: by the year it ends in" } }, "description": "data-dr-props: the filter_chip part's typed props, handed to it as PartProps.props" } } }, "date_range": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the From date is written under (a hidden input of that name), with field_to; exactly one of field and param" }, "field_to": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key the To date is written under; required with field" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param the From date moves (a period or month param), with param_to; exactly one of field and param" }, "param_to": { "type": "string", "minLength": 1, "description": "param mode: the page param the To date moves, the same kind as param; required with param" }, "mode": { "enum": ["date", "month"], "description": "date (the default) stores YYYY-MM-DD; month stores YYYY-MM. Param mode over month params is month" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the From date it starts on; default none" }, "value_to": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$", "description": "field mode: the To date it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the From param's label (param mode), else the element's label" }, "label_from": { "type": "string", "description": "the From picker's label; default From" }, "label_to": { "type": "string", "description": "the To picker's label; default To" }, "placeholder_from": { "type": "string", "description": "what From says before a pick; default Select\u2026" }, "placeholder_to": { "type": "string", "description": "what To says before a pick; default Select\u2026" }, "column": { "type": "boolean", "description": "From above To instead of side by side; default false" } }, "description": "data-dr-props: the date_range part's typed props, handed to it as PartProps.props" } } }, "fiscal_month": { "type": "object", "additionalProperties": false, "required": ["props"], "properties": { "id": { "type": "string", "description": "data-dr-id: the element's stable id, unique on its page" }, "label": { "type": "string", "description": "data-dr-label: the title a reader sees" }, "role": { "type": "string", "description": "data-dr-role: the app role this element is meant for; absent means every role" }, "span": { "type": "integer", "description": "data-dr-span: columns of the kit's twelve" }, "section": { "type": "string", "description": "the page section the element sits in (the nearest data-dr-section)" }, "props": { "type": "object", "additionalProperties": false, "properties": { "field": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$", "description": "field mode: the payload key this picker writes, the calendar month as YYYY-MM; exactly one of field and param" }, "param": { "type": "string", "minLength": 1, "description": "param mode: the page param (a month or period param) it moves with the calendar month as YYYY-MM; exactly one of field and param" }, "fiscal_year_months_modifier": { "type": "integer", "minimum": 0, "description": "how many months after January the fiscal year starts (3: April, so April is the fiscal year's first month); default 0, a calendar year" }, "fiscal_year_back": { "type": "boolean", "description": "the fiscal year is named by the calendar year it starts in; default false: by the year it ends in (an April 2026 start is FY2027)" }, "value": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}$", "description": "field mode: the calendar month it starts on; default none" }, "label": { "type": "string", "description": "the control's label; default the page param's label (param mode), else the element's label" }, "placeholder": { "type": "string", "description": "what the control says before a pick; default Select\u2026" } }, "description": "data-dr-props: the fiscal_month part's typed props, handed to it as PartProps.props" } } } });
|
|
20067
20230
|
var CONTROLS_TYPES2 = Object.freeze(["slider"]);
|
|
20068
|
-
var PARTS2 = Object.freeze({ "number_input": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "tabs": { "module": "dr-components", "reads": null, "children": ["tab_panel"], "events": {}, "empty": null }, "tab_panel": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "select": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": null }, "date_picker": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "data_grid": { "module": "dr-components", "reads": { "roles": ["list", "inbox", "custom"], "as": "rows" }, "children": "none", "events": { "on_row": ["custom", "decide"], "on_row_action": ["remove", "decide", "custom", "submit", "save"] }, "empty": "Nothing to show." }, "dialog": { "module": "dr-components", "reads": null, "children": "any", "events": { "on_confirm": ["custom", "save", "submit", "decide"] }, "empty": null }, "variance_table": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "toggle": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "control_group": { "module": "dr-components", "reads": null, "children": ["number_input", "select", "date_picker", "toggle", "slider", "checkbox", "radio_group"], "events": {}, "empty": null }, "callout": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "scenario_columns": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "slider": { "module": "dr-components-controls", "reads": null, "children": "none", "events": {}, "empty": null }, "button": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_click": ["custom", "submit"] }, "empty": null }, "status": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "badge": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "tag": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "empty_state": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_action": ["custom", "submit"] }, "empty": null }, "stepper": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": { "on_step": ["custom", "submit"] }, "empty": null }, "alert": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "checkbox": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "radio_group": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "file_upload": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_upload": ["custom", "save", "submit"] }, "empty": null }, "skeleton": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "progress": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "accordion": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "tooltip_info": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null } });
|
|
20069
|
-
var TITLED_TYPES2 = Object.freeze(["widget", "form", "list", "queue", "stat", "chart", "custom", "number_input", "select", "date_picker", "dialog"]);
|
|
20070
|
-
var CONTROL_PARTS2 = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider", "checkbox", "radio_group"]);
|
|
20231
|
+
var PARTS2 = Object.freeze({ "number_input": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "tabs": { "module": "dr-components", "reads": null, "children": ["tab_panel"], "events": {}, "empty": null }, "tab_panel": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "select": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": null }, "date_picker": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "data_grid": { "module": "dr-components", "reads": { "roles": ["list", "inbox", "custom"], "as": "rows" }, "children": "none", "events": { "on_row": ["custom", "decide"], "on_row_action": ["remove", "decide", "custom", "submit", "save"] }, "empty": "Nothing to show." }, "dialog": { "module": "dr-components", "reads": null, "children": "any", "events": { "on_confirm": ["custom", "save", "submit", "decide"] }, "empty": null }, "variance_table": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "toggle": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "control_group": { "module": "dr-components", "reads": null, "children": ["number_input", "select", "date_picker", "toggle", "slider", "checkbox", "radio_group", "date_range", "fiscal_month"], "events": {}, "empty": null }, "callout": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "scenario_columns": { "module": "dr-components", "reads": { "roles": ["list", "custom"], "as": "rows" }, "children": "none", "events": {}, "empty": "Nothing to show." }, "slider": { "module": "dr-components-controls", "reads": null, "children": "none", "events": {}, "empty": null }, "button": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_click": ["custom", "submit"] }, "empty": null }, "status": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "badge": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "tag": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "empty_state": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_action": ["custom", "submit"] }, "empty": null }, "stepper": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": { "on_step": ["custom", "submit"] }, "empty": null }, "alert": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "checkbox": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "radio_group": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "file_upload": { "module": "dr-components", "reads": null, "children": "none", "events": { "on_upload": ["custom", "save", "submit"] }, "empty": null }, "skeleton": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "progress": { "module": "dr-components", "reads": { "roles": ["summary", "list", "custom"], "as": "payload" }, "children": "none", "events": {}, "empty": null }, "accordion": { "module": "dr-components", "reads": null, "children": "any", "events": {}, "empty": null }, "tooltip_info": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "filter_bar": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "filter_chip": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "date_range": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null }, "fiscal_month": { "module": "dr-components", "reads": null, "children": "none", "events": {}, "empty": null } });
|
|
20232
|
+
var TITLED_TYPES2 = Object.freeze(["widget", "form", "list", "queue", "stat", "chart", "custom", "number_input", "select", "date_picker", "dialog", "date_range", "fiscal_month"]);
|
|
20233
|
+
var CONTROL_PARTS2 = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider", "checkbox", "radio_group", "date_range", "fiscal_month"]);
|
|
20071
20234
|
|
|
20072
20235
|
// ../flows/appspace-builder/kit/contract/bundleScan.mjs
|
|
20073
20236
|
var COMPONENT_ATTR2 = "data-dr-component";
|
|
@@ -21349,6 +21512,9 @@ function partCalls2(element) {
|
|
|
21349
21512
|
for (const action of Array.isArray(typed.row_actions) ? typed.row_actions : []) {
|
|
21350
21513
|
if (action && typeof action === "object" && named5(action.call)) out.push(action.call);
|
|
21351
21514
|
}
|
|
21515
|
+
for (const column of Array.isArray(typed.columns) ? typed.columns : []) {
|
|
21516
|
+
if (column && typeof column === "object" && column.cell === "toggle" && named5(column.call)) out.push(column.call);
|
|
21517
|
+
}
|
|
21352
21518
|
return out;
|
|
21353
21519
|
}
|
|
21354
21520
|
function isPart3(element) {
|
|
@@ -22796,6 +22962,9 @@ function payloadProducers2(contract, { moduleSource = () => void 0, pageSource =
|
|
|
22796
22962
|
for (const action of Array.isArray(typed.row_actions) ? typed.row_actions : []) {
|
|
22797
22963
|
if (isPlainObject10(action) && named6(action.call)) add(action.call, { page, uid, what: "data_grid", keys: ["id", "row"] });
|
|
22798
22964
|
}
|
|
22965
|
+
for (const column of Array.isArray(typed.columns) ? typed.columns : []) {
|
|
22966
|
+
if (isPlainObject10(column) && column.cell === "toggle" && named6(column.call)) add(column.call, { page, uid, what: "data_grid", keys: ["id", "row", "field", "value"] });
|
|
22967
|
+
}
|
|
22799
22968
|
break;
|
|
22800
22969
|
case "action": {
|
|
22801
22970
|
const keys2 = [];
|
|
@@ -23431,14 +23600,27 @@ function paramModeOf(element) {
|
|
|
23431
23600
|
const typed = isPlainObject11(props.props) ? props.props : {};
|
|
23432
23601
|
return named7(typed.param) ? typed.param : null;
|
|
23433
23602
|
}
|
|
23603
|
+
function paramsWrittenBy(element) {
|
|
23604
|
+
const out = [];
|
|
23605
|
+
const one = paramModeOf(element);
|
|
23606
|
+
if (one !== null) out.push(one);
|
|
23607
|
+
if (element?.type === "custom") return out;
|
|
23608
|
+
const typed = isPlainObject11(element?.props?.props) ? element.props.props : {};
|
|
23609
|
+
if (named7(typed.param_to)) out.push(typed.param_to);
|
|
23610
|
+
for (const filter of Array.isArray(typed.filters) ? typed.filters : []) {
|
|
23611
|
+
if (!isPlainObject11(filter)) continue;
|
|
23612
|
+
if (named7(filter.param)) out.push(filter.param);
|
|
23613
|
+
if (named7(filter.param_to)) out.push(filter.param_to);
|
|
23614
|
+
}
|
|
23615
|
+
return out;
|
|
23616
|
+
}
|
|
23434
23617
|
function paramWriters(contract, { moduleSource = () => void 0 } = {}) {
|
|
23435
23618
|
const out = /* @__PURE__ */ new Map();
|
|
23436
23619
|
for (const page of paramPages(contract)) {
|
|
23437
23620
|
const written = /* @__PURE__ */ new Set();
|
|
23438
23621
|
let unknown = false;
|
|
23439
23622
|
for (const [, element] of elementsOn(contract, page.path)) {
|
|
23440
|
-
const
|
|
23441
|
-
if (mode !== null) written.add(mode);
|
|
23623
|
+
for (const name of paramsWrittenBy(element)) written.add(name);
|
|
23442
23624
|
if (element?.type !== "custom") continue;
|
|
23443
23625
|
const props = isPlainObject11(element.props) ? element.props : {};
|
|
23444
23626
|
const produces = isPlainObject11(props.declares?.produces) ? props.declares.produces : {};
|
|
@@ -24937,8 +25119,8 @@ var kit_default2 = {
|
|
|
24937
25119
|
contract: "contract/extract.mjs",
|
|
24938
25120
|
charts: "echarts@5.6.0",
|
|
24939
25121
|
appWidgets: "dr-app-widgets@1.2.0",
|
|
24940
|
-
appComponents: "dr-components@1.
|
|
24941
|
-
appControls: "dr-components-controls@1.
|
|
25122
|
+
appComponents: "dr-components@1.3.0",
|
|
25123
|
+
appControls: "dr-components-controls@1.2.0"
|
|
24942
25124
|
};
|
|
24943
25125
|
|
|
24944
25126
|
// src/commands/appspace/compile.ts
|
|
@@ -29277,14 +29459,27 @@ function paramModeOf2(element) {
|
|
|
29277
29459
|
const typed = isPlainObject17(props.props) ? props.props : {};
|
|
29278
29460
|
return named10(typed.param) ? typed.param : null;
|
|
29279
29461
|
}
|
|
29462
|
+
function paramsWrittenBy2(element) {
|
|
29463
|
+
const out = [];
|
|
29464
|
+
const one = paramModeOf2(element);
|
|
29465
|
+
if (one !== null) out.push(one);
|
|
29466
|
+
if (element?.type === "custom") return out;
|
|
29467
|
+
const typed = isPlainObject17(element?.props?.props) ? element.props.props : {};
|
|
29468
|
+
if (named10(typed.param_to)) out.push(typed.param_to);
|
|
29469
|
+
for (const filter of Array.isArray(typed.filters) ? typed.filters : []) {
|
|
29470
|
+
if (!isPlainObject17(filter)) continue;
|
|
29471
|
+
if (named10(filter.param)) out.push(filter.param);
|
|
29472
|
+
if (named10(filter.param_to)) out.push(filter.param_to);
|
|
29473
|
+
}
|
|
29474
|
+
return out;
|
|
29475
|
+
}
|
|
29280
29476
|
function paramWriters2(contract, { moduleSource = () => void 0 } = {}) {
|
|
29281
29477
|
const out = /* @__PURE__ */ new Map();
|
|
29282
29478
|
for (const page of paramPages2(contract)) {
|
|
29283
29479
|
const written = /* @__PURE__ */ new Set();
|
|
29284
29480
|
let unknown = false;
|
|
29285
29481
|
for (const [, element] of elementsOn2(contract, page.path)) {
|
|
29286
|
-
const
|
|
29287
|
-
if (mode !== null) written.add(mode);
|
|
29482
|
+
for (const name of paramsWrittenBy2(element)) written.add(name);
|
|
29288
29483
|
if (element?.type !== "custom") continue;
|
|
29289
29484
|
const props = isPlainObject17(element.props) ? element.props : {};
|
|
29290
29485
|
const produces = isPlainObject17(props.declares?.produces) ? props.declares.produces : {};
|