@masterteam/components 0.0.189 → 0.0.190
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/assets/i18n/ar.json +4 -0
- package/assets/i18n/en.json +4 -0
- package/fesm2022/masterteam-components-business-fields.mjs +178 -3
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +20 -1
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-business-fields.d.ts +63 -2
- package/types/masterteam-components.d.ts +39 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { AfterViewInit, InjectionToken, Type } from '@angular/core';
|
|
3
|
-
import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchedulePredecessorFieldRuntimeContext, EntityListFieldRuntimeContext } from '@masterteam/components';
|
|
3
|
+
import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchedulePredecessorFieldRuntimeContext, EntityListFieldRuntimeContext, ScheduleItemSelectorFieldRuntimeContext } from '@masterteam/components';
|
|
4
4
|
import { ControlValueAccessor, Validators, NgControl } from '@angular/forms';
|
|
5
5
|
import { HttpContext } from '@angular/common/http';
|
|
6
6
|
import { ColumnDef, TableAction } from '@masterteam/components/table';
|
|
@@ -340,5 +340,66 @@ interface EntityListAddDialogInputs {
|
|
|
340
340
|
*/
|
|
341
341
|
declare const ENTITY_LIST_ADD_DIALOG_COMPONENT: InjectionToken<Type<unknown>>;
|
|
342
342
|
|
|
343
|
-
|
|
343
|
+
/** One picker option — only the name is shown. */
|
|
344
|
+
interface ScheduleItemOption {
|
|
345
|
+
label: string;
|
|
346
|
+
value: number;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Runtime picker for `ScheduleItemSelector` properties.
|
|
350
|
+
*
|
|
351
|
+
* Backend-filtered: the full option list comes from
|
|
352
|
+
* `GET forms/options/{propertyKey}` (which applies the configured rule, e.g.
|
|
353
|
+
* `DeliverableAcceptance.AvailableDeliverables`). All available items are
|
|
354
|
+
* loaded up front and rendered with the standard `mt-select-field` /
|
|
355
|
+
* `mt-multi-select-field`; the field shows only the item name.
|
|
356
|
+
*
|
|
357
|
+
* The control value is always a numeric id array (`valueMode = "IdArray"`).
|
|
358
|
+
* In `Single` mode only one id may be selected.
|
|
359
|
+
*/
|
|
360
|
+
declare class ScheduleItemSelectorField implements ControlValueAccessor {
|
|
361
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
362
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
363
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
364
|
+
readonly required: _angular_core.InputSignal<boolean>;
|
|
365
|
+
readonly propertyKey: _angular_core.InputSignal<string>;
|
|
366
|
+
readonly selectionMode: _angular_core.InputSignal<"Single" | "Multi">;
|
|
367
|
+
readonly runtimeContext: _angular_core.InputSignal<ScheduleItemSelectorFieldRuntimeContext | null>;
|
|
368
|
+
readonly context: _angular_core.InputSignal<HttpContext | undefined>;
|
|
369
|
+
/** Full list of available deliverables (loaded once). */
|
|
370
|
+
readonly options: _angular_core.WritableSignal<ScheduleItemOption[]>;
|
|
371
|
+
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
372
|
+
readonly disabled: _angular_core.WritableSignal<boolean>;
|
|
373
|
+
/** Selected ids — the control value (`number[]`). */
|
|
374
|
+
readonly value: _angular_core.WritableSignal<number[]>;
|
|
375
|
+
readonly isMultiple: _angular_core.Signal<boolean>;
|
|
376
|
+
/** Single-mode ngModel value (a scalar id, not an array). */
|
|
377
|
+
readonly singleValue: _angular_core.Signal<number>;
|
|
378
|
+
ngControl: NgControl | null;
|
|
379
|
+
onTouched: () => void;
|
|
380
|
+
onModelChange: (value: number[] | null) => void;
|
|
381
|
+
private readonly http;
|
|
382
|
+
private readonly destroyRef;
|
|
383
|
+
/** Query signature already loaded — prevents duplicate full loads. */
|
|
384
|
+
private loadedKey;
|
|
385
|
+
constructor();
|
|
386
|
+
onMultiChange(ids: number[] | null): void;
|
|
387
|
+
onSingleChange(id: number | null): void;
|
|
388
|
+
writeValue(value: unknown): void;
|
|
389
|
+
registerOnChange(fn: (value: number[] | null) => void): void;
|
|
390
|
+
registerOnTouched(fn: () => void): void;
|
|
391
|
+
setDisabledState(disabled: boolean): void;
|
|
392
|
+
private loadAllOptions;
|
|
393
|
+
private fetchPage;
|
|
394
|
+
private buildParams;
|
|
395
|
+
private mapOptions;
|
|
396
|
+
private buildContextKey;
|
|
397
|
+
private queryKey;
|
|
398
|
+
private emit;
|
|
399
|
+
private normalizeIds;
|
|
400
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScheduleItemSelectorField, never>;
|
|
401
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScheduleItemSelectorField, "mt-schedule-item-selector-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; }; "propertyKey": { "alias": "propertyKey"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "runtimeContext": { "alias": "runtimeContext"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export { ENTITY_LIST_ADD_DIALOG_COMPONENT, EntityListField, LookupMatrixField, ScheduleItemSelectorField, SchedulePredecessorField, SchemaConnectionField };
|
|
344
405
|
export type { ConnectionPayload, ConnectionSource, ConnectionSourceLevel, EntityListAddDialogInputs, SchemaConnectionConfig, SourceLevelState };
|
|
@@ -536,8 +536,44 @@ declare class EntityListFieldConfig extends BaseFieldConfig {
|
|
|
536
536
|
context?: HttpContext | undefined;
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
|
+
interface ScheduleItemSelectorFieldRuntimeContext {
|
|
540
|
+
/** Current level id — used to build the options `contextKey` (`Level:{levelId}`). */
|
|
541
|
+
levelId?: number | string | null;
|
|
542
|
+
/**
|
|
543
|
+
* Module schema id of the form that owns the selector property — the
|
|
544
|
+
* `Module:{moduleId}` segment of the options `contextKey`. For Deliverable
|
|
545
|
+
* Acceptance this is the Deliverable Acceptance module schema id, NOT the
|
|
546
|
+
* target schedule module id.
|
|
547
|
+
*/
|
|
548
|
+
moduleId?: number | string | null;
|
|
549
|
+
/** Current workspace instance id (`levelDataId` query param). */
|
|
550
|
+
levelDataId?: number | string | null;
|
|
551
|
+
/**
|
|
552
|
+
* Record being edited (`ownerRecordId` query param). Lets the backend keep
|
|
553
|
+
* the current record's existing selections valid in edit mode.
|
|
554
|
+
*/
|
|
555
|
+
ownerRecordId?: number | string | null;
|
|
556
|
+
}
|
|
557
|
+
declare class ScheduleItemSelectorFieldConfig extends BaseFieldConfig {
|
|
558
|
+
/** Property key — used in the options endpoint route `forms/options/{propertyKey}`. */
|
|
559
|
+
propertyKey: string;
|
|
560
|
+
/** `Single` renders a single-select picker, `Multi` a multi-select picker. */
|
|
561
|
+
selectionMode: 'Single' | 'Multi';
|
|
562
|
+
/** Raw property configuration (selectionMode, scheduleModuleKey, etc.). */
|
|
563
|
+
configuration: any;
|
|
564
|
+
/** Runtime ids needed to call the options endpoint. */
|
|
565
|
+
runtimeContext: ScheduleItemSelectorFieldRuntimeContext | null;
|
|
566
|
+
context: HttpContext | undefined;
|
|
567
|
+
constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
|
|
568
|
+
propertyKey?: string;
|
|
569
|
+
selectionMode?: 'Single' | 'Multi';
|
|
570
|
+
configuration?: any;
|
|
571
|
+
runtimeContext?: ScheduleItemSelectorFieldRuntimeContext | null;
|
|
572
|
+
context?: HttpContext | undefined;
|
|
573
|
+
});
|
|
574
|
+
}
|
|
539
575
|
type DynamicFieldConfig = {
|
|
540
|
-
[K in keyof (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & LocationFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & EntityListFieldConfig & BaseFieldConfig)]?: (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & LocationFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & EntityListFieldConfig & BaseFieldConfig)[K];
|
|
576
|
+
[K in keyof (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & LocationFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & EntityListFieldConfig & ScheduleItemSelectorFieldConfig & BaseFieldConfig)]?: (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & LocationFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & EntityListFieldConfig & ScheduleItemSelectorFieldConfig & BaseFieldConfig)[K];
|
|
541
577
|
};
|
|
542
578
|
interface LayoutConfig {
|
|
543
579
|
containerClass?: string;
|
|
@@ -892,5 +928,5 @@ declare class MTDateFormatPipe implements PipeTransform {
|
|
|
892
928
|
static ɵpipe: i0.ɵɵPipeDeclaration<MTDateFormatPipe, "mtDateFormat", true>;
|
|
893
929
|
}
|
|
894
930
|
|
|
895
|
-
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, endLoading, generateTailwindPalette, getContrastColor, getLightColor, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
|
|
896
|
-
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupMatrixCellConfig, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
|
|
931
|
+
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, endLoading, generateTailwindPalette, getContrastColor, getLightColor, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
|
|
932
|
+
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupMatrixCellConfig, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
|