@masterteam/components 0.0.322 → 0.0.324

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.
@@ -802,7 +802,7 @@ class SchedulePredecessorField {
802
802
  return `${row.predecessorId}${PREDECESSOR_TOKEN_BY_TYPE[row.type]}${lag}`;
803
803
  }
804
804
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SchedulePredecessorField, deps: [], target: i0.ɵɵFactoryTarget.Component });
805
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SchedulePredecessorField, isStandalone: true, selector: "mt-schedule-predecessor-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "predecessorCellTpl", first: true, predicate: ["predecessorCellTpl"], descendants: true, isSignal: true }, { propertyName: "typeCellTpl", first: true, predicate: ["typeCellTpl"], descendants: true, isSignal: true }, { propertyName: "lagCellTpl", first: true, predicate: ["lagCellTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"gap-3 overflow-auto\">\r\n <div class=\"flex items-center justify-between mb-2\">\r\n <div>\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n </div>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'components.schedulePredecessorField.add' | transloco\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [disabled]=\"disabled() || readonly() || !canAddRow()\"\r\n [tooltip]=\"addTooltip()\"\r\n (onClick)=\"addRow()\"\r\n />\r\n </div>\r\n\r\n <ng-template #predecessorCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableTaskOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"\r\n placeholder() ||\r\n ('components.schedulePredecessorField.selectPredecessor' | transloco)\r\n \"\r\n [filter]=\"true\"\r\n [showClear]=\"true\"\r\n [loading]=\"loading()\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.predecessorId || undefined\"\r\n (onChange)=\"updateRow(row.key, { predecessorId: $event ?? '' })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #typeCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"typeOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.type\"\r\n (onChange)=\"updateRow(row.key, { type: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #lagCellTpl let-row>\r\n <mt-number-field\r\n [field]=\"false\"\r\n [useGrouping]=\"false\"\r\n [placeholder]=\"'components.schedulePredecessorField.lagDays' | transloco\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.lagDays\"\r\n (ngModelChange)=\"updateRow(row.key, { lagDays: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"rowActions()\"\r\n [pageSize]=\"pageSize()\"\r\n [generalSearch]=\"false\"\r\n [showFilters]=\"false\"\r\n [dataKey]=\"'key'\"\r\n storageKey=\"schedule-predecessor-field-table\"\r\n [loading]=\"loading()\"\r\n >\r\n <ng-template #empty>\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface px-4 py-5 text-sm text-muted-color\"\r\n >\r\n {{ \"components.schedulePredecessorField.empty\" | transloco }}\r\n </div>\r\n </ng-template>\r\n </mt-table>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
805
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SchedulePredecessorField, isStandalone: true, selector: "mt-schedule-predecessor-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "predecessorCellTpl", first: true, predicate: ["predecessorCellTpl"], descendants: true, isSignal: true }, { propertyName: "typeCellTpl", first: true, predicate: ["typeCellTpl"], descendants: true, isSignal: true }, { propertyName: "lagCellTpl", first: true, predicate: ["lagCellTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"gap-3 overflow-auto\">\r\n <div class=\"flex items-center justify-between mb-2\">\r\n <div>\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n </div>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'components.schedulePredecessorField.add' | transloco\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [disabled]=\"disabled() || readonly() || !canAddRow()\"\r\n [tooltip]=\"addTooltip()\"\r\n (onClick)=\"addRow()\"\r\n />\r\n </div>\r\n\r\n <ng-template #predecessorCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableTaskOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"\r\n placeholder() ||\r\n ('components.schedulePredecessorField.selectPredecessor' | transloco)\r\n \"\r\n [filter]=\"true\"\r\n [showClear]=\"true\"\r\n [loading]=\"loading()\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.predecessorId || undefined\"\r\n (onChange)=\"updateRow(row.key, { predecessorId: $event ?? '' })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #typeCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"typeOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.type\"\r\n (onChange)=\"updateRow(row.key, { type: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #lagCellTpl let-row>\r\n <mt-number-field\r\n [field]=\"false\"\r\n [useGrouping]=\"false\"\r\n [placeholder]=\"'components.schedulePredecessorField.lagDays' | transloco\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.lagDays\"\r\n (ngModelChange)=\"updateRow(row.key, { lagDays: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"rowActions()\"\r\n [pageSize]=\"pageSize()\"\r\n [generalSearch]=\"false\"\r\n [showFilters]=\"false\"\r\n [dataKey]=\"'key'\"\r\n storageKey=\"schedule-predecessor-field-table\"\r\n [loading]=\"loading()\"\r\n >\r\n <ng-template #empty>\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface px-4 py-5 text-sm text-muted-color\"\r\n >\r\n {{ \"components.schedulePredecessorField.empty\" | transloco }}\r\n </div>\r\n </ng-template>\r\n </mt-table>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
806
806
  }
807
807
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SchedulePredecessorField, decorators: [{
808
808
  type: Component,
@@ -3107,8 +3107,8 @@ class EntityListField {
3107
3107
  viewType: column.viewType ?? 'Text',
3108
3108
  value: value !== null && typeof value === 'object'
3109
3109
  ? value
3110
- : (this.toRawValue(value) ?? ''),
3111
- rawValue: this.toRawValue(raw) ?? undefined,
3110
+ : (this.toRawValue(value, column.viewType) ?? ''),
3111
+ rawValue: this.toRawValue(raw, column.viewType) ?? undefined,
3112
3112
  configuration: column.configuration,
3113
3113
  propertyConfiguration: this.propertyByKey().get(propertyKey)?.configuration,
3114
3114
  };
@@ -3261,15 +3261,24 @@ class EntityListField {
3261
3261
  .filter(([propertyKey]) => allowed.size === 0 || allowed.has(propertyKey))
3262
3262
  .map(([propertyKey, value]) => ({
3263
3263
  propertyKey,
3264
- rawValue: this.toRawValue(propertyKey in submitShaped ? submitShaped[propertyKey] : value),
3264
+ rawValue: this.toRawValue(propertyKey in submitShaped ? submitShaped[propertyKey] : value, this.propertyByKey().get(propertyKey)?.viewType),
3265
3265
  }));
3266
3266
  }
3267
3267
  /** Backend `rawValue` is a serialized scalar; objects/arrays go as JSON. */
3268
- toRawValue(value) {
3268
+ toRawValue(value, viewType) {
3269
3269
  if (value == null || value === '')
3270
3270
  return null;
3271
- if (value instanceof Date)
3271
+ if (value instanceof Date) {
3272
+ // The picker holds local midnight. A Date property is a calendar day,
3273
+ // so converting it to UTC can display yesterday in the pending row.
3274
+ // DateTime remains an instant and keeps its existing UTC serialization.
3275
+ if (viewType === 'Date') {
3276
+ if (Number.isNaN(value.getTime()))
3277
+ return null;
3278
+ return `${String(value.getFullYear()).padStart(4, '0')}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}`;
3279
+ }
3272
3280
  return value.toISOString();
3281
+ }
3273
3282
  if (typeof value === 'object')
3274
3283
  return JSON.stringify(value);
3275
3284
  return String(value);
@@ -3606,7 +3615,7 @@ class EntityListField {
3606
3615
  };
3607
3616
  }
3608
3617
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, deps: [], target: i0.ɵɵFactoryTarget.Component });
3609
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, propertyKey: { classPropertyName: "propertyKey", publicName: "propertyKey", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, pendingSubmission: { classPropertyName: "pendingSubmission", publicName: "pendingSubmission", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, providers: [EntityRuntimeContextStore], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (noticeKey(); as notice) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ notice | transloco }}\r\n </div>\r\n } @else if (localReady()) {\r\n <!--\r\n A Local list: rows owned by this record, staged into its own submission.\r\n Add / edit / delete / drag follow the Local operation switches. Opened\r\n from a table cell, it can also show a saved revision's rows instead.\r\n -->\r\n @if (historyAvailable()) {\r\n <ng-container [ngTemplateOutlet]=\"history\" />\r\n }\r\n @if (showingRevision()) {\r\n <section\r\n class=\"flex flex-col gap-2 transition-opacity\"\r\n [class.opacity-60]=\"revisionLoading()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"preservedHeading\" />\r\n @if (revisionLocalRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"revisionLocalRows()\"\r\n [columns]=\"displayRevisionLocalColumns()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.preservedEmpty\" | transloco }}\r\n </div>\r\n }\r\n </section>\r\n } @else {\r\n @if (localCanCreate()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openLocalRowDialog()\"\r\n />\r\n </div>\r\n }\r\n @if (localTableRows().length || localCanCreate()) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"localTableRows()\"\r\n [columns]=\"displayLocalColumns()\"\r\n [rowActions]=\"localRowActions()\"\r\n [reorderableRows]=\"localCanReorder()\"\r\n (rowReorder)=\"onLocalReorder($event)\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noLocalRows\" | transloco }}\r\n </div>\r\n }\r\n }\r\n } @else if (selectionReady()) {\r\n <!--\r\n A Selected list: the source records picked for this record, and nothing\r\n else. Picking and removing change only which records it holds. Opened\r\n from a table cell, a saved revision compares the records it held then\r\n with their values today.\r\n -->\r\n @if (historyAvailable()) {\r\n <ng-container [ngTemplateOutlet]=\"history\" />\r\n }\r\n @if (showingRevision()) {\r\n <ng-container [ngTemplateOutlet]=\"comparisonSections\" />\r\n } @else {\r\n @if (selectionWritable()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.selectRecords' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openSelectionDialog()\"\r\n />\r\n </div>\r\n }\r\n @if (selectionRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"selectionRows()\"\r\n [columns]=\"displayColumns()\"\r\n [rowActions]=\"selectionRowActions()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noSelectedRecords\" | transloco }}\r\n </div>\r\n }\r\n }\r\n } @else if (comparisonMode()) {\r\n <!--\r\n A saved Related list opened from outside its form: its sources' current\r\n values, and the values preserved when it was saved. A missing baseline is\r\n said as such \u2014 it is not an empty list.\r\n -->\r\n @if (!comparisonReady()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n </div>\r\n } @else {\r\n @if (historyAvailable()) {\r\n <ng-container [ngTemplateOutlet]=\"history\" />\r\n }\r\n <ng-container [ngTemplateOutlet]=\"comparisonSections\" />\r\n }\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"tableColumns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"tableColumns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n\r\n<!--\r\n Saved list revisions: each successful save of this list, newest first.\r\n Picking one shows what it preserved \u2014 beside today's values of the records\r\n it held, for a linked list. Read-only: history is never submitted.\r\n-->\r\n<ng-template #history>\r\n <div class=\"flex flex-wrap items-center justify-between gap-2\">\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @if (viewedRevision(); as version) {\r\n <span\r\n class=\"rounded-md border border-primary-200 bg-primary-50 px-2 py-0.5 text-xs font-medium text-primary-700\"\r\n >\r\n {{\r\n \"components.entityListField.viewingRevision\"\r\n | transloco: { version: version }\r\n }}\r\n </span>\r\n <mt-button\r\n [label]=\"'components.entityListField.backToLatest' | transloco\"\r\n size=\"small\"\r\n variant=\"text\"\r\n [disabled]=\"revisionLoading()\"\r\n (onClick)=\"showRevision(null)\"\r\n />\r\n }\r\n </div>\r\n <mt-button\r\n [label]=\"'components.entityListField.revisions' | transloco\"\r\n icon=\"time.clock-rewind\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n (onClick)=\"toggleRevisions()\"\r\n />\r\n </div>\r\n\r\n @if (revisionsOpen()) {\r\n <div\r\n class=\"flex flex-col gap-2 rounded-md border border-surface bg-surface-50 p-3\"\r\n >\r\n <p class=\"text-xs text-muted-color\">\r\n {{ \"components.entityListField.revisionsHint\" | transloco }}\r\n </p>\r\n @if (revisionsError(); as message) {\r\n <p class=\"text-sm text-red-600\">{{ message }}</p>\r\n }\r\n @for (revision of revisionItems(); track revision.version) {\r\n <button\r\n type=\"button\"\r\n class=\"flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-start text-sm transition-colors\"\r\n [class.border-primary-200]=\"viewedRevision() === revision.version\"\r\n [class.bg-primary-50]=\"viewedRevision() === revision.version\"\r\n [class.border-surface]=\"viewedRevision() !== revision.version\"\r\n [class.bg-content]=\"viewedRevision() !== revision.version\"\r\n [disabled]=\"revisionLoading()\"\r\n (click)=\"showRevision(revision.version)\"\r\n >\r\n <span class=\"font-medium text-color\">\r\n {{\r\n \"components.entityListField.revisionLabel\"\r\n | transloco: { version: revision.version }\r\n }}\r\n </span>\r\n <span\r\n class=\"flex min-w-0 flex-wrap items-center justify-end gap-x-2 text-xs text-muted-color\"\r\n >\r\n <span class=\"truncate\">{{ revision.author }}</span>\r\n <span>{{ revision.createdAt | mtDateFormat: \"dateTime\" }}</span>\r\n </span>\r\n </button>\r\n } @empty {\r\n @if (!revisionsLoading() && !revisionsError()) {\r\n <p class=\"text-sm text-muted-color\">\r\n {{ \"components.entityListField.noRevisions\" | transloco }}\r\n </p>\r\n }\r\n }\r\n @if (revisionsLoading()) {\r\n <p-skeleton width=\"100%\" height=\"2.25rem\" borderRadius=\"0.375rem\" />\r\n } @else if (hasMoreRevisions()) {\r\n <div class=\"flex justify-center\">\r\n <mt-button\r\n [label]=\"'components.entityListField.loadMore' | transloco\"\r\n size=\"small\"\r\n variant=\"text\"\r\n (onClick)=\"loadRevisions()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (revisionError(); as message) {\r\n <div\r\n class=\"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ message }}\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- \"Preserved values\", with when they were captured. -->\r\n<ng-template #preservedHeading>\r\n <h4\r\n class=\"flex flex-wrap items-baseline gap-2 text-sm font-semibold text-color\"\r\n >\r\n {{ \"components.entityListField.preservedValues\" | transloco }}\r\n @if (preservedAt(); as capturedAt) {\r\n <span class=\"text-xs font-normal text-muted-color\">\r\n {{\r\n \"components.entityListField.preservedAt\"\r\n | transloco: { date: (capturedAt | mtDateFormat: \"dateTime\") }\r\n }}\r\n </span>\r\n }\r\n </h4>\r\n</ng-template>\r\n\r\n<!--\r\n A linked list's comparison, one table at a time: the values preserved when\r\n it was saved, or its source records' current values. It opens on the\r\n property's configured mode. A missing baseline says so \u2014 it is never\r\n replaced by the current values.\r\n-->\r\n<ng-template #comparisonSections>\r\n <div class=\"flex flex-wrap items-center justify-between gap-2\">\r\n <mt-tabs\r\n size=\"small\"\r\n [options]=\"comparisonViewOptions()\"\r\n [active]=\"comparisonView()\"\r\n (onChange)=\"setComparisonView($event)\"\r\n />\r\n @if (comparisonView() === \"preserved\" && preservedAvailable()) {\r\n @if (preservedAt(); as capturedAt) {\r\n <span class=\"text-xs text-muted-color\">\r\n {{\r\n \"components.entityListField.preservedAt\"\r\n | transloco: { date: (capturedAt | mtDateFormat: \"dateTime\") }\r\n }}\r\n </span>\r\n }\r\n }\r\n </div>\r\n\r\n <section\r\n class=\"flex flex-col gap-2 transition-opacity\"\r\n [class.opacity-60]=\"revisionLoading()\"\r\n >\r\n @if (comparisonView() === \"current\") {\r\n @if (liveRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"liveRows()\"\r\n [columns]=\"displayColumns()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n }\r\n } @else if (!preservedAvailable()) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noPreservedSnapshot\" | transloco }}\r\n </div>\r\n } @else if (preservedRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"preservedRows()\"\r\n [columns]=\"displayColumns()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.preservedEmpty\" | transloco }}\r\n </div>\r\n }\r\n </section>\r\n\r\n @if (unavailableCount()) {\r\n <p class=\"text-xs text-muted-color\">\r\n {{\r\n \"components.entityListField.unavailableRecords\"\r\n | transloco: { count: unavailableCount() }\r\n }}\r\n </p>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3618
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, propertyKey: { classPropertyName: "propertyKey", publicName: "propertyKey", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, pendingSubmission: { classPropertyName: "pendingSubmission", publicName: "pendingSubmission", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, providers: [EntityRuntimeContextStore], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (noticeKey(); as notice) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ notice | transloco }}\r\n </div>\r\n } @else if (localReady()) {\r\n <!--\r\n A Local list: rows owned by this record, staged into its own submission.\r\n Add / edit / delete / drag follow the Local operation switches. Opened\r\n from a table cell, it can also show a saved revision's rows instead.\r\n -->\r\n @if (historyAvailable()) {\r\n <ng-container [ngTemplateOutlet]=\"history\" />\r\n }\r\n @if (showingRevision()) {\r\n <section\r\n class=\"flex flex-col gap-2 transition-opacity\"\r\n [class.opacity-60]=\"revisionLoading()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"preservedHeading\" />\r\n @if (revisionLocalRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"revisionLocalRows()\"\r\n [columns]=\"displayRevisionLocalColumns()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.preservedEmpty\" | transloco }}\r\n </div>\r\n }\r\n </section>\r\n } @else {\r\n @if (localCanCreate()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openLocalRowDialog()\"\r\n />\r\n </div>\r\n }\r\n @if (localTableRows().length || localCanCreate()) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"localTableRows()\"\r\n [columns]=\"displayLocalColumns()\"\r\n [rowActions]=\"localRowActions()\"\r\n [reorderableRows]=\"localCanReorder()\"\r\n (rowReorder)=\"onLocalReorder($event)\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noLocalRows\" | transloco }}\r\n </div>\r\n }\r\n }\r\n } @else if (selectionReady()) {\r\n <!--\r\n A Selected list: the source records picked for this record, and nothing\r\n else. Picking and removing change only which records it holds. Opened\r\n from a table cell, a saved revision compares the records it held then\r\n with their values today.\r\n -->\r\n @if (historyAvailable()) {\r\n <ng-container [ngTemplateOutlet]=\"history\" />\r\n }\r\n @if (showingRevision()) {\r\n <ng-container [ngTemplateOutlet]=\"comparisonSections\" />\r\n } @else {\r\n @if (selectionWritable()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.selectRecords' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openSelectionDialog()\"\r\n />\r\n </div>\r\n }\r\n @if (selectionRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"selectionRows()\"\r\n [columns]=\"displayColumns()\"\r\n [rowActions]=\"selectionRowActions()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noSelectedRecords\" | transloco }}\r\n </div>\r\n }\r\n }\r\n } @else if (comparisonMode()) {\r\n <!--\r\n A saved Related list opened from outside its form: its sources' current\r\n values, and the values preserved when it was saved. A missing baseline is\r\n said as such \u2014 it is not an empty list.\r\n -->\r\n @if (!comparisonReady()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n </div>\r\n } @else {\r\n @if (historyAvailable()) {\r\n <ng-container [ngTemplateOutlet]=\"history\" />\r\n }\r\n <ng-container [ngTemplateOutlet]=\"comparisonSections\" />\r\n }\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"tableColumns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"tableColumns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n\r\n<!--\r\n Saved list revisions: each successful save of this list, newest first.\r\n Picking one shows what it preserved \u2014 beside today's values of the records\r\n it held, for a linked list. Read-only: history is never submitted.\r\n-->\r\n<ng-template #history>\r\n <div class=\"flex flex-wrap items-center justify-between gap-2\">\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @if (viewedRevision(); as version) {\r\n <span\r\n class=\"rounded-md border border-primary-200 bg-primary-50 px-2 py-0.5 text-xs font-medium text-primary-700\"\r\n >\r\n {{\r\n \"components.entityListField.viewingRevision\"\r\n | transloco: { version: version }\r\n }}\r\n </span>\r\n <mt-button\r\n [label]=\"'components.entityListField.backToLatest' | transloco\"\r\n size=\"small\"\r\n variant=\"text\"\r\n [disabled]=\"revisionLoading()\"\r\n (onClick)=\"showRevision(null)\"\r\n />\r\n }\r\n </div>\r\n <mt-button\r\n [label]=\"'components.entityListField.revisions' | transloco\"\r\n icon=\"time.clock-rewind\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n (onClick)=\"toggleRevisions()\"\r\n />\r\n </div>\r\n\r\n @if (revisionsOpen()) {\r\n <div\r\n class=\"flex flex-col gap-2 rounded-md border border-surface bg-surface-50 p-3\"\r\n >\r\n <p class=\"text-xs text-muted-color\">\r\n {{ \"components.entityListField.revisionsHint\" | transloco }}\r\n </p>\r\n @if (revisionsError(); as message) {\r\n <p class=\"text-sm text-red-600\">{{ message }}</p>\r\n }\r\n @for (revision of revisionItems(); track revision.version) {\r\n <button\r\n type=\"button\"\r\n class=\"flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-start text-sm transition-colors\"\r\n [class.border-primary-200]=\"viewedRevision() === revision.version\"\r\n [class.bg-primary-50]=\"viewedRevision() === revision.version\"\r\n [class.border-surface]=\"viewedRevision() !== revision.version\"\r\n [class.bg-content]=\"viewedRevision() !== revision.version\"\r\n [disabled]=\"revisionLoading()\"\r\n (click)=\"showRevision(revision.version)\"\r\n >\r\n <span class=\"font-medium text-color\">\r\n {{\r\n \"components.entityListField.revisionLabel\"\r\n | transloco: { version: revision.version }\r\n }}\r\n </span>\r\n <span\r\n class=\"flex min-w-0 flex-wrap items-center justify-end gap-x-2 text-xs text-muted-color\"\r\n >\r\n <span class=\"truncate\">{{ revision.author }}</span>\r\n <span>{{ revision.createdAt | mtDateFormat: \"dateTime\" }}</span>\r\n </span>\r\n </button>\r\n } @empty {\r\n @if (!revisionsLoading() && !revisionsError()) {\r\n <p class=\"text-sm text-muted-color\">\r\n {{ \"components.entityListField.noRevisions\" | transloco }}\r\n </p>\r\n }\r\n }\r\n @if (revisionsLoading()) {\r\n <p-skeleton width=\"100%\" height=\"2.25rem\" borderRadius=\"0.375rem\" />\r\n } @else if (hasMoreRevisions()) {\r\n <div class=\"flex justify-center\">\r\n <mt-button\r\n [label]=\"'components.entityListField.loadMore' | transloco\"\r\n size=\"small\"\r\n variant=\"text\"\r\n (onClick)=\"loadRevisions()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (revisionError(); as message) {\r\n <div\r\n class=\"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ message }}\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- \"Preserved values\", with when they were captured. -->\r\n<ng-template #preservedHeading>\r\n <h4\r\n class=\"flex flex-wrap items-baseline gap-2 text-sm font-semibold text-color\"\r\n >\r\n {{ \"components.entityListField.preservedValues\" | transloco }}\r\n @if (preservedAt(); as capturedAt) {\r\n <span class=\"text-xs font-normal text-muted-color\">\r\n {{\r\n \"components.entityListField.preservedAt\"\r\n | transloco: { date: (capturedAt | mtDateFormat: \"dateTime\") }\r\n }}\r\n </span>\r\n }\r\n </h4>\r\n</ng-template>\r\n\r\n<!--\r\n A linked list's comparison, one table at a time: the values preserved when\r\n it was saved, or its source records' current values. It opens on the\r\n property's configured mode. A missing baseline says so \u2014 it is never\r\n replaced by the current values.\r\n-->\r\n<ng-template #comparisonSections>\r\n <div class=\"flex flex-wrap items-center justify-between gap-2\">\r\n <mt-tabs\r\n size=\"small\"\r\n [options]=\"comparisonViewOptions()\"\r\n [active]=\"comparisonView()\"\r\n (onChange)=\"setComparisonView($event)\"\r\n />\r\n @if (comparisonView() === \"preserved\" && preservedAvailable()) {\r\n @if (preservedAt(); as capturedAt) {\r\n <span class=\"text-xs text-muted-color\">\r\n {{\r\n \"components.entityListField.preservedAt\"\r\n | transloco: { date: (capturedAt | mtDateFormat: \"dateTime\") }\r\n }}\r\n </span>\r\n }\r\n }\r\n </div>\r\n\r\n <section\r\n class=\"flex flex-col gap-2 transition-opacity\"\r\n [class.opacity-60]=\"revisionLoading()\"\r\n >\r\n @if (comparisonView() === \"current\") {\r\n @if (liveRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"liveRows()\"\r\n [columns]=\"displayColumns()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n }\r\n } @else if (!preservedAvailable()) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noPreservedSnapshot\" | transloco }}\r\n </div>\r\n } @else if (preservedRows().length) {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"preservedRows()\"\r\n [columns]=\"displayColumns()\"\r\n dataKey=\"Id\"\r\n />\r\n } @else {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.preservedEmpty\" | transloco }}\r\n </div>\r\n }\r\n </section>\r\n\r\n @if (unavailableCount()) {\r\n <p class=\"text-xs text-muted-color\">\r\n {{\r\n \"components.entityListField.unavailableRecords\"\r\n | transloco: { count: unavailableCount() }\r\n }}\r\n </p>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3610
3619
  }
3611
3620
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, decorators: [{
3612
3621
  type: Component,