@masterteam/components 0.0.336 → 0.0.338
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 +4 -1
- package/assets/i18n/en.json +4 -1
- package/fesm2022/masterteam-components-entities.mjs +148 -49
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +16 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, Injectable, InjectionToken, input, computed, ChangeDetectionStrategy, Component, inject, ElementRef, DestroyRef, afterNextRender, Directive, effect, untracked, ViewEncapsulation, output, NgZone, model } from '@angular/core';
|
|
3
|
-
import {
|
|
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,90 @@ 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
|
+
const TOOLTIP_KEYS = {
|
|
349
|
+
idle: 'components.entitiesPreview.calculatedValue',
|
|
350
|
+
running: 'components.entitiesPreview.calculatingValue',
|
|
351
|
+
waiting: 'components.entitiesPreview.waitingToCalculate',
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* Marks a property value the backend calculates. Rendered beside its label; it
|
|
355
|
+
* pulses while a recalculation that covers the value is in progress.
|
|
356
|
+
*/
|
|
357
|
+
class EntityCalculatedIndicator {
|
|
358
|
+
/** Set while the value is being recalculated. */
|
|
359
|
+
status = input(null, ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
360
|
+
tooltipKey = computed(() => TOOLTIP_KEYS[this.status() ?? 'idle'], ...(ngDevMode ? [{ debugName: "tooltipKey" }] : /* istanbul ignore next */ []));
|
|
361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
362
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCalculatedIndicator, isStandalone: true, selector: "mt-entity-calculated-indicator", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex shrink-0" }, ngImport: i0, template: `
|
|
363
|
+
<span
|
|
364
|
+
class="relative inline-flex size-3.5 cursor-help items-center justify-center rounded-full font-serif text-[10px] leading-none font-bold italic select-none"
|
|
365
|
+
[class]="
|
|
366
|
+
status()
|
|
367
|
+
? 'bg-primary-700 text-white'
|
|
368
|
+
: 'bg-surface-100 text-surface-500 dark:bg-surface-800 dark:text-surface-300'
|
|
369
|
+
"
|
|
370
|
+
role="img"
|
|
371
|
+
[attr.aria-label]="tooltipKey() | transloco"
|
|
372
|
+
[mtTooltip]="tooltipKey() | transloco"
|
|
373
|
+
tooltipPosition="top"
|
|
374
|
+
>
|
|
375
|
+
@if (status()) {
|
|
376
|
+
<span
|
|
377
|
+
class="absolute inset-0 animate-ping rounded-full bg-primary-700 opacity-60 motion-reduce:animate-none"
|
|
378
|
+
aria-hidden="true"
|
|
379
|
+
></span>
|
|
380
|
+
}
|
|
381
|
+
<span class="relative">f</span>
|
|
382
|
+
</span>
|
|
383
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
384
|
+
}
|
|
385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCalculatedIndicator, decorators: [{
|
|
386
|
+
type: Component,
|
|
387
|
+
args: [{
|
|
388
|
+
selector: 'mt-entity-calculated-indicator',
|
|
389
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
390
|
+
imports: [Tooltip, TranslocoPipe],
|
|
391
|
+
template: `
|
|
392
|
+
<span
|
|
393
|
+
class="relative inline-flex size-3.5 cursor-help items-center justify-center rounded-full font-serif text-[10px] leading-none font-bold italic select-none"
|
|
394
|
+
[class]="
|
|
395
|
+
status()
|
|
396
|
+
? 'bg-primary-700 text-white'
|
|
397
|
+
: 'bg-surface-100 text-surface-500 dark:bg-surface-800 dark:text-surface-300'
|
|
398
|
+
"
|
|
399
|
+
role="img"
|
|
400
|
+
[attr.aria-label]="tooltipKey() | transloco"
|
|
401
|
+
[mtTooltip]="tooltipKey() | transloco"
|
|
402
|
+
tooltipPosition="top"
|
|
403
|
+
>
|
|
404
|
+
@if (status()) {
|
|
405
|
+
<span
|
|
406
|
+
class="absolute inset-0 animate-ping rounded-full bg-primary-700 opacity-60 motion-reduce:animate-none"
|
|
407
|
+
aria-hidden="true"
|
|
408
|
+
></span>
|
|
409
|
+
}
|
|
410
|
+
<span class="relative">f</span>
|
|
411
|
+
</span>
|
|
412
|
+
`,
|
|
413
|
+
host: {
|
|
414
|
+
class: 'inline-flex shrink-0',
|
|
415
|
+
},
|
|
416
|
+
}]
|
|
417
|
+
}], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }] } });
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The entity of the enclosing `mt-entity-preview`. `mt-entity-field` only
|
|
421
|
+
* receives a label, so this lets it read entity-level flags without every view
|
|
422
|
+
* type passing them through its own template.
|
|
423
|
+
*/
|
|
424
|
+
const ENTITY_PREVIEW_DATA = new InjectionToken('ENTITY_PREVIEW_DATA');
|
|
425
|
+
|
|
348
426
|
class EntityField {
|
|
427
|
+
previewData = inject(ENTITY_PREVIEW_DATA, {
|
|
428
|
+
optional: true,
|
|
429
|
+
});
|
|
430
|
+
calculated = computed(() => this.previewData?.().calculated === true, ...(ngDevMode ? [{ debugName: "calculated" }] : /* istanbul ignore next */ []));
|
|
431
|
+
calculationStatus = computed(() => this.previewData?.().calculationStatus, ...(ngDevMode ? [{ debugName: "calculationStatus" }] : /* istanbul ignore next */ []));
|
|
349
432
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
350
433
|
labelIconName = input(null, ...(ngDevMode ? [{ debugName: "labelIconName" }] : /* istanbul ignore next */ []));
|
|
351
434
|
configuration = input(...(ngDevMode ? [undefined, { debugName: "configuration" }] : /* istanbul ignore next */ []));
|
|
@@ -377,54 +460,60 @@ class EntityField {
|
|
|
377
460
|
return `flex min-w-0 ${directionClass} ${gapClass} ${alignClass}`.trimEnd();
|
|
378
461
|
}, ...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
|
|
379
462
|
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
|
-
|
|
463
|
+
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: `
|
|
464
|
+
<div [class]="containerClass()">
|
|
465
|
+
<div [class]="contentContainerClass()">
|
|
466
|
+
<ng-content />
|
|
467
|
+
</div>
|
|
468
|
+
@if (!hideLabel()) {
|
|
469
|
+
<div [class]="labelContainerClass()">
|
|
470
|
+
@if (labelIconName(); as iconName) {
|
|
471
|
+
<mt-icon [icon]="iconName" size="xs" class="shrink-0" />
|
|
472
|
+
}
|
|
473
|
+
<span
|
|
474
|
+
class="block min-w-0 truncate"
|
|
475
|
+
mtTruncateTooltip
|
|
476
|
+
tooltipPosition="top"
|
|
477
|
+
>
|
|
478
|
+
{{ label() }}
|
|
479
|
+
</span>
|
|
480
|
+
@if (calculated()) {
|
|
481
|
+
<mt-entity-calculated-indicator [status]="calculationStatus()" />
|
|
482
|
+
}
|
|
483
|
+
</div>
|
|
484
|
+
}
|
|
485
|
+
</div>
|
|
486
|
+
`, 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", inputs: ["status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
401
487
|
}
|
|
402
488
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityField, decorators: [{
|
|
403
489
|
type: Component,
|
|
404
490
|
args: [{
|
|
405
491
|
selector: 'mt-entity-field',
|
|
406
492
|
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
|
-
|
|
493
|
+
imports: [TruncateTooltip, Icon, EntityCalculatedIndicator],
|
|
494
|
+
template: `
|
|
495
|
+
<div [class]="containerClass()">
|
|
496
|
+
<div [class]="contentContainerClass()">
|
|
497
|
+
<ng-content />
|
|
498
|
+
</div>
|
|
499
|
+
@if (!hideLabel()) {
|
|
500
|
+
<div [class]="labelContainerClass()">
|
|
501
|
+
@if (labelIconName(); as iconName) {
|
|
502
|
+
<mt-icon [icon]="iconName" size="xs" class="shrink-0" />
|
|
503
|
+
}
|
|
504
|
+
<span
|
|
505
|
+
class="block min-w-0 truncate"
|
|
506
|
+
mtTruncateTooltip
|
|
507
|
+
tooltipPosition="top"
|
|
508
|
+
>
|
|
509
|
+
{{ label() }}
|
|
510
|
+
</span>
|
|
511
|
+
@if (calculated()) {
|
|
512
|
+
<mt-entity-calculated-indicator [status]="calculationStatus()" />
|
|
513
|
+
}
|
|
514
|
+
</div>
|
|
515
|
+
}
|
|
516
|
+
</div>
|
|
428
517
|
`,
|
|
429
518
|
host: {
|
|
430
519
|
class: 'block min-w-0 w-full',
|
|
@@ -959,11 +1048,11 @@ class EntityPercentage {
|
|
|
959
1048
|
return Number.isNaN(numericValue) ? null : numericValue;
|
|
960
1049
|
}
|
|
961
1050
|
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 });
|
|
1051
|
+
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 [status]=\"data()?.calculationStatus\"\r\n />\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", inputs: ["status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
963
1052
|
}
|
|
964
1053
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPercentage, decorators: [{
|
|
965
1054
|
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" }]
|
|
1055
|
+
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 [status]=\"data()?.calculationStatus\"\r\n />\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
1056
|
}], 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
1057
|
|
|
969
1058
|
/**
|
|
@@ -1096,11 +1185,11 @@ class EntityCheckbox {
|
|
|
1096
1185
|
return coerceCheckboxValue(this.data()?.value ?? this.value());
|
|
1097
1186
|
}, ...(ngDevMode ? [{ debugName: "checkboxState" }] : /* istanbul ignore next */ []));
|
|
1098
1187
|
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 });
|
|
1188
|
+
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 [status]=\"data()?.calculationStatus\" />\r\n }\r\n }\r\n</div>\r\n", dependencies: [{ kind: "component", type: EntityCalculatedIndicator, selector: "mt-entity-calculated-indicator", inputs: ["status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1100
1189
|
}
|
|
1101
1190
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCheckbox, decorators: [{
|
|
1102
1191
|
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" }]
|
|
1192
|
+
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 [status]=\"data()?.calculationStatus\" />\r\n }\r\n }\r\n</div>\r\n" }]
|
|
1104
1193
|
}], 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
1194
|
|
|
1106
1195
|
class EntityLongText {
|
|
@@ -3750,7 +3839,12 @@ class EntityPreview {
|
|
|
3750
3839
|
return null;
|
|
3751
3840
|
}, ...(ngDevMode ? [{ debugName: "comparisonKind" }] : /* istanbul ignore next */ []));
|
|
3752
3841
|
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" },
|
|
3842
|
+
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: [
|
|
3843
|
+
{
|
|
3844
|
+
provide: ENTITY_PREVIEW_DATA,
|
|
3845
|
+
useFactory: () => inject(EntityPreview).data,
|
|
3846
|
+
},
|
|
3847
|
+
], 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
3848
|
}
|
|
3755
3849
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, decorators: [{
|
|
3756
3850
|
type: Component,
|
|
@@ -3760,6 +3854,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3760
3854
|
ComparisonEntityList,
|
|
3761
3855
|
Tooltip,
|
|
3762
3856
|
Icon,
|
|
3857
|
+
], providers: [
|
|
3858
|
+
{
|
|
3859
|
+
provide: ENTITY_PREVIEW_DATA,
|
|
3860
|
+
useFactory: () => inject(EntityPreview).data,
|
|
3861
|
+
},
|
|
3763
3862
|
], encapsulation: ViewEncapsulation.None, host: {
|
|
3764
3863
|
class: 'w-full',
|
|
3765
3864
|
// Both only apply when there is a note, so an entity without one keeps
|