@masterteam/components 0.0.157 → 0.0.158
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/common.css +1 -1
- package/fesm2022/masterteam-components-business-fields.mjs +165 -2
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +2 -2
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +17 -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 +27 -3
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchedulePredecessorFieldRuntimeContext } from '@masterteam/components';
|
|
2
|
+
import { LookupMatrixFieldConfig, LookupOptionItemConfig, LookupMatrixCellConfig, SchedulePredecessorFieldRuntimeContext, EntityListFieldRuntimeContext } from '@masterteam/components';
|
|
3
3
|
import { ControlValueAccessor, Validators, NgControl } from '@angular/forms';
|
|
4
4
|
import { HttpContext } from '@angular/common/http';
|
|
5
5
|
import { ColumnDef, TableAction } from '@masterteam/components/table';
|
|
@@ -228,5 +228,66 @@ declare class SchedulePredecessorField implements ControlValueAccessor {
|
|
|
228
228
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchedulePredecessorField, "mt-schedule-predecessor-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; }; "configuration": { "alias": "configuration"; "required": false; "isSignal": true; }; "runtimeContext": { "alias": "runtimeContext"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
interface EntityListRowValue {
|
|
232
|
+
propertyId?: number;
|
|
233
|
+
propertyKey?: string;
|
|
234
|
+
rawValue?: unknown;
|
|
235
|
+
value?: unknown;
|
|
236
|
+
}
|
|
237
|
+
interface EntityListReadRow {
|
|
238
|
+
entityId: number;
|
|
239
|
+
values?: EntityListRowValue[];
|
|
240
|
+
}
|
|
241
|
+
/** Stored EntityList property value (round-tripped through the form). */
|
|
242
|
+
interface EntityListStoredValue {
|
|
243
|
+
entityIds?: number[];
|
|
244
|
+
createdIds?: number[];
|
|
245
|
+
updatedIds?: number[];
|
|
246
|
+
deletedIds?: number[];
|
|
247
|
+
snapshot?: unknown;
|
|
248
|
+
rows?: unknown[];
|
|
249
|
+
}
|
|
250
|
+
declare class EntityListField implements ControlValueAccessor {
|
|
251
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
252
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
253
|
+
readonly required: _angular_core.InputSignal<boolean>;
|
|
254
|
+
/** EntityList property id used in the read endpoint route. */
|
|
255
|
+
readonly propertyId: _angular_core.InputSignal<number | null>;
|
|
256
|
+
/** Property configuration (sourceType, moduleId, access, etc). */
|
|
257
|
+
readonly configuration: _angular_core.InputSignal<Record<string, unknown> | null>;
|
|
258
|
+
/** Runtime ids needed to call the read endpoint. */
|
|
259
|
+
readonly runtimeContext: _angular_core.InputSignal<EntityListFieldRuntimeContext | null>;
|
|
260
|
+
/** Optional HttpContext (e.g. to disable base URL prefixing). */
|
|
261
|
+
readonly context: _angular_core.InputSignal<HttpContext | undefined>;
|
|
262
|
+
private readonly storedValue;
|
|
263
|
+
protected readonly rows: _angular_core.WritableSignal<EntityListReadRow[]>;
|
|
264
|
+
protected readonly loading: _angular_core.WritableSignal<boolean>;
|
|
265
|
+
protected readonly errorMessage: _angular_core.WritableSignal<string | null>;
|
|
266
|
+
protected readonly disabled: _angular_core.WritableSignal<boolean>;
|
|
267
|
+
protected requiredValidator: typeof Validators.required;
|
|
268
|
+
ngControl: NgControl | null;
|
|
269
|
+
protected readonly sourceId: _angular_core.Signal<number | null>;
|
|
270
|
+
protected readonly levelDataIdParam: _angular_core.Signal<number | null>;
|
|
271
|
+
protected readonly canRead: _angular_core.Signal<boolean>;
|
|
272
|
+
protected readonly hasRows: _angular_core.Signal<boolean>;
|
|
273
|
+
protected onTouched: () => void;
|
|
274
|
+
protected onModelChange: (value: EntityListStoredValue | null) => void;
|
|
275
|
+
private readonly http;
|
|
276
|
+
private readonly destroyRef;
|
|
277
|
+
constructor();
|
|
278
|
+
writeValue(value: EntityListStoredValue | null): void;
|
|
279
|
+
registerOnChange(fn: (value: EntityListStoredValue | null) => void): void;
|
|
280
|
+
registerOnTouched(fn: () => void): void;
|
|
281
|
+
setDisabledState(isDisabled: boolean): void;
|
|
282
|
+
private fetchRows;
|
|
283
|
+
protected rowTitle(row: EntityListReadRow): string;
|
|
284
|
+
protected rowFields(row: EntityListReadRow): EntityListRowValue[];
|
|
285
|
+
protected trackByRow(_i: number, row: EntityListReadRow): number | string;
|
|
286
|
+
protected trackByField(_i: number, value: EntityListRowValue): string | number;
|
|
287
|
+
protected formatValue(value: EntityListRowValue): string;
|
|
288
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityListField, never>;
|
|
289
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityListField, "mt-entity-list-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "propertyId": { "alias": "propertyId"; "required": false; "isSignal": true; }; "configuration": { "alias": "configuration"; "required": false; "isSignal": true; }; "runtimeContext": { "alias": "runtimeContext"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export { EntityListField, LookupMatrixField, SchedulePredecessorField, SchemaConnectionField };
|
|
232
293
|
export type { ConnectionPayload, ConnectionSource, ConnectionSourceLevel, SchemaConnectionConfig, SourceLevelState };
|
|
@@ -491,8 +491,32 @@ declare class SchedulePredecessorFieldConfig extends BaseFieldConfig {
|
|
|
491
491
|
runtimeContext?: SchedulePredecessorFieldRuntimeContext | null;
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
+
interface EntityListFieldRuntimeContext {
|
|
495
|
+
/**
|
|
496
|
+
* Route id for the read endpoint.
|
|
497
|
+
* - Level-scoped EntityList properties → level-data id
|
|
498
|
+
* - Module-scoped EntityList properties → source module-data id
|
|
499
|
+
*/
|
|
500
|
+
sourceId?: number | string | null;
|
|
501
|
+
levelDataId?: number | string | null;
|
|
502
|
+
}
|
|
503
|
+
declare class EntityListFieldConfig extends BaseFieldConfig {
|
|
504
|
+
/** EntityList property id (used in the read endpoint route). */
|
|
505
|
+
propertyId: number | null;
|
|
506
|
+
/** Property configuration (sourceType, moduleId, access, snapshotMode, fields). */
|
|
507
|
+
configuration: any;
|
|
508
|
+
/** Runtime ids needed to call the read endpoint. */
|
|
509
|
+
runtimeContext: EntityListFieldRuntimeContext | null;
|
|
510
|
+
context: HttpContext | undefined;
|
|
511
|
+
constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
|
|
512
|
+
propertyId?: number | null;
|
|
513
|
+
configuration?: any;
|
|
514
|
+
runtimeContext?: EntityListFieldRuntimeContext | null;
|
|
515
|
+
context?: HttpContext | undefined;
|
|
516
|
+
});
|
|
517
|
+
}
|
|
494
518
|
type DynamicFieldConfig = {
|
|
495
|
-
[K in keyof (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & BaseFieldConfig)]?: (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & BaseFieldConfig)[K];
|
|
519
|
+
[K in keyof (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & EntityListFieldConfig & BaseFieldConfig)]?: (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & EntityListFieldConfig & BaseFieldConfig)[K];
|
|
496
520
|
};
|
|
497
521
|
interface LayoutConfig {
|
|
498
522
|
containerClass?: string;
|
|
@@ -847,5 +871,5 @@ declare class MTDateFormatPipe implements PipeTransform {
|
|
|
847
871
|
static ɵpipe: i0.ɵɵPipeDeclaration<MTDateFormatPipe, "mtDateFormat", true>;
|
|
848
872
|
}
|
|
849
873
|
|
|
850
|
-
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DateFieldConfig, EditorFieldConfig, IconFieldConfig, 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, wrapValidatorWithMessage };
|
|
851
|
-
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, 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 };
|
|
874
|
+
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, 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, wrapValidatorWithMessage };
|
|
875
|
+
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 };
|