@masterteam/components 0.0.160 → 0.0.161

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.161",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -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,7 +27,7 @@ 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';
31
31
  label?: string;
32
32
  options?: FilterOption[];
33
33
  [key: string]: unknown;