@masterteam/components 0.0.160 → 0.0.162

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": "@masterteam/components",
3
- "version": "0.0.160",
3
+ "version": "0.0.162",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -36,7 +36,7 @@ interface EntityListComparison {
36
36
  }
37
37
  type PropertyValueComparison = ValueComparison | EntityListComparison;
38
38
 
39
- type EntityViewType = 'Text' | 'LongText' | 'Date' | 'DateTime' | 'Percentage' | 'Status' | 'Currency' | 'Checkbox' | 'User' | 'Lookup' | 'Attachment' | 'LookupMatrix' | 'LeafDetails';
39
+ type EntityViewType = 'Text' | 'LongText' | 'Date' | 'DateTime' | 'Number' | 'Percentage' | 'Status' | 'Currency' | 'Checkbox' | 'User' | 'Lookup' | 'Attachment' | 'LookupMatrix' | 'LeafDetails';
40
40
  type EntityLabelPosition = 'top' | 'bottom';
41
41
  /** Entity size – controls column span (1-24) inside a 24-column grid */
42
42
  type EntitySize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
@@ -414,7 +414,7 @@ declare class EntityPreview {
414
414
  declare class EntityPreviewBody {
415
415
  readonly data: _angular_core.InputSignal<EntityData>;
416
416
  readonly attachmentShape: _angular_core.InputSignal<"compact" | "default">;
417
- readonly previewType: _angular_core.Signal<"Text" | "LongText" | "Date" | "DateTime" | "Percentage" | "Status" | "Currency" | "Checkbox" | "User" | "Lookup" | "Attachment" | "LeafDetails">;
417
+ readonly previewType: _angular_core.Signal<"Text" | "LongText" | "Date" | "DateTime" | "Number" | "Percentage" | "Status" | "Currency" | "Checkbox" | "User" | "Lookup" | "Attachment" | "LeafDetails">;
418
418
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreviewBody, never>;
419
419
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPreviewBody, "mt-entity-preview-body", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "attachmentShape": { "alias": "attachmentShape"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
420
420
  }
@@ -4,6 +4,20 @@ import { ControlValueAccessor, Validators, NgControl } from '@angular/forms';
4
4
  import { Select } from 'primeng/select';
5
5
  import { isInvalid } from '@masterteam/components';
6
6
 
7
+ /**
8
+ * Resolves the current authenticated user (id + displayName) from
9
+ * `localStorage`, where the host application persists its NGXS `auth`
10
+ * slice. Used by table filters to mark "You" on options that match the
11
+ * logged-in user.
12
+ *
13
+ * The persisted shape can vary slightly between apps, so we look for the
14
+ * id/displayName under a few well-known paths.
15
+ */
16
+ interface CurrentUserInfo {
17
+ id?: string | number | null;
18
+ displayName?: string | null;
19
+ }
20
+
7
21
  declare class SelectField implements ControlValueAccessor, OnInit, OnChanges {
8
22
  cdr: ChangeDetectorRef;
9
23
  dropdown: Select;
@@ -39,6 +53,18 @@ declare class SelectField implements ControlValueAccessor, OnInit, OnChanges {
39
53
  readonly optionGroupIconColor: _angular_core.InputSignal<string>;
40
54
  readonly optionGroupIconShape: _angular_core.InputSignal<string>;
41
55
  readonly optionGroupAvatarShape: _angular_core.InputSignal<"circle" | "square">;
56
+ /**
57
+ * When true, this select represents a user picker (e.g. a table filter for
58
+ * a user column). The component reads the logged-in user from
59
+ * `localStorage` and marks the matching option with a "You" badge.
60
+ */
61
+ readonly markCurrentUser: _angular_core.InputSignal<boolean>;
62
+ protected readonly currentUser: _angular_core.Signal<CurrentUserInfo | null>;
63
+ /**
64
+ * When `markCurrentUser` is on, hoist the option matching the current user
65
+ * to the top of the list so it surfaces first in the dropdown.
66
+ */
67
+ protected readonly displayOptions: _angular_core.Signal<any[] | undefined>;
42
68
  onChange: EventEmitter<any>;
43
69
  styleClass: string;
44
70
  requiredValidator: typeof Validators.required;
@@ -84,9 +110,10 @@ declare class SelectField implements ControlValueAccessor, OnInit, OnChanges {
84
110
  * Falls back to direct property access for non-nested keys.
85
111
  */
86
112
  private resolveNestedValue;
113
+ isCurrentUserOption(option: any): boolean;
87
114
  private resolveOption;
88
115
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectField, never>;
89
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectField, "mt-select-field", never, { "field": { "alias": "field"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hasPlaceholderPrefix": { "alias": "hasPlaceholderPrefix"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "pInputs": { "alias": "pInputs"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "clearAfterSelect": { "alias": "clearAfterSelect"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "group": { "alias": "group"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "optionGroupLabel": { "alias": "optionGroupLabel"; "required": false; "isSignal": true; }; "optionGroupChildren": { "alias": "optionGroupChildren"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "optionIconColor": { "alias": "optionIconColor"; "required": false; "isSignal": true; }; "optionIconShape": { "alias": "optionIconShape"; "required": false; "isSignal": true; }; "optionAvatarShape": { "alias": "optionAvatarShape"; "required": false; "isSignal": true; }; "optionGroupIcon": { "alias": "optionGroupIcon"; "required": false; "isSignal": true; }; "optionGroupIconColor": { "alias": "optionGroupIconColor"; "required": false; "isSignal": true; }; "optionGroupIconShape": { "alias": "optionGroupIconShape"; "required": false; "isSignal": true; }; "optionGroupAvatarShape": { "alias": "optionGroupAvatarShape"; "required": false; "isSignal": true; }; }, { "onChange": "onChange"; }, never, never, true, never>;
116
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectField, "mt-select-field", never, { "field": { "alias": "field"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hasPlaceholderPrefix": { "alias": "hasPlaceholderPrefix"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "pInputs": { "alias": "pInputs"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "clearAfterSelect": { "alias": "clearAfterSelect"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "group": { "alias": "group"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "optionGroupLabel": { "alias": "optionGroupLabel"; "required": false; "isSignal": true; }; "optionGroupChildren": { "alias": "optionGroupChildren"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "optionIconColor": { "alias": "optionIconColor"; "required": false; "isSignal": true; }; "optionIconShape": { "alias": "optionIconShape"; "required": false; "isSignal": true; }; "optionAvatarShape": { "alias": "optionAvatarShape"; "required": false; "isSignal": true; }; "optionGroupIcon": { "alias": "optionGroupIcon"; "required": false; "isSignal": true; }; "optionGroupIconColor": { "alias": "optionGroupIconColor"; "required": false; "isSignal": true; }; "optionGroupIconShape": { "alias": "optionGroupIconShape"; "required": false; "isSignal": true; }; "optionGroupAvatarShape": { "alias": "optionGroupAvatarShape"; "required": false; "isSignal": true; }; "markCurrentUser": { "alias": "markCurrentUser"; "required": false; "isSignal": true; }; }, { "onChange": "onChange"; }, never, never, true, never>;
90
117
  }
91
118
 
92
119
  export { SelectField };
@@ -27,18 +27,18 @@ interface FilterOption {
27
27
  * Configuration for filtering on a specific column.
28
28
  */
29
29
  interface FilterConfig {
30
- type: 'text' | 'select' | 'date' | 'boolean' | 'user';
30
+ type: 'text' | 'select' | 'userSelect' | 'date' | 'boolean' | 'user' | 'numberRange';
31
31
  label?: string;
32
32
  options?: FilterOption[];
33
33
  [key: string]: unknown;
34
34
  }
35
35
  /**
36
- * Filter value for date range or simple value
36
+ * Filter value for date range, numeric range, or simple value
37
37
  */
38
38
  interface FilterValue {
39
39
  value?: any;
40
- from?: Date | null;
41
- to?: Date | null;
40
+ from?: Date | number | null;
41
+ to?: Date | number | null;
42
42
  }
43
43
  interface TableStatusMapValue {
44
44
  display?: string;
@@ -52,7 +52,7 @@ type TableFilters = Record<string, FilterValue | any>;
52
52
  /**
53
53
  * Column type definition
54
54
  */
55
- type ColumnType = 'text' | 'boolean' | 'date' | 'dateTime' | 'user' | 'status' | 'entity' | 'custom';
55
+ type ColumnType = 'text' | 'number' | 'boolean' | 'date' | 'dateTime' | 'user' | 'status' | 'entity' | 'custom';
56
56
  /**
57
57
  * Event emitted when a cell value changes
58
58
  */
@@ -437,7 +437,8 @@ declare class TableFilter implements ControlValueAccessor {
437
437
 
438
438
  /**
439
439
  * Renders a single filter control for one `ColumnDef`, dispatching on
440
- * `column.filterConfig.type` (`text` | `select` | `date` | `boolean` | `user`).
440
+ * `column.filterConfig.type` (`text` | `select` | `date` | `boolean` | `user`
441
+ * | `numberRange`).
441
442
  *
442
443
  * Two-way binds the filter value via `value` / `valueChange`. Shared by both
443
444
  * filter UX modes (popover + per-column) so field rendering lives in one place.
@@ -454,8 +455,10 @@ declare class TableFilterField {
454
455
  protected getFilterType(): string;
455
456
  protected getScalarValue(): any;
456
457
  protected getDateRangeValue(part: 'from' | 'to'): Date | null;
458
+ protected getNumberRangeValue(part: 'from' | 'to'): number | null;
457
459
  protected updateScalar(next: any): void;
458
460
  protected updateDate(part: 'from' | 'to', next: Date | null): void;
461
+ protected updateNumber(part: 'from' | 'to', next: number | null): void;
459
462
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableFilterField, never>;
460
463
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableFilterField, "mt-table-filter-field", never, { "column": { "alias": "column"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
461
464
  }