@masterteam/components 0.0.259 → 0.0.261
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 +358 -358
- package/assets/i18n/en.json +358 -358
- package/fesm2022/masterteam-components-entities.mjs +9 -4
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-field-validation.mjs +20 -7
- package/fesm2022/masterteam-components-field-validation.mjs.map +1 -1
- package/fesm2022/masterteam-components-statistic-card.mjs +3 -2
- package/fesm2022/masterteam-components-statistic-card.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +19 -19
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-tabs.mjs +7 -2
- package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
- package/fesm2022/masterteam-components-upload-field.mjs +1 -1
- package/fesm2022/masterteam-components-upload-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +18 -24
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +10 -0
- package/types/masterteam-components-statistic-card.d.ts +2 -0
- package/types/masterteam-components-tabs.d.ts +9 -0
|
@@ -11,6 +11,26 @@ class ErrorMessagePipe {
|
|
|
11
11
|
return '';
|
|
12
12
|
}
|
|
13
13
|
const t = (key, params) => this.translocoService.translate(`components.validation.${key}`, params);
|
|
14
|
+
// A `.message` on the error object means a caller deliberately configured
|
|
15
|
+
// field-specific copy for this failure — ValidatorConfig with an explicit message
|
|
16
|
+
// (buildValidators → wrapValidatorWithMessage), or ValidatorConfig.custom
|
|
17
|
+
// (createCustomValidator). It must win over the generic translations below,
|
|
18
|
+
// otherwise that copy is silently replaced by the generic string, e.g. every
|
|
19
|
+
// pattern mismatch reading "The format is invalid" no matter what the field
|
|
20
|
+
// configured.
|
|
21
|
+
//
|
|
22
|
+
// The inverse matters just as much: ValidatorConfig's type-specific factories
|
|
23
|
+
// deliberately do NOT default `message` (see the note on ValidatorConfig in
|
|
24
|
+
// dynamic-form.model.ts). With no message configured the raw Angular validator is
|
|
25
|
+
// pushed unwrapped, so nothing reaches this loop and the translated — and, where
|
|
26
|
+
// relevant, parameter-interpolated — generic branch below runs instead. Re-adding
|
|
27
|
+
// a default there would shadow those translations in every locale but English.
|
|
28
|
+
for (const key in errors) {
|
|
29
|
+
const errorValue = errors[key];
|
|
30
|
+
if (errorValue && typeof errorValue === 'object' && errorValue.message) {
|
|
31
|
+
return errorValue.message;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
14
34
|
if (errors['required']) {
|
|
15
35
|
return t('required');
|
|
16
36
|
}
|
|
@@ -44,13 +64,6 @@ class ErrorMessagePipe {
|
|
|
44
64
|
const { size } = errors['fileSizeLimited'] ?? {};
|
|
45
65
|
return t('fileSizeLimited', { size });
|
|
46
66
|
}
|
|
47
|
-
// Handle custom errors that provide their own message
|
|
48
|
-
for (const key in errors) {
|
|
49
|
-
const errorValue = errors[key];
|
|
50
|
-
if (errorValue && typeof errorValue === 'object' && errorValue.message) {
|
|
51
|
-
return errorValue.message;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
67
|
// Fallback for any other error
|
|
55
68
|
const firstErrorKey = Object.keys(errors)[0];
|
|
56
69
|
return t('invalid', { key: firstErrorKey });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-field-validation.mjs","sources":["../../../../packages/masterteam/components/field-validation/error-message.pipe.ts","../../../../packages/masterteam/components/field-validation/field-validation.ts","../../../../packages/masterteam/components/field-validation/character-limit.validator.ts","../../../../packages/masterteam/components/field-validation/masterteam-components-field-validation.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { ValidationErrors } from '@angular/forms';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n@Pipe({\r\n name: 'errorMessage',\r\n standalone: true,\r\n pure: false,\r\n})\r\nexport class ErrorMessagePipe implements PipeTransform {\r\n private readonly translocoService = inject(TranslocoService);\r\n\r\n transform(errors: ValidationErrors | null): string {\r\n if (!errors) {\r\n return '';\r\n }\r\n\r\n const t = (key: string, params?: object) =>\r\n this.translocoService.translate(`components.validation.${key}`, params);\r\n\r\n if (errors['required']) {\r\n return t('required');\r\n }\r\n if (errors['email']) {\r\n return t('email');\r\n }\r\n if (errors['minlength']) {\r\n const { requiredLength } = errors['minlength'];\r\n return t('minLength', { requiredLength });\r\n }\r\n if (errors['maxlength']) {\r\n const { requiredLength } = errors['maxlength'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['characterLimit']) {\r\n const { requiredLength } = errors['characterLimit'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['min']) {\r\n const { min } = errors['min'];\r\n return t('min', { min });\r\n }\r\n if (errors['max']) {\r\n const { max } = errors['max'];\r\n return t('max', { max });\r\n }\r\n if (errors['pattern']) {\r\n return t('pattern');\r\n }\r\n if (errors['fileSizeLimited']) {\r\n const { size } = errors['fileSizeLimited'] ?? {};\r\n return t('fileSizeLimited', { size });\r\n }\r\n\r\n // Handle custom errors that provide their own message\r\n for (const key in errors) {\r\n const errorValue = errors[key];\r\n if (errorValue && typeof errorValue === 'object' && errorValue.message) {\r\n return errorValue.message;\r\n }\r\n }\r\n\r\n // Fallback for any other error\r\n const firstErrorKey = Object.keys(errors)[0];\r\n return t('invalid', { key: firstErrorKey });\r\n }\r\n}\r\n","import { booleanAttribute, Component, input } from '@angular/core';\r\nimport { Message } from 'primeng/message';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { ErrorMessagePipe } from './error-message.pipe';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-field-validation',\r\n standalone: true,\r\n imports: [Message, ErrorMessagePipe],\r\n template: `\r\n @if (isInvalid(control())) {\r\n <p-message\r\n severity=\"error\"\r\n variant=\"simple\"\r\n size=\"small\"\r\n [text]=\"control().errors | errorMessage\"\r\n >\r\n </p-message>\r\n }\r\n `,\r\n host: {\r\n class: 'mt-field-validation',\r\n // Reserve one line of space for fields that can produce an error so the\r\n // message appears/disappears without shifting the field height (and the\r\n // rest of the form). Fields with no validators stay compact.\r\n '[class.mt-field-validation--reserved]': 'shouldReserveSpace()',\r\n },\r\n styles: `\r\n .mt-field-validation {\r\n display: none;\r\n }\r\n .mt-field-validation--reserved {\r\n display: block;\r\n min-height: 1.25rem;\r\n }\r\n `,\r\n})\r\nexport class FieldValidation {\r\n readonly control = input<AbstractControl | null>(null);\r\n readonly touched = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n isInvalid = isInvalid;\r\n\r\n /**\r\n * Reserve the error-message line whenever the control can surface an error —\r\n * i.e. it has sync/async validators, or is already showing one. This keeps the\r\n * field's height constant so showing the error never pushes sibling fields or\r\n * the content below the row. Re-evaluated each change-detection cycle, so it\r\n * picks up validators that fields add asynchronously after init.\r\n */\r\n shouldReserveSpace(): boolean {\r\n const control = this.control();\r\n if (!control) {\r\n return false;\r\n }\r\n return (\r\n control.validator !== null ||\r\n control.asyncValidator !== null ||\r\n isInvalid(control)\r\n );\r\n }\r\n}\r\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport const characterLimitValidator =\n (maxLength: number): ValidatorFn =>\n (control: AbstractControl): ValidationErrors | null => {\n const value = control.value;\n\n if (value === null || value === undefined) {\n return null;\n }\n\n const length = String(value).length;\n\n return length > maxLength\n ? {\n characterLimit: {\n requiredLength: maxLength,\n actualLength: length,\n },\n }\n : null;\n };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MASa,gBAAgB,CAAA;AACV,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5D,IAAA,SAAS,CAAC,MAA+B,EAAA;QACvC,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,EAAE;QACX;QAEA,MAAM,CAA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2FA6BxB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAhC3B,SAAS;+BACE,qBAAqB,EAAA,UAAA,EACnB,IAAI,EAAA,OAAA,EACP,CAAC,OAAO,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAC1B,CAAA;;;;;;;;;;GAUT,EAAA,IAAA,EACK;AACJ,wBAAA,KAAK,EAAE,qBAAqB;;;;AAI5B,wBAAA,uCAAuC,EAAE,sBAAsB;AAChE,qBAAA,EAAA,MAAA,EAAA,CAAA,sGAAA,CAAA,EAAA;;;ACzBI,MAAM,uBAAuB,GAClC,CAAC,SAAiB,KAClB,CAAC,OAAwB,KAA6B;AACpD,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK;IAE3B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AACzC,QAAA,OAAO,IAAI;IACb;IAEA,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM;IAEnC,OAAO,MAAM,GAAG;AACd,UAAE;AACE,YAAA,cAAc,EAAE;AACd,gBAAA,cAAc,EAAE,SAAS;AACzB,gBAAA,YAAY,EAAE,MAAM;AACrB,aAAA;AACF;UACD,IAAI;AACV;;ACrBF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-field-validation.mjs","sources":["../../../../packages/masterteam/components/field-validation/error-message.pipe.ts","../../../../packages/masterteam/components/field-validation/field-validation.ts","../../../../packages/masterteam/components/field-validation/character-limit.validator.ts","../../../../packages/masterteam/components/field-validation/masterteam-components-field-validation.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { ValidationErrors } from '@angular/forms';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n@Pipe({\r\n name: 'errorMessage',\r\n standalone: true,\r\n pure: false,\r\n})\r\nexport class ErrorMessagePipe implements PipeTransform {\r\n private readonly translocoService = inject(TranslocoService);\r\n\r\n transform(errors: ValidationErrors | null): string {\r\n if (!errors) {\r\n return '';\r\n }\r\n\r\n const t = (key: string, params?: object) =>\r\n this.translocoService.translate(`components.validation.${key}`, params);\r\n\r\n // A `.message` on the error object means a caller deliberately configured\r\n // field-specific copy for this failure — ValidatorConfig with an explicit message\r\n // (buildValidators → wrapValidatorWithMessage), or ValidatorConfig.custom\r\n // (createCustomValidator). It must win over the generic translations below,\r\n // otherwise that copy is silently replaced by the generic string, e.g. every\r\n // pattern mismatch reading \"The format is invalid\" no matter what the field\r\n // configured.\r\n //\r\n // The inverse matters just as much: ValidatorConfig's type-specific factories\r\n // deliberately do NOT default `message` (see the note on ValidatorConfig in\r\n // dynamic-form.model.ts). With no message configured the raw Angular validator is\r\n // pushed unwrapped, so nothing reaches this loop and the translated — and, where\r\n // relevant, parameter-interpolated — generic branch below runs instead. Re-adding\r\n // a default there would shadow those translations in every locale but English.\r\n for (const key in errors) {\r\n const errorValue = errors[key];\r\n if (errorValue && typeof errorValue === 'object' && errorValue.message) {\r\n return errorValue.message;\r\n }\r\n }\r\n\r\n if (errors['required']) {\r\n return t('required');\r\n }\r\n if (errors['email']) {\r\n return t('email');\r\n }\r\n if (errors['minlength']) {\r\n const { requiredLength } = errors['minlength'];\r\n return t('minLength', { requiredLength });\r\n }\r\n if (errors['maxlength']) {\r\n const { requiredLength } = errors['maxlength'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['characterLimit']) {\r\n const { requiredLength } = errors['characterLimit'];\r\n return t('maxLength', { requiredLength });\r\n }\r\n if (errors['min']) {\r\n const { min } = errors['min'];\r\n return t('min', { min });\r\n }\r\n if (errors['max']) {\r\n const { max } = errors['max'];\r\n return t('max', { max });\r\n }\r\n if (errors['pattern']) {\r\n return t('pattern');\r\n }\r\n if (errors['fileSizeLimited']) {\r\n const { size } = errors['fileSizeLimited'] ?? {};\r\n return t('fileSizeLimited', { size });\r\n }\r\n\r\n // Fallback for any other error\r\n const firstErrorKey = Object.keys(errors)[0];\r\n return t('invalid', { key: firstErrorKey });\r\n }\r\n}\r\n","import { booleanAttribute, Component, input } from '@angular/core';\r\nimport { Message } from 'primeng/message';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { ErrorMessagePipe } from './error-message.pipe';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-field-validation',\r\n standalone: true,\r\n imports: [Message, ErrorMessagePipe],\r\n template: `\r\n @if (isInvalid(control())) {\r\n <p-message\r\n severity=\"error\"\r\n variant=\"simple\"\r\n size=\"small\"\r\n [text]=\"control().errors | errorMessage\"\r\n >\r\n </p-message>\r\n }\r\n `,\r\n host: {\r\n class: 'mt-field-validation',\r\n // Reserve one line of space for fields that can produce an error so the\r\n // message appears/disappears without shifting the field height (and the\r\n // rest of the form). Fields with no validators stay compact.\r\n '[class.mt-field-validation--reserved]': 'shouldReserveSpace()',\r\n },\r\n styles: `\r\n .mt-field-validation {\r\n display: none;\r\n }\r\n .mt-field-validation--reserved {\r\n display: block;\r\n min-height: 1.25rem;\r\n }\r\n `,\r\n})\r\nexport class FieldValidation {\r\n readonly control = input<AbstractControl | null>(null);\r\n readonly touched = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n isInvalid = isInvalid;\r\n\r\n /**\r\n * Reserve the error-message line whenever the control can surface an error —\r\n * i.e. it has sync/async validators, or is already showing one. This keeps the\r\n * field's height constant so showing the error never pushes sibling fields or\r\n * the content below the row. Re-evaluated each change-detection cycle, so it\r\n * picks up validators that fields add asynchronously after init.\r\n */\r\n shouldReserveSpace(): boolean {\r\n const control = this.control();\r\n if (!control) {\r\n return false;\r\n }\r\n return (\r\n control.validator !== null ||\r\n control.asyncValidator !== null ||\r\n isInvalid(control)\r\n );\r\n }\r\n}\r\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport const characterLimitValidator =\n (maxLength: number): ValidatorFn =>\n (control: AbstractControl): ValidationErrors | null => {\n const value = control.value;\n\n if (value === null || value === undefined) {\n return null;\n }\n\n const length = String(value).length;\n\n return length > maxLength\n ? {\n characterLimit: {\n requiredLength: maxLength,\n actualLength: length,\n },\n }\n : null;\n };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MASa,gBAAgB,CAAA;AACV,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5D,IAAA,SAAS,CAAC,MAA+B,EAAA;QACvC,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,EAAE;QACX;QAEA,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,MAAe,KACrC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA,sBAAA,EAAyB,GAAG,CAAA,CAAE,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;AAgBzE,QAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AACxB,YAAA,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC;YAC9B,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,OAAO,EAAE;gBACtE,OAAO,UAAU,CAAC,OAAO;YAC3B;QACF;AAEA,QAAA,IAAI,MAAM,CAAC,UAAU,CAAC,EAAE;AACtB,YAAA,OAAO,CAAC,CAAC,UAAU,CAAC;QACtB;AACA,QAAA,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE;AACnB,YAAA,OAAO,CAAC,CAAC,OAAO,CAAC;QACnB;AACA,QAAA,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;YAC9C,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,cAAc,EAAE,CAAC;QAC3C;AACA,QAAA,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;YAC9C,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,cA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/components/card';
|
|
4
4
|
import { Avatar } from '@masterteam/components/avatar';
|
|
5
|
+
import { Button } from '@masterteam/components/button';
|
|
5
6
|
|
|
6
7
|
/** Palette token used when no color is supplied. */
|
|
7
8
|
const NEUTRAL_COLOR_TOKEN = 'surface';
|
|
@@ -26,11 +27,11 @@ class StatisticCard {
|
|
|
26
27
|
: `var(--p-${color}-100)`;
|
|
27
28
|
}, ...(ngDevMode ? [{ debugName: "accentBackground" }] : /* istanbul ignore next */ []));
|
|
28
29
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StatisticCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StatisticCard, isStandalone: true, selector: "mt-statistic-card", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, cardClass: { classPropertyName: "cardClass", publicName: "cardClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"accentBackground()\"\r\n [style.--p-avatar-color]=\"accentColor()\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span class=\"text-lg font-semibold\" [style.color]=\"accentColor()\">\r\n {{ data().title }}\r\n </span>\r\n <span class=\"flex items-center gap-1 text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n @if (data().tooltip; as tooltip) {\r\n <mt-button\r\n icon=\"general.info-circle\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n rounded\r\n [tooltip]=\"tooltip\"\r\n styleClass=\"!h-4 !w-4 !p-0 !text-surface-400\"\r\n />\r\n }\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n", styles: [""], dependencies: [{ kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
30
31
|
}
|
|
31
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StatisticCard, decorators: [{
|
|
32
33
|
type: Component,
|
|
33
|
-
args: [{ selector: 'mt-statistic-card', standalone: true, imports: [Card, Avatar], template: "<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"accentBackground()\"\r\n [style.--p-avatar-color]=\"accentColor()\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span class=\"text-lg font-semibold\" [style.color]=\"accentColor()\">\r\n {{ data().title }}\r\n </span>\r\n <span class=\"text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n" }]
|
|
34
|
+
args: [{ selector: 'mt-statistic-card', standalone: true, imports: [Card, Avatar, Button], template: "<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"accentBackground()\"\r\n [style.--p-avatar-color]=\"accentColor()\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span class=\"text-lg font-semibold\" [style.color]=\"accentColor()\">\r\n {{ data().title }}\r\n </span>\r\n <span class=\"flex items-center gap-1 text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n @if (data().tooltip; as tooltip) {\r\n <mt-button\r\n icon=\"general.info-circle\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n rounded\r\n [tooltip]=\"tooltip\"\r\n styleClass=\"!h-4 !w-4 !p-0 !text-surface-400\"\r\n />\r\n }\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n" }]
|
|
34
35
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], cardClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardClass", required: false }] }] } });
|
|
35
36
|
|
|
36
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-statistic-card.mjs","sources":["../../../../packages/masterteam/components/statistic-card/statistic-card.ts","../../../../packages/masterteam/components/statistic-card/statistic-card.html","../../../../packages/masterteam/components/statistic-card/masterteam-components-statistic-card.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\r\nimport { Card } from '@masterteam/components/card';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { MTIcon } from '@masterteam/icons';\r\n\r\nexport interface StatisticCardData {\r\n title: string;\r\n subTitle: string;\r\n icon: MTIcon;\r\n /**\r\n * Either a theme palette token (`violet`, `blue`, ...) or an explicit CSS\r\n * color coming from the backend (`#hex`, `rgb(...)`, `hsl(...)`, `var(...)`).\r\n * Leave empty/`null` to render the neutral surface accent.\r\n */\r\n color?: string | null;\r\n}\r\n\r\n/** Palette token used when no color is supplied. */\r\nconst NEUTRAL_COLOR_TOKEN = 'surface';\r\n\r\nfunction isExplicitCssColor(color: string): boolean {\r\n return (\r\n color.startsWith('#') ||\r\n color.startsWith('rgb') ||\r\n color.startsWith('hsl') ||\r\n color.startsWith('var(')\r\n );\r\n}\r\n\r\n@Component({\r\n selector: 'mt-statistic-card',\r\n standalone: true,\r\n templateUrl: './statistic-card.html',\r\n styleUrl: './statistic-card.scss',\r\n imports: [Card, Avatar],\r\n})\r\nexport class StatisticCard {\r\n readonly data = input.required<StatisticCardData>();\r\n readonly cardClass = input('shadow-md');\r\n\r\n private readonly resolvedColor = computed(\r\n () => this.data().color?.trim() || NEUTRAL_COLOR_TOKEN,\r\n );\r\n\r\n protected readonly accentColor = computed(() => {\r\n const color = this.resolvedColor();\r\n return isExplicitCssColor(color) ? color : `var(--p-${color}-600)`;\r\n });\r\n\r\n protected readonly accentBackground = computed(() => {\r\n const color = this.resolvedColor();\r\n return isExplicitCssColor(color)\r\n ? `color-mix(in srgb, ${color} 12%, transparent)`\r\n : `var(--p-${color}-100)`;\r\n });\r\n}\r\n","<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"accentBackground()\"\r\n [style.--p-avatar-color]=\"accentColor()\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span class=\"text-lg font-semibold\" [style.color]=\"accentColor()\">\r\n {{ data().title }}\r\n </span>\r\n <span class=\"text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"masterteam-components-statistic-card.mjs","sources":["../../../../packages/masterteam/components/statistic-card/statistic-card.ts","../../../../packages/masterteam/components/statistic-card/statistic-card.html","../../../../packages/masterteam/components/statistic-card/masterteam-components-statistic-card.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\r\nimport { Card } from '@masterteam/components/card';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { MTIcon } from '@masterteam/icons';\r\n\r\nexport interface StatisticCardData {\r\n title: string;\r\n subTitle: string;\r\n icon: MTIcon;\r\n /**\r\n * Either a theme palette token (`violet`, `blue`, ...) or an explicit CSS\r\n * color coming from the backend (`#hex`, `rgb(...)`, `hsl(...)`, `var(...)`).\r\n * Leave empty/`null` to render the neutral surface accent.\r\n */\r\n color?: string | null;\r\n /** Optional info-icon tooltip explaining what the metric counts. */\r\n tooltip?: string | null;\r\n}\r\n\r\n/** Palette token used when no color is supplied. */\r\nconst NEUTRAL_COLOR_TOKEN = 'surface';\r\n\r\nfunction isExplicitCssColor(color: string): boolean {\r\n return (\r\n color.startsWith('#') ||\r\n color.startsWith('rgb') ||\r\n color.startsWith('hsl') ||\r\n color.startsWith('var(')\r\n );\r\n}\r\n\r\n@Component({\r\n selector: 'mt-statistic-card',\r\n standalone: true,\r\n templateUrl: './statistic-card.html',\r\n styleUrl: './statistic-card.scss',\r\n imports: [Card, Avatar, Button],\r\n})\r\nexport class StatisticCard {\r\n readonly data = input.required<StatisticCardData>();\r\n readonly cardClass = input('shadow-md');\r\n\r\n private readonly resolvedColor = computed(\r\n () => this.data().color?.trim() || NEUTRAL_COLOR_TOKEN,\r\n );\r\n\r\n protected readonly accentColor = computed(() => {\r\n const color = this.resolvedColor();\r\n return isExplicitCssColor(color) ? color : `var(--p-${color}-600)`;\r\n });\r\n\r\n protected readonly accentBackground = computed(() => {\r\n const color = this.resolvedColor();\r\n return isExplicitCssColor(color)\r\n ? `color-mix(in srgb, ${color} 12%, transparent)`\r\n : `var(--p-${color}-100)`;\r\n });\r\n}\r\n","<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"accentBackground()\"\r\n [style.--p-avatar-color]=\"accentColor()\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span class=\"text-lg font-semibold\" [style.color]=\"accentColor()\">\r\n {{ data().title }}\r\n </span>\r\n <span class=\"flex items-center gap-1 text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n @if (data().tooltip; as tooltip) {\r\n <mt-button\r\n icon=\"general.info-circle\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n rounded\r\n [tooltip]=\"tooltip\"\r\n styleClass=\"!h-4 !w-4 !p-0 !text-surface-400\"\r\n />\r\n }\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAoBA;AACA,MAAM,mBAAmB,GAAG,SAAS;AAErC,SAAS,kBAAkB,CAAC,KAAa,EAAA;AACvC,IAAA,QACE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;AACrB,QAAA,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AACvB,QAAA,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AACvB,QAAA,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;AAE5B;MASa,aAAa,CAAA;AACf,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,0EAAqB;AAC1C,IAAA,SAAS,GAAG,KAAK,CAAC,WAAW,gFAAC;AAEtB,IAAA,aAAa,GAAG,QAAQ,CACvC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,mBAAmB,oFACvD;AAEkB,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AAC7C,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE;AAClC,QAAA,OAAO,kBAAkB,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAA,QAAA,EAAW,KAAK,OAAO;AACpE,IAAA,CAAC,kFAAC;AAEiB,IAAA,gBAAgB,GAAG,Q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A,EACjB,IAAI,EAAA,OAAA,EAGP,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAA,QAAA,EAAA,2gCAAA,EAAA;;;AErCjC;;AAEG;;;;"}
|
|
@@ -1346,25 +1346,25 @@ class TableExportService {
|
|
|
1346
1346
|
static MAX_PRINT_COLUMNS_PER_TABLE = 8;
|
|
1347
1347
|
static RTL_LANGUAGES = /^(ar|fa|he|ur)(?:-|$)/i;
|
|
1348
1348
|
transloco = inject(TranslocoService);
|
|
1349
|
-
static PRINT_CSS = `
|
|
1350
|
-
@media print {
|
|
1351
|
-
html.mt-printing body > *:not(.mt-print-region) { display: none !important; }
|
|
1352
|
-
html.mt-printing, html.mt-printing body { width: 100% !important; height: auto !important;
|
|
1353
|
-
overflow: visible !important; background: #ffffff !important; }
|
|
1354
|
-
.mt-print-region { display: block !important; width: 100%; max-width: 100%;
|
|
1355
|
-
box-sizing: border-box; overflow: visible !important; padding: 16px; color: #111827;
|
|
1356
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
|
|
1357
|
-
.mt-print-region h1 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
|
|
1358
|
-
.mt-print-region table { width: 100%; max-width: 100%; table-layout: fixed;
|
|
1359
|
-
border-collapse: collapse; font-size: 12px; }
|
|
1360
|
-
.mt-print-region table + table { margin-top: 16px; }
|
|
1361
|
-
.mt-print-region th, .mt-print-region td { text-align: start; padding: 6px 8px;
|
|
1362
|
-
border: 1px solid #e5e7eb; vertical-align: top; white-space: normal;
|
|
1363
|
-
overflow-wrap: anywhere; word-break: break-word; }
|
|
1364
|
-
.mt-print-region thead th { background: #f3f4f6; font-weight: 600; }
|
|
1365
|
-
.mt-print-region tbody tr { break-inside: avoid; page-break-inside: avoid; }
|
|
1366
|
-
}
|
|
1367
|
-
.mt-print-region { display: none; }
|
|
1349
|
+
static PRINT_CSS = `
|
|
1350
|
+
@media print {
|
|
1351
|
+
html.mt-printing body > *:not(.mt-print-region) { display: none !important; }
|
|
1352
|
+
html.mt-printing, html.mt-printing body { width: 100% !important; height: auto !important;
|
|
1353
|
+
overflow: visible !important; background: #ffffff !important; }
|
|
1354
|
+
.mt-print-region { display: block !important; width: 100%; max-width: 100%;
|
|
1355
|
+
box-sizing: border-box; overflow: visible !important; padding: 16px; color: #111827;
|
|
1356
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
|
|
1357
|
+
.mt-print-region h1 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
|
|
1358
|
+
.mt-print-region table { width: 100%; max-width: 100%; table-layout: fixed;
|
|
1359
|
+
border-collapse: collapse; font-size: 12px; }
|
|
1360
|
+
.mt-print-region table + table { margin-top: 16px; }
|
|
1361
|
+
.mt-print-region th, .mt-print-region td { text-align: start; padding: 6px 8px;
|
|
1362
|
+
border: 1px solid #e5e7eb; vertical-align: top; white-space: normal;
|
|
1363
|
+
overflow-wrap: anywhere; word-break: break-word; }
|
|
1364
|
+
.mt-print-region thead th { background: #f3f4f6; font-weight: 600; }
|
|
1365
|
+
.mt-print-region tbody tr { break-inside: avoid; page-break-inside: avoid; }
|
|
1366
|
+
}
|
|
1367
|
+
.mt-print-region { display: none; }
|
|
1368
1368
|
`;
|
|
1369
1369
|
exportToExcel(config) {
|
|
1370
1370
|
const workbook = this.buildExcelWorkbook(config);
|