@mintplayer/ng-spark 22.8.0 → 22.10.0

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.
@@ -0,0 +1,30 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TranslatedString } from '@mintplayer/ng-spark/models';
3
+
4
+ type SparkAttributeDescriptionPosition = 'top' | 'bottom' | 'start' | 'end';
5
+ /**
6
+ * The [i] beside an attribute label: a focusable button whose tooltip shows the attribute's
7
+ * `description` (#348). Renders nothing when the model declares no description, so every label
8
+ * site can include it unconditionally.
9
+ *
10
+ * Accessibility comes from `*bsTooltip`: it opens on hover AND focus, closes on Escape, and sets
11
+ * `aria-describedby` on the button while open. The button's own name is the description text, so
12
+ * a screen reader announces the help on focus without waiting for the tooltip.
13
+ *
14
+ * Clicks are stopped: the [i] lives inside sortable grid headers and `<label for>` elements, and
15
+ * must neither toggle the sort nor move focus into the input.
16
+ */
17
+ declare class SparkAttributeDescriptionComponent {
18
+ /** The attribute's `description`; `undefined` (the common case) renders nothing. */
19
+ description: _angular_core.InputSignal<TranslatedString | undefined>;
20
+ /** Where the tooltip opens relative to the [i]. */
21
+ position: _angular_core.InputSignal<SparkAttributeDescriptionPosition>;
22
+ /** Resolved for the current language; re-evaluates when the user switches language. */
23
+ text: _angular_core.Signal<string>;
24
+ onClick(event: MouseEvent): void;
25
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkAttributeDescriptionComponent, never>;
26
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkAttributeDescriptionComponent, "spark-attribute-description", never, { "description": { "alias": "description"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
27
+ }
28
+
29
+ export { SparkAttributeDescriptionComponent };
30
+ export type { SparkAttributeDescriptionPosition };
@@ -123,6 +123,8 @@ interface EntityAttributeDefinition {
123
123
  id: string;
124
124
  name: string;
125
125
  label?: TranslatedString;
126
+ /** Help text rendered as an [i] tooltip beside the label. Absent when the model declares none. */
127
+ description?: TranslatedString;
126
128
  dataType: string;
127
129
  isRequired: boolean;
128
130
  isVisible: boolean;
@@ -265,6 +267,8 @@ interface QueryResult {
265
267
  interface SparkCellColumn {
266
268
  name: string;
267
269
  label?: TranslatedString;
270
+ /** Help text rendered as an [i] tooltip in the column header. Absent when the model declares none. */
271
+ description?: TranslatedString;
268
272
  dataType: string;
269
273
  isArray?: boolean;
270
274
  renderer?: string;
@@ -17,10 +17,12 @@ declare function rendererValue(attr: PersistentObjectAttribute | undefined): any
17
17
  /**
18
18
  * The renderer-facing value of a query-result cell.
19
19
  *
20
- * A grid row carries no nested objects to fall back to — a projection is flat by construction —
21
- * so this is deliberately not the same function as {@link rendererValue}. Keeping them separate
22
- * is what stops a renderer silently receiving `undefined` because it was written against the
23
- * attribute shape.
20
+ * A cell is a single channel: whatever a renderer needs is already on `value` — for a single-child
21
+ * AsDetail column that is the nested PersistentObject itself, put there by the server so this
22
+ * matches what {@link rendererValue} falls through to on a detail page. There is nothing to fall
23
+ * back to, which is why this is deliberately not the same function: keeping them separate is what
24
+ * stops a renderer silently receiving `undefined` because it was written against the attribute
25
+ * shape's `object` / `objects` fields, which a row does not carry.
24
26
  */
25
27
  declare function cellValue(value: QueryResultItemValue | undefined): any;
26
28