@masterteam/components 0.0.165 → 0.0.166
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 +128 -0
- package/assets/i18n/en.json +128 -0
- package/fesm2022/masterteam-components-business-fields.mjs +40 -20
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-client-page.mjs +6 -4
- package/fesm2022/masterteam-components-client-page.mjs.map +1 -1
- package/fesm2022/masterteam-components-drawer.mjs +4 -2
- package/fesm2022/masterteam-components-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-dynamic-drawer.mjs +9 -4
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +19 -8
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +52 -14
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/fesm2022/masterteam-components-icon-field.mjs +4 -3
- package/fesm2022/masterteam-components-icon-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-module-summary-card.mjs +4 -2
- package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -1
- package/fesm2022/masterteam-components-pick-list-field.mjs +5 -3
- package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-runtime-action.mjs +21 -13
- package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -1
- package/fesm2022/masterteam-components-sidebar.mjs +3 -2
- package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +22 -13
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-tabs.mjs +4 -2
- package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
- package/fesm2022/masterteam-components-text-field.mjs +5 -1
- package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-topbar.mjs +3 -2
- package/fesm2022/masterteam-components-topbar.mjs.map +1 -1
- package/fesm2022/masterteam-components-upload-field.mjs +4 -3
- package/fesm2022/masterteam-components-upload-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +5 -6
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-business-fields.d.ts +2 -0
- package/types/masterteam-components-client-page.d.ts +2 -1
- package/types/masterteam-components-drawer.d.ts +1 -0
- package/types/masterteam-components-dynamic-drawer.d.ts +2 -0
- package/types/masterteam-components-entities.d.ts +3 -0
- package/types/masterteam-components-formula.d.ts +7 -3
- package/types/masterteam-components-module-summary-card.d.ts +1 -0
- package/types/masterteam-components-pick-list-field.d.ts +1 -0
- package/types/masterteam-components-runtime-action.d.ts +2 -0
- package/types/masterteam-components-table.d.ts +8 -3
- package/types/masterteam-components-tabs.d.ts +1 -0
- package/types/masterteam-components-text-field.d.ts +2 -1
- package/types/masterteam-components-upload-field.d.ts +1 -0
- package/types/masterteam-components-user-search-field.d.ts +0 -1
|
@@ -9,6 +9,7 @@ import { SecureImagePipe, UploadField } from '@masterteam/components/upload-fiel
|
|
|
9
9
|
import { Progress } from '@masterteam/components/progress';
|
|
10
10
|
import * as i1 from '@angular/forms';
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
|
+
import { TranslocoService } from '@jsverse/transloco';
|
|
12
13
|
import { Button } from '@masterteam/components/button';
|
|
13
14
|
import { forkJoin, finalize, of, take, switchMap, EMPTY, map, catchError } from 'rxjs';
|
|
14
15
|
import * as i1$1 from 'primeng/tooltip';
|
|
@@ -434,6 +435,7 @@ class EntityAttachment {
|
|
|
434
435
|
endPoint = input('uploader', ...(ngDevMode ? [{ debugName: "endPoint" }] : /* istanbul ignore next */ []));
|
|
435
436
|
context = input(undefined, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
436
437
|
httpClient = inject(HttpClient);
|
|
438
|
+
transloco = inject(TranslocoService);
|
|
437
439
|
displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
|
|
438
440
|
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
439
441
|
attachments = signal([], ...(ngDevMode ? [{ debugName: "attachments" }] : /* istanbul ignore next */ []));
|
|
@@ -497,7 +499,10 @@ class EntityAttachment {
|
|
|
497
499
|
return (attachment.id ?? attachment.fileName ?? attachment.name ?? String(index));
|
|
498
500
|
}
|
|
499
501
|
attachmentTooltip(attachment) {
|
|
500
|
-
return (attachment.name ??
|
|
502
|
+
return (attachment.name ??
|
|
503
|
+
attachment.fileName ??
|
|
504
|
+
attachment.id ??
|
|
505
|
+
this.transloco.translate('components.entitiesPreview.attachment'));
|
|
501
506
|
}
|
|
502
507
|
attachmentIcon(attachment) {
|
|
503
508
|
const extension = this.resolveExtension(attachment);
|
|
@@ -941,21 +946,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
941
946
|
}, 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 →\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" }]
|
|
942
947
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
943
948
|
|
|
944
|
-
const
|
|
949
|
+
const OPERATION_BADGE_KEYS = {
|
|
945
950
|
CreateRecord: {
|
|
946
|
-
|
|
951
|
+
key: 'components.comparisonEntities.added',
|
|
947
952
|
classes: 'bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-200',
|
|
948
953
|
},
|
|
949
954
|
UpdateRecord: {
|
|
950
|
-
|
|
955
|
+
key: 'components.comparisonEntities.updated',
|
|
951
956
|
classes: 'bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-200',
|
|
952
957
|
},
|
|
953
958
|
DeleteRecord: {
|
|
954
|
-
|
|
959
|
+
key: 'components.comparisonEntities.removed',
|
|
955
960
|
classes: 'bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-200',
|
|
956
961
|
},
|
|
957
962
|
};
|
|
958
963
|
class ComparisonEntityList {
|
|
964
|
+
transloco = inject(TranslocoService);
|
|
959
965
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
960
966
|
comparison = computed(() => {
|
|
961
967
|
const c = this.data().comparison;
|
|
@@ -965,7 +971,11 @@ class ComparisonEntityList {
|
|
|
965
971
|
targetModuleKey = computed(() => this.comparison()?.targetModuleKey ?? '', ...(ngDevMode ? [{ debugName: "targetModuleKey" }] : /* istanbul ignore next */ []));
|
|
966
972
|
label = computed(() => this.data().name ?? '', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
967
973
|
badgeFor(op) {
|
|
968
|
-
|
|
974
|
+
const config = OPERATION_BADGE_KEYS[op];
|
|
975
|
+
return {
|
|
976
|
+
label: this.transloco.translate(config.key),
|
|
977
|
+
classes: config.classes,
|
|
978
|
+
};
|
|
969
979
|
}
|
|
970
980
|
displayField(value, display) {
|
|
971
981
|
if (display && display.trim().length > 0)
|
|
@@ -1013,6 +1023,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1013
1023
|
|
|
1014
1024
|
const EMPTY_KEY_SET = new Set();
|
|
1015
1025
|
class EntitiesPreview {
|
|
1026
|
+
transloco = inject(TranslocoService);
|
|
1016
1027
|
/** Array of entity data to display */
|
|
1017
1028
|
entities = input.required(...(ngDevMode ? [{ debugName: "entities" }] : /* istanbul ignore next */ []));
|
|
1018
1029
|
attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
|
|
@@ -1030,9 +1041,9 @@ class EntitiesPreview {
|
|
|
1030
1041
|
*/
|
|
1031
1042
|
activeKeys = input(EMPTY_KEY_SET, ...(ngDevMode ? [{ debugName: "activeKeys" }] : /* istanbul ignore next */ []));
|
|
1032
1043
|
/** Tooltip text shown on hover when an entity is clickable but not active. */
|
|
1033
|
-
clickableTooltip = input(
|
|
1044
|
+
clickableTooltip = input(this.transloco.translate('components.entitiesPreview.filterByThis'), ...(ngDevMode ? [{ debugName: "clickableTooltip" }] : /* istanbul ignore next */ []));
|
|
1034
1045
|
/** Tooltip text shown on hover when an entity is the current active filter. */
|
|
1035
|
-
activeTooltip = input('
|
|
1046
|
+
activeTooltip = input(this.transloco.translate('components.entitiesPreview.clearFilter'), ...(ngDevMode ? [{ debugName: "activeTooltip" }] : /* istanbul ignore next */ []));
|
|
1036
1047
|
/**
|
|
1037
1048
|
* Emits when an individual entity slot is clicked. Only fires when the
|
|
1038
1049
|
* entity's key is present in `clickableKeys`.
|