@masterteam/components 0.0.271 → 0.0.273
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-business-fields.mjs +2 -2
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-date-field.mjs +6 -2
- package/fesm2022/masterteam-components-date-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-editor-field.mjs +6 -2
- package/fesm2022/masterteam-components-editor-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +2 -2
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-icon-field.mjs +6 -2
- package/fesm2022/masterteam-components-icon-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-location-field.mjs +6 -2
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-multi-select-field.mjs +6 -2
- package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-number-field.mjs +6 -2
- package/fesm2022/masterteam-components-number-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-pick-list-field.mjs +6 -2
- package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-button-field.mjs +6 -2
- package/fesm2022/masterteam-components-radio-button-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +6 -2
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +6 -2
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-slider-field.mjs +8 -1
- package/fesm2022/masterteam-components-slider-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +12 -3
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-text-field.mjs +7 -2
- package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-textarea-field.mjs +6 -2
- package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-treeselect-field.mjs +7 -1
- package/fesm2022/masterteam-components-treeselect-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +7 -2
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-slider-field.d.ts +5 -0
- package/types/masterteam-components-table.d.ts +10 -1
- package/types/masterteam-components-treeselect-field.d.ts +5 -0
|
@@ -139,12 +139,16 @@ class IconField {
|
|
|
139
139
|
.filter(Boolean))).join(' ');
|
|
140
140
|
}
|
|
141
141
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IconField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IconField, isStandalone: true, selector: "mt-icon-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, host: {
|
|
142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IconField, isStandalone: true, selector: "mt-icon-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.gap-1": "label()" }, classAttribute: "grid" }, ngImport: i0, template: "@if (label()) {\r\n <label\r\n (click)=\"dropdown.show(); dropdown.focus()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-select\r\n #dropdown\r\n [options]=\"icons\"\r\n [filter]=\"true\"\r\n filterBy=\"searchText\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n dataKey=\"key\"\r\n [inputId]=\"fieldId\"\r\n appendTo=\"body\"\r\n (onBlur)=\"onTouched()\"\r\n (ngModelChange)=\"onChangeIcon($event)\"\r\n [ngModel]=\"selectedIcon()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.iconField.selectIcon' | transloco\"\r\n styleClass=\"w-full\"\r\n panelStyleClass=\"icon-select-panel\"\r\n>\r\n <ng-template let-icon #selectedItem>\r\n @let iconKey = getIconKey(icon);\r\n @if (iconKey) {\r\n <div\r\n class=\"flex items-center justify-center text-2xl\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"iconKey\" />\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-center\">\r\n {{ \"components.iconField.selectIcon\" | transloco }}\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template let-icon #item>\r\n <div\r\n class=\"w-full h-full flex items-center justify-center text-lg\"\r\n [attr.aria-label]=\"getIconTooltip(icon)\"\r\n [title]=\"getIconTooltip(icon)\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"icon.key\" />\r\n </div>\r\n </ng-template>\r\n</p-select>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: ["::ng-deep .icon-select-panel{width:min(22rem,100vw - 2rem)}::ng-deep .icon-select-panel .p-select-filter-container{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2)}::ng-deep .icon-select-panel .p-select-list-container .p-select-list{display:grid;grid-template-columns:repeat(7,1fr);padding-inline:calc(var(--spacing) * 2);gap:.5rem}::ng-deep .icon-select-panel .p-select-list-container .p-select-list .p-select-option{padding:.25rem;border-radius:var(--p-select-option-border-radius);width:2.5rem;height:2.5rem}\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: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
143
143
|
}
|
|
144
144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IconField, decorators: [{
|
|
145
145
|
type: Component,
|
|
146
146
|
args: [{ selector: 'mt-icon-field', imports: [FormsModule, Select, Icon, FieldValidation, TranslocoPipe, Tooltip], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
147
|
-
class: 'grid
|
|
147
|
+
class: 'grid',
|
|
148
|
+
// The gap only separates the label from the control. With no label that row
|
|
149
|
+
// is not rendered, so the gap becomes dead space under the control and
|
|
150
|
+
// knocks it out of vertical alignment with sibling fields.
|
|
151
|
+
'[class.gap-1]': 'label()',
|
|
148
152
|
}, template: "@if (label()) {\r\n <label\r\n (click)=\"dropdown.show(); dropdown.focus()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-select\r\n #dropdown\r\n [options]=\"icons\"\r\n [filter]=\"true\"\r\n filterBy=\"searchText\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n dataKey=\"key\"\r\n [inputId]=\"fieldId\"\r\n appendTo=\"body\"\r\n (onBlur)=\"onTouched()\"\r\n (ngModelChange)=\"onChangeIcon($event)\"\r\n [ngModel]=\"selectedIcon()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.iconField.selectIcon' | transloco\"\r\n styleClass=\"w-full\"\r\n panelStyleClass=\"icon-select-panel\"\r\n>\r\n <ng-template let-icon #selectedItem>\r\n @let iconKey = getIconKey(icon);\r\n @if (iconKey) {\r\n <div\r\n class=\"flex items-center justify-center text-2xl\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"iconKey\" />\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-center\">\r\n {{ \"components.iconField.selectIcon\" | transloco }}\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template let-icon #item>\r\n <div\r\n class=\"w-full h-full flex items-center justify-center text-lg\"\r\n [attr.aria-label]=\"getIconTooltip(icon)\"\r\n [title]=\"getIconTooltip(icon)\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"icon.key\" />\r\n </div>\r\n </ng-template>\r\n</p-select>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: ["::ng-deep .icon-select-panel{width:min(22rem,100vw - 2rem)}::ng-deep .icon-select-panel .p-select-filter-container{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2)}::ng-deep .icon-select-panel .p-select-list-container .p-select-list{display:grid;grid-template-columns:repeat(7,1fr);padding-inline:calc(var(--spacing) * 2);gap:.5rem}::ng-deep .icon-select-panel .p-select-list-container .p-select-list .p-select-option{padding:.25rem;border-radius:var(--p-select-option-border-radius);width:2.5rem;height:2.5rem}\n"] }]
|
|
149
153
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
|
|
150
154
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-icon-field.mjs","sources":["../../../../packages/masterteam/components/icon-field/icon-field.ts","../../../../packages/masterteam/components/icon-field/icon-field.html","../../../../packages/masterteam/components/icon-field/masterteam-components-icon-field.ts"],"sourcesContent":["import {\r\n Component,\r\n signal,\r\n inject,\r\n input,\r\n ChangeDetectionStrategy,\r\n effect,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n FormControl,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { Select } from 'primeng/select';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport * as mtIcons from '@masterteam/icons/assets/select-icons.json';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid, newFieldId } from '@masterteam/components';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\n\r\nexport interface IconFieldOption {\r\n key: MTIcon;\r\n name: string;\r\n category: string;\r\n searchText: string;\r\n}\r\n\r\nconst ICON_SEARCH_ALIASES: Record<string, readonly string[]> = {\r\n add: ['plus', 'create', 'new'],\r\n alert: ['warning', 'notification'],\r\n approved: ['check', 'done', 'verified'],\r\n calendar: ['date', 'schedule'],\r\n chart: ['graph', 'analytics'],\r\n check: ['tick', 'done', 'approved'],\r\n clock: ['time'],\r\n cog: ['gear', 'settings', 'config'],\r\n config: ['settings', 'gear', 'cog'],\r\n dollar: ['money', 'finance', 'currency'],\r\n file: ['document'],\r\n folder: ['directory'],\r\n gear: ['settings', 'config', 'cog'],\r\n lg: ['large'],\r\n mail: ['email'],\r\n md: ['medium'],\r\n message: ['chat', 'comment'],\r\n minus: ['remove', 'subtract'],\r\n plus: ['add', 'create', 'new'],\r\n search: ['find', 'lookup'],\r\n settings: ['config', 'gear', 'cog'],\r\n sm: ['small'],\r\n sp: ['special'],\r\n trash: ['delete', 'remove'],\r\n user: ['person', 'profile'],\r\n users: ['team', 'group'],\r\n x: ['close', 'cancel', 'remove'],\r\n};\r\n\r\nconst ICON_DISPLAY_TOKEN_LABELS: Record<string, string> = {\r\n lg: 'large',\r\n md: 'medium',\r\n sm: 'small',\r\n};\r\n\r\n@Component({\r\n selector: 'mt-icon-field',\r\n imports: [FormsModule, Select, Icon, FieldValidation, TranslocoPipe, Tooltip],\r\n templateUrl: './icon-field.html',\r\n styleUrls: ['./icon-field.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid gap-1',\r\n },\r\n})\r\nexport class IconField implements ControlValueAccessor {\r\n readonly label = input<string>('');\r\n\r\n /** Unique; shared by the control and its <label for>. See src/lib/utils/field-id. */\r\n readonly fieldId = newFieldId('mt-icon-field');\r\n readonly required = input<boolean>(false);\r\n\r\n icons: IconFieldOption[] = ((mtIcons?.regular as MTIcon[]) ?? []).map(\r\n (icon) => this.createIconOption(icon),\r\n );\r\n selectedIcon = signal<MTIcon | null>(null);\r\n requiredValidator = Validators.required;\r\n\r\n public ngControl = inject(NgControl, { self: true, optional: true });\r\n\r\n isInvalid = isInvalid;\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n effect(() => {\r\n const control = this.ngControl?.control;\r\n if (control && this.required()) {\r\n control.addValidators(Validators.required);\r\n control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n protected onTouched: () => void = () => {};\r\n private onChange: (icon: MTIcon | null) => void = () => {};\r\n\r\n writeValue(value: MTIcon | null) {\r\n this.selectedIcon.set(value ?? null);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n onChangeIcon(icon: MTIcon | null) {\r\n this.selectedIcon.set(icon ?? null);\r\n this.onChange(icon ?? null);\r\n }\r\n\r\n public validate(c: FormControl) {\r\n return c.errors;\r\n }\r\n\r\n getIconKey(optionOrKey: IconFieldOption | MTIcon | null): MTIcon | null {\r\n if (!optionOrKey) return null;\r\n return typeof optionOrKey === 'string' ? optionOrKey : optionOrKey.key;\r\n }\r\n\r\n getIconTooltip(optionOrKey: IconFieldOption | MTIcon | null): string {\r\n if (!optionOrKey) return '';\r\n const icon =\r\n typeof optionOrKey === 'string'\r\n ? this.icons.find((item) => item.key === optionOrKey)\r\n : optionOrKey;\r\n\r\n return icon ? `${icon.name} (${icon.key})` : String(optionOrKey);\r\n }\r\n\r\n private createIconOption(icon: MTIcon): IconFieldOption {\r\n const [categoryKey = '', iconKey = icon] = icon.split('.', 2);\r\n const keyTokens = this.tokenize(iconKey);\r\n const category = this.toTitleCase(categoryKey);\r\n const name = keyTokens.map((token) => this.toTitleCase(token)).join(' ');\r\n const aliasTokens = keyTokens.flatMap(\r\n (token) => ICON_SEARCH_ALIASES[token] ?? [],\r\n );\r\n\r\n return {\r\n key: icon,\r\n name,\r\n category,\r\n searchText: this.normalizeSearchText([\r\n icon,\r\n categoryKey,\r\n category,\r\n iconKey,\r\n name,\r\n ...keyTokens,\r\n ...aliasTokens,\r\n ]),\r\n };\r\n }\r\n\r\n private tokenize(value: string): string[] {\r\n return value\r\n .split(/[^a-zA-Z0-9]+/)\r\n .map((token) => token.trim().toLowerCase())\r\n .filter(Boolean);\r\n }\r\n\r\n private toTitleCase(value: string): string {\r\n const normalized = ICON_DISPLAY_TOKEN_LABELS[value] ?? value;\r\n return normalized\r\n .split(/[^a-zA-Z0-9]+/)\r\n .filter(Boolean)\r\n .map(\r\n (part) =>\r\n `${part.charAt(0).toUpperCase()}${part.slice(1).toLowerCase()}`,\r\n )\r\n .join(' ');\r\n }\r\n\r\n private normalizeSearchText(values: readonly string[]): string {\r\n return Array.from(\r\n new Set(\r\n values\r\n .flatMap((value) => [value, ...this.tokenize(value)])\r\n .map((value) => value.trim().toLowerCase())\r\n .filter(Boolean),\r\n ),\r\n ).join(' ');\r\n }\r\n}\r\n","@if (label()) {\r\n <label\r\n (click)=\"dropdown.show(); dropdown.focus()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-select\r\n #dropdown\r\n [options]=\"icons\"\r\n [filter]=\"true\"\r\n filterBy=\"searchText\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n dataKey=\"key\"\r\n [inputId]=\"fieldId\"\r\n appendTo=\"body\"\r\n (onBlur)=\"onTouched()\"\r\n (ngModelChange)=\"onChangeIcon($event)\"\r\n [ngModel]=\"selectedIcon()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.iconField.selectIcon' | transloco\"\r\n styleClass=\"w-full\"\r\n panelStyleClass=\"icon-select-panel\"\r\n>\r\n <ng-template let-icon #selectedItem>\r\n @let iconKey = getIconKey(icon);\r\n @if (iconKey) {\r\n <div\r\n class=\"flex items-center justify-center text-2xl\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"iconKey\" />\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-center\">\r\n {{ \"components.iconField.selectIcon\" | transloco }}\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template let-icon #item>\r\n <div\r\n class=\"w-full h-full flex items-center justify-center text-lg\"\r\n [attr.aria-label]=\"getIconTooltip(icon)\"\r\n [title]=\"getIconTooltip(icon)\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"icon.key\" />\r\n </div>\r\n </ng-template>\r\n</p-select>\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":";;;;;;;;;;;;AA8BA,MAAM,mBAAmB,GAAsC;AAC7D,IAAA,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;AAC9B,IAAA,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;AAClC,IAAA,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC;AACvC,IAAA,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;AAC9B,IAAA,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;AAC7B,IAAA,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC;IACnC,KAAK,EAAE,CAAC,MAAM,CAAC;AACf,IAAA,GAAG,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC;AACnC,IAAA,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC;AACnC,IAAA,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;IACxC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,WAAW,CAAC;AACrB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AE,IAAI,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,CAAC,mBAG5D,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,YAAY;AACpB,qBAAA,EAAA,QAAA,EAAA,qxDAAA,EAAA,MAAA,EAAA,CAAA,iiBAAA,CAAA,EAAA;;;AE1EH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-icon-field.mjs","sources":["../../../../packages/masterteam/components/icon-field/icon-field.ts","../../../../packages/masterteam/components/icon-field/icon-field.html","../../../../packages/masterteam/components/icon-field/masterteam-components-icon-field.ts"],"sourcesContent":["import {\r\n Component,\r\n signal,\r\n inject,\r\n input,\r\n ChangeDetectionStrategy,\r\n effect,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n FormControl,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { Select } from 'primeng/select';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport * as mtIcons from '@masterteam/icons/assets/select-icons.json';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid, newFieldId } from '@masterteam/components';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\n\r\nexport interface IconFieldOption {\r\n key: MTIcon;\r\n name: string;\r\n category: string;\r\n searchText: string;\r\n}\r\n\r\nconst ICON_SEARCH_ALIASES: Record<string, readonly string[]> = {\r\n add: ['plus', 'create', 'new'],\r\n alert: ['warning', 'notification'],\r\n approved: ['check', 'done', 'verified'],\r\n calendar: ['date', 'schedule'],\r\n chart: ['graph', 'analytics'],\r\n check: ['tick', 'done', 'approved'],\r\n clock: ['time'],\r\n cog: ['gear', 'settings', 'config'],\r\n config: ['settings', 'gear', 'cog'],\r\n dollar: ['money', 'finance', 'currency'],\r\n file: ['document'],\r\n folder: ['directory'],\r\n gear: ['settings', 'config', 'cog'],\r\n lg: ['large'],\r\n mail: ['email'],\r\n md: ['medium'],\r\n message: ['chat', 'comment'],\r\n minus: ['remove', 'subtract'],\r\n plus: ['add', 'create', 'new'],\r\n search: ['find', 'lookup'],\r\n settings: ['config', 'gear', 'cog'],\r\n sm: ['small'],\r\n sp: ['special'],\r\n trash: ['delete', 'remove'],\r\n user: ['person', 'profile'],\r\n users: ['team', 'group'],\r\n x: ['close', 'cancel', 'remove'],\r\n};\r\n\r\nconst ICON_DISPLAY_TOKEN_LABELS: Record<string, string> = {\r\n lg: 'large',\r\n md: 'medium',\r\n sm: 'small',\r\n};\r\n\r\n@Component({\r\n selector: 'mt-icon-field',\r\n imports: [FormsModule, Select, Icon, FieldValidation, TranslocoPipe, Tooltip],\r\n templateUrl: './icon-field.html',\r\n styleUrls: ['./icon-field.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid',\r\n // The gap only separates the label from the control. With no label that row\r\n // is not rendered, so the gap becomes dead space under the control and\r\n // knocks it out of vertical alignment with sibling fields.\r\n '[class.gap-1]': 'label()',\r\n },\r\n})\r\nexport class IconField implements ControlValueAccessor {\r\n readonly label = input<string>('');\r\n\r\n /** Unique; shared by the control and its <label for>. See src/lib/utils/field-id. */\r\n readonly fieldId = newFieldId('mt-icon-field');\r\n readonly required = input<boolean>(false);\r\n\r\n icons: IconFieldOption[] = ((mtIcons?.regular as MTIcon[]) ?? []).map(\r\n (icon) => this.createIconOption(icon),\r\n );\r\n selectedIcon = signal<MTIcon | null>(null);\r\n requiredValidator = Validators.required;\r\n\r\n public ngControl = inject(NgControl, { self: true, optional: true });\r\n\r\n isInvalid = isInvalid;\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n effect(() => {\r\n const control = this.ngControl?.control;\r\n if (control && this.required()) {\r\n control.addValidators(Validators.required);\r\n control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n protected onTouched: () => void = () => {};\r\n private onChange: (icon: MTIcon | null) => void = () => {};\r\n\r\n writeValue(value: MTIcon | null) {\r\n this.selectedIcon.set(value ?? null);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n onChangeIcon(icon: MTIcon | null) {\r\n this.selectedIcon.set(icon ?? null);\r\n this.onChange(icon ?? null);\r\n }\r\n\r\n public validate(c: FormControl) {\r\n return c.errors;\r\n }\r\n\r\n getIconKey(optionOrKey: IconFieldOption | MTIcon | null): MTIcon | null {\r\n if (!optionOrKey) return null;\r\n return typeof optionOrKey === 'string' ? optionOrKey : optionOrKey.key;\r\n }\r\n\r\n getIconTooltip(optionOrKey: IconFieldOption | MTIcon | null): string {\r\n if (!optionOrKey) return '';\r\n const icon =\r\n typeof optionOrKey === 'string'\r\n ? this.icons.find((item) => item.key === optionOrKey)\r\n : optionOrKey;\r\n\r\n return icon ? `${icon.name} (${icon.key})` : String(optionOrKey);\r\n }\r\n\r\n private createIconOption(icon: MTIcon): IconFieldOption {\r\n const [categoryKey = '', iconKey = icon] = icon.split('.', 2);\r\n const keyTokens = this.tokenize(iconKey);\r\n const category = this.toTitleCase(categoryKey);\r\n const name = keyTokens.map((token) => this.toTitleCase(token)).join(' ');\r\n const aliasTokens = keyTokens.flatMap(\r\n (token) => ICON_SEARCH_ALIASES[token] ?? [],\r\n );\r\n\r\n return {\r\n key: icon,\r\n name,\r\n category,\r\n searchText: this.normalizeSearchText([\r\n icon,\r\n categoryKey,\r\n category,\r\n iconKey,\r\n name,\r\n ...keyTokens,\r\n ...aliasTokens,\r\n ]),\r\n };\r\n }\r\n\r\n private tokenize(value: string): string[] {\r\n return value\r\n .split(/[^a-zA-Z0-9]+/)\r\n .map((token) => token.trim().toLowerCase())\r\n .filter(Boolean);\r\n }\r\n\r\n private toTitleCase(value: string): string {\r\n const normalized = ICON_DISPLAY_TOKEN_LABELS[value] ?? value;\r\n return normalized\r\n .split(/[^a-zA-Z0-9]+/)\r\n .filter(Boolean)\r\n .map(\r\n (part) =>\r\n `${part.charAt(0).toUpperCase()}${part.slice(1).toLowerCase()}`,\r\n )\r\n .join(' ');\r\n }\r\n\r\n private normalizeSearchText(values: readonly string[]): string {\r\n return Array.from(\r\n new Set(\r\n values\r\n .flatMap((value) => [value, ...this.tokenize(value)])\r\n .map((value) => value.trim().toLowerCase())\r\n .filter(Boolean),\r\n ),\r\n ).join(' ');\r\n }\r\n}\r\n","@if (label()) {\r\n <label\r\n (click)=\"dropdown.show(); dropdown.focus()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-select\r\n #dropdown\r\n [options]=\"icons\"\r\n [filter]=\"true\"\r\n filterBy=\"searchText\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n dataKey=\"key\"\r\n [inputId]=\"fieldId\"\r\n appendTo=\"body\"\r\n (onBlur)=\"onTouched()\"\r\n (ngModelChange)=\"onChangeIcon($event)\"\r\n [ngModel]=\"selectedIcon()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.iconField.selectIcon' | transloco\"\r\n styleClass=\"w-full\"\r\n panelStyleClass=\"icon-select-panel\"\r\n>\r\n <ng-template let-icon #selectedItem>\r\n @let iconKey = getIconKey(icon);\r\n @if (iconKey) {\r\n <div\r\n class=\"flex items-center justify-center text-2xl\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"iconKey\" />\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-center\">\r\n {{ \"components.iconField.selectIcon\" | transloco }}\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template let-icon #item>\r\n <div\r\n class=\"w-full h-full flex items-center justify-center text-lg\"\r\n [attr.aria-label]=\"getIconTooltip(icon)\"\r\n [title]=\"getIconTooltip(icon)\"\r\n [mtTooltip]=\"getIconTooltip(icon)\"\r\n tooltipPosition=\"top\"\r\n appendTo=\"body\"\r\n >\r\n <mt-icon [icon]=\"icon.key\" />\r\n </div>\r\n </ng-template>\r\n</p-select>\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":";;;;;;;;;;;;AA8BA,MAAM,mBAAmB,GAAsC;AAC7D,IAAA,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;AAC9B,IAAA,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;AAClC,IAAA,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC;AACvC,IAAA,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;AAC9B,IAAA,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;AAC7B,IAAA,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC;IACnC,KAAK,EAAE,CAAC,MAAM,CAAC;AACf,IAAA,GAAG,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC;AACnC,IAAA,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC;AACnC,IAAA,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;IACxC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,WAAW,CAAC;AACrB,IAAA,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC;IACnC,EAAE,EAAE,CAAC,OAAO,CAAC;IACb,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,EAAE,EAAE,CAAC,QAAQ,CAAC;AACd,IAAA,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;AAC5B,IAAA,KAAK,E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A,qxDAAA,EAAA,MAAA,EAAA,CAAA,iiBAAA,CAAA,EAAA;;;AE9EH;;AAEG;;;;"}
|
|
@@ -579,7 +579,7 @@ class LocationField {
|
|
|
579
579
|
return normalized === 'places/search';
|
|
580
580
|
}
|
|
581
581
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
582
|
-
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 }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: {
|
|
582
|
+
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 }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.gap-1": "label() || hint()" }, classAttribute: "grid" }, viewQueries: [{ propertyName: "autocomplete", first: true, predicate: ["autocomplete"], descendants: true, isSignal: true }], ngImport: i0, template: "@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]=\"fieldId\"\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)=\"onBlur()\"\r\n [ngModel]=\"value()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [id]=\"fieldId\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.locationField.search' | transloco\"\r\n [optionLabel]=\"'display_name'\"\r\n [minLength]=\"minLength()\"\r\n [showEmptyMessage]=\"false\"\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\r\n class=\"flex min-w-0 items-start gap-2\"\r\n (pointerdown)=\"onSuggestionPointerDown()\"\r\n >\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 @if (loading()) {\r\n <p-inputgroup-addon>\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin text-surface-500\"\r\n />\r\n </p-inputgroup-addon>\r\n }\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</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\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", "messageId"] }, { 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 });
|
|
583
583
|
}
|
|
584
584
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LocationField, decorators: [{
|
|
585
585
|
type: Component,
|
|
@@ -593,7 +593,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
593
593
|
Icon,
|
|
594
594
|
TranslocoPipe,
|
|
595
595
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
596
|
-
class: 'grid
|
|
596
|
+
class: 'grid',
|
|
597
|
+
// The gap only separates the label row from the control. With no label and
|
|
598
|
+
// no hint that row is not rendered, so the gap becomes dead space under the
|
|
599
|
+
// control and knocks it out of vertical alignment with sibling fields.
|
|
600
|
+
'[class.gap-1]': 'label() || hint()',
|
|
597
601
|
}, template: "@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]=\"fieldId\"\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)=\"onBlur()\"\r\n [ngModel]=\"value()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [id]=\"fieldId\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.locationField.search' | transloco\"\r\n [optionLabel]=\"'display_name'\"\r\n [minLength]=\"minLength()\"\r\n [showEmptyMessage]=\"false\"\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\r\n class=\"flex min-w-0 items-start gap-2\"\r\n (pointerdown)=\"onSuggestionPointerDown()\"\r\n >\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 @if (loading()) {\r\n <p-inputgroup-addon>\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin text-surface-500\"\r\n />\r\n </p-inputgroup-addon>\r\n }\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</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n" }]
|
|
598
602
|
}], 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 }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }], autocomplete: [{ type: i0.ViewChild, args: ['autocomplete', { isSignal: true }] }] } });
|
|
599
603
|
|
|
@@ -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 OnDestroy,\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 { DOCUMENT } from '@angular/common';\r\nimport {\r\n HttpBackend,\r\n HttpClient,\r\n HttpContext,\r\n HttpParams,\r\n} 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, REQUEST_CONTEXT, newFieldId } 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\nconst BLUR_CLEANUP_DELAY_MS = 150;\r\nconst SUGGESTION_POINTER_BLUR_CLEANUP_DELAY_MS = 750;\r\nconst DIRECT_NOMINATIM_HOST = 'nominatim.openstreetmap.org';\r\n\r\nexport interface LocationFieldConfiguration {\r\n country?: string | { name?: string; code?: string; viewBox?: string };\r\n viewBox?: string;\r\n /** Gateway places-search path, overrides the default `searchUrl`. */\r\n searchUrl?: string;\r\n /**\r\n * Nominatim-compatible geocoding endpoint. Prefer `searchUrl` for Gateway\r\n * places search; this remains for existing proxy/direct Nominatim callers.\r\n */\r\n nominatimBaseUrl?: string;\r\n geocodingUrl?: string;\r\n endpoint?: string;\r\n /**\r\n * Defaults to true for backend/proxy URLs and false for public Nominatim.\r\n * Set explicitly only when a host needs to override that routing.\r\n */\r\n useInterceptors?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** Gateway `/api/places/search` response envelope (the bits we consume). */\r\ninterface PlacesSearchResponse {\r\n data?: {\r\n items?: PlacesSearchItem[];\r\n attribution?: string | null;\r\n } | null;\r\n}\r\n\r\ninterface PlacesSearchItem {\r\n id?: string;\r\n displayName?: string;\r\n latitude?: number;\r\n longitude?: number;\r\n countryCode?: string | null;\r\n address?: Record<string, unknown> | null;\r\n provider?: string;\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, OnDestroy {\r\n readonly hint = input<string>();\r\n readonly label = input<string>();\r\n\r\n /** Unique; shared by the control and its <label for>. See src/lib/utils/field-id. */\r\n readonly fieldId = newFieldId('mt-location-field');\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 | string | null>(\r\n null,\r\n );\r\n /** Gateway places-search endpoint. Resolved through the app's HTTP\r\n * interceptor, which attaches the gateway base URL and session token. */\r\n readonly searchUrl = input<string | undefined>('places/search');\r\n /** HTTP context the consuming app uses to route this call to gateway scope\r\n * (so the GatewaySession bearer token is attached). */\r\n readonly context = input<HttpContext | undefined>(undefined);\r\n\r\n /** Default routing context when the consumer doesn't pass one: route the\r\n * places search to the gateway API base (not the per-application base) so it\r\n * resolves to `{gatewayApiBaseUrl}/places/search` with the GatewaySession\r\n * bearer token. The app's gateway-auth interceptor reads\r\n * `REQUEST_CONTEXT.useBaseUrl` to pick the gateway base + token. */\r\n private readonly gatewayRequestContext = new HttpContext().set(\r\n REQUEST_CONTEXT,\r\n { useBaseUrl: true },\r\n );\r\n\r\n protected readonly value = signal<LocationValue | null>(null);\r\n protected readonly suggestions = signal<LocationValue[]>([]);\r\n protected readonly attribution = signal<string>('');\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 normalizedConfiguration = computed(() =>\r\n this.normalizeConfiguration(this.configuration()),\r\n );\r\n\r\n protected readonly resolvedSearchUrl = computed(() => {\r\n const config = this.normalizedConfiguration();\r\n const configuredUrl =\r\n this.readConfiguredUrl(config?.searchUrl) ??\r\n this.readConfiguredUrl(config?.geocodingUrl) ??\r\n this.readConfiguredUrl(config?.endpoint) ??\r\n this.readConfiguredUrl(config?.nominatimBaseUrl);\r\n\r\n return configuredUrl ?? this.searchUrl()?.trim() ?? 'places/search';\r\n });\r\n\r\n protected readonly countryName = computed(() => {\r\n const country = this.normalizedConfiguration()?.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.normalizedConfiguration()?.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.normalizedConfiguration();\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 document = inject(DOCUMENT);\r\n private readonly http = inject(HttpClient);\r\n private readonly rawHttp = new HttpClient(inject(HttpBackend));\r\n private readonly searchTerms = new Subject<string>();\r\n\r\n /**\r\n * Bumped every time a value is committed (select / manual entry / clear /\r\n * external write). A blur cleanup scheduled before a commit is ignored once\r\n * it fires, preventing it from undoing a value selected in the meantime.\r\n */\r\n private committedValueVersion = 0;\r\n private blurCleanupHandle: ReturnType<typeof setTimeout> | null = null;\r\n private inputFocused = false;\r\n private suggestionPointerActive = false;\r\n private hasUncommittedSearchText = false;\r\n private ignoreSearchResultsUntilNextSearch = false;\r\n\r\n private readonly handleDocumentPointerDown = (event: PointerEvent): void => {\r\n if (this.isOwnAutocompleteOption(event.target)) {\r\n this.onSuggestionPointerDown();\r\n }\r\n };\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.document.addEventListener(\r\n 'pointerdown',\r\n this.handleDocumentPointerDown,\r\n true,\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) => {\r\n if (!this.inputFocused || this.ignoreSearchResultsUntilNextSearch) {\r\n this.suggestions.set([]);\r\n return;\r\n }\r\n\r\n this.suggestions.set(items);\r\n if (items.length) {\r\n queueMicrotask(() => this.autocomplete()?.show());\r\n }\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.cancelPendingBlurCleanup();\r\n this.document.removeEventListener(\r\n 'pointerdown',\r\n this.handleDocumentPointerDown,\r\n true,\r\n );\r\n }\r\n\r\n /**\r\n * Fired by PrimeNG on every keystroke. Pushes the typed term into the\r\n * debounced search stream so results load as the user types (mirrors\r\n * `user-search-field`). The 250ms `debounceTime` + `minLength` guard keep the\r\n * request rate low.\r\n */\r\n protected search(event: { query: string }): void {\r\n this.inputFocused = true;\r\n this.ignoreSearchResultsUntilNextSearch = false;\r\n\r\n const query = event.query ?? '';\r\n const trimmed = query.trim();\r\n const committedName = getLocationDisplayName(this.value()).trim();\r\n this.hasUncommittedSearchText = !!trimmed && committedName !== trimmed;\r\n\r\n this.searchTerms.next(query);\r\n }\r\n\r\n protected onFocus(): void {\r\n this.inputFocused = true;\r\n const autocomplete = this.autocomplete();\r\n if (!autocomplete) return;\r\n\r\n const inputEl = this.getInputElement(autocomplete);\r\n const typed = (inputEl?.value ?? '').trim();\r\n if (!typed) {\r\n this.suggestions.set([]);\r\n return;\r\n }\r\n\r\n // A committed location's name is showing — don't reopen the list for it.\r\n const committedName = getLocationDisplayName(this.value()).trim();\r\n if (committedName && committedName === typed) {\r\n return;\r\n }\r\n\r\n // Resume an in-progress search: re-show the retained suggestions\r\n // immediately, or re-run the search when the list was dropped in the\r\n // meantime so the options come back where the user left off.\r\n if (this.suggestions().length > 0) {\r\n autocomplete.show();\r\n } else {\r\n this.ignoreSearchResultsUntilNextSearch = false;\r\n this.hasUncommittedSearchText = true;\r\n this.searchTerms.next(typed);\r\n }\r\n }\r\n\r\n protected onBlur(): void {\r\n this.onTouched();\r\n this.inputFocused = false;\r\n\r\n const autocomplete = this.autocomplete();\r\n if (!autocomplete) return;\r\n\r\n const inputEl = this.getInputElement(autocomplete);\r\n const typed = (inputEl?.value ?? '').trim();\r\n const committedValueVersion = this.committedValueVersion;\r\n\r\n this.cancelPendingBlurCleanup();\r\n\r\n // A pointerdown on a suggestion fires before its (onSelect); give that\r\n // selection extra time to land before the blur cleanup runs.\r\n const cleanupDelay = this.suggestionPointerActive\r\n ? SUGGESTION_POINTER_BLUR_CLEANUP_DELAY_MS\r\n : BLUR_CLEANUP_DELAY_MS;\r\n\r\n this.blurCleanupHandle = setTimeout(() => {\r\n this.blurCleanupHandle = null;\r\n this.resetUncommittedSearch(autocomplete, typed, committedValueVersion);\r\n }, cleanupDelay);\r\n }\r\n\r\n protected onSelect(event: {\r\n originalEvent: Event;\r\n value: LocationValue;\r\n }): void {\r\n this.cancelPendingBlurCleanup();\r\n this.suggestionPointerActive = false;\r\n\r\n this.inputFocused = false;\r\n this.ignoreSearchResultsUntilNextSearch = true;\r\n this.hasUncommittedSearchText = false;\r\n this.commitValue(normalizeLocationValue(event.value));\r\n this.suggestions.set([]);\r\n this.autocomplete()?.hide();\r\n this.loading.set(false);\r\n }\r\n\r\n protected onClear(): void {\r\n this.cancelPendingBlurCleanup();\r\n this.suggestionPointerActive = false;\r\n\r\n this.inputFocused = false;\r\n this.ignoreSearchResultsUntilNextSearch = true;\r\n this.hasUncommittedSearchText = false;\r\n this.commitValue(null);\r\n this.suggestions.set([]);\r\n this.attribution.set('');\r\n this.loading.set(false);\r\n }\r\n\r\n protected onSuggestionPointerDown(): void {\r\n this.suggestionPointerActive = true;\r\n this.cancelPendingBlurCleanup();\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\r\n this.cancelPendingBlurCleanup();\r\n this.suggestionPointerActive = false;\r\n this.inputFocused = false;\r\n this.ignoreSearchResultsUntilNextSearch = true;\r\n this.hasUncommittedSearchText = false;\r\n this.commitValue(next);\r\n this.suggestions.set([]);\r\n this.loading.set(false);\r\n this.autocomplete()?.hide();\r\n });\r\n }\r\n\r\n writeValue(value: unknown): void {\r\n this.value.set(normalizeLocationValue(value));\r\n this.committedValueVersion++;\r\n this.hasUncommittedSearchText = false;\r\n this.ignoreSearchResultsUntilNextSearch = false;\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 commitValue(value: LocationValue | null): void {\r\n this.value.set(value);\r\n this.committedValueVersion++;\r\n this.onModelChange(value);\r\n this.onTouched();\r\n }\r\n\r\n private isOwnAutocompleteOption(target: EventTarget | null): boolean {\r\n const defaultView = this.document.defaultView;\r\n if (!defaultView || !(target instanceof defaultView.Element)) return false;\r\n\r\n const autocompleteId = this.autocomplete()?.id;\r\n if (!autocompleteId) return false;\r\n\r\n const option = target.closest('[role=\"option\"]');\r\n const listbox = option?.closest('[role=\"listbox\"]');\r\n\r\n return listbox?.id === `${autocompleteId}_list`;\r\n }\r\n\r\n private getInputElement(autocomplete: AutoComplete): HTMLInputElement | null {\r\n return autocomplete.inputEL?.nativeElement ?? null;\r\n }\r\n\r\n private cancelPendingBlurCleanup(): void {\r\n if (this.blurCleanupHandle === null) return;\r\n\r\n clearTimeout(this.blurCleanupHandle);\r\n this.blurCleanupHandle = null;\r\n }\r\n\r\n /**\r\n * On blur, reconcile the free-typed input text with the committed value:\r\n * a selected location keeps showing its display name; an in-progress search\r\n * (typed text with no matching selection) keeps its text AND its fetched\r\n * suggestions so refocusing the field resumes it; an empty field is cleared.\r\n * This replaces PrimeNG `forceSelection`, which raced with async suggestions.\r\n */\r\n private resetUncommittedSearch(\r\n autocomplete: AutoComplete,\r\n typedOnBlur: string,\r\n committedValueVersionOnBlur: number,\r\n ): void {\r\n this.suggestionPointerActive = false;\r\n\r\n if (committedValueVersionOnBlur !== this.committedValueVersion) return;\r\n\r\n const inputEl = this.getInputElement(autocomplete);\r\n const typed = typedOnBlur.trim();\r\n const current = this.value();\r\n const currentName = getLocationDisplayName(current).trim();\r\n\r\n // A committed location is showing and nothing was typed over it: normalize\r\n // the input back to its name and drop the stale list.\r\n if (current && !this.hasUncommittedSearchText) {\r\n this.writeInput(inputEl, currentName);\r\n this.clearSearchState(autocomplete);\r\n return;\r\n }\r\n\r\n // Typed text exactly matches the committed location — keep it.\r\n if (typed && currentName === typed) {\r\n this.clearSearchState(autocomplete);\r\n this.hasUncommittedSearchText = false;\r\n return;\r\n }\r\n\r\n // In-progress search text that isn't a committed location: preserve the\r\n // typed text and the fetched suggestions so onFocus can resume the search.\r\n // Only close the overlay — don't wipe the input or the list.\r\n if (typed) {\r\n this.writeInput(inputEl, typedOnBlur);\r\n this.loading.set(false);\r\n autocomplete.hide();\r\n return;\r\n }\r\n\r\n // Empty input: clear any leftover value and search state.\r\n if (current) {\r\n this.commitValue(null);\r\n }\r\n this.clearInput(inputEl);\r\n this.clearSearchState(autocomplete);\r\n this.hasUncommittedSearchText = false;\r\n }\r\n\r\n private clearInput(inputEl: HTMLInputElement | null): void {\r\n this.writeInput(inputEl, '');\r\n }\r\n\r\n private writeInput(inputEl: HTMLInputElement | null, value: string): void {\r\n if (inputEl) {\r\n inputEl.value = value;\r\n }\r\n }\r\n\r\n private clearSearchState(autocomplete: AutoComplete): void {\r\n this.suggestions.set([]);\r\n this.loading.set(false);\r\n autocomplete.hide();\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('language', this.transloco.getActiveLang() || 'en')\r\n .set('limit', '10');\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 const url = this.resolvedSearchUrl();\r\n const viewBox = this.viewBox();\r\n if (viewBox) {\r\n params = params.set('viewbox', viewBox);\r\n }\r\n\r\n return this.getHttpClientForUrl(url)\r\n .get<PlacesSearchResponse | unknown[]>(url, {\r\n params,\r\n context: this.getHttpContextForUrl(url),\r\n })\r\n .pipe(\r\n finalize(() => this.loading.set(false)),\r\n catchError((error) => {\r\n console.error('Location search failed:', error);\r\n this.attribution.set('');\r\n return of<PlacesSearchResponse | unknown[]>({ data: { items: [] } });\r\n }),\r\n switchMap((response) => {\r\n if (Array.isArray(response)) {\r\n this.attribution.set('');\r\n return of(\r\n response\r\n .map((item) => normalizeLocationValue(item))\r\n .filter((item): item is LocationValue => item !== null),\r\n );\r\n }\r\n\r\n this.attribution.set(response?.data?.attribution?.trim() ?? '');\r\n const items = response?.data?.items ?? [];\r\n return of(\r\n items\r\n .map((item) => normalizeLocationValue(this.toLocationValue(item)))\r\n .filter((item): item is LocationValue => item !== null),\r\n );\r\n }),\r\n );\r\n }\r\n\r\n /** Map a Gateway places item onto the shape `normalizeLocationValue` reads\r\n * (it expects `lat`/`lon`, the gateway returns `latitude`/`longitude`). */\r\n private toLocationValue(item: PlacesSearchItem): Record<string, unknown> {\r\n return {\r\n ...item,\r\n lat: item.latitude,\r\n lon: item.longitude,\r\n };\r\n }\r\n\r\n private normalizeConfiguration(\r\n value: LocationFieldConfiguration | string | null,\r\n ): LocationFieldConfiguration | null {\r\n if (!value) return null;\r\n if (typeof value === 'object') return value;\r\n\r\n const trimmed = value.trim();\r\n if (!trimmed) return null;\r\n\r\n try {\r\n const parsed = JSON.parse(trimmed) as unknown;\r\n return parsed && typeof parsed === 'object'\r\n ? (parsed as LocationFieldConfiguration)\r\n : null;\r\n } catch {\r\n return { nominatimBaseUrl: trimmed };\r\n }\r\n }\r\n\r\n private readConfiguredUrl(value: unknown): string | undefined {\r\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\r\n }\r\n\r\n private getHttpClientForUrl(url: string): HttpClient {\r\n return this.shouldBypassInterceptors(url) ? this.rawHttp : this.http;\r\n }\r\n\r\n private getHttpContextForUrl(url: string): HttpContext | undefined {\r\n const explicitContext = this.context();\r\n if (explicitContext) return explicitContext;\r\n return this.isDefaultGatewayPlacesUrl(url)\r\n ? this.gatewayRequestContext\r\n : undefined;\r\n }\r\n\r\n private shouldBypassInterceptors(url: string): boolean {\r\n const config = this.normalizedConfiguration();\r\n if (typeof config?.useInterceptors === 'boolean') {\r\n return !config.useInterceptors;\r\n }\r\n\r\n try {\r\n const parsed = new URL(url, this.document.baseURI);\r\n return parsed.hostname === DIRECT_NOMINATIM_HOST;\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n private isDefaultGatewayPlacesUrl(url: string): boolean {\r\n const normalized = url.trim().replace(/^\\/+/, '').toLowerCase();\r\n return normalized === 'places/search';\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]=\"fieldId\"\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)=\"onBlur()\"\r\n [ngModel]=\"value()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [id]=\"fieldId\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.locationField.search' | transloco\"\r\n [optionLabel]=\"'display_name'\"\r\n [minLength]=\"minLength()\"\r\n [showEmptyMessage]=\"false\"\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\r\n class=\"flex min-w-0 items-start gap-2\"\r\n (pointerdown)=\"onSuggestionPointerDown()\"\r\n >\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 @if (loading()) {\r\n <p-inputgroup-addon>\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin text-surface-500\"\r\n />\r\n </p-inputgroup-addon>\r\n }\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</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,K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AAA,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,m0FAAA,EAAA;w8BAsCyD,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnJ1E;;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 {\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 OnDestroy,\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 { DOCUMENT } from '@angular/common';\r\nimport {\r\n HttpBackend,\r\n HttpClient,\r\n HttpContext,\r\n HttpParams,\r\n} 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, REQUEST_CONTEXT, newFieldId } 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\nconst BLUR_CLEANUP_DELAY_MS = 150;\r\nconst SUGGESTION_POINTER_BLUR_CLEANUP_DELAY_MS = 750;\r\nconst DIRECT_NOMINATIM_HOST = 'nominatim.openstreetmap.org';\r\n\r\nexport interface LocationFieldConfiguration {\r\n country?: string | { name?: string; code?: string; viewBox?: string };\r\n viewBox?: string;\r\n /** Gateway places-search path, overrides the default `searchUrl`. */\r\n searchUrl?: string;\r\n /**\r\n * Nominatim-compatible geocoding endpoint. Prefer `searchUrl` for Gateway\r\n * places search; this remains for existing proxy/direct Nominatim callers.\r\n */\r\n nominatimBaseUrl?: string;\r\n geocodingUrl?: string;\r\n endpoint?: string;\r\n /**\r\n * Defaults to true for backend/proxy URLs and false for public Nominatim.\r\n * Set explicitly only when a host needs to override that routing.\r\n */\r\n useInterceptors?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** Gateway `/api/places/search` response envelope (the bits we consume). */\r\ninterface PlacesSearchResponse {\r\n data?: {\r\n items?: PlacesSearchItem[];\r\n attribution?: string | null;\r\n } | null;\r\n}\r\n\r\ninterface PlacesSearchItem {\r\n id?: string;\r\n displayName?: string;\r\n latitude?: number;\r\n longitude?: number;\r\n countryCode?: string | null;\r\n address?: Record<string, unknown> | null;\r\n provider?: string;\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',\r\n // The gap only separates the label row from the control. With no label and\r\n // no hint that row is not rendered, so the gap becomes dead space under the\r\n // control and knocks it out of vertical alignment with sibling fields.\r\n '[class.gap-1]': 'label() || hint()',\r\n },\r\n})\r\nexport class LocationField implements ControlValueAccessor, OnDestroy {\r\n readonly hint = input<string>();\r\n readonly label = input<string>();\r\n\r\n /** Unique; shared by the control and its <label for>. See src/lib/utils/field-id. */\r\n readonly fieldId = newFieldId('mt-location-field');\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 | string | null>(\r\n null,\r\n );\r\n /** Gateway places-search endpoint. Resolved through the app's HTTP\r\n * interceptor, which attaches the gateway base URL and session token. */\r\n readonly searchUrl = input<string | undefined>('places/search');\r\n /** HTTP context the consuming app uses to route this call to gateway scope\r\n * (so the GatewaySession bearer token is attached). */\r\n readonly context = input<HttpContext | undefined>(undefined);\r\n\r\n /** Default routing context when the consumer doesn't pass one: route the\r\n * places search to the gateway API base (not the per-application base) so it\r\n * resolves to `{gatewayApiBaseUrl}/places/search` with the GatewaySession\r\n * bearer token. The app's gateway-auth interceptor reads\r\n * `REQUEST_CONTEXT.useBaseUrl` to pick the gateway base + token. */\r\n private readonly gatewayRequestContext = new HttpContext().set(\r\n REQUEST_CONTEXT,\r\n { useBaseUrl: true },\r\n );\r\n\r\n protected readonly value = signal<LocationValue | null>(null);\r\n protected readonly suggestions = signal<LocationValue[]>([]);\r\n protected readonly attribution = signal<string>('');\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 normalizedConfiguration = computed(() =>\r\n this.normalizeConfiguration(this.configuration()),\r\n );\r\n\r\n protected readonly resolvedSearchUrl = computed(() => {\r\n const config = this.normalizedConfiguration();\r\n const configuredUrl =\r\n this.readConfiguredUrl(config?.searchUrl) ??\r\n this.readConfiguredUrl(config?.geocodingUrl) ??\r\n this.readConfiguredUrl(config?.endpoint) ??\r\n this.readConfiguredUrl(config?.nominatimBaseUrl);\r\n\r\n return configuredUrl ?? this.searchUrl()?.trim() ?? 'places/search';\r\n });\r\n\r\n protected readonly countryName = computed(() => {\r\n const country = this.normalizedConfiguration()?.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.normalizedConfiguration()?.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.normalizedConfiguration();\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 document = inject(DOCUMENT);\r\n private readonly http = inject(HttpClient);\r\n private readonly rawHttp = new HttpClient(inject(HttpBackend));\r\n private readonly searchTerms = new Subject<string>();\r\n\r\n /**\r\n * Bumped every time a value is committed (select / manual entry / clear /\r\n * external write). A blur cleanup scheduled before a commit is ignored once\r\n * it fires, preventing it from undoing a value selected in the meantime.\r\n */\r\n private committedValueVersion = 0;\r\n private blurCleanupHandle: ReturnType<typeof setTimeout> | null = null;\r\n private inputFocused = false;\r\n private suggestionPointerActive = false;\r\n private hasUncommittedSearchText = false;\r\n private ignoreSearchResultsUntilNextSearch = false;\r\n\r\n private readonly handleDocumentPointerDown = (event: PointerEvent): void => {\r\n if (this.isOwnAutocompleteOption(event.target)) {\r\n this.onSuggestionPointerDown();\r\n }\r\n };\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.document.addEventListener(\r\n 'pointerdown',\r\n this.handleDocumentPointerDown,\r\n true,\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) => {\r\n if (!this.inputFocused || this.ignoreSearchResultsUntilNextSearch) {\r\n this.suggestions.set([]);\r\n return;\r\n }\r\n\r\n this.suggestions.set(items);\r\n if (items.length) {\r\n queueMicrotask(() => this.autocomplete()?.show());\r\n }\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.cancelPendingBlurCleanup();\r\n this.document.removeEventListener(\r\n 'pointerdown',\r\n this.handleDocumentPointerDown,\r\n true,\r\n );\r\n }\r\n\r\n /**\r\n * Fired by PrimeNG on every keystroke. Pushes the typed term into the\r\n * debounced search stream so results load as the user types (mirrors\r\n * `user-search-field`). The 250ms `debounceTime` + `minLength` guard keep the\r\n * request rate low.\r\n */\r\n protected search(event: { query: string }): void {\r\n this.inputFocused = true;\r\n this.ignoreSearchResultsUntilNextSearch = false;\r\n\r\n const query = event.query ?? '';\r\n const trimmed = query.trim();\r\n const committedName = getLocationDisplayName(this.value()).trim();\r\n this.hasUncommittedSearchText = !!trimmed && committedName !== trimmed;\r\n\r\n this.searchTerms.next(query);\r\n }\r\n\r\n protected onFocus(): void {\r\n this.inputFocused = true;\r\n const autocomplete = this.autocomplete();\r\n if (!autocomplete) return;\r\n\r\n const inputEl = this.getInputElement(autocomplete);\r\n const typed = (inputEl?.value ?? '').trim();\r\n if (!typed) {\r\n this.suggestions.set([]);\r\n return;\r\n }\r\n\r\n // A committed location's name is showing — don't reopen the list for it.\r\n const committedName = getLocationDisplayName(this.value()).trim();\r\n if (committedName && committedName === typed) {\r\n return;\r\n }\r\n\r\n // Resume an in-progress search: re-show the retained suggestions\r\n // immediately, or re-run the search when the list was dropped in the\r\n // meantime so the options come back where the user left off.\r\n if (this.suggestions().length > 0) {\r\n autocomplete.show();\r\n } else {\r\n this.ignoreSearchResultsUntilNextSearch = false;\r\n this.hasUncommittedSearchText = true;\r\n this.searchTerms.next(typed);\r\n }\r\n }\r\n\r\n protected onBlur(): void {\r\n this.onTouched();\r\n this.inputFocused = false;\r\n\r\n const autocomplete = this.autocomplete();\r\n if (!autocomplete) return;\r\n\r\n const inputEl = this.getInputElement(autocomplete);\r\n const typed = (inputEl?.value ?? '').trim();\r\n const committedValueVersion = this.committedValueVersion;\r\n\r\n this.cancelPendingBlurCleanup();\r\n\r\n // A pointerdown on a suggestion fires before its (onSelect); give that\r\n // selection extra time to land before the blur cleanup runs.\r\n const cleanupDelay = this.suggestionPointerActive\r\n ? SUGGESTION_POINTER_BLUR_CLEANUP_DELAY_MS\r\n : BLUR_CLEANUP_DELAY_MS;\r\n\r\n this.blurCleanupHandle = setTimeout(() => {\r\n this.blurCleanupHandle = null;\r\n this.resetUncommittedSearch(autocomplete, typed, committedValueVersion);\r\n }, cleanupDelay);\r\n }\r\n\r\n protected onSelect(event: {\r\n originalEvent: Event;\r\n value: LocationValue;\r\n }): void {\r\n this.cancelPendingBlurCleanup();\r\n this.suggestionPointerActive = false;\r\n\r\n this.inputFocused = false;\r\n this.ignoreSearchResultsUntilNextSearch = true;\r\n this.hasUncommittedSearchText = false;\r\n this.commitValue(normalizeLocationValue(event.value));\r\n this.suggestions.set([]);\r\n this.autocomplete()?.hide();\r\n this.loading.set(false);\r\n }\r\n\r\n protected onClear(): void {\r\n this.cancelPendingBlurCleanup();\r\n this.suggestionPointerActive = false;\r\n\r\n this.inputFocused = false;\r\n this.ignoreSearchResultsUntilNextSearch = true;\r\n this.hasUncommittedSearchText = false;\r\n this.commitValue(null);\r\n this.suggestions.set([]);\r\n this.attribution.set('');\r\n this.loading.set(false);\r\n }\r\n\r\n protected onSuggestionPointerDown(): void {\r\n this.suggestionPointerActive = true;\r\n this.cancelPendingBlurCleanup();\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\r\n this.cancelPendingBlurCleanup();\r\n this.suggestionPointerActive = false;\r\n this.inputFocused = false;\r\n this.ignoreSearchResultsUntilNextSearch = true;\r\n this.hasUncommittedSearchText = false;\r\n this.commitValue(next);\r\n this.suggestions.set([]);\r\n this.loading.set(false);\r\n this.autocomplete()?.hide();\r\n });\r\n }\r\n\r\n writeValue(value: unknown): void {\r\n this.value.set(normalizeLocationValue(value));\r\n this.committedValueVersion++;\r\n this.hasUncommittedSearchText = false;\r\n this.ignoreSearchResultsUntilNextSearch = false;\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 commitValue(value: LocationValue | null): void {\r\n this.value.set(value);\r\n this.committedValueVersion++;\r\n this.onModelChange(value);\r\n this.onTouched();\r\n }\r\n\r\n private isOwnAutocompleteOption(target: EventTarget | null): boolean {\r\n const defaultView = this.document.defaultView;\r\n if (!defaultView || !(target instanceof defaultView.Element)) return false;\r\n\r\n const autocompleteId = this.autocomplete()?.id;\r\n if (!autocompleteId) return false;\r\n\r\n const option = target.closest('[role=\"option\"]');\r\n const listbox = option?.closest('[role=\"listbox\"]');\r\n\r\n return listbox?.id === `${autocompleteId}_list`;\r\n }\r\n\r\n private getInputElement(autocomplete: AutoComplete): HTMLInputElement | null {\r\n return autocomplete.inputEL?.nativeElement ?? null;\r\n }\r\n\r\n private cancelPendingBlurCleanup(): void {\r\n if (this.blurCleanupHandle === null) return;\r\n\r\n clearTimeout(this.blurCleanupHandle);\r\n this.blurCleanupHandle = null;\r\n }\r\n\r\n /**\r\n * On blur, reconcile the free-typed input text with the committed value:\r\n * a selected location keeps showing its display name; an in-progress search\r\n * (typed text with no matching selection) keeps its text AND its fetched\r\n * suggestions so refocusing the field resumes it; an empty field is cleared.\r\n * This replaces PrimeNG `forceSelection`, which raced with async suggestions.\r\n */\r\n private resetUncommittedSearch(\r\n autocomplete: AutoComplete,\r\n typedOnBlur: string,\r\n committedValueVersionOnBlur: number,\r\n ): void {\r\n this.suggestionPointerActive = false;\r\n\r\n if (committedValueVersionOnBlur !== this.committedValueVersion) return;\r\n\r\n const inputEl = this.getInputElement(autocomplete);\r\n const typed = typedOnBlur.trim();\r\n const current = this.value();\r\n const currentName = getLocationDisplayName(current).trim();\r\n\r\n // A committed location is showing and nothing was typed over it: normalize\r\n // the input back to its name and drop the stale list.\r\n if (current && !this.hasUncommittedSearchText) {\r\n this.writeInput(inputEl, currentName);\r\n this.clearSearchState(autocomplete);\r\n return;\r\n }\r\n\r\n // Typed text exactly matches the committed location — keep it.\r\n if (typed && currentName === typed) {\r\n this.clearSearchState(autocomplete);\r\n this.hasUncommittedSearchText = false;\r\n return;\r\n }\r\n\r\n // In-progress search text that isn't a committed location: preserve the\r\n // typed text and the fetched suggestions so onFocus can resume the search.\r\n // Only close the overlay — don't wipe the input or the list.\r\n if (typed) {\r\n this.writeInput(inputEl, typedOnBlur);\r\n this.loading.set(false);\r\n autocomplete.hide();\r\n return;\r\n }\r\n\r\n // Empty input: clear any leftover value and search state.\r\n if (current) {\r\n this.commitValue(null);\r\n }\r\n this.clearInput(inputEl);\r\n this.clearSearchState(autocomplete);\r\n this.hasUncommittedSearchText = false;\r\n }\r\n\r\n private clearInput(inputEl: HTMLInputElement | null): void {\r\n this.writeInput(inputEl, '');\r\n }\r\n\r\n private writeInput(inputEl: HTMLInputElement | null, value: string): void {\r\n if (inputEl) {\r\n inputEl.value = value;\r\n }\r\n }\r\n\r\n private clearSearchState(autocomplete: AutoComplete): void {\r\n this.suggestions.set([]);\r\n this.loading.set(false);\r\n autocomplete.hide();\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('language', this.transloco.getActiveLang() || 'en')\r\n .set('limit', '10');\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 const url = this.resolvedSearchUrl();\r\n const viewBox = this.viewBox();\r\n if (viewBox) {\r\n params = params.set('viewbox', viewBox);\r\n }\r\n\r\n return this.getHttpClientForUrl(url)\r\n .get<PlacesSearchResponse | unknown[]>(url, {\r\n params,\r\n context: this.getHttpContextForUrl(url),\r\n })\r\n .pipe(\r\n finalize(() => this.loading.set(false)),\r\n catchError((error) => {\r\n console.error('Location search failed:', error);\r\n this.attribution.set('');\r\n return of<PlacesSearchResponse | unknown[]>({ data: { items: [] } });\r\n }),\r\n switchMap((response) => {\r\n if (Array.isArray(response)) {\r\n this.attribution.set('');\r\n return of(\r\n response\r\n .map((item) => normalizeLocationValue(item))\r\n .filter((item): item is LocationValue => item !== null),\r\n );\r\n }\r\n\r\n this.attribution.set(response?.data?.attribution?.trim() ?? '');\r\n const items = response?.data?.items ?? [];\r\n return of(\r\n items\r\n .map((item) => normalizeLocationValue(this.toLocationValue(item)))\r\n .filter((item): item is LocationValue => item !== null),\r\n );\r\n }),\r\n );\r\n }\r\n\r\n /** Map a Gateway places item onto the shape `normalizeLocationValue` reads\r\n * (it expects `lat`/`lon`, the gateway returns `latitude`/`longitude`). */\r\n private toLocationValue(item: PlacesSearchItem): Record<string, unknown> {\r\n return {\r\n ...item,\r\n lat: item.latitude,\r\n lon: item.longitude,\r\n };\r\n }\r\n\r\n private normalizeConfiguration(\r\n value: LocationFieldConfiguration | string | null,\r\n ): LocationFieldConfiguration | null {\r\n if (!value) return null;\r\n if (typeof value === 'object') return value;\r\n\r\n const trimmed = value.trim();\r\n if (!trimmed) return null;\r\n\r\n try {\r\n const parsed = JSON.parse(trimmed) as unknown;\r\n return parsed && typeof parsed === 'object'\r\n ? (parsed as LocationFieldConfiguration)\r\n : null;\r\n } catch {\r\n return { nominatimBaseUrl: trimmed };\r\n }\r\n }\r\n\r\n private readConfiguredUrl(value: unknown): string | undefined {\r\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\r\n }\r\n\r\n private getHttpClientForUrl(url: string): HttpClient {\r\n return this.shouldBypassInterceptors(url) ? this.rawHttp : this.http;\r\n }\r\n\r\n private getHttpContextForUrl(url: string): HttpContext | undefined {\r\n const explicitContext = this.context();\r\n if (explicitContext) return explicitContext;\r\n return this.isDefaultGatewayPlacesUrl(url)\r\n ? this.gatewayRequestContext\r\n : undefined;\r\n }\r\n\r\n private shouldBypassInterceptors(url: string): boolean {\r\n const config = this.normalizedConfiguration();\r\n if (typeof config?.useInterceptors === 'boolean') {\r\n return !config.useInterceptors;\r\n }\r\n\r\n try {\r\n const parsed = new URL(url, this.document.baseURI);\r\n return parsed.hostname === DIRECT_NOMINATIM_HOST;\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n private isDefaultGatewayPlacesUrl(url: string): boolean {\r\n const normalized = url.trim().replace(/^\\/+/, '').toLowerCase();\r\n return normalized === 'places/search';\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]=\"fieldId\"\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)=\"onBlur()\"\r\n [ngModel]=\"value()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [id]=\"fieldId\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n [placeholder]=\"'components.locationField.search' | transloco\"\r\n [optionLabel]=\"'display_name'\"\r\n [minLength]=\"minLength()\"\r\n [showEmptyMessage]=\"false\"\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\r\n class=\"flex min-w-0 items-start gap-2\"\r\n (pointerdown)=\"onSuggestionPointerDown()\"\r\n >\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 @if (loading()) {\r\n <p-inputgroup-addon>\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin text-surface-500\"\r\n />\r\n </p-inputgroup-addon>\r\n }\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</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;IACF;AAEA,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7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A,QAAA,EAAA,m0FAAA,EAAA;w8BAsCyD,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvJ1E;;AAEG;;;;"}
|
|
@@ -288,7 +288,7 @@ class MultiSelectField {
|
|
|
288
288
|
optionOrValue);
|
|
289
289
|
}
|
|
290
290
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MultiSelectField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
291
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MultiSelectField, isStandalone: true, selector: "mt-multi-select-field", inputs: { field: { classPropertyName: "field", publicName: "field", 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 }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, optionGroupLabel: { classPropertyName: "optionGroupLabel", publicName: "optionGroupLabel", isSignal: true, isRequired: false, transformFunction: null }, optionGroupChildren: { classPropertyName: "optionGroupChildren", publicName: "optionGroupChildren", isSignal: true, isRequired: false, transformFunction: null }, optionIcon: { classPropertyName: "optionIcon", publicName: "optionIcon", isSignal: true, isRequired: false, transformFunction: null }, optionIconColor: { classPropertyName: "optionIconColor", publicName: "optionIconColor", isSignal: true, isRequired: false, transformFunction: null }, optionIconShape: { classPropertyName: "optionIconShape", publicName: "optionIconShape", isSignal: true, isRequired: false, transformFunction: null }, optionAvatarShape: { classPropertyName: "optionAvatarShape", publicName: "optionAvatarShape", isSignal: true, isRequired: false, transformFunction: null }, optionGroupIcon: { classPropertyName: "optionGroupIcon", publicName: "optionGroupIcon", isSignal: true, isRequired: false, transformFunction: null }, optionGroupIconColor: { classPropertyName: "optionGroupIconColor", publicName: "optionGroupIconColor", isSignal: true, isRequired: false, transformFunction: null }, optionGroupIconShape: { classPropertyName: "optionGroupIconShape", publicName: "optionGroupIconShape", isSignal: true, isRequired: false, transformFunction: null }, optionGroupAvatarShape: { classPropertyName: "optionGroupAvatarShape", publicName: "optionGroupAvatarShape", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, host: { properties: { "class": "this.styleClass" }, classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "multiSelect", first: true, predicate: ["multiSelect"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "@if (label()) {\r\n <label\r\n (click)=\"multiSelect?.show()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-multiSelect\r\n #multiSelect\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n [options]=\"options()\"\r\n [display]=\"display()\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n [group]=\"isGrouped()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name?.toString() || label()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n [filter]=\"filter()\"\r\n [filterBy]=\"filterBy()\"\r\n [dataKey]=\"dataKey()\"\r\n styleClass=\"w-full\"\r\n appendTo=\"body\"\r\n [showClear]=\"showClear()\"\r\n [maxSelectedLabels]=\"maxSelectedLabels\"\r\n [virtualScroll]=\"virtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [panelStyle]=\"panelStyle()\"\r\n>\r\n <ng-template let-selectedOptions #selecteditems>\r\n @if (selectedOptions?.length) {\r\n @if (display() === \"chip\") {\r\n <div class=\"flex flex-wrap gap-2 py-1\">\r\n @for (selected of selectedOptions; track $index) {\r\n <span\r\n class=\"inline-flex items-center gap-2 rounded-full border border-surface-200 bg-surface-50 px-2.5 py-1 text-sm\"\r\n >\r\n @if (shouldRenderOptionColorSwatch(selected)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getOptionSwatchColor(selected)\"\r\n ></span>\r\n } @else if (getOptionIcon(selected)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"\r\n getOptionAvatarBackground(selected)\r\n \"\r\n [style.--p-avatar-color]=\"getOptionAvatarColor(selected)\"\r\n [icon]=\"getOptionIcon(selected)\"\r\n [shape]=\"getOptionAvatarShape(selected)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-[180px] truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionLabelValue(selected) }}</span\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-xs leading-none text-muted-color hover:bg-surface-200 hover:text-color\"\r\n [attr.aria-label]=\"'Remove ' + getOptionLabelValue(selected)\"\r\n [disabled]=\"disabled() || readonly()\"\r\n (click)=\"removeSelected(selected, $event)\"\r\n >\r\n ×\r\n </button>\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"block w-full min-w-0 max-w-full truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ formatSelectedItems(selectedOptions) }}</span\r\n >\r\n }\r\n }\r\n </ng-template>\r\n\r\n <ng-template let-group #group>\r\n <div class=\"flex items-center gap-2 overflow-hidden\">\r\n @if (shouldRenderGroupColorSwatch(group)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getGroupSwatchColor(group)\"\r\n ></span>\r\n } @else if (getGroupIcon(group)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"getGroupAvatarBackground(group)\"\r\n [style.--p-avatar-color]=\"getGroupAvatarColor(group)\"\r\n [icon]=\"getGroupIcon(group)\"\r\n [shape]=\"getGroupAvatarShape(group)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-full flex-1 truncate font-medium\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getGroupLabelValue(group) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template let-option #item>\r\n <div class=\"flex items-center gap-2 overflow-hidden\">\r\n @if (shouldRenderOptionColorSwatch(option)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getOptionSwatchColor(option)\"\r\n ></span>\r\n } @else if (getOptionIcon(option)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"getOptionAvatarBackground(option)\"\r\n [style.--p-avatar-color]=\"getOptionAvatarColor(option)\"\r\n [icon]=\"getOptionIcon(option)\"\r\n [shape]=\"getOptionAvatarShape(option)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-full flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionLabelValue(option) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n</p-multiSelect>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [""], 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: MultiSelectModule }, { kind: "component", type: i2.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
291
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MultiSelectField, isStandalone: true, selector: "mt-multi-select-field", inputs: { field: { classPropertyName: "field", publicName: "field", 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 }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, optionGroupLabel: { classPropertyName: "optionGroupLabel", publicName: "optionGroupLabel", isSignal: true, isRequired: false, transformFunction: null }, optionGroupChildren: { classPropertyName: "optionGroupChildren", publicName: "optionGroupChildren", isSignal: true, isRequired: false, transformFunction: null }, optionIcon: { classPropertyName: "optionIcon", publicName: "optionIcon", isSignal: true, isRequired: false, transformFunction: null }, optionIconColor: { classPropertyName: "optionIconColor", publicName: "optionIconColor", isSignal: true, isRequired: false, transformFunction: null }, optionIconShape: { classPropertyName: "optionIconShape", publicName: "optionIconShape", isSignal: true, isRequired: false, transformFunction: null }, optionAvatarShape: { classPropertyName: "optionAvatarShape", publicName: "optionAvatarShape", isSignal: true, isRequired: false, transformFunction: null }, optionGroupIcon: { classPropertyName: "optionGroupIcon", publicName: "optionGroupIcon", isSignal: true, isRequired: false, transformFunction: null }, optionGroupIconColor: { classPropertyName: "optionGroupIconColor", publicName: "optionGroupIconColor", isSignal: true, isRequired: false, transformFunction: null }, optionGroupIconShape: { classPropertyName: "optionGroupIconShape", publicName: "optionGroupIconShape", isSignal: true, isRequired: false, transformFunction: null }, optionGroupAvatarShape: { classPropertyName: "optionGroupAvatarShape", publicName: "optionGroupAvatarShape", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, host: { properties: { "class.gap-1": "label()", "class": "this.styleClass" }, classAttribute: "grid" }, viewQueries: [{ propertyName: "multiSelect", first: true, predicate: ["multiSelect"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "@if (label()) {\r\n <label\r\n (click)=\"multiSelect?.show()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-multiSelect\r\n #multiSelect\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n [options]=\"options()\"\r\n [display]=\"display()\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n [group]=\"isGrouped()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name?.toString() || label()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n [filter]=\"filter()\"\r\n [filterBy]=\"filterBy()\"\r\n [dataKey]=\"dataKey()\"\r\n styleClass=\"w-full\"\r\n appendTo=\"body\"\r\n [showClear]=\"showClear()\"\r\n [maxSelectedLabels]=\"maxSelectedLabels\"\r\n [virtualScroll]=\"virtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [panelStyle]=\"panelStyle()\"\r\n>\r\n <ng-template let-selectedOptions #selecteditems>\r\n @if (selectedOptions?.length) {\r\n @if (display() === \"chip\") {\r\n <div class=\"flex flex-wrap gap-2 py-1\">\r\n @for (selected of selectedOptions; track $index) {\r\n <span\r\n class=\"inline-flex items-center gap-2 rounded-full border border-surface-200 bg-surface-50 px-2.5 py-1 text-sm\"\r\n >\r\n @if (shouldRenderOptionColorSwatch(selected)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getOptionSwatchColor(selected)\"\r\n ></span>\r\n } @else if (getOptionIcon(selected)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"\r\n getOptionAvatarBackground(selected)\r\n \"\r\n [style.--p-avatar-color]=\"getOptionAvatarColor(selected)\"\r\n [icon]=\"getOptionIcon(selected)\"\r\n [shape]=\"getOptionAvatarShape(selected)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-[180px] truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionLabelValue(selected) }}</span\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-xs leading-none text-muted-color hover:bg-surface-200 hover:text-color\"\r\n [attr.aria-label]=\"'Remove ' + getOptionLabelValue(selected)\"\r\n [disabled]=\"disabled() || readonly()\"\r\n (click)=\"removeSelected(selected, $event)\"\r\n >\r\n ×\r\n </button>\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"block w-full min-w-0 max-w-full truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ formatSelectedItems(selectedOptions) }}</span\r\n >\r\n }\r\n }\r\n </ng-template>\r\n\r\n <ng-template let-group #group>\r\n <div class=\"flex items-center gap-2 overflow-hidden\">\r\n @if (shouldRenderGroupColorSwatch(group)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getGroupSwatchColor(group)\"\r\n ></span>\r\n } @else if (getGroupIcon(group)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"getGroupAvatarBackground(group)\"\r\n [style.--p-avatar-color]=\"getGroupAvatarColor(group)\"\r\n [icon]=\"getGroupIcon(group)\"\r\n [shape]=\"getGroupAvatarShape(group)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-full flex-1 truncate font-medium\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getGroupLabelValue(group) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template let-option #item>\r\n <div class=\"flex items-center gap-2 overflow-hidden\">\r\n @if (shouldRenderOptionColorSwatch(option)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getOptionSwatchColor(option)\"\r\n ></span>\r\n } @else if (getOptionIcon(option)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"getOptionAvatarBackground(option)\"\r\n [style.--p-avatar-color]=\"getOptionAvatarColor(option)\"\r\n [icon]=\"getOptionIcon(option)\"\r\n [shape]=\"getOptionAvatarShape(option)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-full flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionLabelValue(option) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n</p-multiSelect>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [""], 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: MultiSelectModule }, { kind: "component", type: i2.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
292
292
|
}
|
|
293
293
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MultiSelectField, decorators: [{
|
|
294
294
|
type: Component,
|
|
@@ -299,7 +299,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
299
299
|
Avatar,
|
|
300
300
|
TruncateTooltip,
|
|
301
301
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
302
|
-
class: 'grid
|
|
302
|
+
class: 'grid',
|
|
303
|
+
// The gap only separates the label from the control. With no label that row
|
|
304
|
+
// is not rendered, so the gap becomes dead space under the control and
|
|
305
|
+
// knocks it out of vertical alignment with sibling fields.
|
|
306
|
+
'[class.gap-1]': 'label()',
|
|
303
307
|
}, template: "@if (label()) {\r\n <label\r\n (click)=\"multiSelect?.show()\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n<p-multiSelect\r\n #multiSelect\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n [options]=\"options()\"\r\n [display]=\"display()\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n [group]=\"isGrouped()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name?.toString() || label()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n placeholder=\"{{ placeholder() ?? label() ?? '' }}\"\r\n [filter]=\"filter()\"\r\n [filterBy]=\"filterBy()\"\r\n [dataKey]=\"dataKey()\"\r\n styleClass=\"w-full\"\r\n appendTo=\"body\"\r\n [showClear]=\"showClear()\"\r\n [maxSelectedLabels]=\"maxSelectedLabels\"\r\n [virtualScroll]=\"virtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [panelStyle]=\"panelStyle()\"\r\n>\r\n <ng-template let-selectedOptions #selecteditems>\r\n @if (selectedOptions?.length) {\r\n @if (display() === \"chip\") {\r\n <div class=\"flex flex-wrap gap-2 py-1\">\r\n @for (selected of selectedOptions; track $index) {\r\n <span\r\n class=\"inline-flex items-center gap-2 rounded-full border border-surface-200 bg-surface-50 px-2.5 py-1 text-sm\"\r\n >\r\n @if (shouldRenderOptionColorSwatch(selected)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getOptionSwatchColor(selected)\"\r\n ></span>\r\n } @else if (getOptionIcon(selected)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"\r\n getOptionAvatarBackground(selected)\r\n \"\r\n [style.--p-avatar-color]=\"getOptionAvatarColor(selected)\"\r\n [icon]=\"getOptionIcon(selected)\"\r\n [shape]=\"getOptionAvatarShape(selected)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-[180px] truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionLabelValue(selected) }}</span\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-xs leading-none text-muted-color hover:bg-surface-200 hover:text-color\"\r\n [attr.aria-label]=\"'Remove ' + getOptionLabelValue(selected)\"\r\n [disabled]=\"disabled() || readonly()\"\r\n (click)=\"removeSelected(selected, $event)\"\r\n >\r\n ×\r\n </button>\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"block w-full min-w-0 max-w-full truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ formatSelectedItems(selectedOptions) }}</span\r\n >\r\n }\r\n }\r\n </ng-template>\r\n\r\n <ng-template let-group #group>\r\n <div class=\"flex items-center gap-2 overflow-hidden\">\r\n @if (shouldRenderGroupColorSwatch(group)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getGroupSwatchColor(group)\"\r\n ></span>\r\n } @else if (getGroupIcon(group)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"getGroupAvatarBackground(group)\"\r\n [style.--p-avatar-color]=\"getGroupAvatarColor(group)\"\r\n [icon]=\"getGroupIcon(group)\"\r\n [shape]=\"getGroupAvatarShape(group)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-full flex-1 truncate font-medium\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getGroupLabelValue(group) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template let-option #item>\r\n <div class=\"flex items-center gap-2 overflow-hidden\">\r\n @if (shouldRenderOptionColorSwatch(option)) {\r\n <span\r\n class=\"h-3 w-3 shrink-0 rounded-[4px] border border-surface-300\"\r\n [style.backgroundColor]=\"getOptionSwatchColor(option)\"\r\n ></span>\r\n } @else if (getOptionIcon(option)) {\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"getOptionAvatarBackground(option)\"\r\n [style.--p-avatar-color]=\"getOptionAvatarColor(option)\"\r\n [icon]=\"getOptionIcon(option)\"\r\n [shape]=\"getOptionAvatarShape(option)\"\r\n size=\"normal\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 max-w-full flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionLabelValue(option) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n</p-multiSelect>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n" }]
|
|
304
308
|
}], ctorParameters: () => [], propDecorators: { multiSelect: [{
|
|
305
309
|
type: ViewChild,
|