@datarails-ai/dr-appspace-cli 0.10.9 → 0.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +168 -29
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { fileURLToPath as fileURLToPath6 } from "url";
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "@datarails-ai/dr-appspace-cli",
|
|
16
|
-
version: "0.10.
|
|
16
|
+
version: "0.10.10",
|
|
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-
|
|
60
|
+
var BUILD_TIME = "2026-10-01T07:13:05.309Z";
|
|
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,
|
|
@@ -5953,8 +5957,12 @@ var MODULE_OF = Object.freeze({ "widget": "dr-app-widgets", "form": "dr-app-runt
|
|
|
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"] });
|
|
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" });
|
|
5956
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"]);
|
|
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" } } } });
|
|
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" } } } });
|
|
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"]);
|
|
@@ -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 =
|
|
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();
|
|
@@ -10251,7 +10272,7 @@ var contract_schema_default = {
|
|
|
10251
10272
|
},
|
|
10252
10273
|
props_region: { type: "object", properties: {} },
|
|
10253
10274
|
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" } } },
|
|
10275
|
+
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
10276
|
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
10277
|
props_nav: { type: "object", properties: { aria_label: { type: "string", description: "the nav's accessible name" } } },
|
|
10257
10278
|
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" } } },
|
|
@@ -11837,7 +11858,7 @@ function checkAppCards(doc, problems) {
|
|
|
11837
11858
|
}
|
|
11838
11859
|
const name = typeof props["source"] === "string" && props["source"] !== "" ? props["source"] : null;
|
|
11839
11860
|
const kind = typeof props["kind"] === "string" ? props["kind"] : "breakdown";
|
|
11840
|
-
const shape = (KIND_READS3[kind] ?? ["breakdown"])[0] ?? "breakdown";
|
|
11861
|
+
const shape = (KIND_READS3[kind] ?? APP_KIND_READS3[kind] ?? ["breakdown"])[0] ?? "breakdown";
|
|
11841
11862
|
if (name === null) {
|
|
11842
11863
|
problems.push({
|
|
11843
11864
|
code: "missing-prop",
|
|
@@ -14185,7 +14206,7 @@ var UI_KIT2 = "ui-kit/v4";
|
|
|
14185
14206
|
var CHARTS = "echarts@5.6.0";
|
|
14186
14207
|
var FMT = "dr-fmt@2.0.1";
|
|
14187
14208
|
var TOKENS = "dr-tokens@1.0.0";
|
|
14188
|
-
var WIDGETS = "dr-app-widgets@1.
|
|
14209
|
+
var WIDGETS = "dr-app-widgets@1.2.0";
|
|
14189
14210
|
var COMPONENTS = "dr-components@1.1.1";
|
|
14190
14211
|
var CONTROLS = "dr-components-controls@1.0.1";
|
|
14191
14212
|
var PART_FILES = {
|
|
@@ -15101,9 +15122,11 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
|
|
|
15101
15122
|
problems.push(...numberProblems(declared));
|
|
15102
15123
|
problems.push(...numberPinProblems(declared, { "dr-app-runtime": runtime, "dr-app-widgets": appWidgets, "dr-components": appComponents, "dr-components-controls": appControls }));
|
|
15103
15124
|
problems.push(...whenPinProblems(declared, { "dr-components": appComponents }));
|
|
15104
|
-
|
|
15125
|
+
const widgetFindings = tree.problems.length === 0 ? widgetProblems(declared, tree, handlers, contract?.data?.sources, appWidgets) : [];
|
|
15126
|
+
const warnings = widgetFindings.filter((one) => one.advisory).map(({ advisory: _advisory, ...one }) => one);
|
|
15127
|
+
problems.push(...widgetFindings.filter((one) => !one.advisory));
|
|
15105
15128
|
if (tree.problems.length === 0) problems.push(...partProblems(declared, tree, handlers, sources, contract?.pages, model));
|
|
15106
|
-
if (problems.length > 0) return { files: {}, problems, contract };
|
|
15129
|
+
if (problems.length > 0) return { files: {}, problems, contract, warnings };
|
|
15107
15130
|
if (sources !== stated2) contract = { ...contract, data: { ...contract.data, sources } };
|
|
15108
15131
|
const parented = dropEmptyArgs(fillChartFormats(fillParents(declared, tree), handlers, model));
|
|
15109
15132
|
const headed = fillHeaders(contract, parented);
|
|
@@ -15113,7 +15136,7 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
|
|
|
15113
15136
|
if (themed.app !== app) contract = { ...contract, app: themed.app };
|
|
15114
15137
|
const order2 = emittedOrder(contract, elements, pages, tree);
|
|
15115
15138
|
problems.push(...placementProblems(elements, pages, tree, order2));
|
|
15116
|
-
if (problems.length > 0) return { files: {}, problems, contract };
|
|
15139
|
+
if (problems.length > 0) return { files: {}, problems, contract, warnings };
|
|
15117
15140
|
const whole = restate(contract, elements, pages, typed, order2);
|
|
15118
15141
|
const served = servedSources(elements, sources);
|
|
15119
15142
|
const transforms = transformTexts2(sources, extra);
|
|
@@ -15135,7 +15158,7 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
|
|
|
15135
15158
|
}
|
|
15136
15159
|
if (typeof extra["seed.json"] === "string") files["seed.json"] = extra["seed.json"];
|
|
15137
15160
|
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 };
|
|
15161
|
+
return { files, problems, contract: whole, order: order2, warnings };
|
|
15139
15162
|
}
|
|
15140
15163
|
function restate(contract, elements, pages, typed, order2) {
|
|
15141
15164
|
const data = dropEmptyDashboardData(contract.data);
|
|
@@ -15907,8 +15930,8 @@ function whenPinProblems(elements, pins) {
|
|
|
15907
15930
|
return problems;
|
|
15908
15931
|
}
|
|
15909
15932
|
function pinAtLeast(pin, first) {
|
|
15910
|
-
const
|
|
15911
|
-
const [a, b] = [
|
|
15933
|
+
const semver3 = (v) => String(v).split(".").map((n) => Number.parseInt(n, 10) || 0);
|
|
15934
|
+
const [a, b] = [semver3(pin.slice(pin.lastIndexOf("@") + 1)), semver3(first)];
|
|
15912
15935
|
for (let i = 0; i < 3; i++) if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
|
|
15913
15936
|
return true;
|
|
15914
15937
|
}
|
|
@@ -15991,7 +16014,19 @@ function chartProblems(elements, tree, handlers, model) {
|
|
|
15991
16014
|
return problems;
|
|
15992
16015
|
}
|
|
15993
16016
|
var WIDGET_SOURCE_ROLES = ["custom"];
|
|
15994
|
-
|
|
16017
|
+
var TYPED_WIDGET_PROPS = Object.freeze(Object.keys(PROPS_SCHEMAS.widget?.properties?.props?.properties ?? {}));
|
|
16018
|
+
var TYPED_PROP_KINDS = Object.freeze({
|
|
16019
|
+
variant: ["smart"],
|
|
16020
|
+
compare: ["smart"],
|
|
16021
|
+
color_rule: ["smart", "gauge"],
|
|
16022
|
+
goal: ["gauge"],
|
|
16023
|
+
total: ["waterfall", "waterfall-walkthrough"],
|
|
16024
|
+
variance: ["waterfall-breakdown"],
|
|
16025
|
+
forecast_from: ["line-forecast"],
|
|
16026
|
+
dual_axis: ["combo"]
|
|
16027
|
+
});
|
|
16028
|
+
var ORDERED_KINDS = Object.freeze(["waterfall", "waterfall-breakdown", "waterfall-walkthrough"]);
|
|
16029
|
+
function widgetProblems(elements, tree, handlers, sources, widgetsPin = WIDGETS) {
|
|
15995
16030
|
const problems = [];
|
|
15996
16031
|
const declaredSources = isPlainObject7(sources) ? sources : {};
|
|
15997
16032
|
for (const uid of Object.keys(elements).sort(natural3)) {
|
|
@@ -16008,17 +16043,77 @@ function widgetProblems(elements, tree, handlers, sources) {
|
|
|
16008
16043
|
);
|
|
16009
16044
|
continue;
|
|
16010
16045
|
}
|
|
16011
|
-
|
|
16012
|
-
|
|
16046
|
+
const kinds = [...WIDGET_KINDS2, ...APP_WIDGET_KINDS2];
|
|
16047
|
+
if (props.kind !== void 0 && props.kind !== null && !kinds.includes(props.kind)) {
|
|
16048
|
+
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`);
|
|
16049
|
+
continue;
|
|
16050
|
+
}
|
|
16051
|
+
const given = (value) => value !== void 0 && value !== null && value !== "";
|
|
16052
|
+
const at = (key) => `props/${key}`;
|
|
16053
|
+
const flat = TYPED_WIDGET_PROPS.filter((key) => given(props[key]));
|
|
16054
|
+
if (flat.length > 0) {
|
|
16055
|
+
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`);
|
|
16056
|
+
continue;
|
|
16057
|
+
}
|
|
16058
|
+
if (given(props.props) && !isPlainObject7(props.props)) {
|
|
16059
|
+
mismatch("props", `states props ${JSON.stringify(props.props)}; a widget's typed props are an object ({"props": {"goal": 1000}}), written as data-dr-props`);
|
|
16060
|
+
continue;
|
|
16061
|
+
}
|
|
16062
|
+
const typed = isPlainObject7(props.props) ? props.props : {};
|
|
16063
|
+
const finance = APP_WIDGET_KINDS2.includes(props.kind);
|
|
16064
|
+
const smart = given(typed.variant) || given(typed.compare);
|
|
16065
|
+
const pinned = String(widgetsPin ?? "").slice(String(widgetsPin ?? "").lastIndexOf("@") + 1);
|
|
16066
|
+
const need = `dr-app-widgets@${PLATFORM_FINANCE2["dr-app-widgets"]}`;
|
|
16067
|
+
if ((finance || given(props.props)) && !drawsFinanceKinds(widgetsPin)) {
|
|
16068
|
+
const what = finance ? `kind ${JSON.stringify(props.kind)}` : smart ? "a smart kpi (props.variant, props.compare)" : "typed props (props.props)";
|
|
16069
|
+
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`);
|
|
16070
|
+
continue;
|
|
16071
|
+
}
|
|
16072
|
+
if (given(typed.aggregation) || given(props.aggregation)) {
|
|
16073
|
+
mismatch(
|
|
16074
|
+
given(typed.aggregation) ? at("aggregation") : "aggregation",
|
|
16075
|
+
`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`
|
|
16076
|
+
);
|
|
16077
|
+
continue;
|
|
16078
|
+
}
|
|
16079
|
+
if (typed.compare === "vs_prev_year") {
|
|
16080
|
+
mismatch(at("compare"), `states compare "vs_prev_year", and no source computes a year-ago delta yet \u2014 use ${either3(SMART_COMPARES2)}`);
|
|
16081
|
+
continue;
|
|
16082
|
+
}
|
|
16083
|
+
const typeLines = validate2(typed, PROPS_SCHEMAS.widget?.properties?.props ?? {});
|
|
16084
|
+
if (typeLines.length > 0) {
|
|
16085
|
+
const line = typeLines[0];
|
|
16086
|
+
const split2 = line.indexOf(": ");
|
|
16087
|
+
const where2 = line.slice(0, split2);
|
|
16088
|
+
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)})`);
|
|
16089
|
+
continue;
|
|
16090
|
+
}
|
|
16091
|
+
if (smart && (typed.variant !== "smart" || stated(props.kind) && props.kind !== "kpi")) {
|
|
16092
|
+
mismatch(
|
|
16093
|
+
given(typed.variant) && typed.variant !== "smart" ? at("variant") : stated(props.kind) && props.kind !== "kpi" ? "kind" : at("compare"),
|
|
16094
|
+
`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`
|
|
16095
|
+
);
|
|
16096
|
+
continue;
|
|
16097
|
+
}
|
|
16098
|
+
const drawnAs = smart ? "smart" : stated(props.kind) ? props.kind : null;
|
|
16099
|
+
const stray = Object.keys(typed).find((key) => !(TYPED_PROP_KINDS[key] ?? []).includes(drawnAs));
|
|
16100
|
+
if (stray !== void 0) {
|
|
16101
|
+
const owners = TYPED_PROP_KINDS[stray] ?? [];
|
|
16102
|
+
mismatch(
|
|
16103
|
+
at(stray),
|
|
16104
|
+
`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`
|
|
16105
|
+
);
|
|
16013
16106
|
continue;
|
|
16014
16107
|
}
|
|
16015
16108
|
if (!stated(props.source)) {
|
|
16016
16109
|
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
16110
|
continue;
|
|
16018
16111
|
}
|
|
16019
|
-
|
|
16112
|
+
const source = declaredSources[props.source];
|
|
16113
|
+
const handled = Object.prototype.hasOwnProperty.call(handlers, props.source);
|
|
16114
|
+
if (!handled && !isPlainObject7(source)) continue;
|
|
16020
16115
|
const row = handlers[props.source] ?? {};
|
|
16021
|
-
if (!WIDGET_SOURCE_ROLES.includes(row.role)) {
|
|
16116
|
+
if (handled && !WIDGET_SOURCE_ROLES.includes(row.role)) {
|
|
16022
16117
|
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
16118
|
mismatch(
|
|
16024
16119
|
"source",
|
|
@@ -16026,20 +16121,23 @@ function widgetProblems(elements, tree, handlers, sources) {
|
|
|
16026
16121
|
);
|
|
16027
16122
|
continue;
|
|
16028
16123
|
}
|
|
16029
|
-
const source = declaredSources[props.source];
|
|
16030
16124
|
if (!isPlainObject7(source)) continue;
|
|
16031
16125
|
const shape = named4(source.shape) ? source.shape : "rows";
|
|
16126
|
+
const legacy = !finance;
|
|
16127
|
+
const shaped = (message) => problems.push({ code: "widget_source_shape", pointer: `/elements/${escapePointer3(uid)}/props/source`, message: `widget "${uid}" ${message}`, ...legacy ? { advisory: true } : {} });
|
|
16032
16128
|
if (shape === "rows") {
|
|
16033
|
-
|
|
16129
|
+
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
16130
|
continue;
|
|
16035
16131
|
}
|
|
16036
16132
|
if (!stated(props.kind)) continue;
|
|
16037
|
-
const reads = KIND_READS2[props.kind] ?? [];
|
|
16133
|
+
const reads = KIND_READS2[props.kind] ?? APP_KIND_READS2[props.kind] ?? [];
|
|
16038
16134
|
if (!reads.includes(shape)) {
|
|
16039
|
-
|
|
16040
|
-
|
|
16041
|
-
|
|
16042
|
-
|
|
16135
|
+
shaped(`draws ${props.kind}, and source "${props.source}" answers ${shape} (its shape); give the source the shape ${reads.join(" or ")}`);
|
|
16136
|
+
continue;
|
|
16137
|
+
}
|
|
16138
|
+
if (ORDERED_KINDS.includes(props.kind) && shape === "breakdown") {
|
|
16139
|
+
shaped(
|
|
16140
|
+
`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
16141
|
);
|
|
16044
16142
|
}
|
|
16045
16143
|
}
|
|
@@ -19390,8 +19488,12 @@ var MODULE_OF3 = Object.freeze({ "widget": "dr-app-widgets", "form": "dr-app-run
|
|
|
19390
19488
|
var STAT_TONES3 = Object.freeze(["default", "positive", "warning", "negative"]);
|
|
19391
19489
|
var WIDGET_KINDS4 = Object.freeze(["line", "area", "bar", "stacked", "pie", "donut", "kpi", "candle", "bubble", "table", "narrative"]);
|
|
19392
19490
|
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"] });
|
|
19491
|
+
var APP_WIDGET_KINDS4 = Object.freeze(["waterfall", "waterfall-breakdown", "waterfall-walkthrough", "line-forecast", "heatmap", "combo", "stacked-percent", "gauge"]);
|
|
19492
|
+
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"] });
|
|
19493
|
+
var SMART_COMPARES3 = Object.freeze(["BvA", "AvF", "vs_prev_period"]);
|
|
19494
|
+
var PLATFORM_FINANCE3 = Object.freeze({ "dr-app-widgets": "1.2.0" });
|
|
19393
19495
|
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" } } } });
|
|
19496
|
+
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" } } } });
|
|
19395
19497
|
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
19498
|
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
19499
|
var CONTROLS_TYPES2 = Object.freeze(["slider"]);
|
|
@@ -19416,6 +19518,22 @@ var MODULE_RE2 = /^components\/[a-z][a-z0-9_-]*\.js$/;
|
|
|
19416
19518
|
var CHART_KINDS6 = CHART_KINDS5;
|
|
19417
19519
|
var WIDGET_KINDS5 = WIDGET_KINDS4;
|
|
19418
19520
|
var PLATFORM_FORMAT_RE2 = new RegExp(PLATFORM_FORMAT2.pattern, "u");
|
|
19521
|
+
var semver2 = (version) => String(version ?? "").split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
19522
|
+
var APP_WIDGET_KINDS5 = APP_WIDGET_KINDS4;
|
|
19523
|
+
var PLATFORM_FINANCE4 = PLATFORM_FINANCE3;
|
|
19524
|
+
function drawsFinanceKinds2(pin) {
|
|
19525
|
+
return reaches2(pin, PLATFORM_FINANCE4);
|
|
19526
|
+
}
|
|
19527
|
+
function reaches2(pin, table) {
|
|
19528
|
+
const at = String(pin ?? "").lastIndexOf("@");
|
|
19529
|
+
const module = at > 0 ? pin.slice(0, at) : String(pin ?? "");
|
|
19530
|
+
const first = table[module];
|
|
19531
|
+
if (typeof first !== "string") return false;
|
|
19532
|
+
if (!/^\d+\.\d+\.\d+$/.test(pin.slice(at + 1))) return false;
|
|
19533
|
+
const [a, b] = [semver2(pin.slice(at + 1)), semver2(first)];
|
|
19534
|
+
for (let i = 0; i < 3; i++) if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
|
|
19535
|
+
return true;
|
|
19536
|
+
}
|
|
19419
19537
|
var COMPONENT_PROPS5 = COMPONENT_PROPS4;
|
|
19420
19538
|
var STRUCTURED_ATTRIBUTES4 = STRUCTURED_ATTRIBUTES3;
|
|
19421
19539
|
var OWN_RULES2 = /* @__PURE__ */ new Set(["filter", "args", "props", "declares"]);
|
|
@@ -22268,6 +22386,13 @@ var DRAWS = {
|
|
|
22268
22386
|
}
|
|
22269
22387
|
};
|
|
22270
22388
|
var VOCABULARY = "data-dr-";
|
|
22389
|
+
function widgetsPinOn(contract, page) {
|
|
22390
|
+
for (const pin of Array.isArray(contract?.pins) ? contract.pins : []) {
|
|
22391
|
+
if (pin?.module !== "dr-app-widgets" || typeof pin.version !== "string") continue;
|
|
22392
|
+
if (!Array.isArray(pin.pages) || pin.pages.includes(page)) return pin.version;
|
|
22393
|
+
}
|
|
22394
|
+
return null;
|
|
22395
|
+
}
|
|
22271
22396
|
function checkComponents(app, contract, contractError) {
|
|
22272
22397
|
const violations = [];
|
|
22273
22398
|
const skipped = [];
|
|
@@ -22352,12 +22477,22 @@ function checkComponents(app, contract, contractError) {
|
|
|
22352
22477
|
message: `this chart's data-dr-kind is "${kind}", which is not one a chart draws; use ${CHART_KINDS6.join(", ")}`
|
|
22353
22478
|
});
|
|
22354
22479
|
}
|
|
22355
|
-
|
|
22480
|
+
const kinds = [...WIDGET_KINDS5, ...APP_WIDGET_KINDS5];
|
|
22481
|
+
if (element.type === "widget" && kind !== void 0 && kind !== null && kind !== "" && !kinds.includes(kind)) {
|
|
22356
22482
|
violations.push({
|
|
22357
22483
|
rule: draws.rule,
|
|
22358
22484
|
where: uid,
|
|
22359
|
-
message: `this widget card's data-dr-kind is "${kind}", which is not one dr-app-widgets draws; use ${
|
|
22485
|
+
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
22486
|
});
|
|
22487
|
+
} else if (element.type === "widget" && APP_WIDGET_KINDS5.includes(kind)) {
|
|
22488
|
+
const loaded = widgetsPinOn(contract, element.page);
|
|
22489
|
+
if (loaded === null || !drawsFinanceKinds2(`dr-app-widgets@${loaded}`)) {
|
|
22490
|
+
violations.push({
|
|
22491
|
+
rule: draws.rule,
|
|
22492
|
+
where: uid,
|
|
22493
|
+
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(", ")}`
|
|
22494
|
+
});
|
|
22495
|
+
}
|
|
22361
22496
|
}
|
|
22362
22497
|
const module = element.props?.module;
|
|
22363
22498
|
if (element.type === "custom" && !MODULE_RE2.test(module)) {
|
|
@@ -24122,7 +24257,7 @@ var kit_default2 = {
|
|
|
24122
24257
|
checks: "checks/run.mjs",
|
|
24123
24258
|
contract: "contract/extract.mjs",
|
|
24124
24259
|
charts: "echarts@5.6.0",
|
|
24125
|
-
appWidgets: "dr-app-widgets@1.
|
|
24260
|
+
appWidgets: "dr-app-widgets@1.2.0",
|
|
24126
24261
|
appComponents: "dr-components@1.1.1",
|
|
24127
24262
|
appControls: "dr-components-controls@1.0.1"
|
|
24128
24263
|
};
|
|
@@ -24369,6 +24504,10 @@ async function afterWrite(dir, target, kind, contract, built, report, kit, skipp
|
|
|
24369
24504
|
return 2;
|
|
24370
24505
|
}
|
|
24371
24506
|
report.verify = runVerify(target, kind, report.app_id, kit);
|
|
24507
|
+
report.verify.warnings = [
|
|
24508
|
+
...(built.warnings ?? []).map((one) => `${one.code} ${one.pointer ?? "/"}: ${one.message}`),
|
|
24509
|
+
...report.verify.warnings ?? []
|
|
24510
|
+
];
|
|
24372
24511
|
if ((report.verify.violations ?? 0) > 0) {
|
|
24373
24512
|
report.failure = "kit-violations";
|
|
24374
24513
|
await writeReport(dir, report);
|