@qoretechnologies/reqraft 0.10.36 → 0.10.37-pr.95.g4e65c57
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/components/codeSize/index.d.ts +37 -0
- package/dist/components/codeSize/index.d.ts.map +1 -0
- package/dist/components/codeSize/index.js +87 -0
- package/dist/components/codeSize/index.js.map +1 -0
- package/dist/components/form/engine/CompactRow.d.ts +6 -1
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +259 -19
- package/dist/components/form/engine/CompactRow.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +20 -0
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +137 -24
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +37 -0
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -0
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +307 -0
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -0
- package/dist/components/form/engine/compactRowStyles.d.ts +13 -0
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +30 -5
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts +66 -1
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +175 -5
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.js +51 -21
- package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.js +42 -25
- package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +4 -0
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +8 -1
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/helpers/validations.d.ts +14 -0
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +58 -3
- package/dist/helpers/validations.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/codeSize/index.tsx +79 -0
- package/src/components/form/engine/CompactRow.tsx +313 -24
- package/src/components/form/engine/FormEngine.stories.tsx +487 -14
- package/src/components/form/engine/FormEngine.tsx +142 -8
- package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +129 -0
- package/src/components/form/engine/_structuredData/SchemaDataView.tsx +594 -0
- package/src/components/form/engine/compactRowStyles.ts +44 -2
- package/src/components/form/engine/readFirst.ts +201 -5
- package/src/components/form/fields/array/ArrayAuto.tsx +35 -4
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +53 -0
- package/src/components/form/fields/array/ArrayAutoField.tsx +22 -4
- package/src/components/form/fields/auto/AutoFormField.tsx +11 -0
- package/src/helpers/validations.ts +59 -2
- package/src/index.tsx +1 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.canRenderWithSchema = exports.SchemaDataView = void 0;
|
|
11
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
+
var reqore_1 = require("@qoretechnologies/reqore");
|
|
13
|
+
var react_1 = __importDefault(require("react"));
|
|
14
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
15
|
+
var use_context_selector_1 = require("use-context-selector");
|
|
16
|
+
var compactRowContext_1 = require("../compactRowContext");
|
|
17
|
+
var compactRowStyles_1 = require("../compactRowStyles");
|
|
18
|
+
var readFirst_1 = require("../readFirst");
|
|
19
|
+
var structuredData_1 = require("./structuredData");
|
|
20
|
+
/**
|
|
21
|
+
* A read-only rendering of a value THROUGH the schema that describes it.
|
|
22
|
+
*
|
|
23
|
+
* `StructuredDataView` renders data nobody has described: it has to announce
|
|
24
|
+
* what it found ("Object · 2 fields"), print raw keys, and colour values by
|
|
25
|
+
* inferred type, because inference is all it has. That is the right rendering
|
|
26
|
+
* for untyped data and the wrong one for ours — a form field with an
|
|
27
|
+
* `arg_schema` is a value whose shape, names and choices are all known in
|
|
28
|
+
* advance, and showing it as a data tree asks the reader to decode a structure
|
|
29
|
+
* the form already knows how to say out loud.
|
|
30
|
+
*
|
|
31
|
+
* So a described value is rendered the way the form asked for it, in the form's
|
|
32
|
+
* own clothes:
|
|
33
|
+
*
|
|
34
|
+
* - Field names use `StyledFieldLabel` (a `StyledRowLabel` in the read-only
|
|
35
|
+
* eyebrow treatment) and values use `StyledRowValue` — the very components the
|
|
36
|
+
* option rows above are built from. Not a copy of their CSS: a copy is a
|
|
37
|
+
* second definition of "what a form label looks like", and the two drift the
|
|
38
|
+
* first time either is touched.
|
|
39
|
+
* - Values are formatted by the same `formatOptionValue` the rows use, so an
|
|
40
|
+
* `allowed_values` entry resolves to its display name, a bool to Yes/No, a
|
|
41
|
+
* date to the app's format. The same words appear in the summary, the preview
|
|
42
|
+
* and the editor.
|
|
43
|
+
* - Fields appear in the schema's order — the order the form puts them in.
|
|
44
|
+
*
|
|
45
|
+
* A list renders as numbered items: the number sits in a left margin with a rule
|
|
46
|
+
* running down beside the fields belonging to it, and the item's first field
|
|
47
|
+
* starts on the number's own line. The rule is what makes a list of multi-field
|
|
48
|
+
* items readable — without it, "which item does this field belong to?" is
|
|
49
|
+
* answered only by counting.
|
|
50
|
+
*
|
|
51
|
+
* Two deliberate properties:
|
|
52
|
+
*
|
|
53
|
+
* - **Nothing is hidden.** A key the schema does not describe is still shown,
|
|
54
|
+
* under its raw name, after the described ones. A preview that quietly dropped
|
|
55
|
+
* data would be worse than a raw tree, not better.
|
|
56
|
+
* - **It degrades, it does not fail.** With no schema for a level, the caller
|
|
57
|
+
* keeps using `StructuredDataView` — undescribed data still deserves the
|
|
58
|
+
* renderer built for undescribed data.
|
|
59
|
+
*/
|
|
60
|
+
/** Width of the shared label column, set once on the root (see `labelColumn`). */
|
|
61
|
+
var LABEL_COL_VAR = '--schema-view-label-col';
|
|
62
|
+
var StyledSchemaView = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n min-width: 0;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 6px;\n min-width: 0;\n"])));
|
|
63
|
+
/**
|
|
64
|
+
* One list item: its number in the left margin, its fields beside it.
|
|
65
|
+
*
|
|
66
|
+
* `align-items: start` over a single grid row is what puts the first field on
|
|
67
|
+
* the number's line — the fields are one block starting at the top, not a grid
|
|
68
|
+
* row each, so nothing can push them down past their own marker.
|
|
69
|
+
*/
|
|
70
|
+
var StyledItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n column-gap: 8px;\n align-items: start;\n min-width: 0;\n"], ["\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n column-gap: 8px;\n align-items: start;\n min-width: 0;\n"])));
|
|
71
|
+
/** The item number. Furniture, so it reads quieter than the data it indexes;
|
|
72
|
+
* `tabular-nums` keeps "9." and "10." the same width. */
|
|
73
|
+
var StyledMarker = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n line-height: 20px;\n white-space: nowrap;\n"], ["\n color: ", ";\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n line-height: 20px;\n white-space: nowrap;\n"])), function (_a) {
|
|
74
|
+
var $color = _a.$color;
|
|
75
|
+
return $color;
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* The item's identifying value, set as its heading.
|
|
79
|
+
*
|
|
80
|
+
* The first field a schema declares is the one that says WHICH item this is — a
|
|
81
|
+
* method's name, a scheme's type — and it was reading as just another row: same
|
|
82
|
+
* size, same weight, sat behind its own label. Scanning seven methods meant
|
|
83
|
+
* reading fourteen lines to find seven names.
|
|
84
|
+
*
|
|
85
|
+
* Promoting the value (not the label) is what makes the list scannable: the eye
|
|
86
|
+
* lands on `init`, `onOrderStatus`, `onConnect` down the left edge, and the
|
|
87
|
+
* supporting fields stay where they were. The label is not lost, it moves to the
|
|
88
|
+
* title attribute — a heading that needs a caption is not a heading.
|
|
89
|
+
*/
|
|
90
|
+
var StyledItemTitle = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n /* An accent bar and a tinted surface, so the name is found by shape and not\n only by size \u2014 at seven items, scanning a column of identical-weight text is\n the thing this is trying to remove. The bar sits where the item's own rule\n runs, so the heading reads as the start of that item rather than as a\n decoration floating beside it. */\n display: inline-block;\n background: ", ";\n border-left: 3px solid ", ";\n border-radius: 0 4px 4px 0;\n padding: 1px 8px;\n margin-left: -11px;\n /* Outranks the field labels beneath it, which are 600 at 13px.\n One step was not enough: at 14px the name and the \"Description\" label under\n it read as the same thing, and the reported symptom was exactly that \u2014 the\n name looked like another label. Three points and a full weight above the\n labels is what separates \"which item is this\" from \"what is in it\". */\n font-weight: 700;\n font-size: 16px;\n line-height: 22px;\n margin-bottom: 3px;\n min-width: 0;\n overflow-wrap: anywhere;\n /* A literal keeps its mono face, one notch down: mono runs visually larger at\n the same pixel size, so 15px here sits level with 16px prose. */\n ", "\n"], ["\n color: ", ";\n /* An accent bar and a tinted surface, so the name is found by shape and not\n only by size \u2014 at seven items, scanning a column of identical-weight text is\n the thing this is trying to remove. The bar sits where the item's own rule\n runs, so the heading reads as the start of that item rather than as a\n decoration floating beside it. */\n display: inline-block;\n background: ", ";\n border-left: 3px solid ", ";\n border-radius: 0 4px 4px 0;\n padding: 1px 8px;\n margin-left: -11px;\n /* Outranks the field labels beneath it, which are 600 at 13px.\n One step was not enough: at 14px the name and the \"Description\" label under\n it read as the same thing, and the reported symptom was exactly that \u2014 the\n name looked like another label. Three points and a full weight above the\n labels is what separates \"which item is this\" from \"what is in it\". */\n font-weight: 700;\n font-size: 16px;\n line-height: 22px;\n margin-bottom: 3px;\n min-width: 0;\n overflow-wrap: anywhere;\n /* A literal keeps its mono face, one notch down: mono runs visually larger at\n the same pixel size, so 15px here sits level with 16px prose. */\n ", "\n"])), function (_a) {
|
|
91
|
+
var $color = _a.$color;
|
|
92
|
+
return $color;
|
|
93
|
+
}, function (_a) {
|
|
94
|
+
var $accent = _a.$accent;
|
|
95
|
+
return "".concat($accent, "1f");
|
|
96
|
+
}, function (_a) {
|
|
97
|
+
var $accent = _a.$accent;
|
|
98
|
+
return $accent;
|
|
99
|
+
}, function (_a) {
|
|
100
|
+
var $mono = _a.$mono;
|
|
101
|
+
return ($mono ? "font-family: ".concat(compactRowStyles_1.MONO_FONT_STACK, "; font-size: 15px;") : '');
|
|
102
|
+
});
|
|
103
|
+
/** The rule tying an item's fields to its number. */
|
|
104
|
+
var StyledItemFields = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-left: 1px solid ", ";\n padding-left: 10px;\n min-width: 0;\n"], ["\n border-left: 1px solid ", ";\n padding-left: 10px;\n min-width: 0;\n"])), function (_a) {
|
|
105
|
+
var $border = _a.$border;
|
|
106
|
+
return $border;
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* A record's fields: one shared label column, values in the next.
|
|
110
|
+
*
|
|
111
|
+
* The column width is a variable set once on the root, so every field of every
|
|
112
|
+
* item lines up on one edge. Sizing per record would align an item's own fields
|
|
113
|
+
* and leave the items ragged against each other, which reads as a rendering
|
|
114
|
+
* fault rather than as a list.
|
|
115
|
+
*/
|
|
116
|
+
/**
|
|
117
|
+
* A record field's name, in the detail-page vocabulary.
|
|
118
|
+
*
|
|
119
|
+
* Uppercase, tracked and dimmed, so a field name reads as furniture and the
|
|
120
|
+
* VALUE beside it is what the eye lands on. Same treatment the read-only
|
|
121
|
+
* interface panels use, which is the point: an in-editor list of records and a
|
|
122
|
+
* detail-page panel showing the same shape should not look like two components.
|
|
123
|
+
*
|
|
124
|
+
* A variant rather than a change to `StyledRowLabel`: that one is the FORM's own
|
|
125
|
+
* option-row label, and the form's fields are not read-only furniture — they are
|
|
126
|
+
* the things you are about to edit. Composing it keeps the colour, weight base
|
|
127
|
+
* and wrapping behaviour in one place instead of copying them.
|
|
128
|
+
*
|
|
129
|
+
* Applies to the label only. A VALUE is never uppercased: values are frequently
|
|
130
|
+
* case-sensitive — a service method is `onOrderStatus`, not `ONORDERSTATUS` —
|
|
131
|
+
* and the item heading is a value.
|
|
132
|
+
*/
|
|
133
|
+
var StyledFieldLabel = (0, styled_components_1.default)(compactRowStyles_1.StyledRowLabel)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-size: 12px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n opacity: 0.55;\n"], ["\n font-size: 12px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n opacity: 0.55;\n"])));
|
|
134
|
+
var StyledFields = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n /* The supporting fields step in under the heading, so the heading keeps the\n left edge to itself. This is the half that answers \"the name is written in\n the position of the label\": with the labels indented, it no longer is. */\n padding-left: 14px;\n display: grid;\n grid-template-columns: var(", ", 140px) minmax(0, 1fr);\n column-gap: 10px;\n row-gap: 2px;\n align-items: baseline;\n min-width: 0;\n\n /* A row's value truncates because a row is one line high. The preview is the\n place that shows what the row could not, so a long value wraps here instead\n of ellipsising \u2014 otherwise opening the preview would reveal exactly as\n little as the line above it. */\n .options-readfirst-valuetext {\n white-space: normal;\n overflow: visible;\n text-overflow: clip;\n overflow-wrap: anywhere;\n }\n\n /* Mono faces run visually larger than the UI face at the same pixel size, so\n a literal set at the row's 13px looks a step bolder than the label naming\n it. A hair smaller puts the two back on the same footing. */\n .schema-view-data {\n font-size: 12.5px;\n }\n"], ["\n /* The supporting fields step in under the heading, so the heading keeps the\n left edge to itself. This is the half that answers \"the name is written in\n the position of the label\": with the labels indented, it no longer is. */\n padding-left: 14px;\n display: grid;\n grid-template-columns: var(", ", 140px) minmax(0, 1fr);\n column-gap: 10px;\n row-gap: 2px;\n align-items: baseline;\n min-width: 0;\n\n /* A row's value truncates because a row is one line high. The preview is the\n place that shows what the row could not, so a long value wraps here instead\n of ellipsising \u2014 otherwise opening the preview would reveal exactly as\n little as the line above it. */\n .options-readfirst-valuetext {\n white-space: normal;\n overflow: visible;\n text-overflow: clip;\n overflow-wrap: anywhere;\n }\n\n /* Mono faces run visually larger than the UI face at the same pixel size, so\n a literal set at the row's 13px looks a step bolder than the label naming\n it. A hair smaller puts the two back on the same footing. */\n .schema-view-data {\n font-size: 12.5px;\n }\n"])), LABEL_COL_VAR);
|
|
135
|
+
/** A nested level spans both columns and indents under its own name. */
|
|
136
|
+
var StyledNested = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n grid-column: 1 / -1;\n margin-left: 2px;\n padding-left: 10px;\n border-left: 1px solid ", ";\n min-width: 0;\n"], ["\n grid-column: 1 / -1;\n margin-left: 2px;\n padding-left: 10px;\n border-left: 1px solid ", ";\n min-width: 0;\n"])), function (_a) {
|
|
137
|
+
var $border = _a.$border;
|
|
138
|
+
return $border;
|
|
139
|
+
});
|
|
140
|
+
var StyledNestedLabel = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n grid-column: 1 / -1;\n"], ["\n grid-column: 1 / -1;\n"])));
|
|
141
|
+
/** A code value is a block, not a cell: it spans the grid under its own name. */
|
|
142
|
+
var StyledCodeCell = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n grid-column: 1 / -1;\n min-width: 0;\n margin: 2px 0 4px;\n"], ["\n grid-column: 1 / -1;\n min-width: 0;\n margin: 2px 0 4px;\n"])));
|
|
143
|
+
/** Look inside a `{type, value}` envelope, once. `isUiEncodedValue` is the
|
|
144
|
+
* engine's single authority on what an envelope is — a looser test would unwrap
|
|
145
|
+
* a real user hash that happens to carry a `value` key and drop its siblings. */
|
|
146
|
+
var unwrap = function (item) { return ((0, structuredData_1.isUiEncodedValue)(item) ? item.value : item); };
|
|
147
|
+
var isRecord = function (value) {
|
|
148
|
+
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* The width of the shared label column, measured from the longest name that will
|
|
152
|
+
* actually be rendered.
|
|
153
|
+
*
|
|
154
|
+
* A fixed width is a guess in both directions: too wide and a name sits far from
|
|
155
|
+
* its value, too narrow and every name ellipsises. Measuring fits the content;
|
|
156
|
+
* the `%` ceiling stops one long name from taking the whole row when the inset
|
|
157
|
+
* is narrow — a phone, or a deeply nested level.
|
|
158
|
+
*/
|
|
159
|
+
/** Approximate rendered width of one label character, in px. See `labelColumn`. */
|
|
160
|
+
var LABEL_CHAR_PX = 9.5;
|
|
161
|
+
/** Gap to the value, so the longest label is not flush against it. */
|
|
162
|
+
var LABEL_SLACK_PX = 14;
|
|
163
|
+
var labelColumn = function (value, schema) {
|
|
164
|
+
var inner = unwrap(value);
|
|
165
|
+
var records = (Array.isArray(inner) ? inner.map(unwrap) : [inner]).filter(isRecord);
|
|
166
|
+
var longest = records.reduce(function (widest, record) {
|
|
167
|
+
var own = (0, readFirst_1.orderedKeys)(record, schema).reduce(function (max, key) {
|
|
168
|
+
return Math.max(max, (0, readFirst_1.fieldLabel)(key, schema[key]).length);
|
|
169
|
+
}, 0);
|
|
170
|
+
return Math.max(widest, own);
|
|
171
|
+
}, 0);
|
|
172
|
+
// px, not `ch`. `ch` is the base font's `0` advance and knows nothing about
|
|
173
|
+
// the label's own treatment — uppercase, semibold, `letter-spacing: 0.06em`,
|
|
174
|
+
// at 12px — so it under-measures by about a tenth. With `overflow-wrap:
|
|
175
|
+
// anywhere` on the label, an under-measured column does not ellipsise, it
|
|
176
|
+
// BREAKS THE NAME IN HALF: `LEGACY_FLAG` came out over two lines the moment
|
|
177
|
+
// the labels became uppercase. Erring high costs a few px of gap; erring low
|
|
178
|
+
// costs a broken word.
|
|
179
|
+
return longest ? "min(".concat(Math.ceil(longest * LABEL_CHAR_PX + LABEL_SLACK_PX), "px, 45%)") : '140px';
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* `true` when a value is an address a browser can open.
|
|
183
|
+
*
|
|
184
|
+
* Deliberately per VALUE, not per field: a field named `url` frequently holds
|
|
185
|
+
* something that is not one — a bare path, a regex, a template — and offering
|
|
186
|
+
* those a link promises a destination there is not.
|
|
187
|
+
*/
|
|
188
|
+
var isNavigableUrl = function (value) {
|
|
189
|
+
return typeof value === 'string' && /^(https?|wss?|ftps?):\/\//i.test(value);
|
|
190
|
+
};
|
|
191
|
+
/** One field's value, rendered the way its row above renders it. */
|
|
192
|
+
var FieldValue = function (_a) {
|
|
193
|
+
var field = _a.field, fieldSchema = _a.fieldSchema, color = _a.color;
|
|
194
|
+
var formatted = (0, readFirst_1.formatOptionValue)(field, fieldSchema);
|
|
195
|
+
// An allowed value that carries a logo shows it here too, exactly as the row
|
|
196
|
+
// above does — the preview is the same value, so it gets the same treatment.
|
|
197
|
+
var image = (0, readFirst_1.getAllowedValueImage)(field.value, fieldSchema);
|
|
198
|
+
// Data reads in mono; a chosen label does not.
|
|
199
|
+
//
|
|
200
|
+
// "qorus-session" is a literal the author typed — an identifier where the
|
|
201
|
+
// characters themselves matter, and where a proportional font makes `l`/`1`
|
|
202
|
+
// and `O`/`0` a guess. "Default RBAC" is not data at all: it is the name of a
|
|
203
|
+
// choice, written by whoever wrote the schema, and setting it in mono would
|
|
204
|
+
// dress up a label as a value. Resolving through `allowed_values` is what
|
|
205
|
+
// separates the two, and it is the same lookup that produced the text.
|
|
206
|
+
var isChosenLabel = !!(0, readFirst_1.findAllowedValueOption)(field.value, fieldSchema);
|
|
207
|
+
return ((0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowValue, { "$color": color, children: field.value === true || field.value === false ?
|
|
208
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: field.value === true ? 'success' : 'danger', label: formatted })
|
|
209
|
+
: (0, jsx_runtime_1.jsxs)("span", { className: "options-readfirst-valuetext".concat(isChosenLabel ? '' : ' schema-view-data'), style: isChosenLabel ? undefined : { fontFamily: compactRowStyles_1.MONO_FONT_STACK }, children: [image ?
|
|
210
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { image: image, size: '14px', style: { flexShrink: 0, marginRight: 6, verticalAlign: 'middle' } })
|
|
211
|
+
: null, formatted, isNavigableUrl(field.value) ?
|
|
212
|
+
// The read-only detail views make an address openable, and a
|
|
213
|
+
// preview that shows the same value should not be the one place it
|
|
214
|
+
// is inert. A real anchor, so middle-click and "copy link address"
|
|
215
|
+
// work; `stopPropagation` because the row around it toggles.
|
|
216
|
+
(0, jsx_runtime_1.jsx)("a", { className: 'schema-view-open-url', href: field.value, target: '_blank', rel: 'noreferrer noopener', "aria-label": 'Open in a new tab', style: { marginLeft: 4, verticalAlign: 'middle' }, onClick: function (event) { return event.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'ExternalLinkLine', size: '11px' }) })
|
|
217
|
+
: null] }) }));
|
|
218
|
+
};
|
|
219
|
+
/** One described hash: its fields as label/value pairs in the shared columns. */
|
|
220
|
+
var SchemaRecord = function (_a) {
|
|
221
|
+
var record = _a.record, schema = _a.schema, showTypes = _a.showTypes, colors = _a.colors, skipKey = _a.skipKey;
|
|
222
|
+
// The SAME host renderer the row above uses for a `code-editor` field. Read
|
|
223
|
+
// from context rather than threaded through props: a nested level is arbitrarily
|
|
224
|
+
// deep, and the renderer is a property of the form, not of any one level.
|
|
225
|
+
var codePreviewRenderer = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.codePreviewRenderer; });
|
|
226
|
+
var cHover = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cHover; });
|
|
227
|
+
return ((0, jsx_runtime_1.jsx)(StyledFields, { className: 'schema-view-fields', children: (0, readFirst_1.orderedKeys)(record, schema)
|
|
228
|
+
.filter(function (key) { return key !== skipKey; })
|
|
229
|
+
.map(function (key) {
|
|
230
|
+
var fieldSchema = schema[key];
|
|
231
|
+
var nested = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.arg_schema;
|
|
232
|
+
var value = unwrap(record[key]);
|
|
233
|
+
var label = (0, readFirst_1.fieldLabel)(key, fieldSchema);
|
|
234
|
+
var labelWithType = showTypes && (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) ? "".concat(label, " \u00B7 ").concat(fieldSchema.type) : label;
|
|
235
|
+
// A field that describes its own level renders AS that level, indented
|
|
236
|
+
// under its name — the same decision, one step down.
|
|
237
|
+
if (nested && (isRecord(value) || Array.isArray(value))) {
|
|
238
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledNestedLabel, { children: (0, jsx_runtime_1.jsx)(StyledFieldLabel, { "$color": colors.key, children: labelWithType }) }), (0, jsx_runtime_1.jsx)(StyledNested, { "$border": colors.border, children: (0, jsx_runtime_1.jsx)(SchemaLevel, { value: value, schema: nested, showTypes: showTypes, colors: colors }) })] }, key));
|
|
239
|
+
}
|
|
240
|
+
// A code value is source, and source is read as source: the host's renderer
|
|
241
|
+
// gives it the syntax highlighting (and read-only LSP hover) it has in the
|
|
242
|
+
// Source Code field, and "Show more" keeps a long body from taking over the
|
|
243
|
+
// preview. Flattening it to one mono line — which is what a plain value cell
|
|
244
|
+
// does — throws all of that away for a field whose whole content is code.
|
|
245
|
+
if ((0, readFirst_1.isCodeField)(fieldSchema) && typeof value === 'string') {
|
|
246
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledNestedLabel, { children: (0, jsx_runtime_1.jsx)(StyledFieldLabel, { "$color": colors.key, children: labelWithType }) }), (0, jsx_runtime_1.jsx)(StyledCodeCell, { onClick: function (event) { return event.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreCollapsibleContent, { maxCollapsedHeight: 96, buttonProps: { className: 'options-readfirst-viewmore' }, children: codePreviewRenderer ?
|
|
247
|
+
codePreviewRenderer({
|
|
248
|
+
value: value,
|
|
249
|
+
name: key,
|
|
250
|
+
schema: fieldSchema,
|
|
251
|
+
options: schema,
|
|
252
|
+
values: record,
|
|
253
|
+
})
|
|
254
|
+
: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledCodePreview, { className: 'options-readfirst-code', "$bg": cHover, "$border": "".concat(colors.border, "88"), "$fg": colors.key, children: value }) }) })] }, key));
|
|
255
|
+
}
|
|
256
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledFieldLabel, { "$color": colors.key, title: label, children: labelWithType }), (0, jsx_runtime_1.jsx)(FieldValue, { field: { type: fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type, value: value }, fieldSchema: fieldSchema, color: colors.key })] }, key));
|
|
257
|
+
}) }));
|
|
258
|
+
};
|
|
259
|
+
/** A level: a list of numbered items, or a single described hash. */
|
|
260
|
+
var SchemaLevel = function (_a) {
|
|
261
|
+
var value = _a.value, schema = _a.schema, showTypes = _a.showTypes, colors = _a.colors;
|
|
262
|
+
var inner = unwrap(value);
|
|
263
|
+
if (Array.isArray(inner)) {
|
|
264
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: inner.map(function (item, index) {
|
|
265
|
+
var record = unwrap(item);
|
|
266
|
+
return ((0, jsx_runtime_1.jsxs)(StyledItem, { className: 'schema-view-item', children: [(0, jsx_runtime_1.jsxs)(StyledMarker, { "$color": colors.muted, children: [index + 1, "."] }), (0, jsx_runtime_1.jsx)(StyledItemFields, { "$border": colors.border, children: isRecord(record) ?
|
|
267
|
+
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(function () {
|
|
268
|
+
var identity = (0, readFirst_1.recordIdentity)(record, schema);
|
|
269
|
+
if (!identity) {
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
return ((0, jsx_runtime_1.jsx)(StyledItemTitle, { className: 'schema-view-item-title', "$color": colors.key, "$mono": identity.mono, "$accent": colors.accent, title: identity.label, children: identity.text }));
|
|
273
|
+
})(), (0, jsx_runtime_1.jsx)(SchemaRecord, { record: record, schema: schema, showTypes: showTypes, colors: colors, skipKey: (0, readFirst_1.titleKeyFor)(record, schema) })] })
|
|
274
|
+
: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowValue, { "$color": colors.key, children: (0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-valuetext schema-view-data', style: { fontFamily: compactRowStyles_1.MONO_FONT_STACK }, children: (0, readFirst_1.formatOptionValue)({ value: record }) }) }) })] }, index));
|
|
275
|
+
}) }));
|
|
276
|
+
}
|
|
277
|
+
if (isRecord(inner)) {
|
|
278
|
+
return (0, jsx_runtime_1.jsx)(SchemaRecord, { record: inner, schema: schema, showTypes: showTypes, colors: colors });
|
|
279
|
+
}
|
|
280
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', style: { color: colors.key }, children: (0, readFirst_1.formatOptionValue)({ value: inner }) }));
|
|
281
|
+
};
|
|
282
|
+
exports.SchemaDataView = react_1.default.memo(function (_a) {
|
|
283
|
+
var _b;
|
|
284
|
+
var value = _a.value, schema = _a.schema, showTypes = _a.showTypes, colors = _a.colors, onItemClick = _a.onItemClick;
|
|
285
|
+
return ((0, jsx_runtime_1.jsx)(StyledSchemaView, { className: 'schema-data-view', onClick: onItemClick, style: (_b = {}, _b[LABEL_COL_VAR] = labelColumn(value, schema), _b), children: (0, jsx_runtime_1.jsx)(SchemaLevel, { value: value, schema: schema, showTypes: showTypes, colors: colors }) }));
|
|
286
|
+
});
|
|
287
|
+
exports.SchemaDataView.displayName = 'SchemaDataView';
|
|
288
|
+
/**
|
|
289
|
+
* Whether a value can be rendered through a schema at all.
|
|
290
|
+
*
|
|
291
|
+
* A schema describes fields, so there has to be a described level to show: a
|
|
292
|
+
* hash, or a list of them. A list of scalars has no field names to use and falls
|
|
293
|
+
* back to the untyped renderer, which is the right tool for it.
|
|
294
|
+
*/
|
|
295
|
+
var canRenderWithSchema = function (value, schema) {
|
|
296
|
+
if (!schema || typeof schema !== 'object' || !Object.keys(schema).length) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
var inner = unwrap(value);
|
|
300
|
+
if (Array.isArray(inner)) {
|
|
301
|
+
return inner.some(function (item) { return isRecord(unwrap(item)); });
|
|
302
|
+
}
|
|
303
|
+
return isRecord(inner);
|
|
304
|
+
};
|
|
305
|
+
exports.canRenderWithSchema = canRenderWithSchema;
|
|
306
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
307
|
+
//# sourceMappingURL=SchemaDataView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDataView.js","sourceRoot":"","sources":["../../../../../src/components/form/engine/_structuredData/SchemaDataView.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAoG;AAMpG,gDAA0B;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AC,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AATW,QAAA,mBAAmB,uBAS9B"}
|
|
@@ -47,7 +47,20 @@ export declare const StyledStatusDot: any;
|
|
|
47
47
|
export declare const StyledActionSlot: any;
|
|
48
48
|
export declare const StyledColumn: any;
|
|
49
49
|
export declare const StyledRowInset: any;
|
|
50
|
+
/**
|
|
51
|
+
* The stack literal text renders in: source, ids, tokens, data strings.
|
|
52
|
+
*
|
|
53
|
+
* Defined HERE rather than taken from reqore's `ReqoreFonts.mono`, which is the
|
|
54
|
+
* same stack. Reqore is a peer dependency at `>=0.71.16` and that export arrived
|
|
55
|
+
* later, so reading it would crash every consumer inside the declared range —
|
|
56
|
+
* the whole form preview lost over a font choice. One local constant costs
|
|
57
|
+
* nothing and keeps the code preview and the schema view's data values
|
|
58
|
+
* identical, which is the only reason to share it in the first place.
|
|
59
|
+
*/
|
|
60
|
+
export declare const MONO_FONT_STACK = "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace";
|
|
50
61
|
export declare const StyledCodePreview: any;
|
|
51
62
|
export declare const StyledColorSwatch: any;
|
|
52
63
|
export declare const StyledGroupBody: any;
|
|
64
|
+
export declare const StyledAbsorbedField: any;
|
|
65
|
+
export declare const StyledAbsorbedLabel: any;
|
|
53
66
|
//# sourceMappingURL=compactRowStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compactRowStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/compactRowStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAKtF,eAAO,MAAM,UAAU,EAAE,MAAc,CAAC;AAOxC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,kBAAkB,QAA0D,CAAC;AAE1F,eAAO,MA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MAAM,iBAAiB,KAO7B,CAAC;AAEF,eAAO,MAAM,eAAe,KAmQ3B,CAAC;AAWF,eAAO,MAAM,mBAAmB,KAQ/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,KAG/B,CAAC"}
|
|
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.StyledGroupBody = exports.StyledColorSwatch = exports.StyledCodePreview = exports.StyledRowInset = exports.StyledColumn = exports.StyledActionSlot = exports.StyledStatusDot = exports.StyledRowActions = exports.StyledRowValue = exports.StyledCardLabel = exports.StyledCardHeading = exports.StyledLabelDesc = exports.StyledRowLabel = exports.StyledLabelBlock = exports.StyledEditCard = exports.StyledClusterNode = exports.StyledStatusBoxGroupLabel = exports.StyledRequiredClusterHeader = exports.StyledRequiredClusterBox = exports.StyledStatusBox = exports.StyledGroupHeaderLine = exports.StyledGroupHeader = exports.StyledCompactPanel = exports.PANEL_LEFT_CSS = exports.LABEL_COL = exports.LABEL_COL_VAR = exports.LABEL_AFFORDANCE_WIDTH = exports.LABEL_COL_MAX = exports.LABEL_COL_MIN = exports.GROUP_INDENT = exports.COMPACT_PANEL_LEFT = exports.COMPACT_VALUE_LEFT = exports.COMPACT_ROW_GAP = exports.COMPACT_ROW_PAD_X = exports.COMPACT_LABEL_COL = exports.HEADER_GAP = void 0;
|
|
10
|
+
exports.StyledAbsorbedLabel = exports.StyledAbsorbedField = exports.StyledGroupBody = exports.StyledColorSwatch = exports.StyledCodePreview = exports.MONO_FONT_STACK = exports.StyledRowInset = exports.StyledColumn = exports.StyledActionSlot = exports.StyledStatusDot = exports.StyledRowActions = exports.StyledRowValue = exports.StyledCardLabel = exports.StyledCardHeading = exports.StyledLabelDesc = exports.StyledRowLabel = exports.StyledLabelBlock = exports.StyledEditCard = exports.StyledClusterNode = exports.StyledStatusBoxGroupLabel = exports.StyledRequiredClusterHeader = exports.StyledRequiredClusterBox = exports.StyledStatusBox = exports.StyledGroupHeaderLine = exports.StyledGroupHeader = exports.StyledCompactPanel = exports.PANEL_LEFT_CSS = exports.LABEL_COL = exports.LABEL_COL_VAR = exports.LABEL_AFFORDANCE_WIDTH = exports.LABEL_COL_MAX = exports.LABEL_COL_MIN = exports.GROUP_INDENT = exports.COMPACT_PANEL_LEFT = exports.COMPACT_VALUE_LEFT = exports.COMPACT_ROW_GAP = exports.COMPACT_ROW_PAD_X = exports.COMPACT_LABEL_COL = exports.HEADER_GAP = void 0;
|
|
11
11
|
var reqore_1 = require("@qoretechnologies/reqore");
|
|
12
12
|
var sizes_1 = require("@qoretechnologies/reqore/dist/constants/sizes");
|
|
13
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
@@ -154,7 +154,7 @@ exports.StyledCardLabel = styled_components_1.default.div(templateObject_14 || (
|
|
|
154
154
|
});
|
|
155
155
|
/* min-width: 0 lets the grid cell shrink below its content's intrinsic width
|
|
156
156
|
so the ellipsis engages instead of overflowing. */
|
|
157
|
-
exports.StyledRowValue = styled_components_1.default.div(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n min-width: 0;\n font-size: 13px;\n /* Value + inline reason(s) share the line, wrapping the reason below only when\n it doesn't fit (the Focus prototype's layout). */\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 10px;\n row-gap: 2px;\n /* The muted/translucent colour applies to the VALUE TEXT only \u2014 not the whole\n cell \u2014 so the message panels and the structured preview below render at full\n opacity instead of inheriting the dimmed value colour. */\n .options-readfirst-valuetext {\n min-width: 0;\n max-width: 100%;\n color: ", ";\n font-style: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .options-readfirst-reason {\n font-style: italic;\n font-size: 12px;\n line-height: 1.3;\n }\n /* Schema message panels: full width of the value column, on their own line\n directly beneath the value. */\n .options-readfirst-info-panel {\n flex-basis: 100%;\n width: 100%;\n display: flex;\n flex-flow: column;\n gap: 4px;\n margin-top: 4px;\n }\n"], ["\n min-width: 0;\n font-size: 13px;\n /* Value + inline reason(s) share the line, wrapping the reason below only when\n it doesn't fit (the Focus prototype's layout). */\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 10px;\n row-gap: 2px;\n /* The muted/translucent colour applies to the VALUE TEXT only \u2014 not the whole\n cell \u2014 so the message panels and the structured preview below render at full\n opacity instead of inheriting the dimmed value colour. */\n .options-readfirst-valuetext {\n min-width: 0;\n max-width: 100%;\n color: ", ";\n font-style: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .options-readfirst-reason {\n font-style: italic;\n font-size: 12px;\n line-height: 1.3;\n }\n /* Schema message panels: full width of the value column, on their own line\n directly beneath the value. */\n .options-readfirst-info-panel {\n flex-basis: 100%;\n width: 100%;\n display: flex;\n flex-flow: column;\n gap: 4px;\n margin-top: 4px;\n }\n"])), function (_a) {
|
|
157
|
+
exports.StyledRowValue = styled_components_1.default.div(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n min-width: 0;\n font-size: 13px;\n /* Value + inline reason(s) share the line, wrapping the reason below only when\n it doesn't fit (the Focus prototype's layout). */\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 10px;\n row-gap: 2px;\n /* The muted/translucent colour applies to the VALUE TEXT only \u2014 not the whole\n cell \u2014 so the message panels and the structured preview below render at full\n opacity instead of inheriting the dimmed value colour. */\n .options-readfirst-valuetext {\n min-width: 0;\n max-width: 100%;\n color: ", ";\n font-style: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n /* The code size chip kept above an OPEN editor. The read row puts the same chip\n at the top of the value cell with a 2px row-gap under it; matching that here is\n what stops the editor moving as the field opens. */\n .options-readfirst-editing-summary {\n margin-bottom: 2px;\n }\n .options-readfirst-reason {\n font-style: italic;\n font-size: 12px;\n line-height: 1.3;\n }\n /* Schema message panels: full width of the value column, on their own line\n directly beneath the value. */\n .options-readfirst-info-panel {\n flex-basis: 100%;\n width: 100%;\n display: flex;\n flex-flow: column;\n gap: 4px;\n margin-top: 4px;\n }\n"], ["\n min-width: 0;\n font-size: 13px;\n /* Value + inline reason(s) share the line, wrapping the reason below only when\n it doesn't fit (the Focus prototype's layout). */\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 10px;\n row-gap: 2px;\n /* The muted/translucent colour applies to the VALUE TEXT only \u2014 not the whole\n cell \u2014 so the message panels and the structured preview below render at full\n opacity instead of inheriting the dimmed value colour. */\n .options-readfirst-valuetext {\n min-width: 0;\n max-width: 100%;\n color: ", ";\n font-style: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n /* The code size chip kept above an OPEN editor. The read row puts the same chip\n at the top of the value cell with a 2px row-gap under it; matching that here is\n what stops the editor moving as the field opens. */\n .options-readfirst-editing-summary {\n margin-bottom: 2px;\n }\n .options-readfirst-reason {\n font-style: italic;\n font-size: 12px;\n line-height: 1.3;\n }\n /* Schema message panels: full width of the value column, on their own line\n directly beneath the value. */\n .options-readfirst-info-panel {\n flex-basis: 100%;\n width: 100%;\n display: flex;\n flex-flow: column;\n gap: 4px;\n margin-top: 4px;\n }\n"])), function (_a) {
|
|
158
158
|
var $color = _a.$color;
|
|
159
159
|
return $color;
|
|
160
160
|
}, function (_a) {
|
|
@@ -182,12 +182,23 @@ exports.StyledColumn = styled_components_1.default.div(templateObject_19 || (tem
|
|
|
182
182
|
// under the value summary. Full-width of the value column (it's a flex child of
|
|
183
183
|
// the wrapping value cell) so it lines up with the value, not the label gutter.
|
|
184
184
|
exports.StyledRowInset = styled_components_1.default.div(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n flex-basis: 100%;\n width: 100%;\n margin-top: 4px;\n"], ["\n flex-basis: 100%;\n width: 100%;\n margin-top: 4px;\n"])));
|
|
185
|
+
/**
|
|
186
|
+
* The stack literal text renders in: source, ids, tokens, data strings.
|
|
187
|
+
*
|
|
188
|
+
* Defined HERE rather than taken from reqore's `ReqoreFonts.mono`, which is the
|
|
189
|
+
* same stack. Reqore is a peer dependency at `>=0.71.16` and that export arrived
|
|
190
|
+
* later, so reading it would crash every consumer inside the declared range —
|
|
191
|
+
* the whole form preview lost over a font choice. One local constant costs
|
|
192
|
+
* nothing and keeps the code preview and the schema view's data values
|
|
193
|
+
* identical, which is the only reason to share it in the first place.
|
|
194
|
+
*/
|
|
195
|
+
exports.MONO_FONT_STACK = "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace";
|
|
185
196
|
// A collapsed code-block preview shown under the value summary for a
|
|
186
197
|
// `code-editor` field. Multi-line, monospace, subtle background — matches
|
|
187
198
|
// the aesthetic of the classic code-view surface but small enough to sit
|
|
188
199
|
// inside a read-row. Height is capped by the wrapping `ReqoreCollapsibleContent`
|
|
189
200
|
// so the "Show more" affordance stays useful.
|
|
190
|
-
exports.StyledCodePreview = styled_components_1.default.pre(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family
|
|
201
|
+
exports.StyledCodePreview = styled_components_1.default.pre(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: 11.5px;\n line-height: 1.5;\n white-space: pre;\n overflow: auto;\n max-width: 100%;\n"], ["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: 11.5px;\n line-height: 1.5;\n white-space: pre;\n overflow: auto;\n max-width: 100%;\n"])), function (_a) {
|
|
191
202
|
var $bg = _a.$bg;
|
|
192
203
|
return $bg;
|
|
193
204
|
}, function (_a) {
|
|
@@ -196,7 +207,7 @@ exports.StyledCodePreview = styled_components_1.default.pre(templateObject_21 ||
|
|
|
196
207
|
}, function (_a) {
|
|
197
208
|
var $fg = _a.$fg;
|
|
198
209
|
return $fg;
|
|
199
|
-
});
|
|
210
|
+
}, exports.MONO_FONT_STACK);
|
|
200
211
|
// A small inline colour swatch shown before an rgbcolor value's hex string.
|
|
201
212
|
exports.StyledColorSwatch = styled_components_1.default.span(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n width: 12px;\n height: 12px;\n border-radius: 3px;\n flex: 0 0 auto;\n background: ", ";\n border: 1px solid ", ";\n"], ["\n width: 12px;\n height: 12px;\n border-radius: 3px;\n flex: 0 0 auto;\n background: ", ";\n border: 1px solid ", ";\n"])), function (_a) {
|
|
202
213
|
var $color = _a.$color;
|
|
@@ -230,5 +241,19 @@ exports.StyledGroupBody = styled_components_1.default.div(templateObject_23 || (
|
|
|
230
241
|
var $hover = _a.$hover;
|
|
231
242
|
return $hover;
|
|
232
243
|
}, exports.PANEL_LEFT_CSS);
|
|
233
|
-
|
|
244
|
+
// One absorbed sibling, rendered inside its host row's container rather than
|
|
245
|
+
// on a row of its own (see `absorb_fields`). The pair this exists for is a code
|
|
246
|
+
// editor and its language: reading them as two unrelated rows one above the
|
|
247
|
+
// other said they were separate decisions, and they are not.
|
|
248
|
+
//
|
|
249
|
+
// Laid out as label-then-control on one line so it reads as a property of the
|
|
250
|
+
// element it now sits in, and separated from the editor below it by a hairline
|
|
251
|
+
// rather than a gap — the two share one container, so the seam has to look like
|
|
252
|
+
// a division inside it and not like two stacked things.
|
|
253
|
+
exports.StyledAbsorbedField = styled_components_1.default.div(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n padding-bottom: 8px;\n margin-bottom: 8px;\n border-bottom: 1px solid ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n padding-bottom: 8px;\n margin-bottom: 8px;\n border-bottom: 1px solid ", ";\n"])), function (_a) {
|
|
254
|
+
var theme = _a.theme;
|
|
255
|
+
return "".concat(theme.main, "22");
|
|
256
|
+
});
|
|
257
|
+
exports.StyledAbsorbedLabel = (0, styled_components_1.default)(reqore_1.ReqoreP)(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n flex: 0 0 auto;\n margin: 0;\n"], ["\n flex: 0 0 auto;\n margin: 0;\n"])));
|
|
258
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25;
|
|
234
259
|
//# sourceMappingURL=compactRowStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compactRowStyles.js","sourceRoot":"","sources":["../../../../src/components/form/engine/compactRowStyles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,mDAAgE;AAChE,uEAAsF;AACtF,wEAAuC;AAEvC,8EAA8E;AAC9E,oEAAoE;AACvD,QAAA,UAAU,GAAW,KAAK,CAAC;AAExC,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AACjE,QAAA,iBAAiB,GAAG,GAAG,CAAC,CAAC,4CAA4C;AACrE,QAAA,iBAAiB,GAAG,EAAE,CAAC,CAAC,oCAAoC;AAC5D,QAAA,eAAe,GAAG,EAAE,CAAC,CAAC,kBAAkB;AACrD,gFAAgF;AACnE,QAAA,kBAAkB,GAAG,yBAAiB,GAAG,yBAAiB,GAAG,uBAAe,CAAC;AAC1F,6EAA6E;AAChE,QAAA,kBAAkB,GAAG,0BAAkB,GAAG,EAAE,CAAC;AAC1D,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAChE,QAAA,YAAY,GAAG,UAAG,yBAAiB,OAAI,CAAC;AAErD,6EAA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AACxC,QAAA,cAAc,GAAG,2BAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"compactRowStyles.js","sourceRoot":"","sources":["../../../../src/components/form/engine/compactRowStyles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,mDAAgE;AAChE,uEAAsF;AACtF,wEAAuC;AAEvC,8EAA8E;AAC9E,oEAAoE;AACvD,QAAA,UAAU,GAAW,KAAK,CAAC;AAExC,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AACjE,QAAA,iBAAiB,GAAG,GAAG,CAAC,CAAC,4CAA4C;AACrE,QAAA,iBAAiB,GAAG,EAAE,CAAC,CAAC,oCAAoC;AAC5D,QAAA,eAAe,GAAG,EAAE,CAAC,CAAC,kBAAkB;AACrD,gFAAgF;AACnE,QAAA,kBAAkB,GAAG,yBAAiB,GAAG,yBAAiB,GAAG,uBAAe,CAAC;AAC1F,6EAA6E;AAChE,QAAA,kBAAkB,GAAG,0BAAkB,GAAG,EAAE,CAAC;AAC1D,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAChE,QAAA,YAAY,GAAG,UAAG,yBAAiB,OAAI,CAAC;AAErD,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,iFAAiF;AACjF,2EAA2E;AAC3E,8EAA8E;AACjE,QAAA,aAAa,GAAG,GAAG,CAAC;AACpB,QAAA,aAAa,GAAG,yBAAiB,CAAC,CAAC,MAAM;AACtD;;;;;;;;;;;;;;GAcG;AACU,QAAA,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7C,QAAA,aAAa,GAAG,uBAAuB,CAAC;AACxC,QAAA,SAAS,GAAG,cAAO,qBAAa,eAAK,yBAAiB,QAAK,CAAC;AAC5D,QAAA,cAAc,GAAG,eAAQ,iBAAS,gBAAM,yBAAiB,GAAG,uBAAe,GAAG,EAAE,QA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AAA,UAAG,KAAK,CAAC,IAAI,OAAI;AAAjB,CAAiB,EAC3D;AAEW,QAAA,mBAAmB,GAAG,IAAA,2BAAM,EAAC,gBAAO,CAAC,0GAAA,qCAGjD,KAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IQorusFormField, TQorusFormFieldSchema } from '@qoretechnologies/ts-toolkit';
|
|
1
|
+
import { IQorusFormField, IQorusFormSchema, TQorusFormFieldSchema } from '@qoretechnologies/ts-toolkit';
|
|
2
2
|
/**
|
|
3
3
|
* Pure helpers for FormEngine compact (read-first) mode: format an option's
|
|
4
4
|
* stored value into a short summary and resolve its group. Unit-testable.
|
|
@@ -12,6 +12,22 @@ export declare const shouldAutoCollapseCompactAllowedValueOption: (schema: TQoru
|
|
|
12
12
|
* and the inline editor can close without a separate confirmation. */
|
|
13
13
|
export declare const isCompactBooleanOption: (schema: TQorusFormFieldSchema | undefined) => boolean;
|
|
14
14
|
export declare const shouldAutoCollapseCompactOption: (schema: TQorusFormFieldSchema | undefined, value: unknown) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Prefer the matching allowed_values entry's display_name (fallback `name`)
|
|
17
|
+
* over the raw stored value.
|
|
18
|
+
*
|
|
19
|
+
* Exported (as `findAllowedValueOption`) because the form engine's value
|
|
20
|
+
* validation has to answer the SAME question — "is this stored value one of the
|
|
21
|
+
* declared choices?" — and answering it differently loses data. An
|
|
22
|
+
* `allowed_values` entry is written three ways: an envelope (`{value: {type,
|
|
23
|
+
* value}}`), a bare value (`{value: 'default'}`) or a named entry
|
|
24
|
+
* (`{name: 'default'}`). This has always accepted all three; the engine's
|
|
25
|
+
* clearing guard accepted only the first and the third, so a schema using the
|
|
26
|
+
* bare form had its value ERASED on load while this function went on rendering
|
|
27
|
+
* the display name for it — the row read "Default RBAC" collapsed and "—" when
|
|
28
|
+
* opened, and the value was gone from the submitted data.
|
|
29
|
+
*/
|
|
30
|
+
export declare const findAllowedValueOption: (value: unknown, schema?: TQorusFormFieldSchema) => any | undefined;
|
|
15
31
|
/** True when the field's selectable options carry images (logos). Such a choice
|
|
16
32
|
* renders too tall/rich for an inline row, so compact opens it in the card. */
|
|
17
33
|
export declare const optionHasImages: (schema?: TQorusFormFieldSchema) => boolean;
|
|
@@ -158,4 +174,53 @@ export interface IFirstAttentionFieldMeta {
|
|
|
158
174
|
* `undefined` when nothing needs attention.
|
|
159
175
|
*/
|
|
160
176
|
export declare const getFirstAttentionOptionName: (orderedNames: string[], getFieldMeta: (name: string) => IFirstAttentionFieldMeta | undefined) => string | undefined;
|
|
177
|
+
/** Whether a value is worth a row of its own. `false` and `0` are values. */
|
|
178
|
+
export declare const isSet: (value: unknown) => boolean;
|
|
179
|
+
/**
|
|
180
|
+
* The keys to render, in the order to render them: the schema's own order first
|
|
181
|
+
* (that is the order the form puts the fields in), then anything stored that the
|
|
182
|
+
* schema does not mention, so undescribed data is shown rather than dropped.
|
|
183
|
+
*/
|
|
184
|
+
export declare const orderedKeys: (record: Record<string, unknown>, schema: IQorusFormSchema) => string[];
|
|
185
|
+
/** A field whose content is source code. `ui_type` is what the form renders by,
|
|
186
|
+
* so it is what the preview reads by too — the storage type is just `string`. */
|
|
187
|
+
export declare const isCodeField: (fieldSchema: TQorusFormFieldSchema | undefined) => boolean;
|
|
188
|
+
/**
|
|
189
|
+
* The field whose value heads the item — the first DECLARED one holding a plain
|
|
190
|
+
* scalar.
|
|
191
|
+
*
|
|
192
|
+
* Schema order, not value order: the first declared field is the one the form
|
|
193
|
+
* puts at the top of an item, which is the one that says which item it is. A
|
|
194
|
+
* code body or a nested level is skipped, not because it is unimportant but
|
|
195
|
+
* because it has no one-line form — it belongs in the rows below where it can
|
|
196
|
+
* actually be read.
|
|
197
|
+
*
|
|
198
|
+
* One definition, used both to RENDER the heading and to omit that field from
|
|
199
|
+
* the rows. Computing it twice is how the heading and the rows start disagreeing
|
|
200
|
+
* about which field was promoted, and the item shows its name twice or not at
|
|
201
|
+
* all.
|
|
202
|
+
*/
|
|
203
|
+
export declare const titleKeyFor: (record: Record<string, unknown>, schema: IQorusFormSchema) => string | undefined;
|
|
204
|
+
/** What identifies one record: which field was promoted, and how to draw it. */
|
|
205
|
+
export interface IRecordIdentity {
|
|
206
|
+
/** The promoted field's key, so a caller can omit it from the rows below. */
|
|
207
|
+
key: string;
|
|
208
|
+
/** The value, formatted the way its own row would format it. */
|
|
209
|
+
text: string;
|
|
210
|
+
/** The promoted field's label — a caption for the heading, not a second line. */
|
|
211
|
+
label: string;
|
|
212
|
+
/** A literal keeps its mono face; a chosen label is prose. */
|
|
213
|
+
mono: boolean;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The identity of one record, for any surface that heads a list item with it.
|
|
217
|
+
*
|
|
218
|
+
* Exported because the preview is not the only place a list of records is shown:
|
|
219
|
+
* the editable list (`ArrayAuto`) heads the same records, and it must promote the
|
|
220
|
+
* same field and format it the same way. Two implementations would drift the
|
|
221
|
+
* moment one of them learned about a new field type, and the reader would meet
|
|
222
|
+
* an item called `init` in the preview and `#1` in the editor.
|
|
223
|
+
*/
|
|
224
|
+
export declare const recordIdentity: (record: Record<string, unknown>, schema: IQorusFormSchema | undefined) => IRecordIdentity | undefined;
|
|
225
|
+
export declare const fieldLabel: (key: string, fieldSchema: TQorusFormFieldSchema | undefined) => string;
|
|
161
226
|
//# sourceMappingURL=readFirst.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readFirst.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/readFirst.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"readFirst.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/readFirst.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,8BAA8B,CAAC;AA4ItC;;;GAGG;AAEH,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,OAIN,CA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