@masterteam/components 0.0.169 → 0.0.171
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/common.css +1 -1
- package/assets/i18n/ar.json +273 -278
- package/assets/i18n/en.json +273 -257
- package/fesm2022/masterteam-components-entities.mjs +97 -3
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-location-field.mjs +315 -0
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-multi-select-field.mjs +2 -2
- package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +7 -4
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-runtime-action.mjs +69 -34
- package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +2 -2
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-sidebar.mjs +2 -2
- package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +36 -8
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-tabs.mjs +31 -3
- package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +12 -1
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +5 -1
- package/types/masterteam-components-entities.d.ts +24 -5
- package/types/masterteam-components-location-field.d.ts +95 -0
- package/types/masterteam-components-radio-cards-field.d.ts +2 -1
- package/types/masterteam-components-runtime-action.d.ts +2 -1
- package/types/masterteam-components-tabs.d.ts +3 -0
- package/types/masterteam-components.d.ts +13 -3
|
@@ -619,6 +619,29 @@ class EntityAttachment {
|
|
|
619
619
|
return [trimmedValue];
|
|
620
620
|
}
|
|
621
621
|
if (typeof value === 'object') {
|
|
622
|
+
const envelope = value;
|
|
623
|
+
// Backend attachment envelope:
|
|
624
|
+
// { value: <id | id[]>, attachments: [{ value: <id>, name, fileName }] }
|
|
625
|
+
// The stored items don't carry the storage key (their `fileName` is the
|
|
626
|
+
// display name), only the upload id, so resolve every attachment by its
|
|
627
|
+
// id through the metadata endpoint — the same contract
|
|
628
|
+
// `mt-upload-field` uses.
|
|
629
|
+
if (Array.isArray(envelope.attachments)) {
|
|
630
|
+
return envelope.attachments.flatMap((item) => this.normalizeAttachmentValue(item));
|
|
631
|
+
}
|
|
632
|
+
// A single backend attachment item carries its upload id under `value`.
|
|
633
|
+
if (typeof envelope.value === 'string' &&
|
|
634
|
+
envelope.id === undefined &&
|
|
635
|
+
(envelope.fileName !== undefined || envelope.name !== undefined)) {
|
|
636
|
+
return this.normalizeAttachmentValue(envelope.value);
|
|
637
|
+
}
|
|
638
|
+
// Envelope with no resolved attachments yet — unwrap the inner id(s).
|
|
639
|
+
if ('value' in envelope &&
|
|
640
|
+
envelope.id === undefined &&
|
|
641
|
+
envelope.fileName === undefined &&
|
|
642
|
+
envelope.name === undefined) {
|
|
643
|
+
return this.normalizeAttachmentValue(envelope.value);
|
|
644
|
+
}
|
|
622
645
|
return [value];
|
|
623
646
|
}
|
|
624
647
|
return [];
|
|
@@ -677,6 +700,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
677
700
|
args: [{ selector: 'mt-entity-attachment', standalone: true, imports: [FormsModule, UploadField, Button, EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"relaxed\"\r\n>\r\n @if (hasAttachments()) {\r\n @if (shape() === \"compact\") {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (\r\n attachment of attachments();\r\n track attachmentTrackBy($index, attachment)\r\n ) {\r\n <mt-button\r\n iconPos=\"top\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [icon]=\"attachmentIcon(attachment)\"\r\n [tooltip]=\"attachmentTooltip(attachment)\"\r\n styleClass=\"h-9! w-9! rounded-lg!\"\r\n (onClick)=\"onCompactAttachmentClick($event, attachment)\"\r\n />\r\n }\r\n </div>\r\n } @else {\r\n <mt-upload-field\r\n class=\"w-full\"\r\n [ngModel]=\"uploadValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [shape]=\"'card'\"\r\n [multiple]=\"isMultiple()\"\r\n [readonly]=\"true\"\r\n [endPoint]=\"endPoint()\"\r\n [context]=\"context()\"\r\n />\r\n }\r\n } @else {\r\n <span class=\"text-sm font-semibold\">{{ empty }}</span>\r\n }\r\n</mt-entity-field>\r\n" }]
|
|
678
701
|
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], endPoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "endPoint", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
|
|
679
702
|
|
|
703
|
+
class EntityLocation {
|
|
704
|
+
data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
|
|
705
|
+
displayName = computed(() => this.data()?.name ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
|
|
706
|
+
location = computed(() => normalizeEntityLocation(this.data()?.value), ...(ngDevMode ? [{ debugName: "location" }] : /* istanbul ignore next */ []));
|
|
707
|
+
displayValue = computed(() => displayOrPlaceholder(this.location()?.display_name ?? this.location()?.address ?? null), ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
708
|
+
coordinates = computed(() => {
|
|
709
|
+
const location = this.location();
|
|
710
|
+
const lat = location?.lat;
|
|
711
|
+
const lon = location?.lon ?? location?.lng;
|
|
712
|
+
if (lat === undefined || lon === undefined || lat === '' || lon === '') {
|
|
713
|
+
return '';
|
|
714
|
+
}
|
|
715
|
+
return `${lat}, ${lon}`;
|
|
716
|
+
}, ...(ngDevMode ? [{ debugName: "coordinates" }] : /* istanbul ignore next */ []));
|
|
717
|
+
mapsUrl = computed(() => {
|
|
718
|
+
const location = this.location();
|
|
719
|
+
const lat = location?.lat;
|
|
720
|
+
const lon = location?.lon ?? location?.lng;
|
|
721
|
+
if (lat === undefined || lon === undefined || lat === '' || lon === '') {
|
|
722
|
+
return '';
|
|
723
|
+
}
|
|
724
|
+
return `https://www.google.com/maps/?q=${encodeURIComponent(`${lat},${lon}`)}`;
|
|
725
|
+
}, ...(ngDevMode ? [{ debugName: "mapsUrl" }] : /* istanbul ignore next */ []));
|
|
726
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLocation, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
727
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLocation, isStandalone: true, selector: "mt-entity-location", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"displayName()\"\n [labelIconName]=\"'map.marker-pin-01'\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (mapsUrl()) {\n <a\n [href]=\"mapsUrl()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"map.marker-pin-01\" size=\"sm\" class=\"shrink-0\" />\n <span class=\"min-w-0 truncate\">{{ displayValue() }}</span>\n </a>\n } @else {\n <div\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n {{ displayValue() }}\n </div>\n }\n\n @if (coordinates()) {\n <div class=\"min-w-0 truncate text-xs text-gray-500\">\n {{ coordinates() }}\n </div>\n }\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }] });
|
|
728
|
+
}
|
|
729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLocation, decorators: [{
|
|
730
|
+
type: Component,
|
|
731
|
+
args: [{ selector: 'mt-entity-location', imports: [EntityField, Icon, TruncateTooltip], template: "<mt-entity-field\n [label]=\"displayName()\"\n [labelIconName]=\"'map.marker-pin-01'\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (mapsUrl()) {\n <a\n [href]=\"mapsUrl()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"map.marker-pin-01\" size=\"sm\" class=\"shrink-0\" />\n <span class=\"min-w-0 truncate\">{{ displayValue() }}</span>\n </a>\n } @else {\n <div\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n {{ displayValue() }}\n </div>\n }\n\n @if (coordinates()) {\n <div class=\"min-w-0 truncate text-xs text-gray-500\">\n {{ coordinates() }}\n </div>\n }\n</mt-entity-field>\n" }]
|
|
732
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
733
|
+
function normalizeEntityLocation(value) {
|
|
734
|
+
if (value === null || value === undefined || value === '') {
|
|
735
|
+
return null;
|
|
736
|
+
}
|
|
737
|
+
if (typeof value === 'string') {
|
|
738
|
+
const trimmed = value.trim();
|
|
739
|
+
if (!trimmed)
|
|
740
|
+
return null;
|
|
741
|
+
try {
|
|
742
|
+
return normalizeEntityLocation(JSON.parse(trimmed));
|
|
743
|
+
}
|
|
744
|
+
catch {
|
|
745
|
+
return {
|
|
746
|
+
display_name: trimmed,
|
|
747
|
+
address: trimmed,
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
752
|
+
return {
|
|
753
|
+
display_name: String(value),
|
|
754
|
+
address: String(value),
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
const source = value;
|
|
758
|
+
const displayName = readString(source['display_name']) ??
|
|
759
|
+
readString(source['displayName']) ??
|
|
760
|
+
readString(source['address']) ??
|
|
761
|
+
readString(source['name']);
|
|
762
|
+
const lon = source['lon'] ?? source['lng'];
|
|
763
|
+
return {
|
|
764
|
+
...source,
|
|
765
|
+
...(displayName ? { display_name: displayName, address: displayName } : {}),
|
|
766
|
+
...(lon !== undefined ? { lon: lon } : {}),
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function readString(value) {
|
|
770
|
+
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
771
|
+
}
|
|
772
|
+
|
|
680
773
|
class EntityLeafDetails {
|
|
681
774
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
682
775
|
leafValue = computed(() => {
|
|
@@ -906,7 +999,7 @@ class EntityPreviewBody {
|
|
|
906
999
|
return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
|
|
907
1000
|
}, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
|
|
908
1001
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
909
|
-
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()) {\
|
|
1002
|
+
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 (\"Number\") {\n <mt-entity-text [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 (\"Location\") {\n <mt-entity-location [data]=\"data()\" />\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"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
910
1003
|
}
|
|
911
1004
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, decorators: [{
|
|
912
1005
|
type: Component,
|
|
@@ -922,9 +1015,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
922
1015
|
EntityAttachment,
|
|
923
1016
|
EntityStatus,
|
|
924
1017
|
EntityLeafDetails,
|
|
1018
|
+
EntityLocation,
|
|
925
1019
|
], host: {
|
|
926
1020
|
class: 'w-full',
|
|
927
|
-
}, template: "@switch (previewType()) {\
|
|
1021
|
+
}, 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 (\"Number\") {\n <mt-entity-text [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 (\"Location\") {\n <mt-entity-location [data]=\"data()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\n" }]
|
|
928
1022
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
|
|
929
1023
|
|
|
930
1024
|
class ComparisonValue {
|
|
@@ -1283,5 +1377,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1283
1377
|
* Generated bundle index. Do not edit.
|
|
1284
1378
|
*/
|
|
1285
1379
|
|
|
1286
|
-
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 };
|
|
1380
|
+
export { ComparisonEntityList, ComparisonValue, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityPercentage, EntityPreview, EntityPreviewBody, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, buildDisplayEntities, expandLeafDetailsEntity, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue };
|
|
1287
1381
|
//# sourceMappingURL=masterteam-components-entities.mjs.map
|