@masterteam/components 0.0.277 → 0.0.279

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.277",
3
+ "version": "0.0.279",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { AfterViewInit, InjectionToken, Type, OnInit } from '@angular/core';
3
- import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchedulePredecessorFieldRuntimeContext, EntityListFieldRuntimeContext, ScheduleItemSelectorFieldRuntimeContext, LookupCheckListPropertyConfig, LookupModuleCheckListFieldRuntimeContext } from '@masterteam/components';
3
+ import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchemaConnectionFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, EntityListFieldRuntimeContext, ScheduleItemSelectorFieldRuntimeContext, LookupCheckListPropertyConfig, LookupModuleCheckListFieldRuntimeContext } from '@masterteam/components';
4
4
  import { ControlValueAccessor, NgControl, Validators } from '@angular/forms';
5
5
  import { HttpContext } from '@angular/common/http';
6
6
  import { ColumnDef, TableAction } from '@masterteam/components/table';
@@ -115,6 +115,14 @@ declare class SchemaConnectionField implements ControlValueAccessor {
115
115
  * Includes `targetLevelId`, `sourceLevels[]`, `payloadTemplate`, etc.
116
116
  */
117
117
  readonly configuration: _angular_core.InputSignal<SchemaConnectionConfig>;
118
+ /**
119
+ * Runtime scope for this field's options queries. When `templateId` is
120
+ * present, it is sent as a `templateId` structural filter on every source
121
+ * level's `fetch/query` request, scoping the dropdown to the active plan
122
+ * instance. Absent means options load unscoped, same as before this input
123
+ * existed.
124
+ */
125
+ readonly runtimeContext: _angular_core.InputSignal<SchemaConnectionFieldRuntimeContext | null>;
118
126
  /**
119
127
  * Optional HttpContext for API requests (e.g. to set base URL behavior).
120
128
  */
@@ -192,7 +200,7 @@ declare class SchemaConnectionField implements ControlValueAccessor {
192
200
  registerOnTouched(fn: any): void;
193
201
  setDisabledState(disabled: boolean): void;
194
202
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaConnectionField, never>;
195
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaConnectionField, "mt-schema-connection-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "configuration": { "alias": "configuration"; "required": true; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
203
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaConnectionField, "mt-schema-connection-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "configuration": { "alias": "configuration"; "required": true; "isSignal": true; }; "runtimeContext": { "alias": "runtimeContext"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
196
204
  }
197
205
 
198
206
  type PredecessorType = 0 | 1 | 2 | 3;
@@ -27,6 +27,12 @@ declare class PickListField implements ControlValueAccessor, OnInit {
27
27
  readonly dragdrop: _angular_core.InputSignal<boolean>;
28
28
  readonly responsive: _angular_core.InputSignal<boolean>;
29
29
  readonly required: _angular_core.InputSignal<boolean>;
30
+ /**
31
+ * Selected values the user may not remove — the caller owns them (a field the
32
+ * backend requires, say). They render disabled in the target list and are put
33
+ * back if an interaction drops them anyway.
34
+ */
35
+ readonly lockedValues: _angular_core.InputSignal<any[]>;
30
36
  styleClass: string;
31
37
  requiredValidator: typeof Validators.required;
32
38
  value: _angular_core.WritableSignal<any[]>;
@@ -38,6 +44,12 @@ declare class PickListField implements ControlValueAccessor, OnInit {
38
44
  ngControl: NgControl;
39
45
  isInvalid: typeof isInvalid;
40
46
  private hasInitialized;
47
+ private readonly lockedIdentifiers;
48
+ /**
49
+ * Bound as `targetOptionDisabled`, so it has to keep a stable identity — a
50
+ * new function per change-detection pass re-renders both lists every cycle.
51
+ */
52
+ readonly isLockedOption: (item: any) => boolean;
41
53
  pickList?: PickList;
42
54
  constructor();
43
55
  ngOnInit(): void;
@@ -51,13 +63,20 @@ declare class PickListField implements ControlValueAccessor, OnInit {
51
63
  private getNestedValue;
52
64
  private syncLists;
53
65
  private syncFromPickList;
66
+ /**
67
+ * `targetOptionDisabled` only stops a locked item from being *selected*: the
68
+ * pick list's "move all to source" button empties the target without
69
+ * consulting it. Anything locked that was in the value before the interaction
70
+ * goes back into the target list before the new value is emitted.
71
+ */
72
+ private restoreLockedItems;
54
73
  private normalizeValueToOptions;
55
74
  private extractValues;
56
75
  private updateSourceFromTarget;
57
76
  private getIdentifier;
58
77
  private findOption;
59
78
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PickListField, never>;
60
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PickListField, "mt-pick-list-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "sourceHeader": { "alias": "sourceHeader"; "required": false; "isSignal": true; }; "targetHeader": { "alias": "targetHeader"; "required": false; "isSignal": true; }; "showSourceControls": { "alias": "showSourceControls"; "required": false; "isSignal": true; }; "showTargetControls": { "alias": "showTargetControls"; "required": false; "isSignal": true; }; "showSourceFilter": { "alias": "showSourceFilter"; "required": false; "isSignal": true; }; "showTargetFilter": { "alias": "showTargetFilter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "filterLocale": { "alias": "filterLocale"; "required": false; "isSignal": true; }; "filterMatchMode": { "alias": "filterMatchMode"; "required": false; "isSignal": true; }; "dragdrop": { "alias": "dragdrop"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
79
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PickListField, "mt-pick-list-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "sourceHeader": { "alias": "sourceHeader"; "required": false; "isSignal": true; }; "targetHeader": { "alias": "targetHeader"; "required": false; "isSignal": true; }; "showSourceControls": { "alias": "showSourceControls"; "required": false; "isSignal": true; }; "showTargetControls": { "alias": "showTargetControls"; "required": false; "isSignal": true; }; "showSourceFilter": { "alias": "showSourceFilter"; "required": false; "isSignal": true; }; "showTargetFilter": { "alias": "showTargetFilter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "filterLocale": { "alias": "filterLocale"; "required": false; "isSignal": true; }; "filterMatchMode": { "alias": "filterMatchMode"; "required": false; "isSignal": true; }; "dragdrop": { "alias": "dragdrop"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "lockedValues": { "alias": "lockedValues"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
61
80
  }
62
81
 
63
82
  export { PickListField };
@@ -568,6 +568,8 @@ declare class MultiSelectFieldConfig extends BaseFieldConfig {
568
568
  }
569
569
  declare class PickListFieldConfig extends BaseFieldConfig {
570
570
  options: any[];
571
+ /** Selected values the user cannot move back out of the target list. */
572
+ lockedValues: any[];
571
573
  optionLabel: string;
572
574
  optionValue: string;
573
575
  sourceHeader: string;
@@ -595,6 +597,7 @@ declare class PickListFieldConfig extends BaseFieldConfig {
595
597
  dataKey?: string;
596
598
  dragdrop?: boolean;
597
599
  responsive?: boolean;
600
+ lockedValues?: any[];
598
601
  });
599
602
  }
600
603
  declare class CheckboxFieldConfig extends BaseFieldConfig {
@@ -680,14 +683,26 @@ declare class LookupMatrixFieldConfig extends BaseFieldConfig {
680
683
  emptyMessage?: string;
681
684
  });
682
685
  }
686
+ interface SchemaConnectionFieldRuntimeContext {
687
+ /**
688
+ * The active plan/template instance id. When present, it is sent as a
689
+ * `templateId` structural filter on every source level's `fetch/query`
690
+ * options request, scoping the dropdown to records owned by this plan.
691
+ * When absent, options load unscoped (back-compat with hosts that don't
692
+ * pass `templateId` to `mt-client-form`).
693
+ */
694
+ templateId?: number | string | null;
695
+ }
683
696
  declare class SchemaConnectionFieldConfig extends BaseFieldConfig {
684
697
  configuration: any;
685
698
  context: HttpContext | undefined;
686
699
  filter: boolean;
700
+ runtimeContext: SchemaConnectionFieldRuntimeContext | null;
687
701
  constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
688
702
  configuration: any;
689
703
  context?: HttpContext | undefined;
690
704
  filter?: boolean;
705
+ runtimeContext?: SchemaConnectionFieldRuntimeContext | null;
691
706
  });
692
707
  }
693
708
  interface SchedulePredecessorFieldRuntimeContext {
@@ -1254,4 +1269,4 @@ declare class MTDateFormatPipe implements PipeTransform {
1254
1269
  }
1255
1270
 
1256
1271
  export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, READABLE_DARK_INK, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, WCAG_AA_NORMAL_TEXT, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, clockTimeToSeconds, contrastRatio, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, formatClockTime, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, newFieldId, parseClockTime, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, readableTextOn, relativeLuminance, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, toClockTimeParts, wrapValidatorWithMessage };
1257
- export type { ApiRequestConfig, BaseFieldConstructorConfig, ClockTimeParts, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DSColorScale, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTDesignIdentity, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
1272
+ export type { ApiRequestConfig, BaseFieldConstructorConfig, ClockTimeParts, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DSColorScale, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTDesignIdentity, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SchemaConnectionFieldRuntimeContext, SectionConfig, ValidatorType };