eru-grid 0.0.55 → 0.0.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eru-grid",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.2",
6
6
  "@angular/core": "^21.1.2",
@@ -370,6 +370,7 @@ interface Field {
370
370
  cell_page_id?: string;
371
371
  cell_style?: CellTextStyle;
372
372
  cell_style_secondary?: CellTextStyle;
373
+ cell_style_tertiary?: CellTextStyle;
373
374
  is_pii?: boolean;
374
375
  is_ephi?: boolean;
375
376
  to_encrypt?: boolean;
@@ -1099,6 +1100,16 @@ declare function parseCellDate(value: any, pattern?: string, keepTime?: boolean)
1099
1100
  * the interactive cell's job, and a composite that tried to host those would be
1100
1101
  * a layout engine. A column needing that is a `page` cell.
1101
1102
  */
1103
+ /**
1104
+ * A status field with its `open_status` / `close_status` lists flattened into
1105
+ * the `options` array the status control actually reads for its colours.
1106
+ *
1107
+ * Shared rather than done at the call site: the status cell has always built
1108
+ * this, and a composite part handed the raw field instead rendered every pill
1109
+ * in the neutral fallback — the colour lives on the option, and without the
1110
+ * flattened list there is no option to match the value against.
1111
+ */
1112
+ declare function toStatusOptionsField(field: Field | null | undefined): Field | null;
1102
1113
  declare function formatCellValue(value: any, field: Field | null | undefined): string;
1103
1114
  /**
1104
1115
  * Read a field's value off a row, tolerating both shapes the grid is handed:
@@ -2972,20 +2983,64 @@ declare class ChipListComponent implements OnDestroy {
2972
2983
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChipListComponent, "eru-chip-list", never, { "labels": { "alias": "labels"; "required": false; }; "chips": { "alias": "chips"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "availableWidth": { "alias": "availableWidth"; "required": false; }; }, {}, never, never, true, never>;
2973
2984
  }
2974
2985
 
2986
+ interface RatingConfig {
2987
+ startValue?: number;
2988
+ endValue?: number;
2989
+ emojiValue?: 'star' | 'smile' | 'heart';
2990
+ }
2991
+ declare class RatingComponent {
2992
+ value: _angular_core.InputSignal<number>;
2993
+ config: _angular_core.InputSignal<RatingConfig>;
2994
+ isEditable: _angular_core.InputSignal<boolean>;
2995
+ isActive: _angular_core.InputSignal<boolean>;
2996
+ valueChange: EventEmitter<number>;
2997
+ editModeChange: EventEmitter<boolean>;
2998
+ currentValue: _angular_core.WritableSignal<number>;
2999
+ hoverRating: _angular_core.WritableSignal<number>;
3000
+ constructor();
3001
+ getRatingStars: _angular_core.Signal<number[]>;
3002
+ getEmoji(star: number): string;
3003
+ onActivate(): void;
3004
+ setRating(value: number): void;
3005
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RatingComponent, never>;
3006
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RatingComponent, "eru-rating", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "isEditable": { "alias": "isEditable"; "required": false; "isSignal": true; }; "isActive": { "alias": "isActive"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "editModeChange": "editModeChange"; }, never, never, true, never>;
3007
+ }
3008
+
2975
3009
  interface CompositePart {
2976
3010
  name: string;
2977
3011
  label: string;
2978
3012
  text: string;
3013
+ /** The part's own column, so a self-drawing datatype can be given its config. */
3014
+ field: Field | null;
3015
+ /** Unformatted, for the controls — they format and colour their own value. */
3016
+ value: any;
3017
+ /** The datatype to draw, or '' when this part stays as formatted text. */
3018
+ render: string;
3019
+ /** True for a figure, so the slot aligns it the way its own column would. */
3020
+ numeric: boolean;
3021
+ /**
3022
+ * The part's position in `composite_fields`, kept because empty parts are
3023
+ * dropped from the render. Styling by the RENDERED position meant a null
3024
+ * secondary promoted the third part into the second's style — a green
3025
+ * tertiary line turning red the moment its neighbour had no value.
3026
+ */
3027
+ slot: number;
2979
3028
  }
2980
3029
  /**
2981
3030
  * Several of the row's own columns rendered as one cell — a name over an email,
2982
3031
  * an amount over a date.
2983
3032
  *
2984
- * View-only, and text-only, by design. Each part is formatted by its OWN
2985
- * field's rules (`formatCellValue`), so a currency part keeps its symbol and
2986
- * decimals and a date part keeps its pattern; the composite itself decides only
2987
- * arrangement and emphasis. Editing stays on the underlying columns, which are
3033
+ * View-only by design: editing stays on the underlying columns, which are
2988
3034
  * usually hidden once composed.
3035
+ *
3036
+ * A part whose datatype has a visual form of its own — a rating, a progress
3037
+ * bar, a status pill, tags, a priority, people, a checkbox — is drawn with that
3038
+ * control rather than as text, since "4" and "75" tell a reader far less than
3039
+ * four stars and a bar. Everything else is formatted by its OWN field's rules
3040
+ * (`formatCellValue`), so a currency part keeps its symbol and decimals and a
3041
+ * date part keeps its pattern — wrapping those in a control would render the
3042
+ * same string in a heavier box. The composite itself decides only arrangement
3043
+ * and emphasis.
2989
3044
  */
2990
3045
  declare class CompositeComponent {
2991
3046
  row: _angular_core.InputSignal<any>;
@@ -2999,12 +3054,57 @@ declare class CompositeComponent {
2999
3054
  readonly labelPosition: _angular_core.Signal<"none" | "left" | "right">;
3000
3055
  readonly primaryCss: _angular_core.Signal<Record<string, string>>;
3001
3056
  readonly secondaryCss: _angular_core.Signal<Record<string, string>>;
3057
+ /**
3058
+ * The third part and any beyond it.
3059
+ *
3060
+ * Falls back to the secondary style when unset, so every composite authored
3061
+ * before this existed keeps the look it had — three parts sharing one style
3062
+ * is precisely what this is for, not what it breaks.
3063
+ */
3064
+ readonly tertiaryCss: _angular_core.Signal<Record<string, string>>;
3065
+ /**
3066
+ * Primary, secondary, then tertiary for the rest — keyed on the part's
3067
+ * configured slot, never on where it ended up after empty parts were dropped.
3068
+ */
3069
+ cssForSlot(slot: number): Record<string, string>;
3002
3070
  /**
3003
3071
  * Falls back to the composite column itself when `composite_fields` is unset
3004
3072
  * or names nothing that exists, so a column switched to `composite` before it
3005
3073
  * is configured still shows its own value instead of going blank.
3006
3074
  */
3007
3075
  readonly parts: _angular_core.Signal<CompositePart[]>;
3076
+ /**
3077
+ * Datatypes drawn with their own control instead of as text.
3078
+ *
3079
+ * The test is "does this type carry meaning a string cannot" — stars, a bar,
3080
+ * a coloured pill, chips, avatars, a tick. A currency or a date is already
3081
+ * fully said by `formatCellValue`, so it stays text.
3082
+ */
3083
+ private static readonly SELF_DRAWN;
3084
+ /**
3085
+ * The field with this ROW's currency symbol resolved onto it.
3086
+ *
3087
+ * `formatCellValue` only knows the column's static `symbol`, but a
3088
+ * multi-currency column names a sibling column in `symbol_field` and takes
3089
+ * the symbol from each record — which is how the currency CELL renders it
3090
+ * (it is handed the row for exactly this). Without it a composed currency
3091
+ * part lost its symbol and read as a bare number.
3092
+ */
3093
+ private static withRowSymbol;
3094
+ /** Figures are right-aligned by their own cell, so a composed one is too. */
3095
+ private static isNumeric;
3096
+ private static selfDrawnDatatype;
3097
+ /**
3098
+ * A status part needs its option colours flattened the same way the status
3099
+ * CELL does, or every pill renders in the neutral fallback.
3100
+ */
3101
+ statusConfig(field: Field | null): Field | null;
3102
+ /** Rating takes a shape of its own rather than the raw Field. */
3103
+ ratingConfig(field: Field | null): RatingConfig;
3104
+ /** Controls want their own types; a row value can arrive as anything. */
3105
+ asNumber(value: any): number;
3106
+ asText(value: any): string | null;
3107
+ asList(value: any): string[] | null;
3008
3108
  onDrilldown(event: Event, part: CompositePart): void;
3009
3109
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompositeComponent, never>;
3010
3110
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompositeComponent, "eru-composite", never, { "row": { "alias": "row"; "required": false; "isSignal": true; }; "column": { "alias": "column"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "isDrillable": { "alias": "isDrillable"; "required": false; "isSignal": true; }; }, { "drilldownClick": "drilldownClick"; }, never, never, true, never>;
@@ -3624,29 +3724,6 @@ declare class ProgressComponent implements OnInit {
3624
3724
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ProgressComponent, "eru-progress", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "isEditable": { "alias": "isEditable"; "required": false; "isSignal": true; }; "isActive": { "alias": "isActive"; "required": false; "isSignal": true; }; "isDrillable": { "alias": "isDrillable"; "required": false; "isSignal": true; }; "columnWidth": { "alias": "columnWidth"; "required": false; "isSignal": true; }; "fieldSize": { "alias": "fieldSize"; "required": false; "isSignal": true; }; "eruGridStore": { "alias": "eruGridStore"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "blur": "blur"; "focus": "focus"; "drilldownClick": "drilldownClick"; "editModeChange": "editModeChange"; }, never, never, true, never>;
3625
3725
  }
3626
3726
 
3627
- interface RatingConfig {
3628
- startValue?: number;
3629
- endValue?: number;
3630
- emojiValue?: 'star' | 'smile' | 'heart';
3631
- }
3632
- declare class RatingComponent {
3633
- value: _angular_core.InputSignal<number>;
3634
- config: _angular_core.InputSignal<RatingConfig>;
3635
- isEditable: _angular_core.InputSignal<boolean>;
3636
- isActive: _angular_core.InputSignal<boolean>;
3637
- valueChange: EventEmitter<number>;
3638
- editModeChange: EventEmitter<boolean>;
3639
- currentValue: _angular_core.WritableSignal<number>;
3640
- hoverRating: _angular_core.WritableSignal<number>;
3641
- constructor();
3642
- getRatingStars: _angular_core.Signal<number[]>;
3643
- getEmoji(star: number): string;
3644
- onActivate(): void;
3645
- setRating(value: number): void;
3646
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<RatingComponent, never>;
3647
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<RatingComponent, "eru-rating", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "isEditable": { "alias": "isEditable"; "required": false; "isSignal": true; }; "isActive": { "alias": "isActive"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "editModeChange": "editModeChange"; }, never, never, true, never>;
3648
- }
3649
-
3650
3727
  declare class SelectComponent implements OnInit, AfterViewInit {
3651
3728
  private el;
3652
3729
  selectContainer: ElementRef<HTMLElement>;
@@ -4062,5 +4139,5 @@ declare class ThemeToggleComponent {
4062
4139
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThemeToggleComponent, "eru-theme-toggle", never, {}, {}, never, never, true, never>;
4063
4140
  }
4064
4141
 
4065
- export { ACTION_COLUMN_MIN_WIDTH, AttachmentComponent, CELL_RULE_OPERATORS, CheckboxComponent, ChipListComponent, ColumnConstraintsService, CompositeComponent, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DATETIME_FORMATS, DATE_FORMATS, DateComponent, DatetimeComponent, DurationComponent, EXPLICITLY_OVERRIDDEN_FIELD_KEYS, EmailComponent, EruGridComponent, EruGridService, EruGridStore, GRID_COLOR_TOKENS, INHERITED_FIELD_KEYS, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, MONTH_SHORT_NAMES, NumberComponent, NumericInputDirective, PRESENTATION_DATATYPES, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SEEDED_FIELD_KEYS, SELF_COLOURED_DATATYPES, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent, abbreviateNumber, abbreviationScaleFor, cellRuleBarPercent, cellRuleMatches, cellRuleToCss, cellStatAlias, cellTextStyleToCss, collectColumnStatRequests, columnCellRules, composeColorValue, effectiveValueDatatype, evaluateRowCondition, formatCellValue, formatDateTimeWithPattern, formatDateWithPattern, formatNumberValue, hasOwnCellRules, matchCellRule, matchColorRange, normalizeCellRender, normalizeDatatype, normalizeDateFormat, normalizeDateTimeFormat, parseCellDate, parseCellDateTime, parseColorValue, parseDateWithPattern, readRowValue, resolveColumnRules, resolveRowValue, resolveStatValue, rowSelectionKey, statusPillColors, tagPillColors, toDateOnlyString, toDateTimeString };
4142
+ export { ACTION_COLUMN_MIN_WIDTH, AttachmentComponent, CELL_RULE_OPERATORS, CheckboxComponent, ChipListComponent, ColumnConstraintsService, CompositeComponent, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DATETIME_FORMATS, DATE_FORMATS, DateComponent, DatetimeComponent, DurationComponent, EXPLICITLY_OVERRIDDEN_FIELD_KEYS, EmailComponent, EruGridComponent, EruGridService, EruGridStore, GRID_COLOR_TOKENS, INHERITED_FIELD_KEYS, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, MONTH_SHORT_NAMES, NumberComponent, NumericInputDirective, PRESENTATION_DATATYPES, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SEEDED_FIELD_KEYS, SELF_COLOURED_DATATYPES, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent, abbreviateNumber, abbreviationScaleFor, cellRuleBarPercent, cellRuleMatches, cellRuleToCss, cellStatAlias, cellTextStyleToCss, collectColumnStatRequests, columnCellRules, composeColorValue, effectiveValueDatatype, evaluateRowCondition, formatCellValue, formatDateTimeWithPattern, formatDateWithPattern, formatNumberValue, hasOwnCellRules, matchCellRule, matchColorRange, normalizeCellRender, normalizeDatatype, normalizeDateFormat, normalizeDateTimeFormat, parseCellDate, parseCellDateTime, parseColorValue, parseDateWithPattern, readRowValue, resolveColumnRules, resolveRowValue, resolveStatValue, rowSelectionKey, statusPillColors, tagPillColors, toDateOnlyString, toDateTimeString, toStatusOptionsField };
4066
4143
  export type { ActionClick, AggregationFunction, AttachmentConfig, BoardCardContext, CellFormatRule, CellRender, CellRuleOperator, CellStatRef, CellStatVerb, CellTemplateContext, CellTextStyle, CellValueChange, ChipListItem, ColorRangeBand, ColumnReorder, ColumnResize, ColumnStatRequest, ColumnWidthConstraints, CompositePart, CurrencyValidationResult, DataTypes, Drilldown, DurationValue, DynamicDataRequest, EmailValidationResult, ExcelDownloadPayload, ExcelDownloadRequest, ExcelPivotConfig, Field, GridAction, GridConfiguration, GridFeatures, GridMode, GridPreset, GridStyles, GridTokens, GroupItem$1 as GroupItem, LocationConfig, LocationValidationResult, NumberValidationResult, ParsedColorValue, PeopleOption, PersonCardContext, PivotColumnGroupState, PivotColumnHeader, PivotColumnKind, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, PivotRowKind, RatingConfig, Row, RowDataRequest, RowDataResponse, RowGrandTotal, RowGroup, ServerValidationNotice, StatusPillColors, TagPillColors, TextareaValidationResult, TextboxValidationResult, Theme, WebsiteValidationResult };