@masterteam/components 0.0.336 → 0.0.337
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 +2 -1
- package/assets/i18n/en.json +2 -1
- package/fesm2022/masterteam-components-entities.mjs +117 -50
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +9 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Injectable, InjectionToken,
|
|
3
|
-
import {
|
|
2
|
+
import { signal, Injectable, InjectionToken, ChangeDetectionStrategy, Component, inject, computed, input, ElementRef, DestroyRef, afterNextRender, Directive, effect, untracked, ViewEncapsulation, output, NgZone, model } from '@angular/core';
|
|
3
|
+
import { Tooltip, TruncateTooltip } from '@masterteam/components/tooltip';
|
|
4
4
|
import { Icon } from '@masterteam/icons';
|
|
5
|
+
import { TranslocoPipe, TranslocoService } from '@jsverse/transloco';
|
|
5
6
|
import { NgTemplateOutlet, NgComponentOutlet, DOCUMENT } from '@angular/common';
|
|
6
7
|
import { MTDateFormatPipe, REQUEST_CONTEXT, coerceCheckboxValue, readableTextOn, getLightColor } from '@masterteam/components';
|
|
7
8
|
import { HttpContext, HttpClient } from '@angular/common/http';
|
|
8
|
-
import { TranslocoPipe, TranslocoService } from '@jsverse/transloco';
|
|
9
9
|
import { Avatar } from '@masterteam/components/avatar';
|
|
10
10
|
import { SecureImagePipe, UploadField } from '@masterteam/components/upload-field';
|
|
11
11
|
import { Progress } from '@masterteam/components/progress';
|
|
@@ -345,7 +345,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
345
345
|
*/
|
|
346
346
|
const ENTITY_LIST_TABLE_COMPONENT = new InjectionToken('ENTITY_LIST_TABLE_COMPONENT');
|
|
347
347
|
|
|
348
|
+
/** Marks a property value the backend calculates. Rendered beside its label. */
|
|
349
|
+
class EntityCalculatedIndicator {
|
|
350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
351
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: EntityCalculatedIndicator, isStandalone: true, selector: "mt-entity-calculated-indicator", host: { classAttribute: "inline-flex shrink-0" }, ngImport: i0, template: `
|
|
352
|
+
<span
|
|
353
|
+
class="inline-flex size-4.5 cursor-help items-center justify-center rounded-md bg-surface-100 font-serif text-xs leading-none font-bold text-surface-500 italic select-none dark:bg-surface-800 dark:text-surface-300"
|
|
354
|
+
role="img"
|
|
355
|
+
[attr.aria-label]="
|
|
356
|
+
'components.entitiesPreview.calculatedValue' | transloco
|
|
357
|
+
"
|
|
358
|
+
[mtTooltip]="'components.entitiesPreview.calculatedValue' | transloco"
|
|
359
|
+
tooltipPosition="top"
|
|
360
|
+
>f</span
|
|
361
|
+
>
|
|
362
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
363
|
+
}
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedIndicator, decorators: [{
|
|
365
|
+
type: Component,
|
|
366
|
+
args: [{
|
|
367
|
+
selector: 'mt-entity-calculated-indicator',
|
|
368
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
369
|
+
imports: [Tooltip, TranslocoPipe],
|
|
370
|
+
template: `
|
|
371
|
+
<span
|
|
372
|
+
class="inline-flex size-4.5 cursor-help items-center justify-center rounded-md bg-surface-100 font-serif text-xs leading-none font-bold text-surface-500 italic select-none dark:bg-surface-800 dark:text-surface-300"
|
|
373
|
+
role="img"
|
|
374
|
+
[attr.aria-label]="
|
|
375
|
+
'components.entitiesPreview.calculatedValue' | transloco
|
|
376
|
+
"
|
|
377
|
+
[mtTooltip]="'components.entitiesPreview.calculatedValue' | transloco"
|
|
378
|
+
tooltipPosition="top"
|
|
379
|
+
>f</span
|
|
380
|
+
>
|
|
381
|
+
`,
|
|
382
|
+
host: {
|
|
383
|
+
class: 'inline-flex shrink-0',
|
|
384
|
+
},
|
|
385
|
+
}]
|
|
386
|
+
}] });
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* The entity of the enclosing `mt-entity-preview`. `mt-entity-field` only
|
|
390
|
+
* receives a label, so this lets it read entity-level flags without every view
|
|
391
|
+
* type passing them through its own template.
|
|
392
|
+
*/
|
|
393
|
+
const ENTITY_PREVIEW_DATA = new InjectionToken('ENTITY_PREVIEW_DATA');
|
|
394
|
+
|
|
348
395
|
class EntityField {
|
|
396
|
+
previewData = inject(ENTITY_PREVIEW_DATA, {
|
|
397
|
+
optional: true,
|
|
398
|
+
});
|
|
399
|
+
calculated = computed(() => this.previewData?.().calculated === true, ...(ngDevMode ? [{ debugName: "calculated" }] : /* istanbul ignore next */ []));
|
|
349
400
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
350
401
|
labelIconName = input(null, ...(ngDevMode ? [{ debugName: "labelIconName" }] : /* istanbul ignore next */ []));
|
|
351
402
|
configuration = input(...(ngDevMode ? [undefined, { debugName: "configuration" }] : /* istanbul ignore next */ []));
|
|
@@ -377,54 +428,60 @@ class EntityField {
|
|
|
377
428
|
return `flex min-w-0 ${directionClass} ${gapClass} ${alignClass}`.trimEnd();
|
|
378
429
|
}, ...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
|
|
379
430
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
380
|
-
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: `
|
|
381
|
-
<div [class]="containerClass()">
|
|
382
|
-
<div [class]="contentContainerClass()">
|
|
383
|
-
<ng-content />
|
|
384
|
-
</div>
|
|
385
|
-
@if (!hideLabel()) {
|
|
386
|
-
<div [class]="labelContainerClass()">
|
|
387
|
-
@if (labelIconName(); as iconName) {
|
|
388
|
-
<mt-icon [icon]="iconName" size="xs" class="shrink-0" />
|
|
389
|
-
}
|
|
390
|
-
<span
|
|
391
|
-
class="block min-w-0 truncate"
|
|
392
|
-
mtTruncateTooltip
|
|
393
|
-
tooltipPosition="top"
|
|
394
|
-
>
|
|
395
|
-
{{ label() }}
|
|
396
|
-
</span>
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
431
|
+
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: `
|
|
432
|
+
<div [class]="containerClass()">
|
|
433
|
+
<div [class]="contentContainerClass()">
|
|
434
|
+
<ng-content />
|
|
435
|
+
</div>
|
|
436
|
+
@if (!hideLabel()) {
|
|
437
|
+
<div [class]="labelContainerClass()">
|
|
438
|
+
@if (labelIconName(); as iconName) {
|
|
439
|
+
<mt-icon [icon]="iconName" size="xs" class="shrink-0" />
|
|
440
|
+
}
|
|
441
|
+
<span
|
|
442
|
+
class="block min-w-0 truncate"
|
|
443
|
+
mtTruncateTooltip
|
|
444
|
+
tooltipPosition="top"
|
|
445
|
+
>
|
|
446
|
+
{{ label() }}
|
|
447
|
+
</span>
|
|
448
|
+
@if (calculated()) {
|
|
449
|
+
<mt-entity-calculated-indicator />
|
|
450
|
+
}
|
|
451
|
+
</div>
|
|
452
|
+
}
|
|
453
|
+
</div>
|
|
454
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: EntityCalculatedIndicator, selector: "mt-entity-calculated-indicator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
401
455
|
}
|
|
402
456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityField, decorators: [{
|
|
403
457
|
type: Component,
|
|
404
458
|
args: [{
|
|
405
459
|
selector: 'mt-entity-field',
|
|
406
460
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
407
|
-
imports: [TruncateTooltip, Icon],
|
|
408
|
-
template: `
|
|
409
|
-
<div [class]="containerClass()">
|
|
410
|
-
<div [class]="contentContainerClass()">
|
|
411
|
-
<ng-content />
|
|
412
|
-
</div>
|
|
413
|
-
@if (!hideLabel()) {
|
|
414
|
-
<div [class]="labelContainerClass()">
|
|
415
|
-
@if (labelIconName(); as iconName) {
|
|
416
|
-
<mt-icon [icon]="iconName" size="xs" class="shrink-0" />
|
|
417
|
-
}
|
|
418
|
-
<span
|
|
419
|
-
class="block min-w-0 truncate"
|
|
420
|
-
mtTruncateTooltip
|
|
421
|
-
tooltipPosition="top"
|
|
422
|
-
>
|
|
423
|
-
{{ label() }}
|
|
424
|
-
</span>
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
461
|
+
imports: [TruncateTooltip, Icon, EntityCalculatedIndicator],
|
|
462
|
+
template: `
|
|
463
|
+
<div [class]="containerClass()">
|
|
464
|
+
<div [class]="contentContainerClass()">
|
|
465
|
+
<ng-content />
|
|
466
|
+
</div>
|
|
467
|
+
@if (!hideLabel()) {
|
|
468
|
+
<div [class]="labelContainerClass()">
|
|
469
|
+
@if (labelIconName(); as iconName) {
|
|
470
|
+
<mt-icon [icon]="iconName" size="xs" class="shrink-0" />
|
|
471
|
+
}
|
|
472
|
+
<span
|
|
473
|
+
class="block min-w-0 truncate"
|
|
474
|
+
mtTruncateTooltip
|
|
475
|
+
tooltipPosition="top"
|
|
476
|
+
>
|
|
477
|
+
{{ label() }}
|
|
478
|
+
</span>
|
|
479
|
+
@if (calculated()) {
|
|
480
|
+
<mt-entity-calculated-indicator />
|
|
481
|
+
}
|
|
482
|
+
</div>
|
|
483
|
+
}
|
|
484
|
+
</div>
|
|
428
485
|
`,
|
|
429
486
|
host: {
|
|
430
487
|
class: 'block min-w-0 w-full',
|
|
@@ -959,11 +1016,11 @@ class EntityPercentage {
|
|
|
959
1016
|
return Number.isNaN(numericValue) ? null : numericValue;
|
|
960
1017
|
}
|
|
961
1018
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPercentage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
962
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPercentage, isStandalone: true, selector: "mt-entity-percentage", 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 }, rawValue: { classPropertyName: "rawValue", publicName: "rawValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "component", type: Progress, selector: "mt-progress", inputs: ["value", "mode", "showLabel", "unit", "color", "minValue", "maxValue", "height", "circleSize", "strokeWidth", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1019
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPercentage, isStandalone: true, selector: "mt-entity-percentage", 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 }, rawValue: { classPropertyName: "rawValue", publicName: "rawValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"inline-flex min-w-0 items-center gap-1\">\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n @if (data()?.calculated) {\r\n <mt-entity-calculated-indicator />\r\n }\r\n </span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "component", type: Progress, selector: "mt-progress", inputs: ["value", "mode", "showLabel", "unit", "color", "minValue", "maxValue", "height", "circleSize", "strokeWidth", "customClass"] }, { kind: "component", type: EntityCalculatedIndicator, selector: "mt-entity-calculated-indicator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
963
1020
|
}
|
|
964
1021
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPercentage, decorators: [{
|
|
965
1022
|
type: Component,
|
|
966
|
-
args: [{ selector: 'mt-entity-percentage', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [Progress], template: "<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n" }]
|
|
1023
|
+
args: [{ selector: 'mt-entity-percentage', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [Progress, EntityCalculatedIndicator], template: "<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"inline-flex min-w-0 items-center gap-1\">\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n @if (data()?.calculated) {\r\n <mt-entity-calculated-indicator />\r\n }\r\n </span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n" }]
|
|
967
1024
|
}], 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 }] }], rawValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "rawValue", required: false }] }] } });
|
|
968
1025
|
|
|
969
1026
|
/**
|
|
@@ -1096,11 +1153,11 @@ class EntityCheckbox {
|
|
|
1096
1153
|
return coerceCheckboxValue(this.data()?.value ?? this.value());
|
|
1097
1154
|
}, ...(ngDevMode ? [{ debugName: "checkboxState" }] : /* istanbul ignore next */ []));
|
|
1098
1155
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1099
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCheckbox, isStandalone: true, selector: "mt-entity-checkbox", 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 }, rawValue: { classPropertyName: "rawValue", publicName: "rawValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n }\r\n</div>\r\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1156
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCheckbox, isStandalone: true, selector: "mt-entity-checkbox", 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 }, rawValue: { classPropertyName: "rawValue", publicName: "rawValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n @if (data()?.calculated) {\r\n <mt-entity-calculated-indicator />\r\n }\r\n }\r\n</div>\r\n", dependencies: [{ kind: "component", type: EntityCalculatedIndicator, selector: "mt-entity-calculated-indicator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1100
1157
|
}
|
|
1101
1158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCheckbox, decorators: [{
|
|
1102
1159
|
type: Component,
|
|
1103
|
-
args: [{ selector: 'mt-entity-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n }\r\n</div>\r\n" }]
|
|
1160
|
+
args: [{ selector: 'mt-entity-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityCalculatedIndicator], template: "<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n @if (data()?.calculated) {\r\n <mt-entity-calculated-indicator />\r\n }\r\n }\r\n</div>\r\n" }]
|
|
1104
1161
|
}], 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 }] }], rawValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "rawValue", required: false }] }] } });
|
|
1105
1162
|
|
|
1106
1163
|
class EntityLongText {
|
|
@@ -3750,7 +3807,12 @@ class EntityPreview {
|
|
|
3750
3807
|
return null;
|
|
3751
3808
|
}, ...(ngDevMode ? [{ debugName: "comparisonKind" }] : /* istanbul ignore next */ []));
|
|
3752
3809
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3753
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.relative": "infoText()", "class.pe-4": "infoText()" }, classAttribute: "w-full" },
|
|
3810
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.relative": "infoText()", "class.pe-4": "infoText()" }, classAttribute: "w-full" }, providers: [
|
|
3811
|
+
{
|
|
3812
|
+
provide: ENTITY_PREVIEW_DATA,
|
|
3813
|
+
useFactory: () => inject(EntityPreview).data,
|
|
3814
|
+
},
|
|
3815
|
+
], ngImport: i0, template: "@if (infoText(); as info) {\r\n <!--\r\n The note affordance. Absolutely positioned so it stays out of the value's\r\n own layout \u2014 each viewType renders its own markup and there is no shared\r\n slot to put this in \u2014 while the host reserves the corner with `pe-4`, so a\r\n long value truncates before it can run underneath the icon.\r\n -->\r\n <!--\r\n Sized with `text-sm`, not a `size` input: `mt-icon` has none, and its host\r\n is `width: 1em` \u2014 so font-size is what actually scales the glyph.\r\n -->\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"absolute top-0 end-0 z-10 cursor-help text-sm text-surface-400 transition-colors hover:text-primary-600\"\r\n [mtTooltip]=\"info\"\r\n tooltipPosition=\"top\"\r\n tooltipStyleClass=\"mt-entity-info-tooltip\"\r\n [attr.aria-label]=\"info\"\r\n />\r\n}\r\n\r\n@switch (comparisonKind()) {\r\n @case (\"Value\") {\r\n <mt-comparison-value [data]=\"data()\" />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-comparison-entity-list [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-preview-body\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n }\r\n}\r\n", styles: [".mt-entity-info-tooltip{max-width:22rem}.mt-entity-info-tooltip .p-tooltip-text{white-space:pre-wrap;text-align:start;overflow-wrap:anywhere}\n"], dependencies: [{ kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }, { kind: "component", type: ComparisonValue, selector: "mt-comparison-value", inputs: ["data"] }, { kind: "component", type: ComparisonEntityList, selector: "mt-comparison-entity-list", inputs: ["data"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3754
3816
|
}
|
|
3755
3817
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, decorators: [{
|
|
3756
3818
|
type: Component,
|
|
@@ -3760,6 +3822,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3760
3822
|
ComparisonEntityList,
|
|
3761
3823
|
Tooltip,
|
|
3762
3824
|
Icon,
|
|
3825
|
+
], providers: [
|
|
3826
|
+
{
|
|
3827
|
+
provide: ENTITY_PREVIEW_DATA,
|
|
3828
|
+
useFactory: () => inject(EntityPreview).data,
|
|
3829
|
+
},
|
|
3763
3830
|
], encapsulation: ViewEncapsulation.None, host: {
|
|
3764
3831
|
class: 'w-full',
|
|
3765
3832
|
// Both only apply when there is a note, so an entity without one keeps
|