@datarails-ai/dr-appspace-cli 0.10.9 → 0.10.11

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.
Files changed (2) hide show
  1. package/dist/cli.js +365 -50
  2. 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.9",
16
+ version: "0.10.11",
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-09-30T21:20:17.594Z";
60
+ var BUILD_TIME = "2026-10-01T07:27:10.213Z";
61
61
  function formatBuildTime(iso) {
62
62
  if (iso === "") return "";
63
63
  const d = new Date(iso);
@@ -5904,7 +5904,9 @@ function loadsModule(pagePath, text3, pattern) {
5904
5904
  // ../flows/insights-builder/kit/contract/components.gen.mjs
5905
5905
  var components_gen_exports = {};
5906
5906
  __export(components_gen_exports, {
5907
+ APP_KIND_READS: () => APP_KIND_READS,
5907
5908
  APP_TYPES: () => APP_TYPES,
5909
+ APP_WIDGET_KINDS: () => APP_WIDGET_KINDS,
5908
5910
  CHART_FORMATS: () => CHART_FORMATS,
5909
5911
  CHART_KINDS: () => CHART_KINDS,
5910
5912
  COMPONENT_ATTRIBUTES: () => COMPONENT_ATTRIBUTES,
@@ -5922,11 +5924,13 @@ __export(components_gen_exports, {
5922
5924
  MODULE_OF: () => MODULE_OF,
5923
5925
  NEGATIVE_MODES: () => NEGATIVE_MODES,
5924
5926
  PARTS: () => PARTS,
5927
+ PLATFORM_FINANCE: () => PLATFORM_FINANCE,
5925
5928
  PLATFORM_FORMAT: () => PLATFORM_FORMAT,
5926
5929
  PLATFORM_NUMBERS: () => PLATFORM_NUMBERS,
5927
5930
  PROPS_SCHEMAS: () => PROPS_SCHEMAS,
5928
5931
  REGISTRY_VERSION: () => REGISTRY_VERSION,
5929
5932
  ROW_ACTION_WHEN: () => ROW_ACTION_WHEN,
5933
+ SMART_COMPARES: () => SMART_COMPARES,
5930
5934
  STAT_TONES: () => STAT_TONES,
5931
5935
  STRICT_TYPES: () => STRICT_TYPES,
5932
5936
  STRUCTURED_ATTRIBUTES: () => STRUCTURED_ATTRIBUTES,
@@ -5934,9 +5938,9 @@ __export(components_gen_exports, {
5934
5938
  WIDGET_KINDS: () => WIDGET_KINDS
5935
5939
  });
5936
5940
  var REGISTRY_VERSION = Object.freeze(8);
5937
- 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"]);
5938
- 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"]);
5939
- 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"]);
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"]);
5940
5944
  var DASHBOARD_TYPES = Object.freeze(["region", "grid", "control", "nav", "tab", "slot"]);
5941
5945
  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"]);
5942
5946
  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"]]);
@@ -5949,18 +5953,22 @@ var NEGATIVE_MODES = Object.freeze(["minus", "red_minus", "absolute", "red_absol
5949
5953
  var FORMAT_PATTERNS = Object.freeze({ "currency": "$#,###", "number": "#,###", "percent": '#,###.#"%"' });
5950
5954
  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" });
5951
5955
  var ROW_ACTION_WHEN = Object.freeze({ "dr-components": "1.2.0" });
5952
- 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" });
5956
+ 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" });
5953
5957
  var STAT_TONES = Object.freeze(["default", "positive", "warning", "negative"]);
5954
5958
  var WIDGET_KINDS = Object.freeze(["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative"]);
5955
5959
  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"] });
5956
- 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"]);
5957
- 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"], "description": "data-dr-kind on an app page, the widget kind on a dashboard" }, "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" }, "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" } } } });
5960
+ var APP_WIDGET_KINDS = Object.freeze(["waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"]);
5961
+ 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
+ var SMART_COMPARES = Object.freeze(["BvA", "AvF", "vs_prev_period"]);
5963
+ 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" } } } });
5958
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"]);
5959
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" } } } });
5960
5968
  var CONTROLS_TYPES = Object.freeze(["slider"]);
5961
- 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"], "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 } });
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 } });
5962
5970
  var TITLED_TYPES = Object.freeze(["widget", "form", "list", "queue", "stat", "chart", "custom", "number_input", "select", "date_picker", "dialog"]);
5963
- var CONTROL_PARTS = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider"]);
5971
+ var CONTROL_PARTS = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider", "checkbox", "radio_group"]);
5964
5972
 
5965
5973
  // ../flows/insights-builder/kit/contract/bundleScan.mjs
5966
5974
  var COMPONENT_ATTR = "data-dr-component";
@@ -5990,10 +5998,21 @@ var PLATFORM_NUMBERS2 = PLATFORM_NUMBERS;
5990
5998
  var MODULE_OF2 = MODULE_OF;
5991
5999
  var semver = (version) => String(version ?? "").split(".").map((part) => Number.parseInt(part, 10) || 0);
5992
6000
  function drawsPlatformNumbers(pin) {
6001
+ return reaches(pin, PLATFORM_NUMBERS2);
6002
+ }
6003
+ var APP_WIDGET_KINDS2 = APP_WIDGET_KINDS;
6004
+ var APP_KIND_READS2 = APP_KIND_READS;
6005
+ var SMART_COMPARES2 = SMART_COMPARES;
6006
+ var PLATFORM_FINANCE2 = PLATFORM_FINANCE;
6007
+ function drawsFinanceKinds(pin) {
6008
+ return reaches(pin, PLATFORM_FINANCE2);
6009
+ }
6010
+ function reaches(pin, table) {
5993
6011
  const at = String(pin ?? "").lastIndexOf("@");
5994
6012
  const module = at > 0 ? pin.slice(0, at) : String(pin ?? "");
5995
- const first = PLATFORM_NUMBERS2[module];
6013
+ const first = table[module];
5996
6014
  if (typeof first !== "string") return false;
6015
+ if (!/^\d+\.\d+\.\d+$/.test(pin.slice(at + 1))) return false;
5997
6016
  const [a, b] = [semver(pin.slice(at + 1)), semver(first)];
5998
6017
  for (let i = 0; i < 3; i++) if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
5999
6018
  return true;
@@ -9456,6 +9475,8 @@ var STRICT_TYPES2 = new Set(registry.STRICT_TYPES);
9456
9475
  var PROPS_SCHEMAS2 = registry.PROPS_SCHEMAS;
9457
9476
  var WIDGET_KINDS3 = registry.WIDGET_KINDS;
9458
9477
  var KIND_READS3 = registry.KIND_READS;
9478
+ var APP_WIDGET_KINDS3 = registry.APP_WIDGET_KINDS;
9479
+ var APP_KIND_READS3 = registry.APP_KIND_READS;
9459
9480
  var PAYLOAD_KINDS = [
9460
9481
  ...new Set(Object.values(KIND_READS3).flat())
9461
9482
  ].sort();
@@ -9758,13 +9779,27 @@ var contract_schema_default = {
9758
9779
  { properties: { type: { const: "callout" }, props: { $ref: "#/$defs/props_callout" } } },
9759
9780
  { properties: { type: { const: "scenario_columns" }, props: { $ref: "#/$defs/props_scenario_columns" } } },
9760
9781
  { properties: { type: { const: "slider" }, props: { $ref: "#/$defs/props_slider" } } },
9782
+ { properties: { type: { const: "button" }, props: { $ref: "#/$defs/props_button" } } },
9783
+ { properties: { type: { const: "status" }, props: { $ref: "#/$defs/props_status" } } },
9784
+ { properties: { type: { const: "badge" }, props: { $ref: "#/$defs/props_badge" } } },
9785
+ { properties: { type: { const: "tag" }, props: { $ref: "#/$defs/props_tag" } } },
9786
+ { properties: { type: { const: "empty_state" }, props: { $ref: "#/$defs/props_empty_state" } } },
9787
+ { properties: { type: { const: "stepper" }, props: { $ref: "#/$defs/props_stepper" } } },
9788
+ { properties: { type: { const: "alert" }, props: { $ref: "#/$defs/props_alert" } } },
9789
+ { properties: { type: { const: "checkbox" }, props: { $ref: "#/$defs/props_checkbox" } } },
9790
+ { properties: { type: { const: "radio_group" }, props: { $ref: "#/$defs/props_radio_group" } } },
9791
+ { properties: { type: { const: "file_upload" }, props: { $ref: "#/$defs/props_file_upload" } } },
9792
+ { properties: { type: { const: "skeleton" }, props: { $ref: "#/$defs/props_skeleton" } } },
9793
+ { properties: { type: { const: "progress" }, props: { $ref: "#/$defs/props_progress" } } },
9794
+ { properties: { type: { const: "accordion" }, props: { $ref: "#/$defs/props_accordion" } } },
9795
+ { properties: { type: { const: "tooltip_info" }, props: { $ref: "#/$defs/props_tooltip_info" } } },
9761
9796
  { properties: { type: { enum: ["region", "grid", "widget", "control", "nav", "tab", "slot", "form", "list", "detail", "queue", "action", "filter", "stat", "chart", "custom", "field"] }, props: { type: "object" } } }
9762
9797
  ],
9763
9798
  properties: {
9764
9799
  uid: { type: "string" },
9765
9800
  page: { type: "string" },
9766
9801
  type: {
9767
- 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"],
9802
+ 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"],
9768
9803
  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"
9769
9804
  },
9770
9805
  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." },
@@ -10058,7 +10093,7 @@ var contract_schema_default = {
10058
10093
  additionalProperties: false,
10059
10094
  properties: {
10060
10095
  page: { type: "string" },
10061
- 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"] },
10096
+ 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"] },
10062
10097
  id: { type: ["string", "null"] },
10063
10098
  entity: { type: ["string", "null"] },
10064
10099
  handler: { type: ["string", "null"] }
@@ -10251,7 +10286,7 @@ var contract_schema_default = {
10251
10286
  },
10252
10287
  props_region: { type: "object", properties: {} },
10253
10288
  props_grid: { type: "object", properties: {} },
10254
- props_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"], description: "data-dr-kind on an app page, the widget kind on a dashboard" }, 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" }, 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" } } },
10289
+ props_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" } } },
10255
10290
  props_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" } } },
10256
10291
  props_nav: { type: "object", properties: { aria_label: { type: "string", description: "the nav's accessible name" } } },
10257
10292
  props_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" } } },
@@ -10278,7 +10313,21 @@ var contract_schema_default = {
10278
10313
  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" } } },
10279
10314
  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" } } },
10280
10315
  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" } } },
10281
- 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" } } }
10316
+ 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" } } },
10317
+ 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" } } },
10318
+ 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" } } },
10319
+ 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" } } },
10320
+ 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" } } },
10321
+ 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" } } },
10322
+ 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" } } },
10323
+ 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" } } },
10324
+ 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" } } },
10325
+ 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" } } },
10326
+ 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" } } },
10327
+ 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" } } },
10328
+ 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" } } },
10329
+ 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" } } },
10330
+ 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" } } }
10282
10331
  }
10283
10332
  };
10284
10333
 
@@ -11837,7 +11886,7 @@ function checkAppCards(doc, problems) {
11837
11886
  }
11838
11887
  const name = typeof props["source"] === "string" && props["source"] !== "" ? props["source"] : null;
11839
11888
  const kind = typeof props["kind"] === "string" ? props["kind"] : "breakdown";
11840
- const shape = (KIND_READS3[kind] ?? ["breakdown"])[0] ?? "breakdown";
11889
+ const shape = (KIND_READS3[kind] ?? APP_KIND_READS3[kind] ?? ["breakdown"])[0] ?? "breakdown";
11841
11890
  if (name === null) {
11842
11891
  problems.push({
11843
11892
  code: "missing-prop",
@@ -14179,15 +14228,70 @@ function isPlatformChartColour(n, value) {
14179
14228
  return colour !== "" && (PLATFORM_CHART[n - 1] === colour || APP_CHART_ORDER[n - 1] === colour);
14180
14229
  }
14181
14230
 
14231
+ // ../flows/insights-builder/kit/contract/platformBadges.mjs
14232
+ var PLATFORM_BADGE_COLOURS = Object.freeze([
14233
+ ["--dr-color-additional-blue", "#0061ff"],
14234
+ ["--dr-color-additional-bright-green", "#20a452"],
14235
+ ["--dr-color-additional-dark-blue", "#19194c"],
14236
+ ["--dr-color-additional-orange", "#ff4e00"],
14237
+ ["--dr-color-additional-bright-purple", "#b14ef2"],
14238
+ ["--dr-color-additional-light-blue", "#578aff"],
14239
+ ["--dr-color-additional-bright-pink", "#f13fa4"],
14240
+ ["--dr-color-additional-mouse", "#8693a2"],
14241
+ ["--dr-color-additional-medium-green", "#00867e"],
14242
+ ["--dr-color-additional-dark-green", "#006334"],
14243
+ ["--dr-color-additional-light-pink", "#ff6bb7"],
14244
+ ["--dr-color-additional-deep-mocha", "#523f3e"],
14245
+ ["--dr-color-additional-soft-coral", "#f3b1af"],
14246
+ ["--dr-color-additional-navy-blue", "#2e4f8c"],
14247
+ ["--dr-color-additional-cool-lagoon", "#73c9c5"],
14248
+ ["--dr-color-additional-lavender", "#baa9f3"],
14249
+ ["--dr-color-additional-grape", "#753f86"],
14250
+ ["--dr-color-additional-royal-purple", "#724dca"],
14251
+ ["--dr-color-additional-sky-breeze", "#80cafa"],
14252
+ ["--dr-color-additional-honey", "#ffae00"],
14253
+ ["--dr-color-additional-fresh-lime", "#a8d14b"],
14254
+ ["--dr-color-additional-space", "#7b61ff"],
14255
+ ["--dr-color-additional-ocean-teal", "#06a5c7"],
14256
+ ["--dr-color-badge-light-purple", "#dfd9ff"],
14257
+ ["--dr-color-badge-purple", "#7b61ff"],
14258
+ ["--dr-color-badge-water", "#d9f2ff"],
14259
+ ["--dr-color-badge-baby-blue", "#d9e6ff"],
14260
+ ["--dr-color-badge-baby-pink", "#ffdbf1"],
14261
+ ["--dr-color-badge-light-turquoise", "#d6fcf9"],
14262
+ ["--dr-color-badge-bright-green", "#d9ffea"],
14263
+ ["--dr-color-badge-stone", "#f6f4f4"],
14264
+ ["--dr-color-badge-peach", "#ffe5b4"],
14265
+ ["--dr-color-badge-soft-coral", "#ffd2c2"],
14266
+ ["--dr-color-badge-pale-yellow", "#fffacd"],
14267
+ ["--dr-color-badge-pastel-olive", "#dce2b9"],
14268
+ ["--dr-color-badge-powder-blue-grey", "#d3dbe3"],
14269
+ ["--dr-color-badge-muted-plum", "#e7c7db"]
14270
+ ]);
14271
+ var BADGES_FILE = "ui/dr-badges.css";
14272
+ function badgesCss() {
14273
+ const lines = [
14274
+ "/* The platform's badge and additional colours: dr-components' badge draws them.",
14275
+ " * GENERATED by compileApp.mjs (contract/platformBadges.mjs) from vendor/dr-tokens@1.0.0:",
14276
+ " * do not edit. Only names ui-kit/v4 does not declare, so nothing v4 sets is moved.",
14277
+ " */",
14278
+ ":root {"
14279
+ ];
14280
+ for (const [name, value] of PLATFORM_BADGE_COLOURS) lines.push(` ${name}: ${value};`);
14281
+ lines.push("}");
14282
+ return `${lines.join("\n")}
14283
+ `;
14284
+ }
14285
+
14182
14286
  // ../flows/insights-builder/kit/contract/compileApp.mjs
14183
14287
  var RUNTIME = "dr-app-runtime@1.7.1";
14184
14288
  var UI_KIT2 = "ui-kit/v4";
14185
14289
  var CHARTS = "echarts@5.6.0";
14186
14290
  var FMT = "dr-fmt@2.0.1";
14187
14291
  var TOKENS = "dr-tokens@1.0.0";
14188
- var WIDGETS = "dr-app-widgets@1.1.0";
14189
- var COMPONENTS = "dr-components@1.1.1";
14190
- var CONTROLS = "dr-components-controls@1.0.1";
14292
+ var WIDGETS = "dr-app-widgets@1.2.0";
14293
+ var COMPONENTS = "dr-components@1.2.0";
14294
+ var CONTROLS = "dr-components-controls@1.1.0";
14191
14295
  var PART_FILES = {
14192
14296
  "dr-components": { css: "components.css", js: "components.js" },
14193
14297
  "dr-components-controls": { css: "controls.css", js: "controls.js" }
@@ -15101,9 +15205,11 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
15101
15205
  problems.push(...numberProblems(declared));
15102
15206
  problems.push(...numberPinProblems(declared, { "dr-app-runtime": runtime, "dr-app-widgets": appWidgets, "dr-components": appComponents, "dr-components-controls": appControls }));
15103
15207
  problems.push(...whenPinProblems(declared, { "dr-components": appComponents }));
15104
- if (tree.problems.length === 0) problems.push(...widgetProblems(declared, tree, handlers, contract?.data?.sources));
15208
+ const widgetFindings = tree.problems.length === 0 ? widgetProblems(declared, tree, handlers, contract?.data?.sources, appWidgets) : [];
15209
+ const warnings = widgetFindings.filter((one) => one.advisory).map(({ advisory: _advisory, ...one }) => one);
15210
+ problems.push(...widgetFindings.filter((one) => !one.advisory));
15105
15211
  if (tree.problems.length === 0) problems.push(...partProblems(declared, tree, handlers, sources, contract?.pages, model));
15106
- if (problems.length > 0) return { files: {}, problems, contract };
15212
+ if (problems.length > 0) return { files: {}, problems, contract, warnings };
15107
15213
  if (sources !== stated2) contract = { ...contract, data: { ...contract.data, sources } };
15108
15214
  const parented = dropEmptyArgs(fillChartFormats(fillParents(declared, tree), handlers, model));
15109
15215
  const headed = fillHeaders(contract, parented);
@@ -15113,7 +15219,7 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
15113
15219
  if (themed.app !== app) contract = { ...contract, app: themed.app };
15114
15220
  const order2 = emittedOrder(contract, elements, pages, tree);
15115
15221
  problems.push(...placementProblems(elements, pages, tree, order2));
15116
- if (problems.length > 0) return { files: {}, problems, contract };
15222
+ if (problems.length > 0) return { files: {}, problems, contract, warnings };
15117
15223
  const whole = restate(contract, elements, pages, typed, order2);
15118
15224
  const served = servedSources(elements, sources);
15119
15225
  const transforms = transformTexts2(sources, extra);
@@ -15129,13 +15235,14 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
15129
15235
  const theme = isPlainObject7(app.theme) ? app.theme : null;
15130
15236
  if (theme !== null) files[THEME_FILE4] = themeCss(theme);
15131
15237
  files[PALETTE_FILE] = paletteCss();
15238
+ if (pages.some((page) => page.owned !== true && tokensOn(page, elements))) files[BADGES_FILE] = badgesCss();
15132
15239
  for (const page of pages) {
15133
15240
  if (page.owned === true) continue;
15134
15241
  files[page.path] = pageHtml(whole, page, elements, tree, model, { runtime, uiKit, charts, fmt, appWidgets, appComponents, appControls, theme: theme !== null, extra });
15135
15242
  }
15136
15243
  if (typeof extra["seed.json"] === "string") files["seed.json"] = extra["seed.json"];
15137
15244
  files["tests.json"] = typeof extra["tests.json"] === "string" ? extra["tests.json"] : json(testsOf(handlers, names, sources, served));
15138
- return { files, problems, contract: whole, order: order2 };
15245
+ return { files, problems, contract: whole, order: order2, warnings };
15139
15246
  }
15140
15247
  function restate(contract, elements, pages, typed, order2) {
15141
15248
  const data = dropEmptyDashboardData(contract.data);
@@ -15907,8 +16014,8 @@ function whenPinProblems(elements, pins) {
15907
16014
  return problems;
15908
16015
  }
15909
16016
  function pinAtLeast(pin, first) {
15910
- const semver2 = (v) => String(v).split(".").map((n) => Number.parseInt(n, 10) || 0);
15911
- const [a, b] = [semver2(pin.slice(pin.lastIndexOf("@") + 1)), semver2(first)];
16017
+ const semver3 = (v) => String(v).split(".").map((n) => Number.parseInt(n, 10) || 0);
16018
+ const [a, b] = [semver3(pin.slice(pin.lastIndexOf("@") + 1)), semver3(first)];
15912
16019
  for (let i = 0; i < 3; i++) if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
15913
16020
  return true;
15914
16021
  }
@@ -15991,7 +16098,19 @@ function chartProblems(elements, tree, handlers, model) {
15991
16098
  return problems;
15992
16099
  }
15993
16100
  var WIDGET_SOURCE_ROLES = ["custom"];
15994
- function widgetProblems(elements, tree, handlers, sources) {
16101
+ var TYPED_WIDGET_PROPS = Object.freeze(Object.keys(PROPS_SCHEMAS.widget?.properties?.props?.properties ?? {}));
16102
+ var TYPED_PROP_KINDS = Object.freeze({
16103
+ variant: ["smart"],
16104
+ compare: ["smart"],
16105
+ color_rule: ["smart", "gauge"],
16106
+ goal: ["gauge"],
16107
+ total: ["waterfall", "waterfall-walkthrough"],
16108
+ variance: ["waterfall-breakdown"],
16109
+ forecast_from: ["line-forecast"],
16110
+ dual_axis: ["combo"]
16111
+ });
16112
+ var ORDERED_KINDS = Object.freeze(["waterfall", "waterfall-breakdown", "waterfall-walkthrough"]);
16113
+ function widgetProblems(elements, tree, handlers, sources, widgetsPin = WIDGETS) {
15995
16114
  const problems = [];
15996
16115
  const declaredSources = isPlainObject7(sources) ? sources : {};
15997
16116
  for (const uid of Object.keys(elements).sort(natural3)) {
@@ -16008,17 +16127,77 @@ function widgetProblems(elements, tree, handlers, sources) {
16008
16127
  );
16009
16128
  continue;
16010
16129
  }
16011
- if (props.kind !== void 0 && props.kind !== null && !WIDGET_KINDS2.includes(props.kind)) {
16012
- say("kind", "widget_kind", `states kind ${JSON.stringify(props.kind)}, which is not one dr-app-widgets draws; use ${either3(WIDGET_KINDS2)}, or omit kind to draw the payload as it comes`);
16130
+ const kinds = [...WIDGET_KINDS2, ...APP_WIDGET_KINDS2];
16131
+ if (props.kind !== void 0 && props.kind !== null && !kinds.includes(props.kind)) {
16132
+ say("kind", "widget_kind", `states kind ${JSON.stringify(props.kind)}, which is not one dr-app-widgets draws; use ${either3(kinds)}, or omit kind to draw the payload as it comes`);
16133
+ continue;
16134
+ }
16135
+ const given = (value) => value !== void 0 && value !== null && value !== "";
16136
+ const at = (key) => `props/${key}`;
16137
+ const flat = TYPED_WIDGET_PROPS.filter((key) => given(props[key]));
16138
+ if (flat.length > 0) {
16139
+ mismatch(flat[0], `states ${flat.map((key) => JSON.stringify(key)).join(", ")} at the top of its props; a widget's typed props sit under props.props ({"props": {"${flat[0]}": ...}}), which the page carries as data-dr-props`);
16140
+ continue;
16141
+ }
16142
+ if (given(props.props) && !isPlainObject7(props.props)) {
16143
+ mismatch("props", `states props ${JSON.stringify(props.props)}; a widget's typed props are an object ({"props": {"goal": 1000}}), written as data-dr-props`);
16144
+ continue;
16145
+ }
16146
+ const typed = isPlainObject7(props.props) ? props.props : {};
16147
+ const finance = APP_WIDGET_KINDS2.includes(props.kind);
16148
+ const smart = given(typed.variant) || given(typed.compare);
16149
+ const pinned = String(widgetsPin ?? "").slice(String(widgetsPin ?? "").lastIndexOf("@") + 1);
16150
+ const need = `dr-app-widgets@${PLATFORM_FINANCE2["dr-app-widgets"]}`;
16151
+ if ((finance || given(props.props)) && !drawsFinanceKinds(widgetsPin)) {
16152
+ const what = finance ? `kind ${JSON.stringify(props.kind)}` : smart ? "a smart kpi (props.variant, props.compare)" : "typed props (props.props)";
16153
+ say(finance ? "kind" : smart ? at(given(typed.variant) ? "variant" : "compare") : "props", "widget_kind", `states ${what}, which needs ${need}; the pinned version is ${pinned}, which draws only ${either3(WIDGET_KINDS2)} \u2014 use one of those for now`);
16154
+ continue;
16155
+ }
16156
+ if (given(typed.aggregation) || given(props.aggregation)) {
16157
+ mismatch(
16158
+ given(typed.aggregation) ? at("aggregation") : "aggregation",
16159
+ `states aggregation ${JSON.stringify(typed.aggregation ?? props.aggregation)}, and no source computes a YTD/QTD/MTD window yet, so the tile would label a figure it was not handed \u2014 drop aggregation, and put the window in the source (its period) and the label`
16160
+ );
16161
+ continue;
16162
+ }
16163
+ if (typed.compare === "vs_prev_year") {
16164
+ mismatch(at("compare"), `states compare "vs_prev_year", and no source computes a year-ago delta yet \u2014 use ${either3(SMART_COMPARES2)}`);
16165
+ continue;
16166
+ }
16167
+ const typeLines = validate2(typed, PROPS_SCHEMAS.widget?.properties?.props ?? {});
16168
+ if (typeLines.length > 0) {
16169
+ const line = typeLines[0];
16170
+ const split2 = line.indexOf(": ");
16171
+ const where2 = line.slice(0, split2);
16172
+ mismatch(where2 === "/" ? "props" : `props${where2}`, `props.props${where2 === "/" ? "" : where2}: ${line.slice(split2 + 2)} (the widget's typed props in components.json: ${either3(TYPED_WIDGET_PROPS)})`);
16173
+ continue;
16174
+ }
16175
+ if (smart && (typed.variant !== "smart" || stated(props.kind) && props.kind !== "kpi")) {
16176
+ mismatch(
16177
+ given(typed.variant) && typed.variant !== "smart" ? at("variant") : stated(props.kind) && props.kind !== "kpi" ? "kind" : at("compare"),
16178
+ `states ${given(typed.variant) ? `variant ${JSON.stringify(typed.variant)}` : "compare"}${stated(props.kind) ? ` on kind ${JSON.stringify(props.kind)}` : ""}; a smart kpi is kind "kpi" (or no kind) with props.variant "smart", and props.compare is its comparison`
16179
+ );
16180
+ continue;
16181
+ }
16182
+ const drawnAs = smart ? "smart" : stated(props.kind) ? props.kind : null;
16183
+ const stray = Object.keys(typed).find((key) => !(TYPED_PROP_KINDS[key] ?? []).includes(drawnAs));
16184
+ if (stray !== void 0) {
16185
+ const owners = TYPED_PROP_KINDS[stray] ?? [];
16186
+ mismatch(
16187
+ at(stray),
16188
+ `states props.${stray}${drawnAs ? ` on ${drawnAs === "smart" ? "a smart kpi" : `kind "${drawnAs}"`}` : " with no kind"}, which does not read it; ${stray} is ${either3(owners.map((one) => one === "smart" ? `a smart kpi's (kind "kpi", props.variant "smart")` : `${one}'s`))} \u2014 drop it, or give the card that kind`
16189
+ );
16013
16190
  continue;
16014
16191
  }
16015
16192
  if (!stated(props.source)) {
16016
16193
  mismatch("source", 'names no source; a widget names the handler that answers its one widget payload with source \u2014 a custom handler answering {"kind": ..., "meta": {}}');
16017
16194
  continue;
16018
16195
  }
16019
- if (!Object.prototype.hasOwnProperty.call(handlers, props.source)) continue;
16196
+ const source = declaredSources[props.source];
16197
+ const handled = Object.prototype.hasOwnProperty.call(handlers, props.source);
16198
+ if (!handled && !isPlainObject7(source)) continue;
16020
16199
  const row = handlers[props.source] ?? {};
16021
- if (!WIDGET_SOURCE_ROLES.includes(row.role)) {
16200
+ if (handled && !WIDGET_SOURCE_ROLES.includes(row.role)) {
16022
16201
  const answers = row.role === "summary" ? "which answers one number per measure" : row.role === "history" ? "which answers one row's events" : row.role === "list" || row.role === "inbox" ? "which answers rows" : "which answers no payload";
16023
16202
  mismatch(
16024
16203
  "source",
@@ -16026,20 +16205,23 @@ function widgetProblems(elements, tree, handlers, sources) {
16026
16205
  );
16027
16206
  continue;
16028
16207
  }
16029
- const source = declaredSources[props.source];
16030
16208
  if (!isPlainObject7(source)) continue;
16031
16209
  const shape = named4(source.shape) ? source.shape : "rows";
16210
+ const legacy = !finance;
16211
+ const shaped = (message) => problems.push({ code: "widget_source_shape", pointer: `/elements/${escapePointer3(uid)}/props/source`, message: `widget "${uid}" ${message}`, ...legacy ? { advisory: true } : {} });
16032
16212
  if (shape === "rows") {
16033
- say("source", "widget_source_shape", `reads a dashboard payload, and source "${props.source}" answers rows (its shape); a rows source is what a chart or a list reads \u2014 give the source one of the widget shapes`);
16213
+ shaped(`reads a dashboard payload, and source "${props.source}" answers rows (its shape); a rows source is what a chart or a list reads \u2014 give the source one of the widget shapes`);
16034
16214
  continue;
16035
16215
  }
16036
16216
  if (!stated(props.kind)) continue;
16037
- const reads = KIND_READS2[props.kind] ?? [];
16217
+ const reads = KIND_READS2[props.kind] ?? APP_KIND_READS2[props.kind] ?? [];
16038
16218
  if (!reads.includes(shape)) {
16039
- say(
16040
- "source",
16041
- "widget_source_shape",
16042
- `draws ${props.kind}, and source "${props.source}" answers ${shape} (its shape); give the source the shape ${reads.join(" or ")}`
16219
+ shaped(`draws ${props.kind}, and source "${props.source}" answers ${shape} (its shape); give the source the shape ${reads.join(" or ")}`);
16220
+ continue;
16221
+ }
16222
+ if (ORDERED_KINDS.includes(props.kind) && shape === "breakdown") {
16223
+ shaped(
16224
+ `draws ${props.kind}, and source "${props.source}" is a breakdown, which the platform sorts by size and cuts to its top 5 (the rest is one "Other" figure a waterfall does not draw) \u2014 so the bridge would draw the wrong steps and the wrong total. Give the source the shape series (the periods are the steps, in order), or answer the bridge from a custom handler (data.app.handlers, role custom) that returns {"kind": "breakdown", "items": [...]} in the order the steps go`
16043
16225
  );
16044
16226
  }
16045
16227
  }
@@ -16182,6 +16364,65 @@ function partProblems(elements, tree, handlers, sources, pages = [], model = nul
16182
16364
  }
16183
16365
  }
16184
16366
  }
16367
+ const formAbove = () => {
16368
+ for (let up = parentOf(tree, uid); named4(up) && up in elements; up = parentOf(tree, up)) if (elements[up]?.type === "form") return up;
16369
+ return null;
16370
+ };
16371
+ const dialogAbove = () => {
16372
+ for (let up = parentOf(tree, uid); named4(up) && up in elements; up = parentOf(tree, up)) if (elements[up]?.type === "dialog") return up;
16373
+ return null;
16374
+ };
16375
+ if (type === "file_upload") {
16376
+ const form = formAbove();
16377
+ if (form !== null) {
16378
+ say(
16379
+ "part_placement",
16380
+ at,
16381
+ `sits inside form "${elements[form].props?.id ?? form}", and a form posts a part's value as text \u2014 a file column refuses it; give the form a field over a file column (its own upload), or put the file_upload in a parts dialog (one with on_confirm and no form) or on the page with on_upload`
16382
+ );
16383
+ } else if (!stated(typedProps.on_upload) && dialogAbove() === null) {
16384
+ say("part_mode", `${at}/props/props`, "names no on_upload and sits in no dialog, so the file it stores reaches no handler; give it on_upload (the parser hand-off), or put it in a parts dialog whose on_confirm reads it");
16385
+ }
16386
+ }
16387
+ if ((type === "checkbox" || type === "toggle") && stated(typedProps.field)) {
16388
+ const form = formAbove();
16389
+ const table = form !== null ? handlers[elements[form].props?.action]?.table ?? elements[form].props?.entity : null;
16390
+ const column = named4(table) ? model?.tables?.[table]?.columns?.[typedProps.field] : null;
16391
+ if (form !== null && column?.type === "bool") {
16392
+ say(
16393
+ "part_placement",
16394
+ at,
16395
+ `sits inside form "${elements[form].props?.id ?? form}" over bool column "${table}.${typedProps.field}", and a form posts a part's value as the text "true" / "false", which a bool column refuses; use the form's own field over "${typedProps.field}", or put the ${type} in a parts dialog, which posts a real boolean`
16396
+ );
16397
+ }
16398
+ }
16399
+ if (type === "dialog" && kids.some((kid) => elements[kid]?.type === "form")) {
16400
+ for (const kid of kids) {
16401
+ if (elements[kid]?.type === "form") continue;
16402
+ say(
16403
+ "part_children",
16404
+ `/elements/${escapePointer3(kid)}`,
16405
+ `holds "${kid}" (a ${elements[kid]?.type ?? "element"}) beside its form, and a dialog holding a form draws only the form \u2014 it is never drawn or posted; move it into the form (a field), or into a parts dialog (one with on_confirm and no form)`
16406
+ );
16407
+ }
16408
+ }
16409
+ const nested = [];
16410
+ if (type === "button" && Array.isArray(typedProps.split)) {
16411
+ typedProps.split.forEach((item, index) => isPlainObject7(item) && stated(item.on_click) && nested.push([item.on_click, `${at}/props/props/split/${index}/on_click`, `split entry "${item.label ?? index}"`, entry.events?.on_click ?? []]));
16412
+ }
16413
+ if (type === "stepper" && Array.isArray(typedProps.steps)) {
16414
+ typedProps.steps.forEach((step, index) => isPlainObject7(step) && stated(step.action) && nested.push([step.action, `${at}/props/props/steps/${index}/action`, `step "${step.id ?? index}"`, entry.events?.on_step ?? []]));
16415
+ }
16416
+ for (const [name, pointer2, what, roles] of nested) {
16417
+ if (!Object.prototype.hasOwnProperty.call(handlers, name)) {
16418
+ say("part_handler_missing", pointer2, `${what} calls "${name}", which data.app.handlers does not declare; declare it (a ${either3(roles)} handler), or drop it`);
16419
+ } else if (!roles.includes(handlers[name]?.role)) {
16420
+ say("part_handler_missing", pointer2, `${what} calls "${name}", and it has role ${handlers[name]?.role ?? "none"}; it calls a ${either3(roles)} handler`);
16421
+ } else {
16422
+ const refused = rowlessRefusal(name, handlers);
16423
+ if (refused) say("part_handler_missing", pointer2, `${what} calls "${name}", ${refused}`);
16424
+ }
16425
+ }
16185
16426
  if (type === "dialog" && !stated(typedProps.trigger) && typedProps.values_from !== "row") {
16186
16427
  say("part_mode", `${at}/props/props`, `states neither props.trigger nor values_from: "row", so nothing could open it; give it a trigger, or values_from "row" for a grid's row action to open`);
16187
16428
  }
@@ -16291,11 +16532,23 @@ function partProblems(elements, tree, handlers, sources, pages = [], model = nul
16291
16532
  say("part_handler_missing", pointer2, `calls "${name}" with ${prop}, which data.app.handlers does not declare; declare it (a ${either3(roles)} handler), or drop ${prop}`);
16292
16533
  } else if (!roles.includes(handlers[name]?.role)) {
16293
16534
  say("part_handler_missing", pointer2, `calls "${name}" with ${prop}, and it has role ${handlers[name]?.role ?? "none"}; ${prop} calls a ${either3(roles)} handler`);
16535
+ } else if (ROWLESS_EVENTS.has(`${type}.${prop}`)) {
16536
+ const refused = rowlessRefusal(name, handlers);
16537
+ if (refused) say("part_handler_missing", pointer2, `calls "${name}" with ${prop}, ${refused}`);
16294
16538
  }
16295
16539
  }
16296
16540
  }
16297
16541
  return problems;
16298
16542
  }
16543
+ var ROWLESS_EVENTS = /* @__PURE__ */ new Set(["button.on_click", "empty_state.on_action"]);
16544
+ function rowlessRefusal(name, handlers) {
16545
+ const row = handlers[name] ?? {};
16546
+ const required = Array.isArray(row.required) ? row.required.filter(named4) : [];
16547
+ if (row.role === "submit" && required.length > 0) {
16548
+ return `a submit handler that requires ${required.map((key) => `"${key}"`).join(", ")}, and the part posts none of them \u2014 it would refuse every click; call a custom handler, or a submit with nothing required`;
16549
+ }
16550
+ return null;
16551
+ }
16299
16552
  function fillChartFormats(elements, handlers, model) {
16300
16553
  let out = null;
16301
16554
  for (const uid of Object.keys(elements)) {
@@ -17797,6 +18050,13 @@ function pageHtml(contract, page, elements, tree, model, { runtime, uiKit, chart
17797
18050
  // moves v4's order; an app theme declares on the body, so it still
17798
18051
  // wins, as an org palette (inline on <html>) does. The icon font only
17799
18052
  // on a page that draws a `dr-icon-*`.
18053
+ // dr-components 1.2.0's badge draws the platform's
18054
+ // `--dr-color-badge-*` colours, which ui-kit/v4 does not carry: the
18055
+ // compiler's `ui/dr-badges.css` (platformBadges.mjs), only on a page that
18056
+ // holds one. Not dr-tokens' whole tokens.css: it re-declares eight
18057
+ // variables v4 sets (#581 review), and a grid would read differently on
18058
+ // a page with a badge. Every name it declares is one v4 lacks.
18059
+ ...tokensOn(page, elements) ? [`<link rel="stylesheet" href="./${BADGES_FILE.slice("ui/".length)}">`] : [],
17800
18060
  `<link rel="stylesheet" href="./${PALETTE_FILE.slice("ui/".length)}">`,
17801
18061
  ...iconsOn(page, elements, extra) ? [`<link rel="stylesheet" href="${CLIMB}vendor/${TOKENS}/icons/dr-icons.css">`] : [],
17802
18062
  ...chartScripts(page, elements, { charts, fmt }),
@@ -17851,6 +18111,10 @@ function widgetsOn(page, elements) {
17851
18111
  return Object.keys(elements).sort(natural3).map((uid) => elements[uid]).filter((element) => element?.page === page.path && element.type === "widget");
17852
18112
  }
17853
18113
  var ICON_RE = /(^|[^a-z0-9-])dr-icon-[a-z0-9]/;
18114
+ var TOKEN_PARTS = /* @__PURE__ */ new Set(["badge"]);
18115
+ function tokensOn(page, elements) {
18116
+ return Object.values(elements).some((element) => element?.page === page.path && TOKEN_PARTS.has(element.type));
18117
+ }
17854
18118
  function iconsOn(page, elements, extra) {
17855
18119
  for (const element of Object.values(elements)) {
17856
18120
  if (element?.page !== page.path) continue;
@@ -19371,9 +19635,9 @@ function parseAttrs2(raw) {
19371
19635
 
19372
19636
  // ../flows/appspace-builder/kit/contract/components.gen.mjs
19373
19637
  var REGISTRY_VERSION2 = Object.freeze(8);
19374
- 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"]);
19375
- 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"]);
19376
- 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"]);
19638
+ 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"]);
19639
+ 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"]);
19640
+ 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"]);
19377
19641
  var DASHBOARD_TYPES2 = Object.freeze(["region", "grid", "control", "nav", "tab", "slot"]);
19378
19642
  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"]);
19379
19643
  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"]]);
@@ -19386,18 +19650,22 @@ var NEGATIVE_MODES3 = Object.freeze(["minus", "red_minus", "absolute", "red_abso
19386
19650
  var FORMAT_PATTERNS3 = Object.freeze({ "currency": "$#,###", "number": "#,###", "percent": '#,###.#"%"' });
19387
19651
  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" });
19388
19652
  var ROW_ACTION_WHEN3 = Object.freeze({ "dr-components": "1.2.0" });
19389
- 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" });
19653
+ 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" });
19390
19654
  var STAT_TONES3 = Object.freeze(["default", "positive", "warning", "negative"]);
19391
19655
  var WIDGET_KINDS4 = Object.freeze(["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative"]);
19392
19656
  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"] });
19393
- 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"]);
19394
- 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"], "description": "data-dr-kind on an app page, the widget kind on a dashboard" }, "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" }, "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" } } } });
19657
+ var APP_WIDGET_KINDS4 = Object.freeze(["waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"]);
19658
+ 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"] });
19659
+ var SMART_COMPARES3 = Object.freeze(["BvA", "AvF", "vs_prev_period"]);
19660
+ var PLATFORM_FINANCE3 = Object.freeze({ "dr-app-widgets": "1.2.0" });
19661
+ 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"]);
19662
+ 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" } } } });
19395
19663
  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"]);
19396
19664
  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" } } } });
19397
19665
  var CONTROLS_TYPES2 = Object.freeze(["slider"]);
19398
- 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"], "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 } });
19666
+ 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 } });
19399
19667
  var TITLED_TYPES2 = Object.freeze(["widget", "form", "list", "queue", "stat", "chart", "custom", "number_input", "select", "date_picker", "dialog"]);
19400
- var CONTROL_PARTS2 = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider"]);
19668
+ var CONTROL_PARTS2 = Object.freeze(["number_input", "select", "date_picker", "toggle", "control_group", "slider", "checkbox", "radio_group"]);
19401
19669
 
19402
19670
  // ../flows/appspace-builder/kit/contract/bundleScan.mjs
19403
19671
  var COMPONENT_ATTR2 = "data-dr-component";
@@ -19416,6 +19684,22 @@ var MODULE_RE2 = /^components\/[a-z][a-z0-9_-]*\.js$/;
19416
19684
  var CHART_KINDS6 = CHART_KINDS5;
19417
19685
  var WIDGET_KINDS5 = WIDGET_KINDS4;
19418
19686
  var PLATFORM_FORMAT_RE2 = new RegExp(PLATFORM_FORMAT2.pattern, "u");
19687
+ var semver2 = (version) => String(version ?? "").split(".").map((part) => Number.parseInt(part, 10) || 0);
19688
+ var APP_WIDGET_KINDS5 = APP_WIDGET_KINDS4;
19689
+ var PLATFORM_FINANCE4 = PLATFORM_FINANCE3;
19690
+ function drawsFinanceKinds2(pin) {
19691
+ return reaches2(pin, PLATFORM_FINANCE4);
19692
+ }
19693
+ function reaches2(pin, table) {
19694
+ const at = String(pin ?? "").lastIndexOf("@");
19695
+ const module = at > 0 ? pin.slice(0, at) : String(pin ?? "");
19696
+ const first = table[module];
19697
+ if (typeof first !== "string") return false;
19698
+ if (!/^\d+\.\d+\.\d+$/.test(pin.slice(at + 1))) return false;
19699
+ const [a, b] = [semver2(pin.slice(at + 1)), semver2(first)];
19700
+ for (let i = 0; i < 3; i++) if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
19701
+ return true;
19702
+ }
19419
19703
  var COMPONENT_PROPS5 = COMPONENT_PROPS4;
19420
19704
  var STRUCTURED_ATTRIBUTES4 = STRUCTURED_ATTRIBUTES3;
19421
19705
  var OWN_RULES2 = /* @__PURE__ */ new Set(["filter", "args", "props", "declares"]);
@@ -22268,6 +22552,13 @@ var DRAWS = {
22268
22552
  }
22269
22553
  };
22270
22554
  var VOCABULARY = "data-dr-";
22555
+ function widgetsPinOn(contract, page) {
22556
+ for (const pin of Array.isArray(contract?.pins) ? contract.pins : []) {
22557
+ if (pin?.module !== "dr-app-widgets" || typeof pin.version !== "string") continue;
22558
+ if (!Array.isArray(pin.pages) || pin.pages.includes(page)) return pin.version;
22559
+ }
22560
+ return null;
22561
+ }
22271
22562
  function checkComponents(app, contract, contractError) {
22272
22563
  const violations = [];
22273
22564
  const skipped = [];
@@ -22352,12 +22643,22 @@ function checkComponents(app, contract, contractError) {
22352
22643
  message: `this chart's data-dr-kind is "${kind}", which is not one a chart draws; use ${CHART_KINDS6.join(", ")}`
22353
22644
  });
22354
22645
  }
22355
- if (element.type === "widget" && kind !== void 0 && kind !== null && kind !== "" && !WIDGET_KINDS5.includes(kind)) {
22646
+ const kinds = [...WIDGET_KINDS5, ...APP_WIDGET_KINDS5];
22647
+ if (element.type === "widget" && kind !== void 0 && kind !== null && kind !== "" && !kinds.includes(kind)) {
22356
22648
  violations.push({
22357
22649
  rule: draws.rule,
22358
22650
  where: uid,
22359
- message: `this widget card's data-dr-kind is "${kind}", which is not one dr-app-widgets draws; use ${WIDGET_KINDS5.join(", ")}, or leave it out and the payload decides`
22651
+ message: `this widget card's data-dr-kind is "${kind}", which is not one dr-app-widgets draws; use ${kinds.join(", ")}, or leave it out and the payload decides`
22360
22652
  });
22653
+ } else if (element.type === "widget" && APP_WIDGET_KINDS5.includes(kind)) {
22654
+ const loaded = widgetsPinOn(contract, element.page);
22655
+ if (loaded === null || !drawsFinanceKinds2(`dr-app-widgets@${loaded}`)) {
22656
+ violations.push({
22657
+ rule: draws.rule,
22658
+ where: uid,
22659
+ message: `this widget card's data-dr-kind is "${kind}", a finance kind, and its page loads ${loaded === null ? "no dr-app-widgets" : `dr-app-widgets@${loaded}`}; it needs dr-app-widgets@${PLATFORM_FINANCE4["dr-app-widgets"]} \u2014 compile the page again with the current CLI, or use ${WIDGET_KINDS5.join(", ")}`
22660
+ });
22661
+ }
22361
22662
  }
22362
22663
  const module = element.props?.module;
22363
22664
  if (element.type === "custom" && !MODULE_RE2.test(module)) {
@@ -22448,6 +22749,16 @@ function checkComponents(app, contract, contractError) {
22448
22749
  for (const found of stepsWithoutAction2(contract)) {
22449
22750
  violations.push({ rule: "A3.29", where: found.uid, message: found.message });
22450
22751
  }
22752
+ const HANDLER_KEYS2 = /* @__PURE__ */ new Set(["on_click", "on_action", "on_upload", "on_confirm", "on_row", "call", "action"]);
22753
+ const refsIn = (node) => {
22754
+ if (Array.isArray(node)) return node.forEach(refsIn);
22755
+ if (node === null || typeof node !== "object") return;
22756
+ for (const [key, value] of Object.entries(node)) {
22757
+ if (HANDLER_KEYS2.has(key) && typeof value === "string" && value !== "") attributeRefs.add(value);
22758
+ else refsIn(value);
22759
+ }
22760
+ };
22761
+ for (const uid of uids) if (isPart4(elements[uid])) refsIn(elements[uid].props?.props);
22451
22762
  for (const uid of uids) {
22452
22763
  const element = elements[uid];
22453
22764
  if (element.type !== "custom" || typeof element.props?.module !== "string") continue;
@@ -24122,9 +24433,9 @@ var kit_default2 = {
24122
24433
  checks: "checks/run.mjs",
24123
24434
  contract: "contract/extract.mjs",
24124
24435
  charts: "echarts@5.6.0",
24125
- appWidgets: "dr-app-widgets@1.1.0",
24126
- appComponents: "dr-components@1.1.1",
24127
- appControls: "dr-components-controls@1.0.1"
24436
+ appWidgets: "dr-app-widgets@1.2.0",
24437
+ appComponents: "dr-components@1.2.0",
24438
+ appControls: "dr-components-controls@1.1.0"
24128
24439
  };
24129
24440
 
24130
24441
  // src/commands/appspace/compile.ts
@@ -24369,6 +24680,10 @@ async function afterWrite(dir, target, kind, contract, built, report, kit, skipp
24369
24680
  return 2;
24370
24681
  }
24371
24682
  report.verify = runVerify(target, kind, report.app_id, kit);
24683
+ report.verify.warnings = [
24684
+ ...(built.warnings ?? []).map((one) => `${one.code} ${one.pointer ?? "/"}: ${one.message}`),
24685
+ ...report.verify.warnings ?? []
24686
+ ];
24372
24687
  if ((report.verify.violations ?? 0) > 0) {
24373
24688
  report.failure = "kit-violations";
24374
24689
  await writeReport(dir, report);