@atscript/ui 0.1.163 → 0.1.165
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/client-factory.cjs +27 -0
- package/dist/client-factory.d.cts +58 -0
- package/dist/client-factory.d.mts +58 -0
- package/dist/client-factory.mjs +25 -0
- package/dist/form/apply.cjs +38 -0
- package/dist/form/apply.d.cts +36 -0
- package/dist/form/apply.d.mts +36 -0
- package/dist/form/apply.mjs +38 -0
- package/dist/form/clone.cjs +30 -0
- package/dist/form/clone.d.cts +23 -0
- package/dist/form/clone.d.mts +23 -0
- package/dist/form/clone.mjs +30 -0
- package/dist/form/create-form-def.cjs +462 -0
- package/dist/form/create-form-def.d.cts +67 -0
- package/dist/form/create-form-def.d.mts +67 -0
- package/dist/form/create-form-def.mjs +460 -0
- package/dist/form/decimal-format.cjs +324 -0
- package/dist/form/decimal-format.d.cts +86 -0
- package/dist/form/decimal-format.d.mts +86 -0
- package/dist/form/decimal-format.mjs +315 -0
- package/dist/form/diff.cjs +458 -0
- package/dist/form/diff.d.cts +80 -0
- package/dist/form/diff.d.mts +80 -0
- package/dist/form/diff.mjs +457 -0
- package/dist/form/dirty.cjs +65 -0
- package/dist/form/dirty.d.cts +47 -0
- package/dist/form/dirty.d.mts +47 -0
- package/dist/form/dirty.mjs +64 -0
- package/dist/form/error-utils.cjs +97 -0
- package/dist/form/error-utils.d.cts +58 -0
- package/dist/form/error-utils.d.mts +58 -0
- package/dist/form/error-utils.mjs +92 -0
- package/dist/form/form-actions.cjs +30 -0
- package/dist/form/form-actions.d.cts +17 -0
- package/dist/form/form-actions.d.mts +17 -0
- package/dist/form/form-actions.mjs +30 -0
- package/dist/form/grid.cjs +69 -0
- package/dist/form/grid.d.cts +49 -0
- package/dist/form/grid.d.mts +49 -0
- package/dist/form/grid.mjs +64 -0
- package/dist/form/labels.cjs +13 -0
- package/dist/form/labels.d.cts +11 -0
- package/dist/form/labels.d.mts +11 -0
- package/dist/form/labels.mjs +13 -0
- package/dist/form/measurement.cjs +20 -0
- package/dist/form/measurement.d.cts +29 -0
- package/dist/form/measurement.d.mts +29 -0
- package/dist/form/measurement.mjs +20 -0
- package/dist/form/path-utils.cjs +182 -0
- package/dist/form/path-utils.d.cts +47 -0
- package/dist/form/path-utils.d.mts +47 -0
- package/dist/form/path-utils.mjs +175 -0
- package/dist/form/rebase.cjs +89 -0
- package/dist/form/rebase.d.cts +61 -0
- package/dist/form/rebase.d.mts +61 -0
- package/dist/form/rebase.mjs +89 -0
- package/dist/form/skipped-nav.cjs +100 -0
- package/dist/form/skipped-nav.d.cts +13 -0
- package/dist/form/skipped-nav.d.mts +13 -0
- package/dist/form/skipped-nav.mjs +98 -0
- package/dist/form/types.cjs +40 -0
- package/dist/form/types.d.cts +147 -0
- package/dist/form/types.d.mts +147 -0
- package/dist/form/types.mjs +36 -0
- package/dist/form/union-detect.cjs +46 -0
- package/dist/form/union-detect.d.cts +22 -0
- package/dist/form/union-detect.d.mts +22 -0
- package/dist/form/union-detect.mjs +46 -0
- package/dist/form/validate.cjs +186 -0
- package/dist/form/validate.d.cts +81 -0
- package/dist/form/validate.d.mts +81 -0
- package/dist/form/validate.mjs +182 -0
- package/dist/i18n/ui-texts.cjs +135 -0
- package/dist/i18n/ui-texts.d.cts +81 -0
- package/dist/i18n/ui-texts.d.mts +81 -0
- package/dist/i18n/ui-texts.mjs +132 -0
- package/dist/index.cjs +223 -3360
- package/dist/index.d.cts +39 -1693
- package/dist/index.d.mts +39 -1693
- package/dist/index.mjs +36 -3179
- package/dist/messages.cjs +301 -0
- package/dist/messages.d.cts +302 -0
- package/dist/messages.d.mts +302 -0
- package/dist/messages.mjs +300 -0
- package/dist/nav/model-routes.cjs +59 -0
- package/dist/nav/model-routes.d.cts +33 -0
- package/dist/nav/model-routes.d.mts +33 -0
- package/dist/nav/model-routes.mjs +59 -0
- package/dist/plugin/annotations.cjs +592 -0
- package/dist/plugin/annotations.mjs +592 -0
- package/dist/plugin/primitives.cjs +30 -0
- package/dist/plugin/primitives.mjs +30 -0
- package/dist/plugin/value-help-validation.cjs +429 -0
- package/dist/plugin/value-help-validation.mjs +423 -0
- package/dist/plugin.cjs +4 -1001
- package/dist/plugin.mjs +2 -999
- package/dist/shared/annotation-keys.cjs +189 -0
- package/dist/shared/annotation-keys.d.cts +82 -0
- package/dist/shared/annotation-keys.d.mts +82 -0
- package/dist/shared/annotation-keys.mjs +97 -0
- package/dist/shared/field-resolver.cjs +123 -0
- package/dist/shared/field-resolver.d.cts +77 -0
- package/dist/shared/field-resolver.d.mts +77 -0
- package/dist/shared/field-resolver.mjs +110 -0
- package/dist/shared/meta-cache.cjs +282 -0
- package/dist/shared/meta-cache.d.cts +130 -0
- package/dist/shared/meta-cache.d.mts +130 -0
- package/dist/shared/meta-cache.mjs +275 -0
- package/dist/shared/str.cjs +19 -0
- package/dist/shared/str.d.cts +7 -0
- package/dist/shared/str.d.mts +7 -0
- package/dist/shared/str.mjs +17 -0
- package/dist/table/column-resolver.cjs +17 -0
- package/dist/table/column-resolver.d.cts +11 -0
- package/dist/table/column-resolver.d.mts +11 -0
- package/dist/table/column-resolver.mjs +15 -0
- package/dist/table/create-table-def.cjs +242 -0
- package/dist/table/create-table-def.d.cts +19 -0
- package/dist/table/create-table-def.d.mts +19 -0
- package/dist/table/create-table-def.mjs +242 -0
- package/dist/table/navigate-href.cjs +45 -0
- package/dist/table/navigate-href.d.cts +31 -0
- package/dist/table/navigate-href.d.mts +31 -0
- package/dist/table/navigate-href.mjs +45 -0
- package/dist/table/types.d.cts +290 -0
- package/dist/table/types.d.mts +290 -0
- package/dist/table/value-kind.cjs +20 -0
- package/dist/table/value-kind.d.cts +16 -0
- package/dist/table/value-kind.d.mts +16 -0
- package/dist/table/value-kind.mjs +19 -0
- package/dist/value-help/dict-paths.cjs +17 -0
- package/dist/value-help/dict-paths.d.cts +11 -0
- package/dist/value-help/dict-paths.d.mts +11 -0
- package/dist/value-help/dict-paths.mjs +17 -0
- package/dist/value-help/distinct-client.cjs +51 -0
- package/dist/value-help/distinct-client.d.cts +40 -0
- package/dist/value-help/distinct-client.d.mts +40 -0
- package/dist/value-help/distinct-client.mjs +50 -0
- package/dist/value-help/extract-literals.cjs +115 -0
- package/dist/value-help/extract-literals.d.cts +44 -0
- package/dist/value-help/extract-literals.d.mts +44 -0
- package/dist/value-help/extract-literals.mjs +111 -0
- package/dist/value-help/extract-ref.cjs +100 -0
- package/dist/value-help/extract-ref.d.cts +37 -0
- package/dist/value-help/extract-ref.d.mts +37 -0
- package/dist/value-help/extract-ref.mjs +100 -0
- package/dist/value-help/filter-tree.cjs +45 -0
- package/dist/value-help/filter-tree.mjs +45 -0
- package/dist/value-help/index.d.mts +8 -0
- package/dist/value-help/resolve-options.cjs +68 -0
- package/dist/value-help/resolve-options.d.cts +40 -0
- package/dist/value-help/resolve-options.d.mts +40 -0
- package/dist/value-help/resolve-options.mjs +64 -0
- package/dist/value-help/resolve.cjs +66 -0
- package/dist/value-help/resolve.d.cts +36 -0
- package/dist/value-help/resolve.d.mts +36 -0
- package/dist/value-help/resolve.mjs +65 -0
- package/dist/value-help/types.d.cts +41 -0
- package/dist/value-help/types.d.mts +41 -0
- package/dist/value-help/value-help-client.cjs +136 -0
- package/dist/value-help/value-help-client.d.cts +67 -0
- package/dist/value-help/value-help-client.d.mts +67 -0
- package/dist/value-help/value-help-client.mjs +134 -0
- package/package.json +15 -10
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
const require_value_help_validation = require("./value-help-validation.cjs");
|
|
2
|
+
let _atscript_core = require("@atscript/core");
|
|
3
|
+
//#region src/plugin/annotations.ts
|
|
4
|
+
const BUILTIN_TYPES = [
|
|
5
|
+
"text",
|
|
6
|
+
"password",
|
|
7
|
+
"number",
|
|
8
|
+
"decimal",
|
|
9
|
+
"select",
|
|
10
|
+
"multiselect",
|
|
11
|
+
"tags",
|
|
12
|
+
"textarea",
|
|
13
|
+
"checkbox",
|
|
14
|
+
"radio",
|
|
15
|
+
"date",
|
|
16
|
+
"datetime",
|
|
17
|
+
"time",
|
|
18
|
+
"paragraph",
|
|
19
|
+
"action"
|
|
20
|
+
];
|
|
21
|
+
const COL_SPAN_VALUES = [
|
|
22
|
+
"1",
|
|
23
|
+
"2",
|
|
24
|
+
"3",
|
|
25
|
+
"4",
|
|
26
|
+
"5",
|
|
27
|
+
"6",
|
|
28
|
+
"7",
|
|
29
|
+
"8",
|
|
30
|
+
"9",
|
|
31
|
+
"10",
|
|
32
|
+
"11",
|
|
33
|
+
"12",
|
|
34
|
+
"full",
|
|
35
|
+
"half",
|
|
36
|
+
"third"
|
|
37
|
+
];
|
|
38
|
+
const ROW_SPAN_VALUES = [
|
|
39
|
+
"1",
|
|
40
|
+
"2",
|
|
41
|
+
"3",
|
|
42
|
+
"4",
|
|
43
|
+
"5",
|
|
44
|
+
"6"
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* Static `@ui.*` annotation specs registered by the `@atscript/ui` plugin.
|
|
48
|
+
*
|
|
49
|
+
* Namespace contract (see Decision 1 in design.md):
|
|
50
|
+
* - `ui.<key>` — explicit cross-surface shared (`type`)
|
|
51
|
+
* - `ui.form.<key>` — form-only static
|
|
52
|
+
* - `ui.table.<key>` — table-only static
|
|
53
|
+
* - `ui.dict.<key>` — value-help annotations
|
|
54
|
+
* - `ui.valueHelp`, `ui.literalLabel` — dictionary binding, union literal labels
|
|
55
|
+
* - `ui.nav.<key>` — model-level navigation annotations
|
|
56
|
+
* - `ui.array.<key>` — array control annotations
|
|
57
|
+
*
|
|
58
|
+
* The dynamic `ui.form.fn.*` / `ui.table.fn.*` and `ui.form.validate` specs
|
|
59
|
+
* are declared by `@atscript/ui-fns`.
|
|
60
|
+
*/
|
|
61
|
+
const uiAnnotations = { ui: {
|
|
62
|
+
type: new _atscript_core.AnnotationSpec({
|
|
63
|
+
description: "Cell + input renderer type override applied to whichever surface lacks its own override (`ui.form.type` / `ui.table.type`). Built-in types: " + BUILTIN_TYPES.join(", ") + ". Consumers may dispatch additional custom types via the renderer registry — the argument is intentionally open-ended.\n\n**Example:**\n```atscript\n@ui.type \"currency\"\namount: number\n```\n",
|
|
64
|
+
nodeType: ["prop", "type"],
|
|
65
|
+
argument: {
|
|
66
|
+
name: "type",
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "The renderer type used by both form input and table cell unless overridden."
|
|
69
|
+
}
|
|
70
|
+
}),
|
|
71
|
+
form: {
|
|
72
|
+
placeholder: new _atscript_core.AnnotationSpec({
|
|
73
|
+
description: "Defines **placeholder text** for UI input fields.\n\n**Example:**\n```atscript\n@ui.form.placeholder \"Enter your name\"\nname: string\n```\n",
|
|
74
|
+
nodeType: ["prop", "type"],
|
|
75
|
+
argument: {
|
|
76
|
+
name: "text",
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "The placeholder text to display in UI input fields.",
|
|
79
|
+
userText: true
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
hint: new _atscript_core.AnnotationSpec({
|
|
83
|
+
description: "Provides **help text or tooltip** displayed near the field in UI forms.\n\n**Example:**\n```atscript\n@ui.form.hint \"Must be a valid business email\"\nemail: string.email\n```\n",
|
|
84
|
+
nodeType: ["prop", "type"],
|
|
85
|
+
argument: {
|
|
86
|
+
name: "text",
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "Help text or tooltip content.",
|
|
89
|
+
userText: true
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
classes: new _atscript_core.AnnotationSpec({
|
|
93
|
+
description: "Adds **CSS class names** to the rendered field. Multiple `@ui.form.classes` annotations are appended.\n\n**Example:**\n```atscript\n@ui.form.classes \"text-bold\"\n@ui.form.classes \"mt-4\"\ntitle: string\n```\n",
|
|
94
|
+
nodeType: [
|
|
95
|
+
"prop",
|
|
96
|
+
"type",
|
|
97
|
+
"interface"
|
|
98
|
+
],
|
|
99
|
+
multiple: true,
|
|
100
|
+
mergeStrategy: "append",
|
|
101
|
+
argument: {
|
|
102
|
+
name: "names",
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "One or more CSS class names (space-separated)."
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
styles: new _atscript_core.AnnotationSpec({
|
|
108
|
+
description: "Adds **inline CSS styles** to the rendered field. Multiple `@ui.form.styles` annotations are appended.\n\n**Example:**\n```atscript\n@ui.form.styles \"color: red\"\n@ui.form.styles \"font-weight: bold\"\nwarning: string\n```\n",
|
|
109
|
+
nodeType: [
|
|
110
|
+
"prop",
|
|
111
|
+
"type",
|
|
112
|
+
"interface"
|
|
113
|
+
],
|
|
114
|
+
multiple: true,
|
|
115
|
+
mergeStrategy: "append",
|
|
116
|
+
argument: {
|
|
117
|
+
name: "css",
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "CSS style declarations (semicolon-separated)."
|
|
120
|
+
}
|
|
121
|
+
}),
|
|
122
|
+
autocomplete: new _atscript_core.AnnotationSpec({
|
|
123
|
+
description: "Provides an **autocomplete hint** for the rendered input field.\n\n**Example:**\n```atscript\n@ui.form.autocomplete \"email\"\nemail: string.email\n```\n",
|
|
124
|
+
nodeType: ["prop", "type"],
|
|
125
|
+
argument: {
|
|
126
|
+
name: "value",
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "HTML autocomplete attribute value."
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
disabled: new _atscript_core.AnnotationSpec({
|
|
132
|
+
description: "Statically mark this field as disabled in the form.",
|
|
133
|
+
nodeType: ["prop", "type"],
|
|
134
|
+
passedWhenReferred: false
|
|
135
|
+
}),
|
|
136
|
+
options: new _atscript_core.AnnotationSpec({
|
|
137
|
+
description: "Static option for select/radio fields. Repeat for each option. Label is the display text, value is the key (defaults to label).",
|
|
138
|
+
nodeType: ["prop", "type"],
|
|
139
|
+
multiple: true,
|
|
140
|
+
mergeStrategy: "replace",
|
|
141
|
+
argument: [{
|
|
142
|
+
name: "label",
|
|
143
|
+
type: "string",
|
|
144
|
+
description: "Display label for the option",
|
|
145
|
+
userText: true
|
|
146
|
+
}, {
|
|
147
|
+
name: "value",
|
|
148
|
+
type: "string",
|
|
149
|
+
optional: true,
|
|
150
|
+
description: "Value/key for the option (defaults to label if omitted)"
|
|
151
|
+
}],
|
|
152
|
+
modify(_token, args) {
|
|
153
|
+
if (args.length === 1) args.push(args[0].clone({}));
|
|
154
|
+
}
|
|
155
|
+
}),
|
|
156
|
+
order: new _atscript_core.AnnotationSpec({
|
|
157
|
+
description: "Explicit form-field ordering (lower values render first).",
|
|
158
|
+
nodeType: ["prop", "type"],
|
|
159
|
+
passedWhenReferred: false,
|
|
160
|
+
argument: {
|
|
161
|
+
name: "order",
|
|
162
|
+
type: "number",
|
|
163
|
+
description: "Numeric order (lower = earlier)"
|
|
164
|
+
}
|
|
165
|
+
}),
|
|
166
|
+
type: new _atscript_core.AnnotationSpec({
|
|
167
|
+
description: "Form input type override. Wins over the shared `@ui.type` for this prop's form input. Built-in types: " + BUILTIN_TYPES.join(", ") + ". Consumers may register additional types in the form types map; the argument is intentionally open-ended.",
|
|
168
|
+
nodeType: ["prop", "type"],
|
|
169
|
+
argument: {
|
|
170
|
+
name: "type",
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "The input type used by `<as-field>` for this prop."
|
|
173
|
+
},
|
|
174
|
+
validate: require_value_help_validation.validateFormType
|
|
175
|
+
}),
|
|
176
|
+
component: new _atscript_core.AnnotationSpec({
|
|
177
|
+
description: "Named component override for the form-side renderer.",
|
|
178
|
+
nodeType: [
|
|
179
|
+
"prop",
|
|
180
|
+
"interface",
|
|
181
|
+
"type"
|
|
182
|
+
],
|
|
183
|
+
argument: {
|
|
184
|
+
name: "name",
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Component name from the form components registry"
|
|
187
|
+
}
|
|
188
|
+
}),
|
|
189
|
+
hidden: new _atscript_core.AnnotationSpec({
|
|
190
|
+
description: "Statically hide this field in the form.",
|
|
191
|
+
nodeType: ["prop", "type"],
|
|
192
|
+
passedWhenReferred: false
|
|
193
|
+
}),
|
|
194
|
+
attr: new _atscript_core.AnnotationSpec({
|
|
195
|
+
description: "Custom attribute or component prop applied to the form input. Repeat for each attr. Passed via v-bind.",
|
|
196
|
+
nodeType: ["prop", "type"],
|
|
197
|
+
multiple: true,
|
|
198
|
+
mergeStrategy: "replace",
|
|
199
|
+
argument: [{
|
|
200
|
+
name: "name",
|
|
201
|
+
type: "string",
|
|
202
|
+
description: "Attribute/prop name (e.g., \"data-testid\", \"variant\", \"size\")"
|
|
203
|
+
}, {
|
|
204
|
+
name: "value",
|
|
205
|
+
type: "string",
|
|
206
|
+
description: "Static value (string, number, boolean, or undefined)"
|
|
207
|
+
}]
|
|
208
|
+
}),
|
|
209
|
+
grid: {
|
|
210
|
+
colSpan: new _atscript_core.AnnotationSpec({
|
|
211
|
+
description: "Grid column span for the field in auto-generated forms. Accepts numeric strings `\"1\"` to `\"12\"` or aliases `\"full\"` (12), `\"half\"` (6), `\"third\"` (4). Optional second argument applies inside narrow containers (≤480px); defaults to `\"full\"` when omitted.\n\n**Example:**\n```atscript\n@ui.form.grid.colSpan \"6\", \"12\" // half-width desktop, full-width narrow\nfirstName: string\n```\n",
|
|
212
|
+
nodeType: ["prop", "type"],
|
|
213
|
+
argument: [{
|
|
214
|
+
name: "desktop",
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "Column span for non-narrow containers. \"1\"-\"12\", \"full\", \"half\", or \"third\".",
|
|
217
|
+
values: COL_SPAN_VALUES
|
|
218
|
+
}, {
|
|
219
|
+
name: "narrow",
|
|
220
|
+
type: "string",
|
|
221
|
+
optional: true,
|
|
222
|
+
description: "Column span for containers ≤480px wide. Defaults to \"full\".",
|
|
223
|
+
values: COL_SPAN_VALUES
|
|
224
|
+
}]
|
|
225
|
+
}),
|
|
226
|
+
rowSpan: new _atscript_core.AnnotationSpec({
|
|
227
|
+
description: "Grid row span for the field. Accepts numeric strings `\"1\"` to `\"6\"`. Optional second argument applies inside narrow containers (≤480px); defaults to `\"1\"` when omitted.\n\n**Example:**\n```atscript\n@ui.form.grid.rowSpan \"2\"\nbio: string\n```\n",
|
|
228
|
+
nodeType: ["prop", "type"],
|
|
229
|
+
argument: [{
|
|
230
|
+
name: "desktop",
|
|
231
|
+
type: "string",
|
|
232
|
+
description: "Row span for non-narrow containers. \"1\"-\"6\".",
|
|
233
|
+
values: ROW_SPAN_VALUES
|
|
234
|
+
}, {
|
|
235
|
+
name: "narrow",
|
|
236
|
+
type: "string",
|
|
237
|
+
optional: true,
|
|
238
|
+
description: "Row span for containers ≤480px wide. Defaults to \"1\".",
|
|
239
|
+
values: ROW_SPAN_VALUES
|
|
240
|
+
}]
|
|
241
|
+
})
|
|
242
|
+
},
|
|
243
|
+
submit: { text: new _atscript_core.AnnotationSpec({
|
|
244
|
+
description: "Static submit button text.",
|
|
245
|
+
nodeType: ["interface", "type"],
|
|
246
|
+
argument: {
|
|
247
|
+
name: "text",
|
|
248
|
+
type: "string",
|
|
249
|
+
description: "Submit button label",
|
|
250
|
+
userText: true
|
|
251
|
+
}
|
|
252
|
+
}) },
|
|
253
|
+
label: { singular: new _atscript_core.AnnotationSpec({
|
|
254
|
+
description: "Singular label form for an array field. Used by AsArray to render \"Add <singular>\" / \"Remove <singular>\" / per-item \"#N\"-suffixed labels. When omitted, the array falls back to `'item'`.\n\n**Example:**\n```atscript\n@meta.label 'Phone numbers'\n@ui.form.label.singular 'phone number'\nphones: string[]\n```\n",
|
|
255
|
+
nodeType: ["prop", "type"],
|
|
256
|
+
argument: {
|
|
257
|
+
name: "singular",
|
|
258
|
+
type: "string",
|
|
259
|
+
description: "Singular label, e.g. \"phone number\" for a `phones` field.",
|
|
260
|
+
userText: true
|
|
261
|
+
}
|
|
262
|
+
}) },
|
|
263
|
+
pushDown: new _atscript_core.AnnotationSpec({
|
|
264
|
+
description: "Render this field below the form's submit button instead of above it. Pushed-down fields collect into their own grid (same 12-column layout, `@ui.form.order`/`@ui.form.grid.*` honoured) that sits under the submit action. Typical use: a secondary `ui.action` link such as \"Already have an account? Sign in\" beneath a Sign-up button.\n\n**Example:**\n```atscript\n@ui.form.pushDown\n@ui.form.attr 'text', 'Already have an account?'\n@ui.form.attr 'align', 'center'\n@ui.form.action 'signin', 'Sign in'\nsigninAction: ui.action\n```\n",
|
|
265
|
+
nodeType: ["prop", "type"]
|
|
266
|
+
}),
|
|
267
|
+
action: new _atscript_core.AnnotationSpec({
|
|
268
|
+
description: "Form action button for this field.",
|
|
269
|
+
nodeType: ["prop", "type"],
|
|
270
|
+
argument: [{
|
|
271
|
+
name: "id",
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "The action name emitted on trigger"
|
|
274
|
+
}, {
|
|
275
|
+
name: "label",
|
|
276
|
+
type: "string",
|
|
277
|
+
optional: true,
|
|
278
|
+
description: "Display label for the action (falls back to @meta.label)",
|
|
279
|
+
userText: true
|
|
280
|
+
}]
|
|
281
|
+
}),
|
|
282
|
+
prefix: {
|
|
283
|
+
$self: new _atscript_core.AnnotationSpec({
|
|
284
|
+
description: "Literal **prefix adornment** rendered before the input value. Works on all default inputs (`AsInput`, `AsNumber`, `AsDecimal`). When set on a field that also carries `@db.amount.currency*`, the explicit prefix wins — currency only contributes a prefix when no explicit one is present.\n\n**Example:**\n```atscript\n@ui.form.prefix \"+1\"\nphone: string\n```\n",
|
|
285
|
+
nodeType: ["prop", "type"],
|
|
286
|
+
argument: {
|
|
287
|
+
name: "value",
|
|
288
|
+
type: "string",
|
|
289
|
+
description: "Literal text to display before the input value.",
|
|
290
|
+
userText: true
|
|
291
|
+
}
|
|
292
|
+
}),
|
|
293
|
+
ref: new _atscript_core.AnnotationSpec({
|
|
294
|
+
description: "**Sibling-field reference** for the prefix adornment. The string argument is the name of another field on the same parent whose value will be displayed as the prefix at runtime. `@ui.form.prefix` wins over `@ui.form.prefix.ref` when both are present.\n\n**Example:**\n```atscript\ncountryCode: string\n@ui.form.prefix.ref \"countryCode\"\nphone: string\n```\n",
|
|
295
|
+
nodeType: ["prop", "type"],
|
|
296
|
+
passedWhenReferred: false,
|
|
297
|
+
argument: {
|
|
298
|
+
name: "field",
|
|
299
|
+
type: "string",
|
|
300
|
+
description: "Name of a sibling field whose value drives the prefix."
|
|
301
|
+
}
|
|
302
|
+
}),
|
|
303
|
+
icon: new _atscript_core.AnnotationSpec({
|
|
304
|
+
description: "**Icon adornment** rendered to the left of the input (further out than `@ui.form.prefix` text). The argument is a CSS class that paints the glyph — typically a UnoCSS preset-icons utility like `i-mdi-mail` or a custom registry alias. The consumer is responsible for ensuring the class is reachable (safelist / preset / shortcut). Combined order: `[prefix-icon][prefix-text][input]`.\n\n**Example:**\n```atscript\n@ui.form.prefix.icon \"i-mdi-mail\"\nemail: string.email\n```\n",
|
|
305
|
+
nodeType: ["prop", "type"],
|
|
306
|
+
argument: {
|
|
307
|
+
name: "class",
|
|
308
|
+
type: "string",
|
|
309
|
+
description: "CSS class painting the icon glyph. Consumer manages safelist / preset coverage."
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
},
|
|
313
|
+
suffix: {
|
|
314
|
+
$self: new _atscript_core.AnnotationSpec({
|
|
315
|
+
description: "Literal **suffix adornment** rendered after the input value. Works on all default inputs. When set on a field that also carries `@db.unit*`, the explicit suffix wins — unit code only contributes a suffix when no explicit one is present.\n\n**Example:**\n```atscript\n@ui.form.suffix \"/hr\"\nrate: number\n```\n",
|
|
316
|
+
nodeType: ["prop", "type"],
|
|
317
|
+
argument: {
|
|
318
|
+
name: "value",
|
|
319
|
+
type: "string",
|
|
320
|
+
description: "Literal text to display after the input value.",
|
|
321
|
+
userText: true
|
|
322
|
+
}
|
|
323
|
+
}),
|
|
324
|
+
ref: new _atscript_core.AnnotationSpec({
|
|
325
|
+
description: "**Sibling-field reference** for the suffix adornment. The string argument is the name of another field on the same parent whose value will be displayed as the suffix at runtime. `@ui.form.suffix` wins over `@ui.form.suffix.ref` when both are present.\n\n**Example:**\n```atscript\nunit: 'kg' | 'lb'\n@ui.form.suffix.ref \"unit\"\nweight: number\n```\n",
|
|
326
|
+
nodeType: ["prop", "type"],
|
|
327
|
+
passedWhenReferred: false,
|
|
328
|
+
argument: {
|
|
329
|
+
name: "field",
|
|
330
|
+
type: "string",
|
|
331
|
+
description: "Name of a sibling field whose value drives the suffix."
|
|
332
|
+
}
|
|
333
|
+
}),
|
|
334
|
+
icon: new _atscript_core.AnnotationSpec({
|
|
335
|
+
description: "**Icon adornment** rendered to the right of the input (further out than `@ui.form.suffix` text). The argument is a CSS class that paints the glyph — typically a UnoCSS preset-icons utility like `i-mdi-mail` or a custom registry alias. The consumer is responsible for ensuring the class is reachable (safelist / preset / shortcut). Combined order: `[input][suffix-text][suffix-icon]`.\n\n**Example:**\n```atscript\n@ui.form.suffix.icon \"i-mdi-check\"\ncode: string\n```\n",
|
|
336
|
+
nodeType: ["prop", "type"],
|
|
337
|
+
argument: {
|
|
338
|
+
name: "class",
|
|
339
|
+
type: "string",
|
|
340
|
+
description: "CSS class painting the icon glyph. Consumer manages safelist / preset coverage."
|
|
341
|
+
}
|
|
342
|
+
})
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
table: {
|
|
346
|
+
width: new _atscript_core.AnnotationSpec({
|
|
347
|
+
description: "Sets the **default column width** for this field when rendered in a table. Accepts any CSS width string (e.g. `120px`, `12em`, `20ch`). The user can still resize the column manually; double-click on the resize handle auto-fits to content; the column-menu Reset entry returns to this value.\n\n**Example:**\n```atscript\n@ui.table.width \"240px\"\ndescription: string\n```\n",
|
|
348
|
+
nodeType: ["prop", "type"],
|
|
349
|
+
argument: {
|
|
350
|
+
name: "width",
|
|
351
|
+
type: "string",
|
|
352
|
+
description: "CSS width for the column (e.g. '120px', '15em', '20ch')."
|
|
353
|
+
}
|
|
354
|
+
}),
|
|
355
|
+
component: new _atscript_core.AnnotationSpec({
|
|
356
|
+
description: "Named component override for the table-cell renderer.",
|
|
357
|
+
nodeType: [
|
|
358
|
+
"prop",
|
|
359
|
+
"interface",
|
|
360
|
+
"type"
|
|
361
|
+
],
|
|
362
|
+
argument: {
|
|
363
|
+
name: "name",
|
|
364
|
+
type: "string",
|
|
365
|
+
description: "Component name from the table components registry"
|
|
366
|
+
}
|
|
367
|
+
}),
|
|
368
|
+
exclude: new _atscript_core.AnnotationSpec({
|
|
369
|
+
description: "Completely removes this field from the table — not displayable, filterable, or sortable, and not shown in the config dialog. The field stays in the type and remains a valid `@ui.table.selectWith` target so its data can still be fetched for custom cells.",
|
|
370
|
+
nodeType: ["prop", "type"],
|
|
371
|
+
passedWhenReferred: false
|
|
372
|
+
}),
|
|
373
|
+
attr: new _atscript_core.AnnotationSpec({
|
|
374
|
+
description: "Custom attribute or component prop applied to the rendered `<td>`. Repeat for each attr. Passed via v-bind.",
|
|
375
|
+
nodeType: ["prop", "type"],
|
|
376
|
+
multiple: true,
|
|
377
|
+
mergeStrategy: "replace",
|
|
378
|
+
argument: [{
|
|
379
|
+
name: "name",
|
|
380
|
+
type: "string",
|
|
381
|
+
description: "Attribute/prop name (e.g., \"title\", \"data-row\", \"aria-label\")"
|
|
382
|
+
}, {
|
|
383
|
+
name: "value",
|
|
384
|
+
type: "string",
|
|
385
|
+
description: "Static value applied to the cell."
|
|
386
|
+
}]
|
|
387
|
+
}),
|
|
388
|
+
classes: new _atscript_core.AnnotationSpec({
|
|
389
|
+
description: "CSS classes applied to the rendered `<td>` for this column's cells. Multiple `@ui.table.classes` annotations are appended.\n\n**Example:**\n```atscript\n@ui.table.classes \"font-bold\"\n@ui.table.classes \"text-right\"\namount: number\n```\n",
|
|
390
|
+
nodeType: [
|
|
391
|
+
"prop",
|
|
392
|
+
"type",
|
|
393
|
+
"interface"
|
|
394
|
+
],
|
|
395
|
+
multiple: true,
|
|
396
|
+
mergeStrategy: "append",
|
|
397
|
+
argument: {
|
|
398
|
+
name: "names",
|
|
399
|
+
type: "string",
|
|
400
|
+
description: "One or more CSS class names (space-separated)."
|
|
401
|
+
}
|
|
402
|
+
}),
|
|
403
|
+
selectWith: new _atscript_core.AnnotationSpec({
|
|
404
|
+
description: "Extra sibling leaf field paths to include in the table `$select` whenever this column is displayed. These fields are fetched but never rendered as their own columns — use them to back a custom cell renderer or formatter. Multiple `@ui.table.selectWith` annotations are appended. Names siblings of the DECLARING interface, so it never travels across refs.\n\n**Example:**\n```atscript\n@ui.table.selectWith \"firstName\"\n@ui.table.selectWith \"lastName\"\nfullName: string\n```\n",
|
|
405
|
+
nodeType: [
|
|
406
|
+
"prop",
|
|
407
|
+
"type",
|
|
408
|
+
"interface"
|
|
409
|
+
],
|
|
410
|
+
multiple: true,
|
|
411
|
+
mergeStrategy: "append",
|
|
412
|
+
argument: {
|
|
413
|
+
name: "path",
|
|
414
|
+
type: "string",
|
|
415
|
+
description: "Sibling leaf field path to fetch alongside this column."
|
|
416
|
+
},
|
|
417
|
+
passedWhenReferred: false
|
|
418
|
+
}),
|
|
419
|
+
styles: new _atscript_core.AnnotationSpec({
|
|
420
|
+
description: "Inline CSS styles applied to the rendered `<td>` for this column's cells. Multiple `@ui.table.styles` annotations are appended.\n\n**Example:**\n```atscript\n@ui.table.styles \"padding-left: 12px\"\ndescription: string\n```\n",
|
|
421
|
+
nodeType: [
|
|
422
|
+
"prop",
|
|
423
|
+
"type",
|
|
424
|
+
"interface"
|
|
425
|
+
],
|
|
426
|
+
multiple: true,
|
|
427
|
+
mergeStrategy: "append",
|
|
428
|
+
argument: {
|
|
429
|
+
name: "css",
|
|
430
|
+
type: "string",
|
|
431
|
+
description: "CSS style declarations (semicolon-separated)."
|
|
432
|
+
}
|
|
433
|
+
}),
|
|
434
|
+
type: new _atscript_core.AnnotationSpec({
|
|
435
|
+
description: "Cell renderer type override. Wins over the shared `@ui.type` for this prop's table cell. Built-in types: " + BUILTIN_TYPES.join(", ") + ". Consumers may register additional types in the table types map; the argument is intentionally open-ended.",
|
|
436
|
+
nodeType: ["prop", "type"],
|
|
437
|
+
argument: {
|
|
438
|
+
name: "type",
|
|
439
|
+
type: "string",
|
|
440
|
+
description: "The cell renderer type dispatched via the table types map."
|
|
441
|
+
}
|
|
442
|
+
}),
|
|
443
|
+
order: new _atscript_core.AnnotationSpec({
|
|
444
|
+
description: "Initial column ordering — lower values appear first; user-driven runtime reorder still mutates table state's `columnNames`.",
|
|
445
|
+
nodeType: ["prop", "type"],
|
|
446
|
+
passedWhenReferred: false,
|
|
447
|
+
argument: {
|
|
448
|
+
name: "order",
|
|
449
|
+
type: "number",
|
|
450
|
+
description: "Numeric order (lower = earlier)"
|
|
451
|
+
}
|
|
452
|
+
})
|
|
453
|
+
},
|
|
454
|
+
valueHelp: {
|
|
455
|
+
$self: new _atscript_core.AnnotationSpec({
|
|
456
|
+
description: "Binds this field to a value-help dictionary **without a foreign key** — no constraint, no query semantics, presentation only. Filter pickers (table filter dialog / inline field) and form reference pickers search the target's controller and commit the target's `field`. The binding wins over a `@db.rel.FK` on the field or its chain, and travels through chain refs and `extends`. The optional `filter` is a static scope AND'd into every picker query; fields it pins with `=` are hidden from the picker columns.\n\n**Example:**\n```atscript\n@ui.valueHelp AttributeValue, 'value', `attribute = 'color'`\ncolor: Ticket.color\n```\n",
|
|
457
|
+
nodeType: ["prop", "type"],
|
|
458
|
+
multiple: false,
|
|
459
|
+
argument: [
|
|
460
|
+
{
|
|
461
|
+
name: "target",
|
|
462
|
+
type: "ref",
|
|
463
|
+
description: "The dictionary interface (served by a controller exposing `@db.http.path`). Not a `@db.alias`.",
|
|
464
|
+
refFilter: require_value_help_validation.isValueHelpTarget
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "field",
|
|
468
|
+
type: "string",
|
|
469
|
+
description: "Top-level scalar field of the target whose value this field stores. Same type as this field.",
|
|
470
|
+
fieldScope: require_value_help_validation.valueHelpScopes.field
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
optional: true,
|
|
474
|
+
name: "filter",
|
|
475
|
+
type: "query",
|
|
476
|
+
description: "Static scope on the target (`attribute = 'color' and active = true`) — field-to-value comparisons of the target's fields only.",
|
|
477
|
+
fieldScope: require_value_help_validation.valueHelpScopes.filter
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
validate: require_value_help_validation.validateValueHelp
|
|
481
|
+
}),
|
|
482
|
+
distinct: new _atscript_core.AnnotationSpec({
|
|
483
|
+
description: "Offers a **distinct-values picker** for this column in table filters: the values already stored, read from the table's own controller via `$groupBy`. Shown only when the server reports the field filterable and groupable, and the field has no dictionary binding, FK help or literal options. Not offered in forms.\n\n**Example:**\n```atscript\n@ui.valueHelp.distinct\ncity?: string\n```\n",
|
|
484
|
+
nodeType: ["prop", "type"],
|
|
485
|
+
validate: require_value_help_validation.validateDistinct
|
|
486
|
+
})
|
|
487
|
+
},
|
|
488
|
+
literalLabel: new _atscript_core.AnnotationSpec({
|
|
489
|
+
description: "Display label for one literal of a union (`'open' | 'closed'`) or one value of a boolean (`'true'` / `'false'`). Repeat per literal; unlabelled literals keep their raw text, unlabelled booleans read Yes / No. Used by form selects/radios, read-only form fields, table cells, enum filter options, filter chips and export. A prop's labels are added to the referenced type's (`append` merge: the type's other labels stay); for the same literal the prop's label wins.\n\n**Example:**\n```atscript\n@ui.literalLabel 'in_progress', 'In progress'\nexport type Status = 'open' | 'in_progress'\n\n@ui.literalLabel 'true', 'Active'\n@ui.literalLabel 'false', 'Inactive'\nactive: boolean\n```\n",
|
|
490
|
+
nodeType: ["prop", "type"],
|
|
491
|
+
multiple: true,
|
|
492
|
+
mergeStrategy: "append",
|
|
493
|
+
argument: [{
|
|
494
|
+
name: "value",
|
|
495
|
+
type: "string",
|
|
496
|
+
description: "The literal as text (`'2'` for the number literal `2`; `'true'` / `'false'` on a boolean).",
|
|
497
|
+
valueScope: require_value_help_validation.literalLabelValues
|
|
498
|
+
}, {
|
|
499
|
+
name: "label",
|
|
500
|
+
type: "string",
|
|
501
|
+
description: "Display label.",
|
|
502
|
+
userText: true
|
|
503
|
+
}],
|
|
504
|
+
validate: require_value_help_validation.validateLiteralLabel
|
|
505
|
+
}),
|
|
506
|
+
dict: {
|
|
507
|
+
label: new _atscript_core.AnnotationSpec({
|
|
508
|
+
description: "Marks this field as the primary display label when the table is used as a value-help dictionary",
|
|
509
|
+
nodeType: ["prop"],
|
|
510
|
+
passedWhenReferred: false
|
|
511
|
+
}),
|
|
512
|
+
descr: new _atscript_core.AnnotationSpec({
|
|
513
|
+
description: "Marks this field as the secondary description in value-help display",
|
|
514
|
+
nodeType: ["prop"],
|
|
515
|
+
passedWhenReferred: false
|
|
516
|
+
}),
|
|
517
|
+
attr: new _atscript_core.AnnotationSpec({
|
|
518
|
+
description: "Marks this field as an additional attribute column in table-mode value help",
|
|
519
|
+
nodeType: ["prop"],
|
|
520
|
+
multiple: true,
|
|
521
|
+
mergeStrategy: "append",
|
|
522
|
+
passedWhenReferred: false
|
|
523
|
+
}),
|
|
524
|
+
filterable: new _atscript_core.AnnotationSpec({
|
|
525
|
+
description: "Marks this field as filterable in the value-help picker UI. Surfaced via `meta.fields[name].filterable` on value-help `/meta` responses.",
|
|
526
|
+
nodeType: ["prop"],
|
|
527
|
+
passedWhenReferred: false
|
|
528
|
+
}),
|
|
529
|
+
sortable: new _atscript_core.AnnotationSpec({
|
|
530
|
+
description: "Marks this field as sortable in the value-help picker UI. Surfaced via `meta.fields[name].sortable` on value-help `/meta` responses.",
|
|
531
|
+
nodeType: ["prop"],
|
|
532
|
+
passedWhenReferred: false
|
|
533
|
+
}),
|
|
534
|
+
searchable: new _atscript_core.AnnotationSpec({
|
|
535
|
+
description: "Marks a prop as participating in `$search`, or — on an interface — marks every `string` prop on the target as searchable. Surfaced via `meta.searchable` on value-help `/meta` responses.",
|
|
536
|
+
nodeType: ["prop", "interface"],
|
|
537
|
+
passedWhenReferred: false
|
|
538
|
+
})
|
|
539
|
+
},
|
|
540
|
+
nav: {
|
|
541
|
+
group: new _atscript_core.AnnotationSpec({
|
|
542
|
+
description: "Navigation section this model belongs to when the app generates navigation from model metadata (`buildModelRoutes`). Models sharing a group value are meant to render under one nav section — grouping itself is left to the consumer.\n\n**Example:**\n```atscript\n@db.table 'orders'\n@ui.nav.group 'Sales'\nexport interface Order {\n```\n",
|
|
543
|
+
nodeType: ["interface", "type"],
|
|
544
|
+
passedWhenReferred: false,
|
|
545
|
+
argument: {
|
|
546
|
+
name: "group",
|
|
547
|
+
type: "string",
|
|
548
|
+
description: "Nav section name shared by related models.",
|
|
549
|
+
userText: true
|
|
550
|
+
}
|
|
551
|
+
}),
|
|
552
|
+
order: new _atscript_core.AnnotationSpec({
|
|
553
|
+
description: "Position of this model in generated navigation — lower values appear first; models without an order sort last (in input order).\n\n**Example:**\n```atscript\n@db.table 'orders'\n@ui.nav.order 1\nexport interface Order {\n```\n",
|
|
554
|
+
nodeType: ["interface", "type"],
|
|
555
|
+
passedWhenReferred: false,
|
|
556
|
+
argument: {
|
|
557
|
+
name: "order",
|
|
558
|
+
type: "number",
|
|
559
|
+
description: "Numeric order (lower = earlier)"
|
|
560
|
+
}
|
|
561
|
+
}),
|
|
562
|
+
hidden: new _atscript_core.AnnotationSpec({
|
|
563
|
+
description: "Opts this model out of generated navigation (e.g. API-only models). `buildModelRoutes` still returns the route flagged `hidden: true` — filtering is the consumer's decision.\n\n**Example:**\n```atscript\n@db.table 'audit_log'\n@ui.nav.hidden\nexport interface AuditLog {\n```\n",
|
|
564
|
+
nodeType: ["interface", "type"],
|
|
565
|
+
passedWhenReferred: false
|
|
566
|
+
})
|
|
567
|
+
},
|
|
568
|
+
array: {
|
|
569
|
+
add: { label: new _atscript_core.AnnotationSpec({
|
|
570
|
+
description: "Label for the add-item button (default: \"Add item\")",
|
|
571
|
+
nodeType: ["prop"],
|
|
572
|
+
argument: {
|
|
573
|
+
name: "label",
|
|
574
|
+
type: "string",
|
|
575
|
+
description: "Button label text",
|
|
576
|
+
userText: true
|
|
577
|
+
}
|
|
578
|
+
}) },
|
|
579
|
+
remove: { label: new _atscript_core.AnnotationSpec({
|
|
580
|
+
description: "Label for the remove-item button (default: \"Remove\")",
|
|
581
|
+
nodeType: ["prop"],
|
|
582
|
+
argument: {
|
|
583
|
+
name: "label",
|
|
584
|
+
type: "string",
|
|
585
|
+
description: "Button label text",
|
|
586
|
+
userText: true
|
|
587
|
+
}
|
|
588
|
+
}) }
|
|
589
|
+
}
|
|
590
|
+
} };
|
|
591
|
+
//#endregion
|
|
592
|
+
exports.uiAnnotations = uiAnnotations;
|