@masterteam/components 0.0.148 → 0.0.150

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.
Files changed (28) hide show
  1. package/assets/common.css +1 -1
  2. package/fesm2022/masterteam-components-date-field.mjs +6 -4
  3. package/fesm2022/masterteam-components-date-field.mjs.map +1 -1
  4. package/fesm2022/masterteam-components-editor-field.mjs +2 -2
  5. package/fesm2022/masterteam-components-editor-field.mjs.map +1 -1
  6. package/fesm2022/masterteam-components-entities.mjs +108 -8
  7. package/fesm2022/masterteam-components-entities.mjs.map +1 -1
  8. package/fesm2022/masterteam-components-number-field.mjs +2 -2
  9. package/fesm2022/masterteam-components-number-field.mjs.map +1 -1
  10. package/fesm2022/masterteam-components-page-header.mjs +1 -1
  11. package/fesm2022/masterteam-components-page-header.mjs.map +1 -1
  12. package/fesm2022/masterteam-components-property-filter-builder.mjs +1 -1
  13. package/fesm2022/masterteam-components-property-filter-builder.mjs.map +1 -1
  14. package/fesm2022/masterteam-components-select-field.mjs +2 -2
  15. package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
  16. package/fesm2022/masterteam-components-slider-field.mjs +2 -2
  17. package/fesm2022/masterteam-components-slider-field.mjs.map +1 -1
  18. package/fesm2022/masterteam-components-table.mjs +5 -5
  19. package/fesm2022/masterteam-components-table.mjs.map +1 -1
  20. package/fesm2022/masterteam-components-tabs.mjs +108 -7
  21. package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
  22. package/fesm2022/masterteam-components-textarea-field.mjs +2 -2
  23. package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/types/masterteam-components-date-field.d.ts +6 -5
  26. package/types/masterteam-components-entities.d.ts +75 -4
  27. package/types/masterteam-components-table.d.ts +2 -2
  28. package/types/masterteam-components-tabs.d.ts +17 -2
@@ -880,20 +880,19 @@ function buildDisplayEntities(entities) {
880
880
  .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
881
881
  }
882
882
 
883
- class EntityPreview {
884
- /** Single entity data to display */
883
+ class EntityPreviewBody {
885
884
  data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
886
885
  attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
887
886
  previewType = computed(() => {
888
887
  const viewType = this.data().viewType;
889
888
  return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
890
889
  }, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
891
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
892
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
890
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
891
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreviewBody, isStandalone: true, selector: "mt-entity-preview-body", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@switch (previewType()) {\n @case (\"Text\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"LongText\") {\n <mt-entity-long-text [data]=\"data()\" />\n }\n @case (\"Date\") {\n <mt-entity-date [data]=\"data()\" />\n }\n @case (\"DateTime\") {\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\n }\n @case (\"User\") {\n <mt-entity-user [data]=\"data()\" />\n }\n @case (\"Percentage\") {\n <mt-entity-percentage [data]=\"data()\" />\n }\n @case (\"Currency\") {\n <mt-entity-currency [data]=\"data()\" />\n }\n @case (\"Checkbox\") {\n <mt-entity-checkbox [data]=\"data()\" />\n }\n @case (\"Lookup\") {\n <mt-entity-lookup [data]=\"data()\" />\n }\n @case (\"Status\") {\n <mt-entity-status [data]=\"data()\" />\n }\n @case (\"Attachment\") {\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
893
892
  }
894
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, decorators: [{
893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, decorators: [{
895
894
  type: Component,
896
- args: [{ selector: 'mt-entity-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
895
+ args: [{ selector: 'mt-entity-preview-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
897
896
  EntityText,
898
897
  EntityLongText,
899
898
  EntityDate,
@@ -907,7 +906,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
907
906
  EntityLeafDetails,
908
907
  ], host: {
909
908
  class: 'w-full',
910
- }, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n" }]
909
+ }, template: "@switch (previewType()) {\n @case (\"Text\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"LongText\") {\n <mt-entity-long-text [data]=\"data()\" />\n }\n @case (\"Date\") {\n <mt-entity-date [data]=\"data()\" />\n }\n @case (\"DateTime\") {\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\n }\n @case (\"User\") {\n <mt-entity-user [data]=\"data()\" />\n }\n @case (\"Percentage\") {\n <mt-entity-percentage [data]=\"data()\" />\n }\n @case (\"Currency\") {\n <mt-entity-currency [data]=\"data()\" />\n }\n @case (\"Checkbox\") {\n <mt-entity-checkbox [data]=\"data()\" />\n }\n @case (\"Lookup\") {\n <mt-entity-lookup [data]=\"data()\" />\n }\n @case (\"Status\") {\n <mt-entity-status [data]=\"data()\" />\n }\n @case (\"Attachment\") {\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\n" }]
910
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
911
+
912
+ class ComparisonValue {
913
+ data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
914
+ comparison = computed(() => {
915
+ const c = this.data().comparison;
916
+ return c?.kind === 'Value' ? c : null;
917
+ }, ...(ngDevMode ? [{ debugName: "comparison" }] : /* istanbul ignore next */ []));
918
+ oldEntity = computed(() => this.buildSide(this.comparison()?.oldValue), ...(ngDevMode ? [{ debugName: "oldEntity" }] : /* istanbul ignore next */ []));
919
+ newEntity = computed(() => this.buildSide(this.comparison()?.newValue), ...(ngDevMode ? [{ debugName: "newEntity" }] : /* istanbul ignore next */ []));
920
+ buildSide(side) {
921
+ if (!side)
922
+ return null;
923
+ const base = this.data();
924
+ return {
925
+ ...base,
926
+ rawValue: side.raw === null || side.raw === undefined
927
+ ? undefined
928
+ : String(side.raw),
929
+ value: (side.display ?? side.value ?? ''),
930
+ comparison: undefined,
931
+ };
932
+ }
933
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
934
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ComparisonValue, isStandalone: true, selector: "mt-comparison-value", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "block w-full" }, ngImport: i0, template: "@if (comparison(); as cmp) {\n <div class=\"flex w-full min-w-0 items-stretch gap-3\">\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\n >Before</span\n >\n @if (oldEntity(); as old) {\n <mt-entity-preview-body [data]=\"old\" />\n } @else {\n <span class=\"text-sm text-muted-color\">_</span>\n }\n </div>\n <div class=\"flex shrink-0 items-center text-muted-color\" aria-hidden=\"true\">\n &rarr;\n </div>\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\n >\n <span class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\n >After</span\n >\n @if (newEntity(); as next) {\n <mt-entity-preview-body [data]=\"next\" />\n } @else {\n <span class=\"text-sm text-muted-color\">_</span>\n }\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
935
+ }
936
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonValue, decorators: [{
937
+ type: Component,
938
+ args: [{ selector: 'mt-comparison-value', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityPreviewBody], host: {
939
+ class: 'block w-full',
940
+ }, template: "@if (comparison(); as cmp) {\n <div class=\"flex w-full min-w-0 items-stretch gap-3\">\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\n >Before</span\n >\n @if (oldEntity(); as old) {\n <mt-entity-preview-body [data]=\"old\" />\n } @else {\n <span class=\"text-sm text-muted-color\">_</span>\n }\n </div>\n <div class=\"flex shrink-0 items-center text-muted-color\" aria-hidden=\"true\">\n &rarr;\n </div>\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\n >\n <span class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\n >After</span\n >\n @if (newEntity(); as next) {\n <mt-entity-preview-body [data]=\"next\" />\n } @else {\n <span class=\"text-sm text-muted-color\">_</span>\n }\n </div>\n </div>\n}\n" }]
941
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
942
+
943
+ const OPERATION_BADGES = {
944
+ CreateRecord: {
945
+ label: 'Added',
946
+ classes: 'bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-200',
947
+ },
948
+ UpdateRecord: {
949
+ label: 'Updated',
950
+ classes: 'bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-200',
951
+ },
952
+ DeleteRecord: {
953
+ label: 'Removed',
954
+ classes: 'bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-200',
955
+ },
956
+ };
957
+ class ComparisonEntityList {
958
+ data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
959
+ comparison = computed(() => {
960
+ const c = this.data().comparison;
961
+ return c?.kind === 'EntityList' ? c : null;
962
+ }, ...(ngDevMode ? [{ debugName: "comparison" }] : /* istanbul ignore next */ []));
963
+ rows = computed(() => this.comparison()?.rows ?? [], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
964
+ targetModuleKey = computed(() => this.comparison()?.targetModuleKey ?? '', ...(ngDevMode ? [{ debugName: "targetModuleKey" }] : /* istanbul ignore next */ []));
965
+ label = computed(() => this.data().name ?? '', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
966
+ badgeFor(op) {
967
+ return OPERATION_BADGES[op];
968
+ }
969
+ displayField(value, display) {
970
+ if (display && display.trim().length > 0)
971
+ return display;
972
+ return displayOrPlaceholder(value);
973
+ }
974
+ rowId(_i, row) {
975
+ return row.entityId ?? _i;
976
+ }
977
+ oldField(row, propertyKey) {
978
+ return row.oldValues.find((v) => v.propertyKey === propertyKey);
979
+ }
980
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonEntityList, deps: [], target: i0.ɵɵFactoryTarget.Component });
981
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ComparisonEntityList, isStandalone: true, selector: "mt-comparison-entity-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "block w-full" }, ngImport: i0, template: "@if (comparison(); as cmp) {\n <div class=\"flex w-full min-w-0 flex-col gap-2\">\n @if (label()) {\n <div class=\"flex items-baseline justify-between\">\n <span class=\"text-sm font-medium text-color\">{{ label() }}</span>\n @if (targetModuleKey()) {\n <span class=\"text-xs text-muted-color\">{{ targetModuleKey() }}</span>\n }\n </div>\n }\n @if (rows().length === 0) {\n <div class=\"text-sm text-muted-color\">_</div>\n } @else {\n <ul class=\"flex flex-col gap-2\">\n @for (row of rows(); track rowId($index, row)) {\n <li\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <div class=\"flex items-center justify-between gap-2\">\n <span\n class=\"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium\"\n [class]=\"badgeFor(row.operation).classes\"\n >\n {{ badgeFor(row.operation).label }}\n </span>\n <span class=\"text-xs text-muted-color\">#{{ row.entityId }}</span>\n </div>\n\n @switch (row.operation) {\n @case (\"CreateRecord\") {\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\n @for (f of row.newValues; track f.propertyKey) {\n <div class=\"flex min-w-0 flex-col\">\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\n <dd class=\"truncate text-sm text-color\">\n {{ displayField(f.value, f.display) }}\n </dd>\n </div>\n }\n </dl>\n }\n @case (\"DeleteRecord\") {\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\n @for (f of row.oldValues; track f.propertyKey) {\n <div class=\"flex min-w-0 flex-col\">\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\n <dd class=\"truncate text-sm text-color line-through\">\n {{ displayField(f.value, f.display) }}\n </dd>\n </div>\n }\n </dl>\n }\n @default {\n <dl class=\"flex flex-col gap-1\">\n @for (f of row.newValues; track f.propertyKey) {\n <div class=\"flex min-w-0 flex-col\">\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\n <dd class=\"flex min-w-0 flex-wrap items-center gap-2\">\n <span\n class=\"max-w-[40%] truncate text-sm text-muted-color line-through\"\n >\n {{\n displayField(\n $any(oldField(row, f.propertyKey))?.value,\n $any(oldField(row, f.propertyKey))?.display\n )\n }}\n </span>\n <span class=\"text-muted-color\" aria-hidden=\"true\"\n >&rarr;</span\n >\n <span class=\"max-w-[40%] truncate text-sm text-color\">\n {{ displayField(f.value, f.display) }}\n </span>\n </dd>\n </div>\n }\n </dl>\n }\n }\n </li>\n }\n </ul>\n }\n </div>\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
982
+ }
983
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonEntityList, decorators: [{
984
+ type: Component,
985
+ args: [{ selector: 'mt-comparison-entity-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], host: {
986
+ class: 'block w-full',
987
+ }, template: "@if (comparison(); as cmp) {\n <div class=\"flex w-full min-w-0 flex-col gap-2\">\n @if (label()) {\n <div class=\"flex items-baseline justify-between\">\n <span class=\"text-sm font-medium text-color\">{{ label() }}</span>\n @if (targetModuleKey()) {\n <span class=\"text-xs text-muted-color\">{{ targetModuleKey() }}</span>\n }\n </div>\n }\n @if (rows().length === 0) {\n <div class=\"text-sm text-muted-color\">_</div>\n } @else {\n <ul class=\"flex flex-col gap-2\">\n @for (row of rows(); track rowId($index, row)) {\n <li\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <div class=\"flex items-center justify-between gap-2\">\n <span\n class=\"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium\"\n [class]=\"badgeFor(row.operation).classes\"\n >\n {{ badgeFor(row.operation).label }}\n </span>\n <span class=\"text-xs text-muted-color\">#{{ row.entityId }}</span>\n </div>\n\n @switch (row.operation) {\n @case (\"CreateRecord\") {\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\n @for (f of row.newValues; track f.propertyKey) {\n <div class=\"flex min-w-0 flex-col\">\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\n <dd class=\"truncate text-sm text-color\">\n {{ displayField(f.value, f.display) }}\n </dd>\n </div>\n }\n </dl>\n }\n @case (\"DeleteRecord\") {\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\n @for (f of row.oldValues; track f.propertyKey) {\n <div class=\"flex min-w-0 flex-col\">\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\n <dd class=\"truncate text-sm text-color line-through\">\n {{ displayField(f.value, f.display) }}\n </dd>\n </div>\n }\n </dl>\n }\n @default {\n <dl class=\"flex flex-col gap-1\">\n @for (f of row.newValues; track f.propertyKey) {\n <div class=\"flex min-w-0 flex-col\">\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\n <dd class=\"flex min-w-0 flex-wrap items-center gap-2\">\n <span\n class=\"max-w-[40%] truncate text-sm text-muted-color line-through\"\n >\n {{\n displayField(\n $any(oldField(row, f.propertyKey))?.value,\n $any(oldField(row, f.propertyKey))?.display\n )\n }}\n </span>\n <span class=\"text-muted-color\" aria-hidden=\"true\"\n >&rarr;</span\n >\n <span class=\"max-w-[40%] truncate text-sm text-color\">\n {{ displayField(f.value, f.display) }}\n </span>\n </dd>\n </div>\n }\n </dl>\n }\n }\n </li>\n }\n </ul>\n }\n </div>\n}\n" }]
988
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
989
+
990
+ class EntityPreview {
991
+ data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
992
+ attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
993
+ comparisonKind = computed(() => {
994
+ const c = this.data().comparison;
995
+ if (!c)
996
+ return null;
997
+ if (c.kind === 'Value')
998
+ return 'Value';
999
+ if (c.kind === 'EntityList')
1000
+ return 'EntityList';
1001
+ return null;
1002
+ }, ...(ngDevMode ? [{ debugName: "comparisonKind" }] : /* istanbul ignore next */ []));
1003
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
1004
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@switch (comparisonKind()) {\n @case (\"Value\") {\n <mt-comparison-value [data]=\"data()\" />\n }\n @case (\"EntityList\") {\n <mt-comparison-entity-list [data]=\"data()\" />\n }\n @default {\n <mt-entity-preview-body\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n }\n}\n", dependencies: [{ kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }, { kind: "component", type: ComparisonValue, selector: "mt-comparison-value", inputs: ["data"] }, { kind: "component", type: ComparisonEntityList, selector: "mt-comparison-entity-list", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1005
+ }
1006
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, decorators: [{
1007
+ type: Component,
1008
+ args: [{ selector: 'mt-entity-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityPreviewBody, ComparisonValue, ComparisonEntityList], host: {
1009
+ class: 'w-full',
1010
+ }, template: "@switch (comparisonKind()) {\n @case (\"Value\") {\n <mt-comparison-value [data]=\"data()\" />\n }\n @case (\"EntityList\") {\n <mt-comparison-entity-list [data]=\"data()\" />\n }\n @default {\n <mt-entity-preview-body\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n }\n}\n" }]
911
1011
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
912
1012
 
913
1013
  class EntitiesPreview {
@@ -1112,5 +1212,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
1112
1212
  * Generated bundle index. Do not edit.
1113
1213
  */
1114
1214
 
1115
- export { EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLongText, EntityLookup, EntityPercentage, EntityPreview, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, buildDisplayEntities, expandLeafDetailsEntity, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue };
1215
+ export { ComparisonEntityList, ComparisonValue, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLongText, EntityLookup, EntityPercentage, EntityPreview, EntityPreviewBody, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, buildDisplayEntities, expandLeafDetailsEntity, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue };
1116
1216
  //# sourceMappingURL=masterteam-components-entities.mjs.map