@masterteam/components 0.0.190 → 0.0.192
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 +2 -2
- package/assets/i18n/ar.json +6 -0
- package/assets/i18n/en.json +6 -0
- package/fesm2022/masterteam-components-business-fields.mjs +161 -1
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-chip.mjs +8 -4
- package/fesm2022/masterteam-components-chip.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +105 -3
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-pick-list-field.mjs +2 -2
- package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +15 -1
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-business-fields.d.ts +48 -2
- package/types/masterteam-components-chip.d.ts +3 -1
- package/types/masterteam-components-entities.d.ts +78 -5
- package/types/masterteam-components.d.ts +24 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, Component } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, computed, output, Component } from '@angular/core';
|
|
3
3
|
import { Icon } from '@masterteam/icons';
|
|
4
4
|
import * as i1 from 'primeng/chip';
|
|
5
5
|
import { ChipModule } from 'primeng/chip';
|
|
@@ -11,6 +11,10 @@ class Chip {
|
|
|
11
11
|
removable = input(false, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
12
12
|
removeIcon = input('general.x-circle', ...(ngDevMode ? [{ debugName: "removeIcon" }] : /* istanbul ignore next */ []));
|
|
13
13
|
styleClass = input('', ...(ngDevMode ? [{ debugName: "styleClass" }] : /* istanbul ignore next */ []));
|
|
14
|
+
size = input('normal', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
15
|
+
chipClass = computed(() => [this.styleClass(), this.size() === 'small' ? 'mt-chip-sm' : '']
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.join(' '), ...(ngDevMode ? [{ debugName: "chipClass" }] : /* istanbul ignore next */ []));
|
|
14
18
|
onRemove = output();
|
|
15
19
|
onImageError = output();
|
|
16
20
|
onChipRemove(event) {
|
|
@@ -20,12 +24,12 @@ class Chip {
|
|
|
20
24
|
this.onImageError.emit(event);
|
|
21
25
|
}
|
|
22
26
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Chip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Chip, isStandalone: true, selector: "mt-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeIcon: { classPropertyName: "removeIcon", publicName: "removeIcon", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onRemove: "onRemove", onImageError: "onImageError" }, ngImport: i0, template: "<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"
|
|
27
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Chip, isStandalone: true, selector: "mt-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeIcon: { classPropertyName: "removeIcon", publicName: "removeIcon", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onRemove: "onRemove", onImageError: "onImageError" }, ngImport: i0, template: "<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"chipClass()\"\r\n (onRemove)=\"onChipRemove($event)\"\r\n (onImageError)=\"onChipImageError($event)\"\r\n>\r\n <ng-template #removeicon>\r\n <mt-icon class=\"align-super!\" [icon]=\"removeIcon()\" />\r\n </ng-template>\r\n @if (icon()) {\r\n <mt-icon #iconTemplate class=\"align-super!\" [icon]=\"icon()\" />\r\n }\r\n</p-chip>\r\n", styles: [":host ::ng-deep .mt-chip-sm.p-chip{padding-block:.125rem;padding-inline:.5rem;gap:.25rem;font-size:.75rem;line-height:1rem}:host ::ng-deep .mt-chip-sm.p-chip .p-chip-label{font-size:.75rem;line-height:1rem}:host ::ng-deep .mt-chip-sm.p-chip .p-chip-icon,:host ::ng-deep .mt-chip-sm.p-chip .p-chip-image{width:1rem;height:1rem;font-size:.875rem}\n"], dependencies: [{ kind: "ngmodule", type: ChipModule }, { kind: "component", type: i1.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "disabled", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }] });
|
|
24
28
|
}
|
|
25
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Chip, decorators: [{
|
|
26
30
|
type: Component,
|
|
27
|
-
args: [{ selector: 'mt-chip', standalone: true, imports: [ChipModule, Icon], template: "<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"
|
|
28
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], removeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeIcon", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], onRemove: [{ type: i0.Output, args: ["onRemove"] }], onImageError: [{ type: i0.Output, args: ["onImageError"] }] } });
|
|
31
|
+
args: [{ selector: 'mt-chip', standalone: true, imports: [ChipModule, Icon], template: "<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"chipClass()\"\r\n (onRemove)=\"onChipRemove($event)\"\r\n (onImageError)=\"onChipImageError($event)\"\r\n>\r\n <ng-template #removeicon>\r\n <mt-icon class=\"align-super!\" [icon]=\"removeIcon()\" />\r\n </ng-template>\r\n @if (icon()) {\r\n <mt-icon #iconTemplate class=\"align-super!\" [icon]=\"icon()\" />\r\n }\r\n</p-chip>\r\n", styles: [":host ::ng-deep .mt-chip-sm.p-chip{padding-block:.125rem;padding-inline:.5rem;gap:.25rem;font-size:.75rem;line-height:1rem}:host ::ng-deep .mt-chip-sm.p-chip .p-chip-label{font-size:.75rem;line-height:1rem}:host ::ng-deep .mt-chip-sm.p-chip .p-chip-icon,:host ::ng-deep .mt-chip-sm.p-chip .p-chip-image{width:1rem;height:1rem;font-size:.875rem}\n"] }]
|
|
32
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], removeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeIcon", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onRemove: [{ type: i0.Output, args: ["onRemove"] }], onImageError: [{ type: i0.Output, args: ["onImageError"] }] } });
|
|
29
33
|
|
|
30
34
|
/**
|
|
31
35
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-chip.mjs","sources":["../../../../packages/masterteam/components/chip/chip.ts","../../../../packages/masterteam/components/chip/chip.html","../../../../packages/masterteam/components/chip/masterteam-components-chip.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"masterteam-components-chip.mjs","sources":["../../../../packages/masterteam/components/chip/chip.ts","../../../../packages/masterteam/components/chip/chip.html","../../../../packages/masterteam/components/chip/masterteam-components-chip.ts"],"sourcesContent":["import {\r\n Component,\r\n computed,\r\n output,\r\n input,\r\n booleanAttribute,\r\n} from '@angular/core';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport { ChipModule } from 'primeng/chip';\r\n\r\n@Component({\r\n selector: 'mt-chip',\r\n standalone: true,\r\n imports: [ChipModule, Icon],\r\n templateUrl: './chip.html',\r\n styleUrls: ['./chip.scss'],\r\n})\r\nexport class Chip {\r\n readonly label = input<string>('');\r\n readonly icon = input<MTIcon>();\r\n readonly image = input<string>('');\r\n readonly removable = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n readonly removeIcon = input<MTIcon>('general.x-circle');\r\n readonly styleClass = input<string>('');\r\n readonly size = input<'small' | 'normal'>('normal');\r\n\r\n readonly chipClass = computed(() =>\r\n [this.styleClass(), this.size() === 'small' ? 'mt-chip-sm' : '']\r\n .filter(Boolean)\r\n .join(' '),\r\n );\r\n\r\n onRemove = output<MouseEvent>();\r\n onImageError = output<Event>();\r\n\r\n onChipRemove(event: MouseEvent): void {\r\n this.onRemove.emit(event);\r\n }\r\n\r\n onChipImageError(event: Event): void {\r\n this.onImageError.emit(event);\r\n }\r\n}\r\n","<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"chipClass()\"\r\n (onRemove)=\"onChipRemove($event)\"\r\n (onImageError)=\"onChipImageError($event)\"\r\n>\r\n <ng-template #removeicon>\r\n <mt-icon class=\"align-super!\" [icon]=\"removeIcon()\" />\r\n </ng-template>\r\n @if (icon()) {\r\n <mt-icon #iconTemplate class=\"align-super!\" [icon]=\"icon()\" />\r\n }\r\n</p-chip>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAiBa,IAAI,CAAA;AACN,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;IACzB,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AACtB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;IACzB,SAAS,GAAG,KAAK,CAAmB,KAAK,iFAChD,SAAS,EAAE,gBAAgB,EAAA,CAC3B;AACO,IAAA,UAAU,GAAG,KAAK,CAAS,kBAAkB,iFAAC;AAC9C,IAAA,UAAU,GAAG,KAAK,CAAS,EAAE,iFAAC;AAC9B,IAAA,IAAI,GAAG,KAAK,CAAqB,QAAQ,2EAAC;IAE1C,SAAS,GAAG,QAAQ,CAAC,MAC5B,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC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forms';
|
|
13
13
|
import { Button } from '@masterteam/components/button';
|
|
14
14
|
import { forkJoin, finalize, of, take, switchMap, EMPTY, map, catchError } from 'rxjs';
|
|
15
|
+
import { Chip } from '@masterteam/components/chip';
|
|
15
16
|
import * as i1$1 from 'primeng/tooltip';
|
|
16
17
|
import { TooltipModule } from 'primeng/tooltip';
|
|
17
18
|
import { CdkDrag, CdkDropList, CdkDragPlaceholder } from '@angular/cdk/drag-drop';
|
|
@@ -860,6 +861,105 @@ function normalizeEntityConnection(value) {
|
|
|
860
861
|
return { ...source, ...(display !== undefined ? { display } : {}) };
|
|
861
862
|
}
|
|
862
863
|
|
|
864
|
+
/**
|
|
865
|
+
* Preview renderer for `ScheduleItemSelector` properties.
|
|
866
|
+
*
|
|
867
|
+
* The value is the array of resolved schedule items returned by runtime
|
|
868
|
+
* rendering (`{ id, name, status, ... }`); each one is shown as a chip.
|
|
869
|
+
*/
|
|
870
|
+
class EntityScheduleItem {
|
|
871
|
+
/** Full entity data object */
|
|
872
|
+
data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
|
|
873
|
+
displayName = computed(() => this.data()?.name ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
|
|
874
|
+
items = computed(() => {
|
|
875
|
+
const value = this.data()?.value;
|
|
876
|
+
if (!Array.isArray(value))
|
|
877
|
+
return [];
|
|
878
|
+
return value.filter((item) => !!item && typeof item === 'object' && 'name' in item);
|
|
879
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
880
|
+
emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;
|
|
881
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityScheduleItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
882
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityScheduleItem, isStandalone: true, selector: "mt-entity-schedule-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (items().length) {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (item of items(); track item.id) {\r\n <mt-chip [label]=\"item.name\" size=\"small\" />\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: Chip, selector: "mt-chip", inputs: ["label", "icon", "image", "removable", "removeIcon", "styleClass", "size"], outputs: ["onRemove", "onImageError"] }] });
|
|
883
|
+
}
|
|
884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityScheduleItem, decorators: [{
|
|
885
|
+
type: Component,
|
|
886
|
+
args: [{ selector: 'mt-entity-schedule-item', standalone: true, imports: [EntityField, Chip], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (items().length) {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (item of items(); track item.id) {\r\n <mt-chip [label]=\"item.name\" size=\"small\" />\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
|
|
887
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
888
|
+
|
|
889
|
+
class EntityLookupModuleCheckList {
|
|
890
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
891
|
+
/**
|
|
892
|
+
* Normalizes the stored value into a flat list of checklist entries.
|
|
893
|
+
* Accepts both the rendered view model (`{ items: [...] }`) and the raw
|
|
894
|
+
* stored array (`[{ lookupKey, props }]`); returns `[]` for anything else.
|
|
895
|
+
*/
|
|
896
|
+
items = computed(() => {
|
|
897
|
+
const raw = this.data().value;
|
|
898
|
+
const entries = this.extractEntries(raw);
|
|
899
|
+
return entries
|
|
900
|
+
.filter((entry) => entry && typeof entry === 'object')
|
|
901
|
+
.map((entry) => {
|
|
902
|
+
const record = entry;
|
|
903
|
+
const props = record['props'] ?? record['Props'];
|
|
904
|
+
return {
|
|
905
|
+
lookupKey: this.resolveLookupKey(entry),
|
|
906
|
+
props: (Array.isArray(props) ? props : []).map((prop) => {
|
|
907
|
+
const propRecord = (prop ?? {});
|
|
908
|
+
return {
|
|
909
|
+
key: String(propRecord['key'] ?? propRecord['Key'] ?? ''),
|
|
910
|
+
value: this.renderPropValue(propRecord['value'] ?? propRecord['Value'] ?? null),
|
|
911
|
+
};
|
|
912
|
+
}),
|
|
913
|
+
};
|
|
914
|
+
});
|
|
915
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
916
|
+
hasItems = computed(() => this.items().length > 0, ...(ngDevMode ? [{ debugName: "hasItems" }] : /* istanbul ignore next */ []));
|
|
917
|
+
emptyLabel = displayOrPlaceholder(null);
|
|
918
|
+
extractEntries(raw) {
|
|
919
|
+
if (Array.isArray(raw)) {
|
|
920
|
+
return raw;
|
|
921
|
+
}
|
|
922
|
+
const wrapped = raw?.items;
|
|
923
|
+
if (Array.isArray(wrapped)) {
|
|
924
|
+
return wrapped;
|
|
925
|
+
}
|
|
926
|
+
if (typeof raw === 'string' && raw.trim()) {
|
|
927
|
+
try {
|
|
928
|
+
return this.extractEntries(JSON.parse(raw));
|
|
929
|
+
}
|
|
930
|
+
catch {
|
|
931
|
+
return [];
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
return [];
|
|
935
|
+
}
|
|
936
|
+
resolveLookupKey(entry) {
|
|
937
|
+
const record = entry;
|
|
938
|
+
const key = entry.lookupKey ?? record['Lookupkey'] ?? record['lookupkey'];
|
|
939
|
+
return typeof key === 'string' ? key : '';
|
|
940
|
+
}
|
|
941
|
+
renderPropValue(value) {
|
|
942
|
+
if (value === null || value === undefined || value === '') {
|
|
943
|
+
return this.emptyLabel;
|
|
944
|
+
}
|
|
945
|
+
if (typeof value === 'object') {
|
|
946
|
+
try {
|
|
947
|
+
return JSON.stringify(value);
|
|
948
|
+
}
|
|
949
|
+
catch {
|
|
950
|
+
return String(value);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
return String(value);
|
|
954
|
+
}
|
|
955
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
956
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookupModuleCheckList, isStandalone: true, selector: "mt-entity-lookup-module-check-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupKey || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <span class=\"truncate text-xs text-muted-color\">\r\n {{ prop.key }}\r\n </span>\r\n <span class=\"truncate text-sm text-color\">\r\n {{ prop.value }}\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
957
|
+
}
|
|
958
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, decorators: [{
|
|
959
|
+
type: Component,
|
|
960
|
+
args: [{ selector: 'mt-entity-lookup-module-check-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField], template: "<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupKey || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <span class=\"truncate text-xs text-muted-color\">\r\n {{ prop.key }}\r\n </span>\r\n <span class=\"truncate text-sm text-color\">\r\n {{ prop.value }}\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
|
|
961
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
962
|
+
|
|
863
963
|
class EntityLeafDetails {
|
|
864
964
|
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
865
965
|
leafValue = computed(() => {
|
|
@@ -1089,7 +1189,7 @@ class EntityPreviewBody {
|
|
|
1089
1189
|
return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
|
|
1090
1190
|
}, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
|
|
1091
1191
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1092
|
-
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()) {\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 (\"Number\") {\r\n <mt-entity-text [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 (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\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"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1192
|
+
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()) {\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 (\"Number\") {\r\n <mt-entity-text [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 (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\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"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityScheduleItem, selector: "mt-entity-schedule-item", inputs: ["data"] }, { kind: "component", type: EntityLookupModuleCheckList, selector: "mt-entity-lookup-module-check-list", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1093
1193
|
}
|
|
1094
1194
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, decorators: [{
|
|
1095
1195
|
type: Component,
|
|
@@ -1107,9 +1207,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1107
1207
|
EntityLeafDetails,
|
|
1108
1208
|
EntityLocation,
|
|
1109
1209
|
EntityConnection,
|
|
1210
|
+
EntityScheduleItem,
|
|
1211
|
+
EntityLookupModuleCheckList,
|
|
1110
1212
|
], host: {
|
|
1111
1213
|
class: 'w-full',
|
|
1112
|
-
}, 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 (\"Number\") {\r\n <mt-entity-text [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 (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\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" }]
|
|
1214
|
+
}, 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 (\"Number\") {\r\n <mt-entity-text [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 (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\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" }]
|
|
1113
1215
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
|
|
1114
1216
|
|
|
1115
1217
|
class ComparisonValue {
|
|
@@ -1468,5 +1570,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1468
1570
|
* Generated bundle index. Do not edit.
|
|
1469
1571
|
*/
|
|
1470
1572
|
|
|
1471
|
-
export { ComparisonEntityList, ComparisonValue, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityPercentage, EntityPreview, EntityPreviewBody, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, buildDisplayEntities, expandLeafDetailsEntity, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue };
|
|
1573
|
+
export { ComparisonEntityList, ComparisonValue, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, buildDisplayEntities, expandLeafDetailsEntity, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue };
|
|
1472
1574
|
//# sourceMappingURL=masterteam-components-entities.mjs.map
|