@masterteam/components 0.0.165 → 0.0.167

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 +2 -2
  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 +34 -13
  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-modal.mjs +35 -0
  19. package/fesm2022/masterteam-components-modal.mjs.map +1 -1
  20. package/fesm2022/masterteam-components-module-summary-card.mjs +4 -2
  21. package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -1
  22. package/fesm2022/masterteam-components-pick-list-field.mjs +5 -3
  23. package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
  24. package/fesm2022/masterteam-components-runtime-action.mjs +21 -13
  25. package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -1
  26. package/fesm2022/masterteam-components-sidebar.mjs +3 -2
  27. package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
  28. package/fesm2022/masterteam-components-table.mjs +60 -13
  29. package/fesm2022/masterteam-components-table.mjs.map +1 -1
  30. package/fesm2022/masterteam-components-tabs.mjs +4 -2
  31. package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
  32. package/fesm2022/masterteam-components-text-field.mjs +16 -4
  33. package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
  34. package/fesm2022/masterteam-components-topbar.mjs +3 -2
  35. package/fesm2022/masterteam-components-topbar.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 +4 -0
  46. package/types/masterteam-components-formula.d.ts +7 -3
  47. package/types/masterteam-components-modal.d.ts +10 -2
  48. package/types/masterteam-components-module-summary-card.d.ts +1 -0
  49. package/types/masterteam-components-pick-list-field.d.ts +1 -0
  50. package/types/masterteam-components-runtime-action.d.ts +2 -0
  51. package/types/masterteam-components-table.d.ts +28 -13
  52. package/types/masterteam-components-tabs.d.ts +1 -0
  53. package/types/masterteam-components-text-field.d.ts +4 -3
  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';
@@ -56,8 +57,14 @@ class EntityField {
56
57
  const justifyClass = isEntityAlignEnd(this.configuration())
57
58
  ? 'justify-end'
58
59
  : '';
59
- return `flex min-w-0 items-center gap-1 text-sm text-gray-500 ${justifyClass}`.trimEnd();
60
+ return `flex min-w-0 max-w-full items-center gap-1 text-sm text-gray-500 ${justifyClass}`.trimEnd();
60
61
  }, ...(ngDevMode ? [{ debugName: "labelContainerClass" }] : /* istanbul ignore next */ []));
62
+ contentContainerClass = computed(() => {
63
+ const alignClass = isEntityAlignEnd(this.configuration())
64
+ ? 'self-end'
65
+ : 'self-stretch';
66
+ return `min-w-0 max-w-full ${alignClass}`;
67
+ }, ...(ngDevMode ? [{ debugName: "contentContainerClass" }] : /* istanbul ignore next */ []));
61
68
  containerClass = computed(() => {
62
69
  const gapClass = this.gap() === 'relaxed'
63
70
  ? 'gap-2'
@@ -73,7 +80,9 @@ class EntityField {
73
80
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityField, deps: [], target: i0.ɵɵFactoryTarget.Component });
74
81
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityField, isStandalone: true, selector: "mt-entity-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelIconName: { classPropertyName: "labelIconName", publicName: "labelIconName", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: `
75
82
  <div [class]="containerClass()">
76
- <ng-content />
83
+ <div [class]="contentContainerClass()">
84
+ <ng-content />
85
+ </div>
77
86
  @if (!hideLabel()) {
78
87
  <div [class]="labelContainerClass()">
79
88
  @if (labelIconName(); as iconName) {
@@ -99,7 +108,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
99
108
  imports: [TruncateTooltip, Icon],
100
109
  template: `
101
110
  <div [class]="containerClass()">
102
- <ng-content />
111
+ <div [class]="contentContainerClass()">
112
+ <ng-content />
113
+ </div>
103
114
  @if (!hideLabel()) {
104
115
  <div [class]="labelContainerClass()">
105
116
  @if (labelIconName(); as iconName) {
@@ -137,11 +148,11 @@ class EntityText {
137
148
  return displayOrPlaceholder(this.value());
138
149
  }, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
139
150
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityText, deps: [], target: i0.ɵɵFactoryTarget.Component });
140
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: EntityText, isStandalone: true, selector: "mt-entity-text", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }] });
151
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: EntityText, isStandalone: true, selector: "mt-entity-text", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }] });
141
152
  }
142
153
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityText, decorators: [{
143
154
  type: Component,
144
- args: [{ selector: 'mt-entity-text', standalone: true, imports: [EntityField, TruncateTooltip], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n" }]
155
+ args: [{ selector: 'mt-entity-text', standalone: true, imports: [EntityField, TruncateTooltip], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n" }]
145
156
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
146
157
 
147
158
  class EntityDate {
@@ -434,6 +445,7 @@ class EntityAttachment {
434
445
  endPoint = input('uploader', ...(ngDevMode ? [{ debugName: "endPoint" }] : /* istanbul ignore next */ []));
435
446
  context = input(undefined, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
436
447
  httpClient = inject(HttpClient);
448
+ transloco = inject(TranslocoService);
437
449
  displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
438
450
  loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
439
451
  attachments = signal([], ...(ngDevMode ? [{ debugName: "attachments" }] : /* istanbul ignore next */ []));
@@ -497,7 +509,10 @@ class EntityAttachment {
497
509
  return (attachment.id ?? attachment.fileName ?? attachment.name ?? String(index));
498
510
  }
499
511
  attachmentTooltip(attachment) {
500
- return (attachment.name ?? attachment.fileName ?? attachment.id ?? 'Attachment');
512
+ return (attachment.name ??
513
+ attachment.fileName ??
514
+ attachment.id ??
515
+ this.transloco.translate('components.entitiesPreview.attachment'));
501
516
  }
502
517
  attachmentIcon(attachment) {
503
518
  const extension = this.resolveExtension(attachment);
@@ -941,21 +956,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
941
956
  }, 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
957
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
943
958
 
944
- const OPERATION_BADGES = {
959
+ const OPERATION_BADGE_KEYS = {
945
960
  CreateRecord: {
946
- label: 'Added',
961
+ key: 'components.comparisonEntities.added',
947
962
  classes: 'bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-200',
948
963
  },
949
964
  UpdateRecord: {
950
- label: 'Updated',
965
+ key: 'components.comparisonEntities.updated',
951
966
  classes: 'bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-200',
952
967
  },
953
968
  DeleteRecord: {
954
- label: 'Removed',
969
+ key: 'components.comparisonEntities.removed',
955
970
  classes: 'bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-200',
956
971
  },
957
972
  };
958
973
  class ComparisonEntityList {
974
+ transloco = inject(TranslocoService);
959
975
  data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
960
976
  comparison = computed(() => {
961
977
  const c = this.data().comparison;
@@ -965,7 +981,11 @@ class ComparisonEntityList {
965
981
  targetModuleKey = computed(() => this.comparison()?.targetModuleKey ?? '', ...(ngDevMode ? [{ debugName: "targetModuleKey" }] : /* istanbul ignore next */ []));
966
982
  label = computed(() => this.data().name ?? '', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
967
983
  badgeFor(op) {
968
- return OPERATION_BADGES[op];
984
+ const config = OPERATION_BADGE_KEYS[op];
985
+ return {
986
+ label: this.transloco.translate(config.key),
987
+ classes: config.classes,
988
+ };
969
989
  }
970
990
  displayField(value, display) {
971
991
  if (display && display.trim().length > 0)
@@ -1013,6 +1033,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
1013
1033
 
1014
1034
  const EMPTY_KEY_SET = new Set();
1015
1035
  class EntitiesPreview {
1036
+ transloco = inject(TranslocoService);
1016
1037
  /** Array of entity data to display */
1017
1038
  entities = input.required(...(ngDevMode ? [{ debugName: "entities" }] : /* istanbul ignore next */ []));
1018
1039
  attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
@@ -1030,9 +1051,9 @@ class EntitiesPreview {
1030
1051
  */
1031
1052
  activeKeys = input(EMPTY_KEY_SET, ...(ngDevMode ? [{ debugName: "activeKeys" }] : /* istanbul ignore next */ []));
1032
1053
  /** 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 */ []));
1054
+ clickableTooltip = input(this.transloco.translate('components.entitiesPreview.filterByThis'), ...(ngDevMode ? [{ debugName: "clickableTooltip" }] : /* istanbul ignore next */ []));
1034
1055
  /** 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 */ []));
1056
+ activeTooltip = input(this.transloco.translate('components.entitiesPreview.clearFilter'), ...(ngDevMode ? [{ debugName: "activeTooltip" }] : /* istanbul ignore next */ []));
1036
1057
  /**
1037
1058
  * Emits when an individual entity slot is clicked. Only fires when the
1038
1059
  * entity's key is present in `clickableKeys`.