@atscript/ui 0.1.189 → 0.1.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/client-factory.d.cts +9 -7
  2. package/dist/client-factory.d.mts +9 -7
  3. package/dist/form/create-form-def.cjs +38 -1
  4. package/dist/form/create-form-def.d.cts +1 -1
  5. package/dist/form/create-form-def.d.mts +1 -1
  6. package/dist/form/create-form-def.mjs +38 -1
  7. package/dist/form/diff.cjs +8 -1
  8. package/dist/form/diff.d.cts +5 -2
  9. package/dist/form/diff.d.mts +5 -2
  10. package/dist/form/diff.mjs +9 -2
  11. package/dist/form/skipped-nav.cjs +1 -1
  12. package/dist/form/skipped-nav.mjs +1 -1
  13. package/dist/index.cjs +11 -0
  14. package/dist/index.d.cts +7 -4
  15. package/dist/index.d.mts +7 -4
  16. package/dist/index.mjs +6 -3
  17. package/dist/messages.cjs +3 -0
  18. package/dist/messages.d.cts +3 -0
  19. package/dist/messages.d.mts +3 -0
  20. package/dist/messages.mjs +3 -0
  21. package/dist/plugin/annotations.cjs +57 -2
  22. package/dist/plugin/annotations.mjs +58 -3
  23. package/dist/plugin/value-help-validation.cjs +358 -24
  24. package/dist/plugin/value-help-validation.mjs +356 -26
  25. package/dist/shared/annotation-keys.cjs +11 -0
  26. package/dist/shared/annotation-keys.d.cts +3 -1
  27. package/dist/shared/annotation-keys.d.mts +3 -1
  28. package/dist/shared/annotation-keys.mjs +8 -1
  29. package/dist/shared/meta-cache.d.cts +3 -3
  30. package/dist/shared/meta-cache.d.mts +3 -3
  31. package/dist/shared/value-label.cjs +28 -0
  32. package/dist/shared/value-label.d.cts +25 -0
  33. package/dist/shared/value-label.d.mts +25 -0
  34. package/dist/shared/value-label.mjs +27 -0
  35. package/dist/table/create-table-def.cjs +15 -1
  36. package/dist/table/create-table-def.mjs +15 -1
  37. package/dist/table/types.d.cts +31 -9
  38. package/dist/table/types.d.mts +31 -9
  39. package/dist/value-help/distinct-client.d.cts +2 -2
  40. package/dist/value-help/distinct-client.d.mts +2 -2
  41. package/dist/value-help/extract-ref.cjs +22 -5
  42. package/dist/value-help/extract-ref.mjs +23 -6
  43. package/dist/value-help/filter-tree.cjs +39 -14
  44. package/dist/value-help/filter-tree.mjs +39 -14
  45. package/dist/value-help/index.d.mts +3 -1
  46. package/dist/value-help/options.cjs +30 -0
  47. package/dist/value-help/options.d.cts +19 -0
  48. package/dist/value-help/options.d.mts +19 -0
  49. package/dist/value-help/options.mjs +29 -0
  50. package/dist/value-help/scope.cjs +50 -0
  51. package/dist/value-help/scope.d.cts +32 -0
  52. package/dist/value-help/scope.d.mts +32 -0
  53. package/dist/value-help/scope.mjs +49 -0
  54. package/dist/value-help/types.d.cts +29 -1
  55. package/dist/value-help/types.d.mts +29 -1
  56. package/dist/value-help/value-help-client.cjs +23 -4
  57. package/dist/value-help/value-help-client.d.cts +27 -8
  58. package/dist/value-help/value-help-client.d.mts +27 -8
  59. package/dist/value-help/value-help-client.mjs +23 -5
  60. package/package.json +9 -9
@@ -1,9 +1,11 @@
1
1
  import { getFieldsForType, getSiblingAnnotation, isInterface, isProp, isQueryComparison, isQueryLogical, isRef, isStructure } from "@atscript/core";
2
- import { NOT_DIMENSION_REASON, forEachFieldRef, getAnnotationAlias, isAliasDecl, isDbSourceDecl, isStrictAggregateStruct, primitiveBaseType, validateExclusiveWith, validateQueryScope, validateRefArgument } from "@atscript/db/shared";
2
+ import { NOT_DIMENSION_REASON, annotationTarget, effectiveAnnotationNames, fkChainRef, getAnnotationAlias, getTypeFields, isAliasDecl, isDbSourceDecl, isNavProp, isStrictAggregateStruct, primitiveBaseType, siblingStringFields, validateExclusiveWith, validateQueryScope, validateRefArgument, validateSiblingStringField } from "@atscript/db/shared";
3
3
  //#region src/plugin/value-help-validation.ts
4
4
  /**
5
5
  * Editor scopes + validators of `@ui.valueHelp`, `@ui.valueHelp.distinct` and
6
- * `@ui.literalLabel` (since 0.1.148). Scopes and validators share one source,
6
+ * `@ui.literalLabel` (since 0.1.148), and of `@ui.valueHelp.fill`,
7
+ * `@ui.valueHelp.column`, host references in a binding filter and
8
+ * `@ui.valueLabel` (since 0.1.190). Scopes and validators share one source,
7
9
  * so a diagnostic and what the editor completes never diverge.
8
10
  */
9
11
  const WARNING = 2;
@@ -21,11 +23,27 @@ const valueHelpScopes = {
21
23
  unqualifiedTarget: target
22
24
  } : void 0;
23
25
  },
24
- filter: (arg) => {
26
+ filter: (arg, doc) => {
25
27
  const target = targetOf(arg);
26
- return target ? {
27
- allowedTypes: [target],
28
+ if (!target) return void 0;
29
+ const host = hostOf(arg, doc);
30
+ return {
31
+ allowedTypes: typeof host === "object" && host.name !== target ? [target, host.name] : [target],
28
32
  unqualifiedTarget: target
33
+ };
34
+ },
35
+ hostField: (arg, doc) => {
36
+ const host = hostOf(arg, doc);
37
+ return typeof host === "object" ? {
38
+ allowedTypes: [],
39
+ unqualifiedTarget: host.name
40
+ } : void 0;
41
+ },
42
+ bindingField: (arg, doc) => {
43
+ const binding = bindingOf(annotationTarget(arg, doc), doc);
44
+ return binding ? {
45
+ allowedTypes: [],
46
+ unqualifiedTarget: binding.name
29
47
  } : void 0;
30
48
  }
31
49
  };
@@ -196,32 +214,139 @@ function annotatedField(node, doc) {
196
214
  owner
197
215
  };
198
216
  }
199
- function isNavigation(node) {
200
- return !!node && (node.countAnnotations("db.rel.to") > 0 || node.countAnnotations("db.rel.from") > 0 || node.countAnnotations("db.rel.via") > 0);
201
- }
202
217
  /** Top-level conjuncts of a predicate (an `and` chain flattened). */
203
218
  function conjuncts(expr) {
204
219
  if (isQueryLogical(expr) && expr.operator === "and") return expr.operands.flatMap(conjuncts);
205
220
  return [expr];
206
221
  }
222
+ /** The right-hand field reference of a comparison, if it compares two fields. */
223
+ function rightRef(cmp) {
224
+ return cmp.right && "fieldRef" in cmp.right ? cmp.right : void 0;
225
+ }
207
226
  /**
208
227
  * Fields the filter pins with a top-level `=` against a literal value. The
209
- * compile-time twin of `pinnedOf` in `value-help/filter-tree.ts` (which reads the
210
- * emitted tree at runtime) — keep the two rules in step.
228
+ * compile-time twin of `pinnedOf` in `value-help/filter-tree.ts` (which reads
229
+ * the emitted tree at runtime) — keep the two rules in step.
211
230
  */
212
231
  function pinnedFields(filter) {
213
232
  const pinned = /* @__PURE__ */ new Set();
214
233
  const expr = filter?.queryNode?.expression;
215
234
  if (!expr) return pinned;
216
- for (const c of conjuncts(expr)) if (isQueryComparison(c) && c.operator === "=" && c.right && !("fieldRef" in c.right)) pinned.add(c.left.fieldRef.text);
235
+ for (const c of conjuncts(expr)) {
236
+ if (!isQueryComparison(c) || c.operator !== "=" || !c.right) continue;
237
+ if (!rightRef(c)) pinned.add(c.left.fieldRef.text);
238
+ }
217
239
  return pinned;
218
240
  }
241
+ /**
242
+ * The target fields the filter's host references pin (`targetField =
243
+ * Host.field`), each with its host field — pinned only while that host field
244
+ * has a value.
245
+ */
246
+ function hostPins(filter, hostName) {
247
+ const pins = /* @__PURE__ */ new Map();
248
+ const expr = filter?.queryNode?.expression;
249
+ if (!expr) return pins;
250
+ for (const c of conjuncts(expr)) {
251
+ if (!isQueryComparison(c) || c.operator !== "=") continue;
252
+ const ref = rightRef(c);
253
+ if (ref?.typeRef?.text === hostName) pins.set(c.left.fieldRef.text, ref.fieldRef.text);
254
+ }
255
+ return pins;
256
+ }
257
+ /**
258
+ * The {@link THost} of the field the annotation (or argument) `token` sits
259
+ * on; `undefined` when it sits on no field (a type-level binding, an entry
260
+ * that lands nowhere).
261
+ */
262
+ function hostOf(token, doc) {
263
+ const node = token.parentNode;
264
+ if (!node) return void 0;
265
+ if (isRef(node)) {
266
+ const at = node.token("identifier")?.range.start;
267
+ const block = at ? doc.annotateBlockAt(at.line, at.character) : void 0;
268
+ if (!block) return void 0;
269
+ if (!block.isMutating) return "copy";
270
+ if (node.hasChain) return "inline";
271
+ const field = annotationTarget(token, doc);
272
+ const fields = getTypeFields(field?.ownerNode, doc);
273
+ return field && fields ? {
274
+ name: block.targetName,
275
+ fields,
276
+ field
277
+ } : void 0;
278
+ }
279
+ if (!isProp(node)) return void 0;
280
+ const iface = node.ownerNode?.ownerNode;
281
+ if (!isStructure(node.ownerNode) || !iface || !isInterface(iface)) return "inline";
282
+ const fields = getTypeFields(iface, doc);
283
+ return fields && iface.id ? {
284
+ name: iface.id,
285
+ fields,
286
+ field: node
287
+ } : void 0;
288
+ }
289
+ const REFUSED = {
290
+ inline: "a top-level field of an interface, not a field of an inline structure, a type or a nested annotate entry",
291
+ copy: "a field of an interface or of a mutating annotate block, not of an `annotate … as` copy"
292
+ };
293
+ /**
294
+ * The binding a field's fills and columns belong to: its own `@ui.valueHelp`
295
+ * (for an `annotate` entry's field, the landed one — the entry's wins), else its
296
+ * own `@db.rel.FK` help. A binding the field only gets through its type or a
297
+ * chain reference takes no fills or columns.
298
+ */
299
+ function bindingOf(field, doc) {
300
+ if (!field) return void 0;
301
+ const own = field.annotations?.find((a) => a.name === "ui.valueHelp");
302
+ if (own) {
303
+ const name = own.args[0]?.text;
304
+ return name ? {
305
+ name,
306
+ target: resolveTarget(name, doc)
307
+ } : void 0;
308
+ }
309
+ if (field.countAnnotations("db.rel.FK") > 0) {
310
+ const ref = fkChainRef(field.getDefinition());
311
+ if (ref?.id) return {
312
+ name: ref.id,
313
+ target: resolveTarget(ref.id, doc.refOrigin(ref))
314
+ };
315
+ }
316
+ }
317
+ const SCALAR = "a scalar (not an object, an array, a navigation or @db.json)";
318
+ /** Whether a field holds no scalar: an object, an array, `@db.json` or a navigation. */
319
+ function isNotScalar(prop, doc) {
320
+ if (prop.countAnnotations("db.json") > 0 || isNavProp(prop)) return true;
321
+ const design = designOf(prop.getDefinition(), doc.declaringDoc(prop, doc));
322
+ return design === "object" || design === "array";
323
+ }
324
+ /** FL3 / CL2: why `name` is no top-level scalar field of the binding's target. */
325
+ function targetFieldProblem(binding, name) {
326
+ if (name.includes(".")) return `'${name}' must be a top-level field of '${binding.name}', not a dotted path`;
327
+ const target = binding.target;
328
+ if (!target) return void 0;
329
+ const prop = target.props.get(name);
330
+ if (!prop) return `Field '${name}' does not exist on '${binding.name}'`;
331
+ if (isNotScalar(prop, target.doc)) return `'${binding.name}.${name}' must be ${SCALAR}`;
332
+ }
333
+ /** FL4 / VH9: why the host field `local` cannot take the target field `name`'s values. */
334
+ function designMismatch(host, local, binding, name, doc) {
335
+ const localProp = host.fields.get(local);
336
+ const targetProp = binding.target?.props.get(name);
337
+ if (!localProp || !targetProp || !binding.target) return void 0;
338
+ const a = designOf(targetProp.getDefinition(), binding.target.doc);
339
+ const b = designOf(localProp.getDefinition(), doc.declaringDoc(localProp, doc));
340
+ if (!a || !b || a === "other" || b === "other" || a === b) return void 0;
341
+ return `'${binding.name}.${name}' is ${a}, '${host.name}.${local}' is ${b}`;
342
+ }
219
343
  function validateValueHelp(token, args, doc) {
220
344
  const errors = [];
221
345
  const [targetArg, fieldArg, filterArg] = args;
222
346
  const host = token.parentNode;
223
347
  const field = annotatedField(host, doc);
224
- if (isNavigation(field?.prop ?? host)) errors.push({
348
+ const navNode = field?.prop ?? host;
349
+ if (navNode && isNavProp(navNode)) errors.push({
225
350
  message: "@ui.valueHelp is not valid on a navigation field — bind the foreign-key field",
226
351
  severity: ERROR,
227
352
  range: token.range
@@ -273,36 +398,51 @@ function validateValueHelp(token, args, doc) {
273
398
  });
274
399
  }
275
400
  const filterQuery = filterArg?.queryNode;
401
+ const formHost = hostOf(token, doc);
402
+ const validHost = typeof formHost === "object" ? formHost : void 0;
276
403
  if (filterArg && filterQuery) {
277
404
  errors.push(...validateQueryScope(filterArg, {
278
- allowedTypes: [targetName],
405
+ allowedTypes: validHost && validHost.name !== targetName ? [targetName, validHost.name] : [targetName],
279
406
  unqualifiedTarget: targetName
280
407
  }, doc));
281
- for (const cmp of comparisons(filterQuery.expression)) if (cmp.right && "fieldRef" in cmp.right) errors.push({
282
- message: "a value-help filter compares target fields with literal values",
283
- severity: ERROR,
284
- range: cmp.right.fieldRef.range
285
- });
408
+ errors.push(...validateHostRefs(filterQuery.expression, {
409
+ host: formHost,
410
+ binding: {
411
+ name: targetName,
412
+ target
413
+ },
414
+ doc
415
+ }));
286
416
  }
287
417
  if (fieldProp && fieldName !== void 0) {
288
418
  const idFields = [...target.props.entries()].filter(([, p]) => p.countAnnotations("meta.id") > 0);
289
419
  let ok = fieldProp.countAnnotations("db.index.unique") > 0 || fieldProp.countAnnotations("meta.id") > 0 && idFields.length === 1;
290
420
  if (!ok && fieldProp.countAnnotations("meta.id") > 0) {
291
- const pinned = pinnedFields(filterArg);
292
- ok = idFields.every(([name]) => name === fieldName || pinned.has(name));
421
+ const literal = pinnedFields(filterArg);
422
+ const byHost = validHost ? hostPins(filterArg, validHost.name) : void 0;
423
+ const fieldAnnotations = validHost?.field.annotations ?? [];
424
+ const argOf = (name) => fieldAnnotations.find((a) => a.name === name)?.args[0]?.text;
425
+ const formType = argOf("ui.form.type") ?? argOf("ui.type");
426
+ const dropdown = formType === "select" || formType === "radio";
427
+ const fills = fieldAnnotations.filter((a) => a.name === "ui.valueHelp.fill");
428
+ const writtenBack = (member) => {
429
+ const local = byHost?.get(member);
430
+ return !dropdown && local !== void 0 && fills.some((a) => a.args[0]?.text === local && a.args[1]?.text === member);
431
+ };
432
+ ok = idFields.every(([name]) => name === fieldName || literal.has(name) || writtenBack(name));
293
433
  }
294
434
  if (!ok) errors.push({
295
- message: `values may repeat in the picker — '${targetName}.${fieldName}' is not unique (a sole @meta.id, @db.index.unique, or a composite key member with the other members pinned by '=' in the filter)`,
435
+ message: `values may repeat in the picker — '${targetName}.${fieldName}' is not unique (a sole @meta.id, @db.index.unique, or a composite key member with the other members pinned by '=' to a literal in the filter, or to a host field a fill writes back from the picked row)`,
296
436
  severity: WARNING,
297
437
  range: token.range
298
438
  });
299
439
  }
300
440
  if (filterQuery && getAnnotationAlias(target.decl, "db.table.filterable") === "manual") {
301
441
  const seen = /* @__PURE__ */ new Set();
302
- forEachFieldRef(filterQuery.expression, (ref) => {
303
- if (ref.typeRef && ref.typeRef.text !== targetName) return;
442
+ for (const { left: ref } of comparisons(filterQuery.expression)) {
443
+ if (ref.typeRef && ref.typeRef.text !== targetName) continue;
304
444
  const name = ref.fieldRef.text;
305
- if (seen.has(name)) return;
445
+ if (seen.has(name)) continue;
306
446
  seen.add(name);
307
447
  const prop = target.props.get(name.split(".")[0]);
308
448
  if (prop && prop.countAnnotations("db.column.filterable") === 0) errors.push({
@@ -310,7 +450,27 @@ function validateValueHelp(token, args, doc) {
310
450
  severity: WARNING,
311
451
  range: ref.fieldRef.range
312
452
  });
313
- });
453
+ }
454
+ }
455
+ if (validHost && isRef(host)) {
456
+ const binding = {
457
+ name: targetName,
458
+ target
459
+ };
460
+ for (const a of validHost.field.annotations ?? []) {
461
+ if (a.token.parentNode === host) continue;
462
+ const isFill = a.name === "ui.valueHelp.fill";
463
+ if (!isFill && a.name !== "ui.valueHelp.column") continue;
464
+ const local = isFill ? a.args[0]?.text : void 0;
465
+ const name = a.args[isFill ? 1 : 0]?.text;
466
+ if (name === void 0) continue;
467
+ const problem = targetFieldProblem(binding, name) ?? (local === void 0 ? void 0 : designMismatch(validHost, local, binding, name, doc));
468
+ if (problem) errors.push({
469
+ message: `@${a.name} '${a.args.map((t) => t.text).join("', '")}' of this field: ${problem}`,
470
+ severity: ERROR,
471
+ range: token.range
472
+ });
473
+ }
314
474
  }
315
475
  return errors;
316
476
  }
@@ -319,6 +479,138 @@ function comparisons(expr) {
319
479
  if (isQueryLogical(expr)) return expr.operands.flatMap(comparisons);
320
480
  return isQueryComparison(expr) ? [expr] : [];
321
481
  }
482
+ /**
483
+ * VH5 / VH9 (since 0.1.190): a field-to-field comparison is a host reference —
484
+ * a top-level `and` conjunct `targetField = Host.field` naming an existing
485
+ * scalar field of the host of the same design type that is not the bound
486
+ * field. Anything else that compares two fields or names the host is an error.
487
+ */
488
+ function validateHostRefs(expr, ctx) {
489
+ const errors = [];
490
+ const { host, binding, doc } = ctx;
491
+ const targetName = binding.name;
492
+ const error = (message, range) => errors.push({
493
+ message,
494
+ severity: ERROR,
495
+ range
496
+ });
497
+ const visit = (node, topLevel) => {
498
+ if (isQueryLogical(node)) {
499
+ const chain = topLevel && node.operator === "and";
500
+ for (const operand of node.operands) visit(operand, chain);
501
+ return;
502
+ }
503
+ if (!isQueryComparison(node)) return;
504
+ const hostName = typeof host === "object" ? host.name : void 0;
505
+ if (hostName && hostName !== targetName && node.left.typeRef?.text === hostName) error(`the left side names a field of '${targetName}'; a host field belongs on the right ('field = ${hostName}.${node.left.fieldRef.text}')`, node.left.typeRef.range);
506
+ const ref = rightRef(node);
507
+ if (!ref) return;
508
+ if (typeof host !== "object") {
509
+ error(host === void 0 ? "a value-help filter compares target fields with literal values" : `a host reference (a right-hand field reference) needs ${REFUSED[host]}`, ref.fieldRef.range);
510
+ return;
511
+ }
512
+ const typeName = ref.typeRef?.text;
513
+ if (typeName !== host.name) {
514
+ if (typeName === void 0 || typeName === targetName) error(`a value-help filter compares target fields with literal values, or with a field of the host: '${host.name}.${ref.fieldRef.text}'`, ref.fieldRef.range);
515
+ return;
516
+ }
517
+ if (!topLevel) error("a host reference must be a top-level 'and' conjunct of the filter (not under 'or' / 'not')", ref.fieldRef.range);
518
+ if (node.operator !== "=") error(`a host reference compares with '=' (got '${node.operator}')`, ref.fieldRef.range);
519
+ const name = ref.fieldRef.text;
520
+ const prop = name.includes(".") ? void 0 : host.fields.get(name);
521
+ if (!prop) {
522
+ error(name.includes(".") ? `a host reference names a top-level field of '${host.name}', not a dotted path` : `Field '${name}' does not exist on '${host.name}'`, ref.fieldRef.range);
523
+ return;
524
+ }
525
+ if (name === host.field.id) error("a host reference cannot name the bound field itself", ref.fieldRef.range);
526
+ else if (isNotScalar(prop, doc)) error(`host field '${host.name}.${name}' must be ${SCALAR}`, ref.fieldRef.range);
527
+ else {
528
+ const mismatch = designMismatch(host, name, binding, node.left.fieldRef.text, doc);
529
+ if (mismatch) error(mismatch, ref.fieldRef.range);
530
+ }
531
+ };
532
+ visit(expr, true);
533
+ return errors;
534
+ }
535
+ function validateFill(token, args, doc) {
536
+ const errors = [];
537
+ const [localArg, targetArg] = args;
538
+ const host = hostOf(token, doc);
539
+ if (typeof host !== "object") {
540
+ if (host) errors.push({
541
+ message: `@ui.valueHelp.fill needs ${REFUSED[host]}`,
542
+ severity: ERROR,
543
+ range: token.range
544
+ });
545
+ return errors;
546
+ }
547
+ const binding = bindingOf(host.field, doc);
548
+ if (!binding) {
549
+ errors.push({
550
+ message: "@ui.valueHelp.fill needs a binding of this field's own (@ui.valueHelp or @db.rel.FK)",
551
+ severity: ERROR,
552
+ range: token.range
553
+ });
554
+ return errors;
555
+ }
556
+ const local = localArg?.text;
557
+ let localOk = false;
558
+ if (localArg && local !== void 0) {
559
+ const prop = local.includes(".") ? void 0 : host.fields.get(local);
560
+ if (!prop || local === host.field.id) errors.push({
561
+ message: local.includes(".") ? `'${local}' must be a top-level field of '${host.name}', not a dotted path` : prop ? "@ui.valueHelp.fill cannot fill the bound field itself" : `Field '${local}' does not exist on '${host.name}'`,
562
+ severity: ERROR,
563
+ range: localArg.range
564
+ });
565
+ else if (isNavProp(prop)) errors.push({
566
+ message: `'${local}' is a navigation field — a pick never writes it`,
567
+ severity: WARNING,
568
+ range: localArg.range
569
+ });
570
+ else if (isNotScalar(prop, doc)) errors.push({
571
+ message: `'${host.name}.${local}' must be ${SCALAR}`,
572
+ severity: ERROR,
573
+ range: localArg.range
574
+ });
575
+ else {
576
+ localOk = true;
577
+ const effective = effectiveAnnotationNames(prop, doc);
578
+ const why = effective.has("db.column.derived") ? "@db.column.derived" : effective.has("meta.readonly") ? "@meta.readonly" : void 0;
579
+ if (why) errors.push({
580
+ message: `'${local}' is ${why} — a pick never writes it`,
581
+ severity: WARNING,
582
+ range: localArg.range
583
+ });
584
+ }
585
+ }
586
+ const name = targetArg?.text;
587
+ if (targetArg && name !== void 0) {
588
+ const problem = targetFieldProblem(binding, name) ?? (localOk && local !== void 0 ? designMismatch(host, local, binding, name, doc) : void 0);
589
+ if (problem) errors.push({
590
+ message: problem,
591
+ severity: ERROR,
592
+ range: targetArg.range
593
+ });
594
+ }
595
+ return errors;
596
+ }
597
+ function validateColumn(token, args, doc) {
598
+ const field = annotationTarget(token, doc);
599
+ if (!field) return [];
600
+ const binding = bindingOf(field, doc);
601
+ if (!binding) return [{
602
+ message: "@ui.valueHelp.column needs a binding of this field's own (@ui.valueHelp or @db.rel.FK)",
603
+ severity: ERROR,
604
+ range: token.range
605
+ }];
606
+ const name = args[0]?.text;
607
+ const problem = name === void 0 ? void 0 : targetFieldProblem(binding, name);
608
+ return problem ? [{
609
+ message: problem,
610
+ severity: ERROR,
611
+ range: args[0].range
612
+ }] : [];
613
+ }
322
614
  function validateDistinct(token, _args, doc) {
323
615
  const errors = [];
324
616
  const host = token.parentNode;
@@ -406,6 +698,44 @@ function validateLiteralLabel(token, args, doc) {
406
698
  return errors;
407
699
  }
408
700
  /**
701
+ * `valueScope` of `@ui.valueLabel`'s `field`: the string-valued fields of the
702
+ * type the annotated field belongs to, declared or inherited
703
+ * (`siblingStringFields`: never the field itself, an object, a number or a
704
+ * dotted path) — for an `annotate` entry, of the annotated interface.
705
+ * Go-to-definition jumps to the field in the file that declares it.
706
+ */
707
+ function valueLabelFields(annotationToken, doc) {
708
+ return siblingStringFields(annotationToken, doc).map((prop) => {
709
+ const token = prop.token("identifier");
710
+ return Object.assign({ value: prop.id ?? `` }, token && { definition: {
711
+ doc: doc.declaringDoc(prop, doc),
712
+ token
713
+ } });
714
+ });
715
+ }
716
+ function validateValueLabel(token, args, doc) {
717
+ const errors = [];
718
+ const field = annotationTarget(token, doc);
719
+ const name = args[0]?.text;
720
+ if (name !== void 0) if (field?.id !== void 0 && name === field.id) errors.push({
721
+ message: "@ui.valueLabel names the field holding this value's text, not this field",
722
+ severity: ERROR,
723
+ range: args[0].range
724
+ });
725
+ else errors.push(...validateSiblingStringField(token, args, doc, "@ui.valueLabel"));
726
+ errors.push(...validateExclusiveWith(token, "@ui.valueLabel", [{ key: "ui.literalLabel" }], doc));
727
+ if (field && name !== void 0 && name !== field.id) {
728
+ const binding = bindingOf(field, doc);
729
+ const filled = (field.annotations ?? []).some((a) => a.name === "ui.valueHelp.fill" && a.args[0]?.text === name);
730
+ if (binding && !filled) errors.push({
731
+ message: `a pick of this field's value help does not fill '${name}' — the text goes stale after a pick (add @ui.valueHelp.fill '${name}', '<a field of ${binding.name}>')`,
732
+ severity: WARNING,
733
+ range: token.range
734
+ });
735
+ }
736
+ return errors;
737
+ }
738
+ /**
409
739
  * `@ui.form.type` / `@ui.type`: the free-entry `tags` renderer edits an array —
410
740
  * on any other field it would mount with a scalar value.
411
741
  */
@@ -420,4 +750,4 @@ function validateFormType(token, args, doc) {
420
750
  }];
421
751
  }
422
752
  //#endregion
423
- export { isValueHelpTarget, literalLabelValues, validateDistinct, validateFormType, validateLiteralLabel, validateValueHelp, valueHelpScopes };
753
+ export { isValueHelpTarget, literalLabelValues, validateColumn, validateDistinct, validateFill, validateFormType, validateLiteralLabel, validateValueHelp, validateValueLabel, valueHelpScopes, valueLabelFields };
@@ -43,7 +43,13 @@ const UI_DICT_SORTABLE = "ui.dict.sortable";
43
43
  const UI_DICT_SEARCHABLE = "ui.dict.searchable";
44
44
  const UI_VALUE_HELP = "ui.valueHelp";
45
45
  const UI_VALUE_HELP_DISTINCT = "ui.valueHelp.distinct";
46
+ /** `@ui.valueHelp.fill 'local', 'targetField'` — since 0.1.190. */
47
+ const UI_VALUE_HELP_FILL = "ui.valueHelp.fill";
48
+ /** `@ui.valueHelp.column 'field'` — since 0.1.190. */
49
+ const UI_VALUE_HELP_COLUMN = "ui.valueHelp.column";
46
50
  const UI_LITERAL_LABEL = "ui.literalLabel";
51
+ /** `@ui.valueLabel 'field', 'arrangement'?` — a code shown with its text; since 0.1.190. */
52
+ const UI_VALUE_LABEL = "ui.valueLabel";
47
53
  const UI_NAV_GROUP = "ui.nav.group";
48
54
  const UI_NAV_ORDER = "ui.nav.order";
49
55
  const UI_NAV_HIDDEN = "ui.nav.hidden";
@@ -60,6 +66,7 @@ const DB_UNIT = "db.unit";
60
66
  const DB_UNIT_REF = "db.unit.ref";
61
67
  const DB_COLUMN_PRECISION = "db.column.precision";
62
68
  const DB_COLUMN_VERSION = "db.column.version";
69
+ const DB_COLUMN_VERSION_TOKEN = "db.column.version.token";
63
70
  const DB_COLUMN_DERIVED = "db.column.derived";
64
71
  const WF_ACTION_WITH_DATA = "wf.action.withData";
65
72
  const META_LABEL = "meta.label";
@@ -99,6 +106,7 @@ exports.DB_AMOUNT_CURRENCY_REF = DB_AMOUNT_CURRENCY_REF;
99
106
  exports.DB_COLUMN_DERIVED = DB_COLUMN_DERIVED;
100
107
  exports.DB_COLUMN_PRECISION = DB_COLUMN_PRECISION;
101
108
  exports.DB_COLUMN_VERSION = DB_COLUMN_VERSION;
109
+ exports.DB_COLUMN_VERSION_TOKEN = DB_COLUMN_VERSION_TOKEN;
102
110
  exports.DB_ENCRYPTED = DB_ENCRYPTED;
103
111
  exports.DB_HTTP_PATH = DB_HTTP_PATH;
104
112
  exports.DB_JSON = DB_JSON;
@@ -185,5 +193,8 @@ exports.UI_TABLE_TYPE = UI_TABLE_TYPE;
185
193
  exports.UI_TABLE_WIDTH = UI_TABLE_WIDTH;
186
194
  exports.UI_TYPE = UI_TYPE;
187
195
  exports.UI_VALUE_HELP = UI_VALUE_HELP;
196
+ exports.UI_VALUE_HELP_COLUMN = UI_VALUE_HELP_COLUMN;
188
197
  exports.UI_VALUE_HELP_DISTINCT = UI_VALUE_HELP_DISTINCT;
198
+ exports.UI_VALUE_HELP_FILL = UI_VALUE_HELP_FILL;
199
+ exports.UI_VALUE_LABEL = UI_VALUE_LABEL;
189
200
  exports.WF_ACTION_WITH_DATA = WF_ACTION_WITH_DATA;
@@ -38,6 +38,8 @@ declare const UI_DICT_ATTR: "ui.dict.attr";
38
38
  declare const UI_DICT_FILTERABLE: "ui.dict.filterable";
39
39
  declare const UI_DICT_SORTABLE: "ui.dict.sortable";
40
40
  declare const UI_DICT_SEARCHABLE: "ui.dict.searchable";
41
+ /** `@ui.valueLabel 'field', 'arrangement'?` — a code shown with its text; since 0.1.190. */
42
+ declare const UI_VALUE_LABEL: "ui.valueLabel";
41
43
  declare const UI_NAV_GROUP: "ui.nav.group";
42
44
  declare const UI_NAV_ORDER: "ui.nav.order";
43
45
  declare const UI_NAV_HIDDEN: "ui.nav.hidden";
@@ -79,4 +81,4 @@ declare const UI_TABLE_FN_CLASSES: "ui.table.fn.classes";
79
81
  declare const UI_TABLE_FN_STYLES: "ui.table.fn.styles";
80
82
  declare const UI_FORM_VALIDATE: "ui.form.validate";
81
83
  //#endregion
82
- export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, WF_ACTION_WITH_DATA };
84
+ export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, UI_VALUE_LABEL, WF_ACTION_WITH_DATA };
@@ -38,6 +38,8 @@ declare const UI_DICT_ATTR: "ui.dict.attr";
38
38
  declare const UI_DICT_FILTERABLE: "ui.dict.filterable";
39
39
  declare const UI_DICT_SORTABLE: "ui.dict.sortable";
40
40
  declare const UI_DICT_SEARCHABLE: "ui.dict.searchable";
41
+ /** `@ui.valueLabel 'field', 'arrangement'?` — a code shown with its text; since 0.1.190. */
42
+ declare const UI_VALUE_LABEL: "ui.valueLabel";
41
43
  declare const UI_NAV_GROUP: "ui.nav.group";
42
44
  declare const UI_NAV_ORDER: "ui.nav.order";
43
45
  declare const UI_NAV_HIDDEN: "ui.nav.hidden";
@@ -79,4 +81,4 @@ declare const UI_TABLE_FN_CLASSES: "ui.table.fn.classes";
79
81
  declare const UI_TABLE_FN_STYLES: "ui.table.fn.styles";
80
82
  declare const UI_FORM_VALIDATE: "ui.form.validate";
81
83
  //#endregion
82
- export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, WF_ACTION_WITH_DATA };
84
+ export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, UI_VALUE_LABEL, WF_ACTION_WITH_DATA };
@@ -43,7 +43,13 @@ const UI_DICT_SORTABLE = "ui.dict.sortable";
43
43
  const UI_DICT_SEARCHABLE = "ui.dict.searchable";
44
44
  const UI_VALUE_HELP = "ui.valueHelp";
45
45
  const UI_VALUE_HELP_DISTINCT = "ui.valueHelp.distinct";
46
+ /** `@ui.valueHelp.fill 'local', 'targetField'` — since 0.1.190. */
47
+ const UI_VALUE_HELP_FILL = "ui.valueHelp.fill";
48
+ /** `@ui.valueHelp.column 'field'` — since 0.1.190. */
49
+ const UI_VALUE_HELP_COLUMN = "ui.valueHelp.column";
46
50
  const UI_LITERAL_LABEL = "ui.literalLabel";
51
+ /** `@ui.valueLabel 'field', 'arrangement'?` — a code shown with its text; since 0.1.190. */
52
+ const UI_VALUE_LABEL = "ui.valueLabel";
47
53
  const UI_NAV_GROUP = "ui.nav.group";
48
54
  const UI_NAV_ORDER = "ui.nav.order";
49
55
  const UI_NAV_HIDDEN = "ui.nav.hidden";
@@ -60,6 +66,7 @@ const DB_UNIT = "db.unit";
60
66
  const DB_UNIT_REF = "db.unit.ref";
61
67
  const DB_COLUMN_PRECISION = "db.column.precision";
62
68
  const DB_COLUMN_VERSION = "db.column.version";
69
+ const DB_COLUMN_VERSION_TOKEN = "db.column.version.token";
63
70
  const DB_COLUMN_DERIVED = "db.column.derived";
64
71
  const WF_ACTION_WITH_DATA = "wf.action.withData";
65
72
  const META_LABEL = "meta.label";
@@ -94,4 +101,4 @@ const UI_TABLE_FN_CLASSES = "ui.table.fn.classes";
94
101
  const UI_TABLE_FN_STYLES = "ui.table.fn.styles";
95
102
  const UI_FORM_VALIDATE = "ui.form.validate";
96
103
  //#endregion
97
- export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_DERIVED, DB_COLUMN_PRECISION, DB_COLUMN_VERSION, DB_ENCRYPTED, DB_HTTP_PATH, DB_JSON, DB_REL_FK, DB_TABLE, DB_UNIT, DB_UNIT_REF, DB_VIEW, DB_VIEW_FOR, EXPECT_ARRAY_KEY, EXPECT_ARRAY_UNIQUE_ITEMS, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_NS, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_PUSH_DOWN, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_LITERAL_LABEL, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, UI_VALUE_HELP, UI_VALUE_HELP_DISTINCT, WF_ACTION_WITH_DATA };
104
+ export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_DERIVED, DB_COLUMN_PRECISION, DB_COLUMN_VERSION, DB_COLUMN_VERSION_TOKEN, DB_ENCRYPTED, DB_HTTP_PATH, DB_JSON, DB_REL_FK, DB_TABLE, DB_UNIT, DB_UNIT_REF, DB_VIEW, DB_VIEW_FOR, EXPECT_ARRAY_KEY, EXPECT_ARRAY_UNIQUE_ITEMS, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_NS, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_PUSH_DOWN, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_LITERAL_LABEL, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, UI_VALUE_HELP, UI_VALUE_HELP_COLUMN, UI_VALUE_HELP_DISTINCT, UI_VALUE_HELP_FILL, UI_VALUE_LABEL, WF_ACTION_WITH_DATA };
@@ -3,7 +3,7 @@ import { MetaResponse, TableDef } from "../table/types.cjs";
3
3
  import { UiTexts } from "../i18n/ui-texts.cjs";
4
4
  import { ResolvedValueHelp } from "../value-help/resolve.cjs";
5
5
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
6
- import { Client } from "@atscript/db-client";
6
+ import { ClientLike } from "@atscript/db-client";
7
7
 
8
8
  //#region src/shared/meta-cache.d.ts
9
9
  /**
@@ -34,7 +34,7 @@ import { Client } from "@atscript/db-client";
34
34
  * uncached entry whose client keeps no `/meta` store.
35
35
  */
36
36
  interface MetaCacheEntry {
37
- client: Client;
37
+ client: ClientLike;
38
38
  meta: Promise<MetaResponse>;
39
39
  type: Promise<TAtscriptAnnotatedType>;
40
40
  resolved?: Promise<ResolvedValueHelp>;
@@ -66,7 +66,7 @@ interface MetaEntryOptions {
66
66
  *
67
67
  * @internal Shared with `@atscript/vue-table`.
68
68
  */
69
- declare function createMetaClient(url: string, factory: ClientFactory | undefined, locale: string | undefined, metaKey?: string): Client;
69
+ declare function createMetaClient(url: string, factory: ClientFactory | undefined, locale: string | undefined, metaKey?: string): ClientLike;
70
70
  /**
71
71
  * Get or create the cache entry for `url` in the UI locale of
72
72
  * `options.texts`. First caller's `factory` (and `options.metaKey`) seeds the
@@ -3,7 +3,7 @@ import { MetaResponse, TableDef } from "../table/types.mjs";
3
3
  import { UiTexts } from "../i18n/ui-texts.mjs";
4
4
  import { ResolvedValueHelp } from "../value-help/resolve.mjs";
5
5
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
6
- import { Client } from "@atscript/db-client";
6
+ import { ClientLike } from "@atscript/db-client";
7
7
 
8
8
  //#region src/shared/meta-cache.d.ts
9
9
  /**
@@ -34,7 +34,7 @@ import { Client } from "@atscript/db-client";
34
34
  * uncached entry whose client keeps no `/meta` store.
35
35
  */
36
36
  interface MetaCacheEntry {
37
- client: Client;
37
+ client: ClientLike;
38
38
  meta: Promise<MetaResponse>;
39
39
  type: Promise<TAtscriptAnnotatedType>;
40
40
  resolved?: Promise<ResolvedValueHelp>;
@@ -66,7 +66,7 @@ interface MetaEntryOptions {
66
66
  *
67
67
  * @internal Shared with `@atscript/vue-table`.
68
68
  */
69
- declare function createMetaClient(url: string, factory: ClientFactory | undefined, locale: string | undefined, metaKey?: string): Client;
69
+ declare function createMetaClient(url: string, factory: ClientFactory | undefined, locale: string | undefined, metaKey?: string): ClientLike;
70
70
  /**
71
71
  * Get or create the cache entry for `url` in the UI locale of
72
72
  * `options.texts`. First caller's `factory` (and `options.metaKey`) seeds the