@masterteam/components 0.0.180 → 0.0.181
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/fesm2022/masterteam-components-drawer.mjs +2 -2
- package/fesm2022/masterteam-components-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +16 -16
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-field-validation.mjs +24 -4
- package/fesm2022/masterteam-components-field-validation.mjs.map +1 -1
- package/fesm2022/masterteam-components-location-field.mjs +4 -4
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-number-field.mjs +2 -2
- package/fesm2022/masterteam-components-number-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +2 -2
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +2 -2
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +25 -11
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-text-field.mjs +2 -2
- package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-textarea-field.mjs +2 -2
- package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-toggle-field.mjs +2 -2
- package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +34 -4
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +3 -3
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +16 -16
- package/types/masterteam-components-field-validation.d.ts +8 -0
- package/types/masterteam-components-table.d.ts +2 -0
- package/types/masterteam-components-user-search-field.d.ts +2 -0
|
@@ -70,8 +70,24 @@ class FieldValidation {
|
|
|
70
70
|
control = input(null, ...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
71
71
|
touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
72
72
|
isInvalid = isInvalid;
|
|
73
|
+
/**
|
|
74
|
+
* Reserve the error-message line whenever the control can surface an error —
|
|
75
|
+
* i.e. it has sync/async validators, or is already showing one. This keeps the
|
|
76
|
+
* field's height constant so showing the error never pushes sibling fields or
|
|
77
|
+
* the content below the row. Re-evaluated each change-detection cycle, so it
|
|
78
|
+
* picks up validators that fields add asynchronously after init.
|
|
79
|
+
*/
|
|
80
|
+
shouldReserveSpace() {
|
|
81
|
+
const control = this.control();
|
|
82
|
+
if (!control) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return (control.validator !== null ||
|
|
86
|
+
control.asyncValidator !== null ||
|
|
87
|
+
isInvalid(control));
|
|
88
|
+
}
|
|
73
89
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FieldValidation, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
74
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: FieldValidation, isStandalone: true, selector: "mt-field-validation", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.
|
|
90
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: FieldValidation, isStandalone: true, selector: "mt-field-validation", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.mt-field-validation--reserved": "shouldReserveSpace()" }, classAttribute: "mt-field-validation" }, ngImport: i0, template: `
|
|
75
91
|
@if (isInvalid(control())) {
|
|
76
92
|
<p-message
|
|
77
93
|
severity="error"
|
|
@@ -81,7 +97,7 @@ class FieldValidation {
|
|
|
81
97
|
>
|
|
82
98
|
</p-message>
|
|
83
99
|
}
|
|
84
|
-
`, isInline: true, dependencies: [{ kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }] });
|
|
100
|
+
`, isInline: true, styles: [".mt-field-validation{display:none}.mt-field-validation--reserved{display:block;min-height:1.25rem}\n"], dependencies: [{ kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }] });
|
|
85
101
|
}
|
|
86
102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FieldValidation, decorators: [{
|
|
87
103
|
type: Component,
|
|
@@ -96,8 +112,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
96
112
|
</p-message>
|
|
97
113
|
}
|
|
98
114
|
`, host: {
|
|
99
|
-
|
|
100
|
-
|
|
115
|
+
class: 'mt-field-validation',
|
|
116
|
+
// Reserve one line of space for fields that can produce an error so the
|
|
117
|
+
// message appears/disappears without shifting the field height (and the
|
|
118
|
+
// rest of the form). Fields with no validators stay compact.
|
|
119
|
+
'[class.mt-field-validation--reserved]': 'shouldReserveSpace()',
|
|
120
|
+
}, styles: [".mt-field-validation{display:none}.mt-field-validation--reserved{display:block;min-height:1.25rem}\n"] }]
|
|
101
121
|
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
|
|
102
122
|
|
|
103
123
|
const characterLimitValidator = (maxLength) => (control) => {
|
|
@@ -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 return t('fileSizeLimited');\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.
|
|
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 return t('fileSizeLimited');\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';\r\n\r\nexport const characterLimitValidator =\r\n (maxLength: number): ValidatorFn =>\r\n (control: AbstractControl): ValidationErrors | null => {\r\n const value = control.value;\r\n\r\n if (value === null || value === undefined) {\r\n return null;\r\n }\r\n\r\n const length = String(value).length;\r\n\r\n return length > maxLength\r\n ? {\r\n characterLimit: {\r\n requiredLength: maxLength,\r\n actualLength: length,\r\n },\r\n }\r\n : null;\r\n };\r\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;AAEzE,QAAA,IAAI,MAAM,CAAC,UAAU,CAAC,EAAE;AACtB,YAAA,OAAO,CAAC,CAAC,UAAU,CAAC;QACtB;AACA,QAAA,IAAI,MAAM,CAAC,OAAO,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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;;;;"}
|
|
@@ -125,11 +125,11 @@ class LocationManualDialog {
|
|
|
125
125
|
}));
|
|
126
126
|
}
|
|
127
127
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationManualDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
128
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: LocationManualDialog, isStandalone: true, selector: "mt-location-manual-dialog", inputs: { initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<form\
|
|
128
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: LocationManualDialog, isStandalone: true, selector: "mt-location-manual-dialog", inputs: { initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<form\n [formGroup]=\"form\"\n [class]=\"modal.contentClass + ' flex flex-col gap-4 p-4'\"\n>\n <mt-text-field\n [label]=\"'components.locationField.displayName' | transloco\"\n [placeholder]=\"'components.locationField.displayName' | transloco\"\n formControlName=\"display_name\"\n [required]=\"true\"\n />\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <mt-number-field\n [label]=\"'components.locationField.longitude' | transloco\"\n [placeholder]=\"'components.locationField.longitude' | transloco\"\n [min]=\"-180\"\n [max]=\"180\"\n formControlName=\"longitude\"\n [required]=\"true\"\n />\n <mt-number-field\n [label]=\"'components.locationField.latitude' | transloco\"\n [placeholder]=\"'components.locationField.latitude' | transloco\"\n [min]=\"-90\"\n [max]=\"90\"\n formControlName=\"latitude\"\n [required]=\"true\"\n />\n </div>\n</form>\n\n<div [class]=\"modal.footerClass\">\n <mt-button\n [label]=\"'components.locationField.cancel' | transloco\"\n variant=\"outlined\"\n (onClick)=\"cancel()\"\n />\n <mt-button\n [label]=\"'components.locationField.save' | transloco\"\n severity=\"primary\"\n [disabled]=\"form.invalid\"\n (onClick)=\"save()\"\n />\n</div>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { 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"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
129
129
|
}
|
|
130
130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationManualDialog, decorators: [{
|
|
131
131
|
type: Component,
|
|
132
|
-
args: [{ selector: 'mt-location-manual-dialog', imports: [ReactiveFormsModule, TranslocoPipe, Button, TextField, NumberField], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form\
|
|
132
|
+
args: [{ selector: 'mt-location-manual-dialog', imports: [ReactiveFormsModule, TranslocoPipe, Button, TextField, NumberField], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form\n [formGroup]=\"form\"\n [class]=\"modal.contentClass + ' flex flex-col gap-4 p-4'\"\n>\n <mt-text-field\n [label]=\"'components.locationField.displayName' | transloco\"\n [placeholder]=\"'components.locationField.displayName' | transloco\"\n formControlName=\"display_name\"\n [required]=\"true\"\n />\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <mt-number-field\n [label]=\"'components.locationField.longitude' | transloco\"\n [placeholder]=\"'components.locationField.longitude' | transloco\"\n [min]=\"-180\"\n [max]=\"180\"\n formControlName=\"longitude\"\n [required]=\"true\"\n />\n <mt-number-field\n [label]=\"'components.locationField.latitude' | transloco\"\n [placeholder]=\"'components.locationField.latitude' | transloco\"\n [min]=\"-90\"\n [max]=\"90\"\n formControlName=\"latitude\"\n [required]=\"true\"\n />\n </div>\n</form>\n\n<div [class]=\"modal.footerClass\">\n <mt-button\n [label]=\"'components.locationField.cancel' | transloco\"\n variant=\"outlined\"\n (onClick)=\"cancel()\"\n />\n <mt-button\n [label]=\"'components.locationField.save' | transloco\"\n severity=\"primary\"\n [disabled]=\"form.invalid\"\n (onClick)=\"save()\"\n />\n</div>\n" }]
|
|
133
133
|
}], ctorParameters: () => [], propDecorators: { initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }] } });
|
|
134
134
|
function coerceNumber(value) {
|
|
135
135
|
if (value === null || value === undefined || value === '') {
|
|
@@ -289,7 +289,7 @@ class LocationField {
|
|
|
289
289
|
.filter((item) => item !== null))));
|
|
290
290
|
}
|
|
291
291
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
292
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LocationField, isStandalone: true, selector: "mt-location-field", inputs: { hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, searchUrl: { classPropertyName: "searchUrl", publicName: "searchUrl", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "autocomplete", first: true, predicate: ["autocomplete"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label() || hint()) {\
|
|
292
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LocationField, isStandalone: true, selector: "mt-location-field", inputs: { hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, searchUrl: { classPropertyName: "searchUrl", publicName: "searchUrl", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "autocomplete", first: true, predicate: ["autocomplete"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label() || hint()) {\n <div class=\"mb-1 flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >\n {{ label() }}\n </label>\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n\n<div class=\"relative\">\n <p-inputgroup>\n <p-autoComplete\n #autocomplete=\"\"\n [suggestions]=\"suggestions()\"\n (completeMethod)=\"search($event)\"\n (onSelect)=\"onSelect($event)\"\n (onClear)=\"onClear()\"\n (onFocus)=\"onFocus()\"\n (onBlur)=\"onTouched()\"\n [ngModel]=\"value()\"\n [disabled]=\"disabled() || readonly()\"\n [id]=\"ngControl?.name || label()\"\n [invalid]=\"isInvalid(ngControl?.control)\"\n [placeholder]=\"'components.locationField.search' | transloco\"\n [optionLabel]=\"'display_name'\"\n [minLength]=\"minLength()\"\n [forceSelection]=\"true\"\n class=\"w-full\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n >\n <ng-template let-location pTemplate=\"item\">\n <div class=\"flex min-w-0 items-start gap-2\">\n <mt-icon icon=\"map.marker-pin-01\" class=\"mt-0.5 shrink-0 text-xl\" />\n <span class=\"min-w-0 text-wrap text-sm leading-5\">\n {{ location.display_name }}\n </span>\n </div>\n </ng-template>\n\n <ng-template let-location pTemplate=\"selecteditem\">\n <span class=\"min-w-0 truncate\">{{ location?.display_name }}</span>\n </ng-template>\n </p-autoComplete>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n class=\"inline-flex h-full items-center justify-center text-surface-500 transition-colors hover:text-primary-500 disabled:cursor-not-allowed disabled:opacity-50\"\n [disabled]=\"disabled() || readonly()\"\n [mtTooltip]=\"'components.locationField.enterManually' | transloco\"\n tooltipPosition=\"top\"\n (click)=\"openManualDialog()\"\n >\n <mt-icon icon=\"general.edit-03\" />\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n\n @if (loading()) {\n <mt-icon\n icon=\"general.loading-01\"\n class=\"absolute end-12 top-1/2 -translate-y-1/2 animate-spin bg-white\"\n />\n }\n</div>\n\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i2.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i4.InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "component", type: i5.InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
293
293
|
}
|
|
294
294
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationField, decorators: [{
|
|
295
295
|
type: Component,
|
|
@@ -304,7 +304,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
304
304
|
TranslocoPipe,
|
|
305
305
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
306
306
|
class: 'grid gap-1',
|
|
307
|
-
}, template: "@if (label() || hint()) {\
|
|
307
|
+
}, template: "@if (label() || hint()) {\n <div class=\"mb-1 flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >\n {{ label() }}\n </label>\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n\n<div class=\"relative\">\n <p-inputgroup>\n <p-autoComplete\n #autocomplete=\"\"\n [suggestions]=\"suggestions()\"\n (completeMethod)=\"search($event)\"\n (onSelect)=\"onSelect($event)\"\n (onClear)=\"onClear()\"\n (onFocus)=\"onFocus()\"\n (onBlur)=\"onTouched()\"\n [ngModel]=\"value()\"\n [disabled]=\"disabled() || readonly()\"\n [id]=\"ngControl?.name || label()\"\n [invalid]=\"isInvalid(ngControl?.control)\"\n [placeholder]=\"'components.locationField.search' | transloco\"\n [optionLabel]=\"'display_name'\"\n [minLength]=\"minLength()\"\n [forceSelection]=\"true\"\n class=\"w-full\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n >\n <ng-template let-location pTemplate=\"item\">\n <div class=\"flex min-w-0 items-start gap-2\">\n <mt-icon icon=\"map.marker-pin-01\" class=\"mt-0.5 shrink-0 text-xl\" />\n <span class=\"min-w-0 text-wrap text-sm leading-5\">\n {{ location.display_name }}\n </span>\n </div>\n </ng-template>\n\n <ng-template let-location pTemplate=\"selecteditem\">\n <span class=\"min-w-0 truncate\">{{ location?.display_name }}</span>\n </ng-template>\n </p-autoComplete>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n class=\"inline-flex h-full items-center justify-center text-surface-500 transition-colors hover:text-primary-500 disabled:cursor-not-allowed disabled:opacity-50\"\n [disabled]=\"disabled() || readonly()\"\n [mtTooltip]=\"'components.locationField.enterManually' | transloco\"\n tooltipPosition=\"top\"\n (click)=\"openManualDialog()\"\n >\n <mt-icon icon=\"general.edit-03\" />\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n\n @if (loading()) {\n <mt-icon\n icon=\"general.loading-01\"\n class=\"absolute end-12 top-1/2 -translate-y-1/2 animate-spin bg-white\"\n />\n }\n</div>\n\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\n" }]
|
|
308
308
|
}], ctorParameters: () => [], propDecorators: { hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], searchUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchUrl", required: false }] }], autocomplete: [{ type: i0.ViewChild, args: ['autocomplete', { isSignal: true }] }] } });
|
|
309
309
|
|
|
310
310
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-location-field.mjs","sources":["../../../../packages/masterteam/components/location-field/location-value.ts","../../../../packages/masterteam/components/location-field/location-manual-dialog.ts","../../../../packages/masterteam/components/location-field/location-manual-dialog.html","../../../../packages/masterteam/components/location-field/location-field.ts","../../../../packages/masterteam/components/location-field/location-field.html","../../../../packages/masterteam/components/location-field/masterteam-components-location-field.ts"],"sourcesContent":["export interface LocationValue {\r\n display_name?: string;\r\n address?: string;\r\n lat?: string | number;\r\n lon?: string | number;\r\n lng?: string | number;\r\n [key: string]: unknown;\r\n}\r\n\r\nexport function normalizeLocationValue(value: unknown): LocationValue | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n const trimmed = value.trim();\r\n if (!trimmed) return null;\r\n\r\n try {\r\n return normalizeLocationValue(JSON.parse(trimmed));\r\n } catch {\r\n return {\r\n display_name: trimmed,\r\n address: trimmed,\r\n };\r\n }\r\n }\r\n\r\n if (typeof value !== 'object') {\r\n return {\r\n display_name: String(value),\r\n address: String(value),\r\n };\r\n }\r\n\r\n const source = value as Record<string, unknown>;\r\n const lat = source['lat'];\r\n const lon = source['lon'] ?? source['lng'];\r\n const displayName =\r\n readString(source['display_name']) ??\r\n readString(source['displayName']) ??\r\n readString(source['address']) ??\r\n readString(source['name']);\r\n\r\n return {\r\n ...source,\r\n ...(displayName ? { display_name: displayName, address: displayName } : {}),\r\n ...(lat !== undefined ? { lat: lat as string | number } : {}),\r\n ...(lon !== undefined\r\n ? { lon: lon as string | number, lng: lon as string | number }\r\n : {}),\r\n };\r\n}\r\n\r\nexport function getLocationDisplayName(value: LocationValue | null): string {\r\n return value?.display_name?.trim() || value?.address?.trim() || '';\r\n}\r\n\r\nexport function getLocationLongitude(\r\n value: LocationValue | null,\r\n): string | number | undefined {\r\n return value?.lon ?? value?.lng;\r\n}\r\n\r\nfunction readString(value: unknown): string | undefined {\r\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n effect,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { NumberField } from '@masterteam/components/number-field';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport {\r\n getLocationDisplayName,\r\n getLocationLongitude,\r\n LocationValue,\r\n normalizeLocationValue,\r\n} from './location-value';\r\n\r\n@Component({\r\n selector: 'mt-location-manual-dialog',\r\n imports: [ReactiveFormsModule, TranslocoPipe, Button, TextField, NumberField],\r\n templateUrl: './location-manual-dialog.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class LocationManualDialog {\r\n readonly initialValue = input<LocationValue | null>(null);\r\n\r\n protected readonly modal = inject(ModalService);\r\n private readonly ref = inject(ModalRef);\r\n\r\n protected readonly form = new FormGroup({\r\n display_name: new FormControl('', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n longitude: new FormControl<number | null>(null, {\r\n validators: [\r\n Validators.required,\r\n Validators.min(-180),\r\n Validators.max(180),\r\n ],\r\n }),\r\n latitude: new FormControl<number | null>(null, {\r\n validators: [\r\n Validators.required,\r\n Validators.min(-90),\r\n Validators.max(90),\r\n ],\r\n }),\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const value = normalizeLocationValue(this.initialValue());\r\n this.form.patchValue(\r\n {\r\n display_name: getLocationDisplayName(value),\r\n longitude: coerceNumber(getLocationLongitude(value)),\r\n latitude: coerceNumber(value?.lat),\r\n },\r\n { emitEvent: false },\r\n );\r\n });\r\n }\r\n\r\n protected cancel(): void {\r\n this.ref.close(null);\r\n }\r\n\r\n protected save(): void {\r\n if (this.form.invalid) {\r\n this.form.markAllAsTouched();\r\n return;\r\n }\r\n\r\n const raw = this.form.getRawValue();\r\n this.ref.close(\r\n normalizeLocationValue({\r\n display_name: raw.display_name,\r\n address: raw.display_name,\r\n lon: raw.longitude,\r\n lng: raw.longitude,\r\n lat: raw.latitude,\r\n }),\r\n );\r\n }\r\n}\r\n\r\nfunction coerceNumber(value: unknown): number | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n const parsed = Number(value);\r\n return Number.isFinite(parsed) ? parsed : null;\r\n}\r\n","<form\r\n [formGroup]=\"form\"\r\n [class]=\"modal.contentClass + ' flex flex-col gap-4 p-4'\"\r\n>\r\n <mt-text-field\r\n [label]=\"'components.locationField.displayName' | transloco\"\r\n [placeholder]=\"'components.locationField.displayName' | transloco\"\r\n formControlName=\"display_name\"\r\n [required]=\"true\"\r\n />\r\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\r\n <mt-number-field\r\n [label]=\"'components.locationField.longitude' | transloco\"\r\n [placeholder]=\"'components.locationField.longitude' | transloco\"\r\n [min]=\"-180\"\r\n [max]=\"180\"\r\n formControlName=\"longitude\"\r\n [required]=\"true\"\r\n />\r\n <mt-number-field\r\n [label]=\"'components.locationField.latitude' | transloco\"\r\n [placeholder]=\"'components.locationField.latitude' | transloco\"\r\n [min]=\"-90\"\r\n [max]=\"90\"\r\n formControlName=\"latitude\"\r\n [required]=\"true\"\r\n />\r\n </div>\r\n</form>\r\n\r\n<div [class]=\"modal.footerClass\">\r\n <mt-button\r\n [label]=\"'components.locationField.cancel' | transloco\"\r\n variant=\"outlined\"\r\n (onClick)=\"cancel()\"\r\n />\r\n <mt-button\r\n [label]=\"'components.locationField.save' | transloco\"\r\n severity=\"primary\"\r\n [disabled]=\"form.invalid\"\r\n (onClick)=\"save()\"\r\n />\r\n</div>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { HttpBackend, HttpClient, HttpParams } from '@angular/common/http';\r\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';\r\nimport { InputGroupModule } from 'primeng/inputgroup';\r\nimport { InputGroupAddonModule } from 'primeng/inputgroupaddon';\r\nimport {\r\n catchError,\r\n debounceTime,\r\n finalize,\r\n of,\r\n Subject,\r\n switchMap,\r\n take,\r\n tap,\r\n} from 'rxjs';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid } from '@masterteam/components';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { LocationManualDialog } from './location-manual-dialog';\r\nimport {\r\n getLocationDisplayName,\r\n LocationValue,\r\n normalizeLocationValue,\r\n} from './location-value';\r\n\r\nexport interface LocationFieldConfiguration {\r\n country?: string | { name?: string; code?: string; viewBox?: string };\r\n viewBox?: string;\r\n nominatimBaseUrl?: string;\r\n [key: string]: unknown;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-location-field',\r\n imports: [\r\n FormsModule,\r\n AutoCompleteModule,\r\n InputGroupModule,\r\n InputGroupAddonModule,\r\n FieldValidation,\r\n Tooltip,\r\n Icon,\r\n TranslocoPipe,\r\n ],\r\n templateUrl: './location-field.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid gap-1',\r\n },\r\n})\r\nexport class LocationField implements ControlValueAccessor {\r\n readonly hint = input<string>();\r\n readonly label = input<string>();\r\n readonly placeholder = input<string>();\r\n readonly readonly = input<boolean>(false);\r\n readonly required = input<boolean>(false);\r\n readonly minLength = input<number>(2);\r\n readonly configuration = input<LocationFieldConfiguration | null>(null);\r\n readonly searchUrl = input<string | undefined>(\r\n 'https://nominatim.openstreetmap.org/search',\r\n );\r\n\r\n protected readonly value = signal<LocationValue | null>(null);\r\n protected readonly suggestions = signal<LocationValue[]>([]);\r\n protected readonly disabled = signal(false);\r\n protected readonly loading = signal(false);\r\n protected readonly requiredValidator = Validators.required;\r\n protected readonly autocomplete = viewChild<AutoComplete>('autocomplete');\r\n\r\n protected readonly displayValue = computed(() =>\r\n getLocationDisplayName(this.value()),\r\n );\r\n\r\n protected readonly resolvedSearchUrl = computed(() => {\r\n const configuredUrl = this.configuration()?.nominatimBaseUrl;\r\n return typeof configuredUrl === 'string' && configuredUrl.trim()\r\n ? configuredUrl\r\n : (this.searchUrl() ?? 'https://nominatim.openstreetmap.org/search');\r\n });\r\n\r\n protected readonly countryName = computed(() => {\r\n const country = this.configuration()?.country;\r\n if (typeof country === 'string') return country.trim();\r\n return country?.name?.trim() ?? '';\r\n });\r\n\r\n protected readonly countryCode = computed(() => {\r\n const country = this.configuration()?.country;\r\n if (typeof country === 'object') return country?.code?.trim() ?? '';\r\n return '';\r\n });\r\n\r\n protected readonly viewBox = computed(() => {\r\n const config = this.configuration();\r\n const country = config?.country;\r\n if (typeof config?.viewBox === 'string' && config.viewBox.trim()) {\r\n return config.viewBox;\r\n }\r\n if (typeof country === 'object' && country?.viewBox?.trim()) {\r\n return country.viewBox;\r\n }\r\n return '';\r\n });\r\n\r\n public ngControl: NgControl | null = null;\r\n protected readonly isInvalid = isInvalid;\r\n\r\n private readonly modal = inject(ModalService);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly http = new HttpClient(inject(HttpBackend));\r\n private readonly searchTerms = new Subject<string>();\r\n\r\n protected onTouched: () => void = () => {};\r\n private onModelChange: (value: LocationValue | null) => void = () => {};\r\n\r\n constructor() {\r\n this.ngControl = inject(NgControl, { self: true, optional: true });\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n\r\n effect(() => {\r\n if (this.ngControl?.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity({ emitEvent: false });\r\n }\r\n });\r\n\r\n this.searchTerms\r\n .pipe(\r\n takeUntilDestroyed(),\r\n debounceTime(250),\r\n tap(() => this.loading.set(true)),\r\n switchMap((term) => this.searchLocations(term)),\r\n )\r\n .subscribe((items) => this.suggestions.set(items));\r\n }\r\n\r\n protected search(event: { query: string }): void {\r\n this.searchTerms.next(event.query);\r\n }\r\n\r\n protected onFocus(): void {\r\n if (this.suggestions().length > 0) {\r\n this.autocomplete()?.show();\r\n }\r\n }\r\n\r\n protected onSelect(event: {\r\n originalEvent: Event;\r\n value: LocationValue;\r\n }): void {\r\n this.setValue(normalizeLocationValue(event.value));\r\n }\r\n\r\n protected onClear(): void {\r\n this.setValue(null);\r\n this.suggestions.set([]);\r\n }\r\n\r\n protected openManualDialog(): void {\r\n if (this.disabled() || this.readonly()) return;\r\n\r\n const ref = this.modal.openModal(LocationManualDialog, 'dialog', {\r\n header: this.transloco.translate('components.locationField.manualHeader'),\r\n styleClass: '!w-[40rem] max-w-[96vw]',\r\n dismissableMask: true,\r\n inputValues: {\r\n initialValue: this.value(),\r\n },\r\n });\r\n\r\n ref.onClose.pipe(take(1)).subscribe((result: unknown) => {\r\n const next = normalizeLocationValue(result);\r\n if (!next) return;\r\n this.setValue(next);\r\n });\r\n }\r\n\r\n writeValue(value: unknown): void {\r\n this.value.set(normalizeLocationValue(value));\r\n }\r\n\r\n registerOnChange(fn: (value: LocationValue | null) => void): void {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean): void {\r\n this.disabled.set(disabled);\r\n }\r\n\r\n private setValue(value: LocationValue | null): void {\r\n this.value.set(value);\r\n this.onModelChange(value);\r\n this.onTouched();\r\n }\r\n\r\n private searchLocations(term: string) {\r\n const trimmed = term?.trim();\r\n if (!trimmed || trimmed.length < this.minLength()) {\r\n this.loading.set(false);\r\n return of<LocationValue[]>([]);\r\n }\r\n\r\n const countryName = this.countryName();\r\n const query =\r\n countryName && !trimmed.toLowerCase().includes(countryName.toLowerCase())\r\n ? `${trimmed}, ${countryName}`\r\n : trimmed;\r\n\r\n let params = new HttpParams()\r\n .set('q', query)\r\n .set('format', 'json')\r\n .set('addressdetails', '1')\r\n .set('limit', '10')\r\n .set('accept-language', this.transloco.getActiveLang() || 'en');\r\n\r\n const viewBox = this.viewBox();\r\n if (viewBox) {\r\n params = params.set('bounded', '1').set('viewbox', viewBox);\r\n }\r\n\r\n const countryCode = this.countryCode();\r\n if (countryCode) {\r\n params = params.set('countrycodes', countryCode.toLowerCase());\r\n }\r\n\r\n return this.http.get<unknown[]>(this.resolvedSearchUrl(), { params }).pipe(\r\n finalize(() => this.loading.set(false)),\r\n catchError((error) => {\r\n console.error('Location search failed:', error);\r\n return of<unknown[]>([]);\r\n }),\r\n switchMap((items) =>\r\n of(\r\n items\r\n .map((item) => normalizeLocationValue(item))\r\n .filter((item): item is LocationValue => item !== null),\r\n ),\r\n ),\r\n );\r\n }\r\n}\r\n","@if (label() || hint()) {\r\n <div class=\"mb-1 flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n @if (hint()) {\r\n <span\r\n class=\"inline-flex text-surface-400\"\r\n [mtTooltip]=\"hint()\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n<div class=\"relative\">\r\n <p-inputgroup>\r\n <p-autoComplete\r\n #autocomplete=\"\"\r\n [suggestions]=\"suggestions()\"\r\n (completeMethod)=\"search($event)\"\r\n (onSelect)=\"onSelect($event)\"\r\n (onClear)=\"onClear()\"\r\n (onFocus)=\"onFocus()\"\r\n (onBlur)=\"onTouched()\"\r\n [ngModel]=\"value()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [id]=\"ngControl?.name || label()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.locationField.search' | transloco\"\r\n [optionLabel]=\"'display_name'\"\r\n [minLength]=\"minLength()\"\r\n [forceSelection]=\"true\"\r\n class=\"w-full\"\r\n appendTo=\"body\"\r\n styleClass=\"w-full\"\r\n >\r\n <ng-template let-location pTemplate=\"item\">\r\n <div class=\"flex min-w-0 items-start gap-2\">\r\n <mt-icon icon=\"map.marker-pin-01\" class=\"mt-0.5 shrink-0 text-xl\" />\r\n <span class=\"min-w-0 text-wrap text-sm leading-5\">\r\n {{ location.display_name }}\r\n </span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template let-location pTemplate=\"selecteditem\">\r\n <span class=\"min-w-0 truncate\">{{ location?.display_name }}</span>\r\n </ng-template>\r\n </p-autoComplete>\r\n\r\n <p-inputgroup-addon>\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-full items-center justify-center text-surface-500 transition-colors hover:text-primary-500 disabled:cursor-not-allowed disabled:opacity-50\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [mtTooltip]=\"'components.locationField.enterManually' | transloco\"\r\n tooltipPosition=\"top\"\r\n (click)=\"openManualDialog()\"\r\n >\r\n <mt-icon icon=\"general.edit-03\" />\r\n </button>\r\n </p-inputgroup-addon>\r\n </p-inputgroup>\r\n\r\n @if (loading()) {\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"absolute end-12 top-1/2 -translate-y-1/2 animate-spin bg-white\"\r\n />\r\n }\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASM,SAAU,sBAAsB,CAAC,KAAc,EAAA;AACnD,IAAA,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE;AACzD,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAI,CAAC,OAAO;AAAE,YAAA,OAAO,IAAI;AAEzB,QAAA,IAAI;YACF,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpD;AAAE,QAAA,MAAM;YACN,OAAO;AACL,gBAAA,YAAY,EAAE,OAAO;AACrB,gBAAA,OAAO,EAAE,OAAO;aACjB;QACH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AO;wBACP,IAAI;wBACJ,aAAa;qBACd,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,YAAY;AACpB,qBAAA,EAAA,QAAA,EAAA,uuFAAA,EAAA;02BAmByD,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEtF1E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-location-field.mjs","sources":["../../../../packages/masterteam/components/location-field/location-value.ts","../../../../packages/masterteam/components/location-field/location-manual-dialog.ts","../../../../packages/masterteam/components/location-field/location-manual-dialog.html","../../../../packages/masterteam/components/location-field/location-field.ts","../../../../packages/masterteam/components/location-field/location-field.html","../../../../packages/masterteam/components/location-field/masterteam-components-location-field.ts"],"sourcesContent":["export interface LocationValue {\n display_name?: string;\n address?: string;\n lat?: string | number;\n lon?: string | number;\n lng?: string | number;\n [key: string]: unknown;\n}\n\nexport function normalizeLocationValue(value: unknown): LocationValue | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed) return null;\n\n try {\n return normalizeLocationValue(JSON.parse(trimmed));\n } catch {\n return {\n display_name: trimmed,\n address: trimmed,\n };\n }\n }\n\n if (typeof value !== 'object') {\n return {\n display_name: String(value),\n address: String(value),\n };\n }\n\n const source = value as Record<string, unknown>;\n const lat = source['lat'];\n const lon = source['lon'] ?? source['lng'];\n const displayName =\n readString(source['display_name']) ??\n readString(source['displayName']) ??\n readString(source['address']) ??\n readString(source['name']);\n\n return {\n ...source,\n ...(displayName ? { display_name: displayName, address: displayName } : {}),\n ...(lat !== undefined ? { lat: lat as string | number } : {}),\n ...(lon !== undefined\n ? { lon: lon as string | number, lng: lon as string | number }\n : {}),\n };\n}\n\nexport function getLocationDisplayName(value: LocationValue | null): string {\n return value?.display_name?.trim() || value?.address?.trim() || '';\n}\n\nexport function getLocationLongitude(\n value: LocationValue | null,\n): string | number | undefined {\n return value?.lon ?? value?.lng;\n}\n\nfunction readString(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { Button } from '@masterteam/components/button';\nimport { ModalRef } from '@masterteam/components/dialog';\nimport { ModalService } from '@masterteam/components/modal';\nimport { NumberField } from '@masterteam/components/number-field';\nimport { TextField } from '@masterteam/components/text-field';\nimport {\n getLocationDisplayName,\n getLocationLongitude,\n LocationValue,\n normalizeLocationValue,\n} from './location-value';\n\n@Component({\n selector: 'mt-location-manual-dialog',\n imports: [ReactiveFormsModule, TranslocoPipe, Button, TextField, NumberField],\n templateUrl: './location-manual-dialog.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LocationManualDialog {\n readonly initialValue = input<LocationValue | null>(null);\n\n protected readonly modal = inject(ModalService);\n private readonly ref = inject(ModalRef);\n\n protected readonly form = new FormGroup({\n display_name: new FormControl('', {\n nonNullable: true,\n validators: [Validators.required],\n }),\n longitude: new FormControl<number | null>(null, {\n validators: [\n Validators.required,\n Validators.min(-180),\n Validators.max(180),\n ],\n }),\n latitude: new FormControl<number | null>(null, {\n validators: [\n Validators.required,\n Validators.min(-90),\n Validators.max(90),\n ],\n }),\n });\n\n constructor() {\n effect(() => {\n const value = normalizeLocationValue(this.initialValue());\n this.form.patchValue(\n {\n display_name: getLocationDisplayName(value),\n longitude: coerceNumber(getLocationLongitude(value)),\n latitude: coerceNumber(value?.lat),\n },\n { emitEvent: false },\n );\n });\n }\n\n protected cancel(): void {\n this.ref.close(null);\n }\n\n protected save(): void {\n if (this.form.invalid) {\n this.form.markAllAsTouched();\n return;\n }\n\n const raw = this.form.getRawValue();\n this.ref.close(\n normalizeLocationValue({\n display_name: raw.display_name,\n address: raw.display_name,\n lon: raw.longitude,\n lng: raw.longitude,\n lat: raw.latitude,\n }),\n );\n }\n}\n\nfunction coerceNumber(value: unknown): number | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n}\n","<form\n [formGroup]=\"form\"\n [class]=\"modal.contentClass + ' flex flex-col gap-4 p-4'\"\n>\n <mt-text-field\n [label]=\"'components.locationField.displayName' | transloco\"\n [placeholder]=\"'components.locationField.displayName' | transloco\"\n formControlName=\"display_name\"\n [required]=\"true\"\n />\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <mt-number-field\n [label]=\"'components.locationField.longitude' | transloco\"\n [placeholder]=\"'components.locationField.longitude' | transloco\"\n [min]=\"-180\"\n [max]=\"180\"\n formControlName=\"longitude\"\n [required]=\"true\"\n />\n <mt-number-field\n [label]=\"'components.locationField.latitude' | transloco\"\n [placeholder]=\"'components.locationField.latitude' | transloco\"\n [min]=\"-90\"\n [max]=\"90\"\n formControlName=\"latitude\"\n [required]=\"true\"\n />\n </div>\n</form>\n\n<div [class]=\"modal.footerClass\">\n <mt-button\n [label]=\"'components.locationField.cancel' | transloco\"\n variant=\"outlined\"\n (onClick)=\"cancel()\"\n />\n <mt-button\n [label]=\"'components.locationField.save' | transloco\"\n severity=\"primary\"\n [disabled]=\"form.invalid\"\n (onClick)=\"save()\"\n />\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { HttpBackend, HttpClient, HttpParams } from '@angular/common/http';\nimport {\n ControlValueAccessor,\n FormsModule,\n NgControl,\n Validators,\n} from '@angular/forms';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';\nimport { InputGroupModule } from 'primeng/inputgroup';\nimport { InputGroupAddonModule } from 'primeng/inputgroupaddon';\nimport {\n catchError,\n debounceTime,\n finalize,\n of,\n Subject,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport { FieldValidation } from '@masterteam/components/field-validation';\nimport { isInvalid } from '@masterteam/components';\nimport { Tooltip } from '@masterteam/components/tooltip';\nimport { ModalService } from '@masterteam/components/modal';\nimport { Icon } from '@masterteam/icons';\nimport { LocationManualDialog } from './location-manual-dialog';\nimport {\n getLocationDisplayName,\n LocationValue,\n normalizeLocationValue,\n} from './location-value';\n\nexport interface LocationFieldConfiguration {\n country?: string | { name?: string; code?: string; viewBox?: string };\n viewBox?: string;\n nominatimBaseUrl?: string;\n [key: string]: unknown;\n}\n\n@Component({\n selector: 'mt-location-field',\n imports: [\n FormsModule,\n AutoCompleteModule,\n InputGroupModule,\n InputGroupAddonModule,\n FieldValidation,\n Tooltip,\n Icon,\n TranslocoPipe,\n ],\n templateUrl: './location-field.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'grid gap-1',\n },\n})\nexport class LocationField implements ControlValueAccessor {\n readonly hint = input<string>();\n readonly label = input<string>();\n readonly placeholder = input<string>();\n readonly readonly = input<boolean>(false);\n readonly required = input<boolean>(false);\n readonly minLength = input<number>(2);\n readonly configuration = input<LocationFieldConfiguration | null>(null);\n readonly searchUrl = input<string | undefined>(\n 'https://nominatim.openstreetmap.org/search',\n );\n\n protected readonly value = signal<LocationValue | null>(null);\n protected readonly suggestions = signal<LocationValue[]>([]);\n protected readonly disabled = signal(false);\n protected readonly loading = signal(false);\n protected readonly requiredValidator = Validators.required;\n protected readonly autocomplete = viewChild<AutoComplete>('autocomplete');\n\n protected readonly displayValue = computed(() =>\n getLocationDisplayName(this.value()),\n );\n\n protected readonly resolvedSearchUrl = computed(() => {\n const configuredUrl = this.configuration()?.nominatimBaseUrl;\n return typeof configuredUrl === 'string' && configuredUrl.trim()\n ? configuredUrl\n : (this.searchUrl() ?? 'https://nominatim.openstreetmap.org/search');\n });\n\n protected readonly countryName = computed(() => {\n const country = this.configuration()?.country;\n if (typeof country === 'string') return country.trim();\n return country?.name?.trim() ?? '';\n });\n\n protected readonly countryCode = computed(() => {\n const country = this.configuration()?.country;\n if (typeof country === 'object') return country?.code?.trim() ?? '';\n return '';\n });\n\n protected readonly viewBox = computed(() => {\n const config = this.configuration();\n const country = config?.country;\n if (typeof config?.viewBox === 'string' && config.viewBox.trim()) {\n return config.viewBox;\n }\n if (typeof country === 'object' && country?.viewBox?.trim()) {\n return country.viewBox;\n }\n return '';\n });\n\n public ngControl: NgControl | null = null;\n protected readonly isInvalid = isInvalid;\n\n private readonly modal = inject(ModalService);\n private readonly transloco = inject(TranslocoService);\n private readonly http = new HttpClient(inject(HttpBackend));\n private readonly searchTerms = new Subject<string>();\n\n protected onTouched: () => void = () => {};\n private onModelChange: (value: LocationValue | null) => void = () => {};\n\n constructor() {\n this.ngControl = inject(NgControl, { self: true, optional: true });\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n effect(() => {\n if (this.ngControl?.control && this.required()) {\n this.ngControl.control.addValidators(Validators.required);\n this.ngControl.control.updateValueAndValidity({ emitEvent: false });\n }\n });\n\n this.searchTerms\n .pipe(\n takeUntilDestroyed(),\n debounceTime(250),\n tap(() => this.loading.set(true)),\n switchMap((term) => this.searchLocations(term)),\n )\n .subscribe((items) => this.suggestions.set(items));\n }\n\n protected search(event: { query: string }): void {\n this.searchTerms.next(event.query);\n }\n\n protected onFocus(): void {\n if (this.suggestions().length > 0) {\n this.autocomplete()?.show();\n }\n }\n\n protected onSelect(event: {\n originalEvent: Event;\n value: LocationValue;\n }): void {\n this.setValue(normalizeLocationValue(event.value));\n }\n\n protected onClear(): void {\n this.setValue(null);\n this.suggestions.set([]);\n }\n\n protected openManualDialog(): void {\n if (this.disabled() || this.readonly()) return;\n\n const ref = this.modal.openModal(LocationManualDialog, 'dialog', {\n header: this.transloco.translate('components.locationField.manualHeader'),\n styleClass: '!w-[40rem] max-w-[96vw]',\n dismissableMask: true,\n inputValues: {\n initialValue: this.value(),\n },\n });\n\n ref.onClose.pipe(take(1)).subscribe((result: unknown) => {\n const next = normalizeLocationValue(result);\n if (!next) return;\n this.setValue(next);\n });\n }\n\n writeValue(value: unknown): void {\n this.value.set(normalizeLocationValue(value));\n }\n\n registerOnChange(fn: (value: LocationValue | null) => void): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this.disabled.set(disabled);\n }\n\n private setValue(value: LocationValue | null): void {\n this.value.set(value);\n this.onModelChange(value);\n this.onTouched();\n }\n\n private searchLocations(term: string) {\n const trimmed = term?.trim();\n if (!trimmed || trimmed.length < this.minLength()) {\n this.loading.set(false);\n return of<LocationValue[]>([]);\n }\n\n const countryName = this.countryName();\n const query =\n countryName && !trimmed.toLowerCase().includes(countryName.toLowerCase())\n ? `${trimmed}, ${countryName}`\n : trimmed;\n\n let params = new HttpParams()\n .set('q', query)\n .set('format', 'json')\n .set('addressdetails', '1')\n .set('limit', '10')\n .set('accept-language', this.transloco.getActiveLang() || 'en');\n\n const viewBox = this.viewBox();\n if (viewBox) {\n params = params.set('bounded', '1').set('viewbox', viewBox);\n }\n\n const countryCode = this.countryCode();\n if (countryCode) {\n params = params.set('countrycodes', countryCode.toLowerCase());\n }\n\n return this.http.get<unknown[]>(this.resolvedSearchUrl(), { params }).pipe(\n finalize(() => this.loading.set(false)),\n catchError((error) => {\n console.error('Location search failed:', error);\n return of<unknown[]>([]);\n }),\n switchMap((items) =>\n of(\n items\n .map((item) => normalizeLocationValue(item))\n .filter((item): item is LocationValue => item !== null),\n ),\n ),\n );\n }\n}\n","@if (label() || hint()) {\n <div class=\"mb-1 flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >\n {{ label() }}\n </label>\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n\n<div class=\"relative\">\n <p-inputgroup>\n <p-autoComplete\n #autocomplete=\"\"\n [suggestions]=\"suggestions()\"\n (completeMethod)=\"search($event)\"\n (onSelect)=\"onSelect($event)\"\n (onClear)=\"onClear()\"\n (onFocus)=\"onFocus()\"\n (onBlur)=\"onTouched()\"\n [ngModel]=\"value()\"\n [disabled]=\"disabled() || readonly()\"\n [id]=\"ngControl?.name || label()\"\n [invalid]=\"isInvalid(ngControl?.control)\"\n [placeholder]=\"'components.locationField.search' | transloco\"\n [optionLabel]=\"'display_name'\"\n [minLength]=\"minLength()\"\n [forceSelection]=\"true\"\n class=\"w-full\"\n appendTo=\"body\"\n styleClass=\"w-full\"\n >\n <ng-template let-location pTemplate=\"item\">\n <div class=\"flex min-w-0 items-start gap-2\">\n <mt-icon icon=\"map.marker-pin-01\" class=\"mt-0.5 shrink-0 text-xl\" />\n <span class=\"min-w-0 text-wrap text-sm leading-5\">\n {{ location.display_name }}\n </span>\n </div>\n </ng-template>\n\n <ng-template let-location pTemplate=\"selecteditem\">\n <span class=\"min-w-0 truncate\">{{ location?.display_name }}</span>\n </ng-template>\n </p-autoComplete>\n\n <p-inputgroup-addon>\n <button\n type=\"button\"\n class=\"inline-flex h-full items-center justify-center text-surface-500 transition-colors hover:text-primary-500 disabled:cursor-not-allowed disabled:opacity-50\"\n [disabled]=\"disabled() || readonly()\"\n [mtTooltip]=\"'components.locationField.enterManually' | transloco\"\n tooltipPosition=\"top\"\n (click)=\"openManualDialog()\"\n >\n <mt-icon icon=\"general.edit-03\" />\n </button>\n </p-inputgroup-addon>\n </p-inputgroup>\n\n @if (loading()) {\n <mt-icon\n icon=\"general.loading-01\"\n class=\"absolute end-12 top-1/2 -translate-y-1/2 animate-spin bg-white\"\n />\n }\n</div>\n\n<mt-field-validation [control]=\"ngContro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AA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAChB,qBAAqB,oKACrB,eAAe,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACf,OAAO,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACP,IAAI,iEACJ,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAQJ,aAAa,EAAA,UAAA,EAAA,CAAA;kBAlBzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,OAAA,EACpB;wBACP,WAAW;wBACX,kBAAkB;wBAClB,gBAAgB;wBAChB,qBAAqB;wBACrB,eAAe;wBACf,OAAO;wBACP,IAAI;wBACJ,aAAa;qBACd,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,YAAY;AACpB,qBAAA,EAAA,QAAA,EAAA,qkFAAA,EAAA;02BAmByD,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEtF1E;;AAEG;;;;"}
|
|
@@ -75,13 +75,13 @@ class NumberField {
|
|
|
75
75
|
this.disabled.set(disabled);
|
|
76
76
|
}
|
|
77
77
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NumberField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NumberField, isStandalone: true, selector: "mt-number-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, pInputs: { classPropertyName: "pInputs", publicName: "pInputs", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, useGrouping: { classPropertyName: "useGrouping", publicName: "useGrouping", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.styleClass" }, classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "inputNumber", first: true, predicate: ["inputNumber"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "@if (label() || hint()) {\
|
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NumberField, isStandalone: true, selector: "mt-number-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, pInputs: { classPropertyName: "pInputs", publicName: "pInputs", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, useGrouping: { classPropertyName: "useGrouping", publicName: "useGrouping", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.styleClass" }, classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "inputNumber", first: true, predicate: ["inputNumber"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n<p-inputnumber\r\n #inputNumber\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [format]=\"format() || useGrouping()\"\r\n [useGrouping]=\"useGrouping()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [maxFractionDigits]=\"maxFractionDigits()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n styleClass=\"w-full\"\r\n inputStyleClass=\"w-full\"\r\n></p-inputnumber>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [":host p-inputNumber{display:block;width:100%}:host p-inputNumber input{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i2.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
79
|
}
|
|
80
80
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NumberField, decorators: [{
|
|
81
81
|
type: Component,
|
|
82
82
|
args: [{ selector: 'mt-number-field', standalone: true, imports: [FormsModule, InputNumberModule, FieldValidation, Tooltip, Icon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
83
83
|
class: 'grid gap-1',
|
|
84
|
-
}, template: "@if (label() || hint()) {\
|
|
84
|
+
}, template: "@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n<p-inputnumber\r\n #inputNumber\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [format]=\"format() || useGrouping()\"\r\n [useGrouping]=\"useGrouping()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [maxFractionDigits]=\"maxFractionDigits()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n styleClass=\"w-full\"\r\n inputStyleClass=\"w-full\"\r\n></p-inputnumber>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [":host p-inputNumber{display:block;width:100%}:host p-inputNumber input{width:100%}\n"] }]
|
|
85
85
|
}], ctorParameters: () => [], propDecorators: { inputNumber: [{
|
|
86
86
|
type: ViewChild,
|
|
87
87
|
args: ['inputNumber', { static: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-number-field.mjs","sources":["../../../../packages/masterteam/components/number-field/number-field.ts","../../../../packages/masterteam/components/number-field/number-field.html","../../../../packages/masterteam/components/number-field/masterteam-components-number-field.ts"],"sourcesContent":["import {\r\n Component,\r\n HostBinding,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n ViewChild,\r\n signal,\r\n input,\r\n inject,\r\n ChangeDetectionStrategy,\r\n effect,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { InputNumberModule, InputNumber } from 'primeng/inputnumber';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid } from '@masterteam/components';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\n\r\n@Component({\r\n selector: 'mt-number-field',\r\n standalone: true,\r\n imports: [FormsModule, InputNumberModule, FieldValidation, Tooltip, Icon],\r\n templateUrl: './number-field.html',\r\n styleUrls: ['./number-field.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid gap-1',\r\n },\r\n})\r\nexport class NumberField implements ControlValueAccessor, OnInit, OnChanges {\r\n @ViewChild('inputNumber', { static: true })\r\n inputNumber: InputNumber;\r\n\r\n readonly field = input<boolean>(true);\r\n readonly hint = input<string>();\r\n readonly label = input<string>();\r\n readonly placeholder = input<string>();\r\n readonly class = input<string>('');\r\n readonly readonly = input<boolean>(false);\r\n readonly pInputs = input<Partial<InputNumber>>();\r\n readonly format = input<boolean>(false);\r\n readonly useGrouping = input<boolean>(false);\r\n readonly maxFractionDigits = input<number>(2);\r\n // TODO: wait for primeng to allow undefined and remove these numbers\r\n readonly min = input<number>(-999999999999999);\r\n readonly max = input<number>(999999999999999);\r\n readonly required = input<boolean>(false);\r\n\r\n @HostBinding('class') styleClass: string;\r\n\r\n public ngControl = inject(NgControl, { self: true });\r\n\r\n isInvalid = isInvalid;\r\n\r\n requiredValidator = Validators.required;\r\n value = signal<number | null>(null);\r\n disabled = signal<boolean>(false);\r\n\r\n onTouched: () => void = () => {};\r\n onModelChange: (value: number | null) => void = () => {};\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n effect(() => {\r\n if (this.ngControl.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n applyInputsToInputNumber() {\r\n Object.assign(this.inputNumber, this.pInputs());\r\n }\r\n\r\n ngOnInit() {\r\n this.styleClass = this.class();\r\n if (this.pInputs()) {\r\n this.applyInputsToInputNumber();\r\n }\r\n }\r\n onValueChange(value: number | null) {\r\n this.onModelChange(value);\r\n this.value.set(value);\r\n }\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['pInputs']) {\r\n this.applyInputsToInputNumber();\r\n }\r\n }\r\n\r\n writeValue(value: number | null) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n}\r\n","@if (label() || hint()) {\r\n <div class=\"flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (hint()) {\r\n <span\r\n class=\"inline-flex text-surface-400\"\r\n [mtTooltip]=\"hint()\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n<p-inputnumber\r\n #inputNumber\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [format]=\"format() || useGrouping()\"\r\n [useGrouping]=\"useGrouping()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [maxFractionDigits]=\"maxFractionDigits()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n styleClass=\"w-full\"\r\n inputStyleClass=\"w-full\"\r\n></p-inputnumber>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAoCa,WAAW,CAAA;AAEtB,IAAA,WAAW;AAEF,IAAA,KAAK,GAAG,KAAK,CAAU,IAAI,4EAAC;IAC5B,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACtB,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACvB,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAC7B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAwB;AACvC,IAAA,MAAM,GAAG,KAAK,CAAU,KAAK,6EAAC;AAC9B,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,kFAAC;AACnC,IAAA,iBAAiB,GAAG,KAAK,CAAS,CAAC,wFAAC;;AAEpC,IAAA,GAAG,GAAG,KAAK,CAAS,CAAC,eAAe,0EAAC;AACrC,IAAA,GAAG,GAAG,KAAK,CAAS,eAAe,0EAAC;AACpC,IAAA,QAAQ,GAAG,KAA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E,IAAI,EAAE;;sBAkBzC,WAAW;uBAAC,OAAO;;;AEvDtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-number-field.mjs","sources":["../../../../packages/masterteam/components/number-field/number-field.ts","../../../../packages/masterteam/components/number-field/number-field.html","../../../../packages/masterteam/components/number-field/masterteam-components-number-field.ts"],"sourcesContent":["import {\r\n Component,\r\n HostBinding,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n ViewChild,\r\n signal,\n input,\n inject,\n ChangeDetectionStrategy,\n effect,\n} from '@angular/core';\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { InputNumberModule, InputNumber } from 'primeng/inputnumber';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid } from '@masterteam/components';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\n\r\n@Component({\r\n selector: 'mt-number-field',\r\n standalone: true,\r\n imports: [FormsModule, InputNumberModule, FieldValidation, Tooltip, Icon],\r\n templateUrl: './number-field.html',\r\n styleUrls: ['./number-field.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid gap-1',\r\n },\r\n})\r\nexport class NumberField implements ControlValueAccessor, OnInit, OnChanges {\r\n @ViewChild('inputNumber', { static: true })\r\n inputNumber: InputNumber;\r\n\r\n readonly field = input<boolean>(true);\n readonly hint = input<string>();\n readonly label = input<string>();\n readonly placeholder = input<string>();\r\n readonly class = input<string>('');\r\n readonly readonly = input<boolean>(false);\r\n readonly pInputs = input<Partial<InputNumber>>();\r\n readonly format = input<boolean>(false);\r\n readonly useGrouping = input<boolean>(false);\r\n readonly maxFractionDigits = input<number>(2);\r\n // TODO: wait for primeng to allow undefined and remove these numbers\r\n readonly min = input<number>(-999999999999999);\r\n readonly max = input<number>(999999999999999);\r\n readonly required = input<boolean>(false);\r\n\r\n @HostBinding('class') styleClass: string;\r\n\r\n public ngControl = inject(NgControl, { self: true });\r\n\r\n isInvalid = isInvalid;\r\n\r\n requiredValidator = Validators.required;\n value = signal<number | null>(null);\n disabled = signal<boolean>(false);\n\n onTouched: () => void = () => {};\n onModelChange: (value: number | null) => void = () => {};\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n effect(() => {\r\n if (this.ngControl.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n applyInputsToInputNumber() {\r\n Object.assign(this.inputNumber, this.pInputs());\r\n }\r\n\r\n ngOnInit() {\r\n this.styleClass = this.class();\r\n if (this.pInputs()) {\r\n this.applyInputsToInputNumber();\r\n }\r\n }\r\n onValueChange(value: number | null) {\r\n this.onModelChange(value);\r\n this.value.set(value);\r\n }\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['pInputs']) {\r\n this.applyInputsToInputNumber();\r\n }\r\n }\r\n\r\n writeValue(value: number | null) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n}\r\n","@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n<p-inputnumber\r\n #inputNumber\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [format]=\"format() || useGrouping()\"\r\n [useGrouping]=\"useGrouping()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [maxFractionDigits]=\"maxFractionDigits()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n styleClass=\"w-full\"\r\n inputStyleClass=\"w-full\"\r\n></p-inputnumber>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAoCa,WAAW,CAAA;AAEtB,IAAA,WAAW;AAEF,IAAA,KAAK,GAAG,KAAK,CAAU,IAAI,4EAAC;IAC5B,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACtB,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACvB,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAC7B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAwB;AACvC,IAAA,MAAM,GAAG,KAAK,CAAU,KAAK,6EAAC;AAC9B,IAAA,W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AuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,YAAY;AACpB,qBAAA,EAAA,QAAA,EAAA,muCAAA,EAAA,MAAA,EAAA,CAAA,sFAAA,CAAA,EAAA;;sBAGA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;sBAkBzC,WAAW;uBAAC,OAAO;;;AEvDtB;;AAEG;;;;"}
|
|
@@ -75,13 +75,13 @@ class RadioCardsField {
|
|
|
75
75
|
this.onTouched();
|
|
76
76
|
}
|
|
77
77
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: RadioCardsField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: RadioCardsField, isStandalone: true, selector: "mt-radio-cards-field", inputs: { circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, providers: [], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["option"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (label() || hint()) {\
|
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: RadioCardsField, isStandalone: true, selector: "mt-radio-cards-field", inputs: { circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, providers: [], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["option"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >{{ label() }}</label\n >\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n<div\n class=\"relative\"\n [class.opacity-50]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [id]=\"ngControl?.name || label()\"\n>\n <mt-radio-cards\n [options]=\"normalizedOptions()\"\n [activeId]=\"selectedId()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [circle]=\"circle()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [itemTemplate]=\"itemTemplate()\"\n ></mt-radio-cards>\n</div>\n\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: RadioCards, selector: "mt-radio-cards", inputs: ["circle", "color", "size", "columns", "options", "activeId", "itemTemplate"], outputs: ["optionsChange", "activeIdChange", "selectionChange"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
79
|
}
|
|
80
80
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: RadioCardsField, decorators: [{
|
|
81
81
|
type: Component,
|
|
82
82
|
args: [{ selector: 'mt-radio-cards-field', standalone: true, imports: [FormsModule, RadioCards, FieldValidation, Tooltip, Icon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
83
83
|
class: 'grid gap-1',
|
|
84
|
-
}, providers: [], template: "@if (label() || hint()) {\
|
|
84
|
+
}, providers: [], template: "@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >{{ label() }}</label\n >\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n<div\n class=\"relative\"\n [class.opacity-50]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [id]=\"ngControl?.name || label()\"\n>\n <mt-radio-cards\n [options]=\"normalizedOptions()\"\n [activeId]=\"selectedId()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [circle]=\"circle()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [itemTemplate]=\"itemTemplate()\"\n ></mt-radio-cards>\n</div>\n\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\n" }]
|
|
85
85
|
}], ctorParameters: () => [], propDecorators: { circle: [{ type: i0.Input, args: [{ isSignal: true, alias: "circle", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], itemTemplate: [{ type: i0.ContentChild, args: ['option', { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
86
86
|
function normalizeRadioItem(option, optionLabel, optionValue) {
|
|
87
87
|
if (option === null || option === undefined) {
|