@masterteam/components 0.0.164 → 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.
Files changed (55) hide show
  1. package/assets/common.css +1 -1
  2. package/assets/i18n/ar.json +128 -0
  3. package/assets/i18n/en.json +128 -0
  4. package/fesm2022/masterteam-components-business-fields.mjs +40 -20
  5. package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
  6. package/fesm2022/masterteam-components-client-page.mjs +6 -4
  7. package/fesm2022/masterteam-components-client-page.mjs.map +1 -1
  8. package/fesm2022/masterteam-components-drawer.mjs +4 -2
  9. package/fesm2022/masterteam-components-drawer.mjs.map +1 -1
  10. package/fesm2022/masterteam-components-dynamic-drawer.mjs +9 -4
  11. package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
  12. package/fesm2022/masterteam-components-entities.mjs +19 -8
  13. package/fesm2022/masterteam-components-entities.mjs.map +1 -1
  14. package/fesm2022/masterteam-components-formula.mjs +52 -14
  15. package/fesm2022/masterteam-components-formula.mjs.map +1 -1
  16. package/fesm2022/masterteam-components-icon-field.mjs +4 -3
  17. package/fesm2022/masterteam-components-icon-field.mjs.map +1 -1
  18. package/fesm2022/masterteam-components-module-summary-card.mjs +4 -2
  19. package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -1
  20. package/fesm2022/masterteam-components-pick-list-field.mjs +5 -3
  21. package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
  22. package/fesm2022/masterteam-components-runtime-action.mjs +21 -13
  23. package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -1
  24. package/fesm2022/masterteam-components-sidebar.mjs +3 -2
  25. package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
  26. package/fesm2022/masterteam-components-table.mjs +51 -16
  27. package/fesm2022/masterteam-components-table.mjs.map +1 -1
  28. package/fesm2022/masterteam-components-tabs.mjs +4 -2
  29. package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
  30. package/fesm2022/masterteam-components-text-field.mjs +5 -1
  31. package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
  32. package/fesm2022/masterteam-components-topbar.mjs +3 -2
  33. package/fesm2022/masterteam-components-topbar.mjs.map +1 -1
  34. package/fesm2022/masterteam-components-tree.mjs +14 -2
  35. package/fesm2022/masterteam-components-tree.mjs.map +1 -1
  36. package/fesm2022/masterteam-components-upload-field.mjs +4 -3
  37. package/fesm2022/masterteam-components-upload-field.mjs.map +1 -1
  38. package/fesm2022/masterteam-components-user-search-field.mjs +5 -6
  39. package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/types/masterteam-components-business-fields.d.ts +2 -0
  42. package/types/masterteam-components-client-page.d.ts +2 -1
  43. package/types/masterteam-components-drawer.d.ts +1 -0
  44. package/types/masterteam-components-dynamic-drawer.d.ts +2 -0
  45. package/types/masterteam-components-entities.d.ts +3 -0
  46. package/types/masterteam-components-formula.d.ts +7 -3
  47. package/types/masterteam-components-module-summary-card.d.ts +1 -0
  48. package/types/masterteam-components-pick-list-field.d.ts +1 -0
  49. package/types/masterteam-components-runtime-action.d.ts +2 -0
  50. package/types/masterteam-components-table.d.ts +15 -3
  51. package/types/masterteam-components-tabs.d.ts +1 -0
  52. package/types/masterteam-components-text-field.d.ts +2 -1
  53. package/types/masterteam-components-tree.d.ts +1 -0
  54. package/types/masterteam-components-upload-field.d.ts +1 -0
  55. 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 ?? attachment.fileName ?? attachment.id ?? 'Attachment');
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 &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" }]
942
947
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
943
948
 
944
- const OPERATION_BADGES = {
949
+ const OPERATION_BADGE_KEYS = {
945
950
  CreateRecord: {
946
- label: 'Added',
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
- label: 'Updated',
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
- label: 'Removed',
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
- return OPERATION_BADGES[op];
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('Click to filter by this value', ...(ngDevMode ? [{ debugName: "clickableTooltip" }] : /* istanbul ignore next */ []));
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('Click to clear filter', ...(ngDevMode ? [{ debugName: "activeTooltip" }] : /* istanbul ignore next */ []));
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`.