@masterteam/components 0.0.350 → 0.0.352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/ar.json +3 -1
- package/assets/i18n/en.json +3 -1
- package/fesm2022/masterteam-components-business-fields.mjs +3 -3
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-property-filter-builder.mjs +1 -1
- package/fesm2022/masterteam-components-property-filter-builder.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +5 -3
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +152 -12
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-upload-field.mjs +119 -19
- package/fesm2022/masterteam-components-upload-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +85 -8
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +3 -0
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-select-field.d.ts +3 -1
- package/types/masterteam-components-table.d.ts +45 -2
- package/types/masterteam-components-upload-field.d.ts +9 -0
- package/types/masterteam-components-user-search-field.d.ts +41 -2
- package/types/masterteam-components.d.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-select-field.mjs","sources":["../../../../packages/masterteam/components/select-field/current-user.util.ts","../../../../packages/masterteam/components/select-field/select-field.ts","../../../../packages/masterteam/components/select-field/select-field.html","../../../../packages/masterteam/components/select-field/masterteam-components-select-field.ts"],"sourcesContent":["/**\r\n * Resolves the current authenticated user (id + displayName) from\r\n * `localStorage`, where the host application persists its NGXS `auth`\r\n * slice. Used by table filters to mark \"You\" on options that match the\r\n * logged-in user.\r\n *\r\n * The persisted shape can vary slightly between apps, so we look for the\r\n * id/displayName under a few well-known paths.\r\n */\r\nexport interface CurrentUserInfo {\r\n id?: string | number | null;\r\n displayName?: string | null;\r\n}\r\n\r\nexport function getCurrentUserFromLocalStorage(): CurrentUserInfo | null {\r\n if (typeof localStorage === 'undefined') {\r\n return null;\r\n }\r\n\r\n try {\r\n const raw = localStorage.getItem('auth');\r\n if (!raw) return null;\r\n\r\n const parsed = JSON.parse(raw) as Record<string, unknown> | null;\r\n if (!parsed || typeof parsed !== 'object') return null;\r\n\r\n const user =\r\n (parsed['user'] as Record<string, unknown> | undefined) ??\r\n ((parsed['state'] as Record<string, unknown> | undefined)?.['user'] as\r\n | Record<string, unknown>\r\n | undefined);\r\n if (!user || typeof user !== 'object') return null;\r\n\r\n const nested = user['user'] as Record<string, unknown> | undefined;\r\n\r\n const id =\r\n (user['id'] as string | number | undefined) ??\r\n (nested?.['id'] as string | number | undefined) ??\r\n (user['userId'] as string | number | undefined) ??\r\n null;\r\n\r\n const displayName =\r\n (user['displayName'] as string | undefined) ??\r\n (nested?.['displayName'] as string | undefined) ??\r\n (user['name'] as string | undefined) ??\r\n null;\r\n\r\n if (id == null && !displayName) return null;\r\n\r\n return { id, displayName };\r\n } catch {\r\n return null;\r\n }\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n EventEmitter,\r\n HostBinding,\r\n NgZone,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n ViewChild,\r\n signal,\r\n input,\r\n inject,\r\n ChangeDetectorRef,\r\n ChangeDetectionStrategy,\r\n effect,\r\n computed,\r\n} from '@angular/core';\r\n\r\nimport {\r\n ControlValueAccessor,\r\n FormControlDirective,\r\n FormControlName,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { Select } from 'primeng/select';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid, newFieldId } from '@masterteam/components';\r\nimport { TranslocoModule } from '@jsverse/transloco';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Tooltip, TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { getCurrentUserFromLocalStorage } from './current-user.util';\r\n\r\n/** Rendered in place of an option/group label that resolves to an empty value. */\r\nconst EMPTY_LABEL_PLACEHOLDER = '-';\r\n\r\n@Component({\r\n selector: 'mt-select-field',\r\n standalone: true,\r\n imports: [\r\n FormsModule,\r\n Select,\r\n FieldValidation,\r\n TranslocoModule,\r\n Avatar,\r\n Tooltip,\r\n TruncateTooltip,\r\n Icon,\r\n ],\r\n templateUrl: './select-field.html',\r\n styleUrls: ['./select-field.scss'],\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 SelectField\r\n implements ControlValueAccessor, OnInit, OnChanges, AfterViewInit\r\n{\r\n cdr = inject(ChangeDetectorRef);\r\n private el = inject(ElementRef);\r\n private zone = inject(NgZone);\r\n private destroyRef = inject(DestroyRef);\r\n\r\n @ViewChild('dropdown', { static: true })\r\n dropdown: Select;\r\n\r\n protected readonly panelStyle = signal<Record<string, string>>({});\r\n\r\n ngAfterViewInit(): void {\r\n this.zone.runOutsideAngular(() => {\r\n const ro = new ResizeObserver(() => {\r\n const width = this.el.nativeElement.offsetWidth;\r\n if (width > 0 && `${width}px` !== this.panelStyle()['width']) {\r\n this.panelStyle.set({ width: `${width}px` });\r\n }\r\n });\r\n ro.observe(this.el.nativeElement);\r\n this.destroyRef.onDestroy(() => ro.disconnect());\r\n });\r\n }\r\n\r\n /**\r\n * `false` marks a control that only looks like a field: a toolbar switcher, a\r\n * view or version picker. It always holds a value, so it never gets the\r\n * default clear button, even when bound to a reactive control.\r\n */\r\n readonly field = input<boolean>(true);\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-select-field');\r\n readonly labelId = `${this.fieldId}-label`;\r\n /**\r\n * PrimeNG's focusable element is a `span[role=combobox]`, which `<label for>`\r\n * cannot name, so assistive technology only heard the value (\"Any\"). Naming\r\n * it by the label plus itself announces \"Category, Any\".\r\n */\r\n protected readonly comboboxLabelledBy = computed(() =>\r\n this.label() ? `${this.labelId} ${this.fieldId}` : undefined,\r\n );\r\n readonly placeholder = input<string>('');\r\n readonly hasPlaceholderPrefix = input<boolean>(true);\r\n readonly class = input<string>('');\r\n readonly readonly = input<boolean>(false);\r\n readonly pInputs = input<Partial<Select>>();\r\n readonly options = input<any[] | undefined>(undefined);\r\n readonly optionValue = input<string | undefined>(undefined);\r\n readonly optionLabel = input<string | undefined>(undefined);\r\n readonly filter = input<boolean | undefined>(undefined);\r\n readonly filterBy = input<string | undefined>(undefined);\r\n readonly dataKey = input<string | undefined>(undefined);\r\n /**\r\n * Clear button. Left unset it appears only on an optional field of a reactive\r\n * form, which has to be able to go back to empty. A required field, a\r\n * `[field]=\"false\"` switcher and a bare `ngModel` selector have nothing to\r\n * clear to. Pass an explicit `true` / `false` to override that.\r\n */\r\n readonly showClear = input<boolean | undefined>(undefined);\r\n readonly clearAfterSelect = input<boolean | undefined>(undefined);\r\n readonly required = input<boolean>(false); // Add readonly required input\r\n readonly group = input<boolean>(false);\r\n readonly size = input<'small' | 'large' | ''>('');\r\n\r\n readonly pSelectSize = computed(() => this.size() as 'small' | 'large' | '');\r\n\r\n readonly panelSizeClass = computed(() =>\r\n this.size() === 'small' ? 'mt-select-panel-small' : '',\r\n );\r\n readonly optionGroupLabel = input<string>('label');\r\n readonly optionGroupChildren = input<string>('items');\r\n readonly loading = input<boolean>(false);\r\n readonly optionIcon = input<string>('icon');\r\n readonly optionIconColor = input<string>('color');\r\n readonly optionIconShape = input<string>('shape');\r\n readonly optionAvatarShape = input<'circle' | 'square'>('square');\r\n readonly optionGroupIcon = input<string>('icon');\r\n readonly optionGroupIconColor = input<string>('color');\r\n readonly optionGroupIconShape = input<string>('shape');\r\n readonly optionGroupAvatarShape = input<'circle' | 'square'>('square');\r\n\r\n /**\r\n * When true, this select represents a user picker (e.g. a table filter for\r\n * a user column). The component reads the logged-in user from\r\n * `localStorage` and marks the matching option with a \"You\" badge.\r\n */\r\n readonly markCurrentUser = input<boolean>(false);\r\n\r\n protected readonly currentUser = computed(() =>\r\n this.markCurrentUser() ? getCurrentUserFromLocalStorage() : null,\r\n );\r\n\r\n /**\r\n * When `markCurrentUser` is on, hoist the option matching the current user\r\n * to the top of the list so it surfaces first in the dropdown.\r\n */\r\n protected readonly displayOptions = computed(() => {\r\n const options = this.options();\r\n if (!options?.length || !this.markCurrentUser() || !this.currentUser()) {\r\n return options;\r\n }\r\n\r\n const index = options.findIndex((option) =>\r\n this.isCurrentUserOption(option),\r\n );\r\n if (index <= 0) return options;\r\n\r\n const reordered = options.slice();\r\n const [currentUserOption] = reordered.splice(index, 1);\r\n reordered.unshift(currentUserOption);\r\n return reordered;\r\n });\r\n\r\n @Output() onChange: EventEmitter<any> = new EventEmitter();\r\n\r\n @HostBinding('class') styleClass: string;\r\n\r\n requiredValidator = Validators.required;\r\n value = signal<any>(null);\r\n disabled = signal<boolean>(false);\r\n\r\n onTouched: () => void = () => {};\r\n onModelChange: (value: any) => void = () => {};\r\n\r\n public ngControl: NgControl | null = null;\r\n\r\n isInvalid = isInvalid;\r\n\r\n constructor() {\r\n try {\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 } catch {\r\n this.ngControl = null;\r\n }\r\n effect(() => {\r\n if (this.ngControl?.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n applyInputsToDropdown() {\r\n // Object.assign(this.dropdown, this.pInputs());\r\n }\r\n\r\n ngOnInit() {\r\n this.styleClass = this.class();\r\n if (this.pInputs()) {\r\n this.applyInputsToDropdown();\r\n }\r\n }\r\n\r\n onValueChange(value: any) {\r\n this.onModelChange(value);\r\n this.value.set(value);\r\n this.onChange.emit(value);\r\n if (this.clearAfterSelect()) {\r\n this.clearSelection();\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['pInputs']) {\r\n this.applyInputsToDropdown();\r\n }\r\n }\r\n\r\n /**\r\n * The search leaves no option focused, so Enter picked nothing even when the\r\n * search narrowed the list to one option. Focus that option: Enter then\r\n * selects it, as it would after an arrow key.\r\n */\r\n protected onDropdownFilter(): void {\r\n const dropdown = this.dropdown;\r\n const selectable = (dropdown.visibleOptions() as unknown[])\r\n .map((option, index) => ({ option, index }))\r\n .filter(({ option }) => dropdown.isValidOption(option));\r\n if (selectable.length === 1) {\r\n dropdown.focusedOptionIndex.set(selectable[0].index);\r\n }\r\n }\r\n\r\n writeValue(value: string) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n\r\n isGrouped(): boolean {\r\n return this.group();\r\n }\r\n\r\n /**\r\n * Required through the input or through a `Validators.required` on the bound\r\n * control — DynamicForm and hand-written reactive forms take the second route.\r\n * A method, not a computed: validators are mutable and carry no signal, so\r\n * only re-reading them per change detection keeps this truthful.\r\n */\r\n isRequiredField(): boolean {\r\n return (\r\n this.required() ||\r\n !!this.ngControl?.control?.hasValidator(this.requiredValidator)\r\n );\r\n }\r\n\r\n /** Explicit `showClear` wins; otherwise only an optional form field clears. */\r\n isClearable(): boolean {\r\n if (this.readonly() || this.disabled()) return false;\r\n return this.showClear() ?? this.isOptionalFormField();\r\n }\r\n\r\n private isOptionalFormField(): boolean {\r\n const isReactiveField =\r\n this.ngControl instanceof FormControlName ||\r\n this.ngControl instanceof FormControlDirective;\r\n return isReactiveField && this.field() && !this.isRequiredField();\r\n }\r\n\r\n // TODO: make this method work\r\n public clearSelection() {\r\n this.dropdown.clear(this.value());\r\n this.dropdown.value = null;\r\n this.value.set(null);\r\n this.onModelChange(null);\r\n this.onChange.emit(null);\r\n this.cdr.detectChanges();\r\n }\r\n\r\n getOptionLabelValue(option: any): string {\r\n const resolvedOption = this.resolveOption(option);\r\n if (resolvedOption == null) return '';\r\n\r\n const labelKey = this.optionLabel();\r\n if (labelKey && typeof resolvedOption === 'object') {\r\n return this.resolveNestedValue(resolvedOption, labelKey) ?? '';\r\n }\r\n\r\n return typeof resolvedOption === 'object'\r\n ? (resolvedOption.label ?? '')\r\n : String(resolvedOption);\r\n }\r\n\r\n /**\r\n * Label used for rendering. Options whose label resolves to an empty string\r\n * would otherwise paint a blank, unreadable row, so they fall back to a dash.\r\n * Kept separate from {@link getOptionLabelValue} so value comparisons (e.g.\r\n * current-user matching) still see the real, empty label.\r\n */\r\n getOptionDisplayLabel(option: any): string {\r\n return this.getOptionLabelValue(option).trim() || EMPTY_LABEL_PLACEHOLDER;\r\n }\r\n\r\n getOptionIcon(option: any): string | undefined {\r\n const resolvedOption = this.resolveOption(option);\r\n if (!resolvedOption || typeof resolvedOption !== 'object') return undefined;\r\n return resolvedOption[this.optionIcon()];\r\n }\r\n\r\n shouldRenderOptionColorSwatch(option: any): boolean {\r\n return !!this.getOptionSwatchColor(option) && !this.getOptionIcon(option);\r\n }\r\n\r\n getOptionSwatchColor(option: any): string | null {\r\n return this.resolveDisplayColor(this.getOptionColor(option));\r\n }\r\n\r\n getOptionAvatarBackground(option: any): string | null {\r\n return this.getAvatarBackgroundByColor(this.getOptionColor(option));\r\n }\r\n\r\n getOptionAvatarColor(option: any): string | null {\r\n return this.getAvatarColorByColor(this.getOptionColor(option));\r\n }\r\n\r\n getOptionAvatarShape(option: any): 'circle' | 'square' {\r\n const resolvedOption = this.resolveOption(option);\r\n if (!resolvedOption || typeof resolvedOption !== 'object') {\r\n return this.normalizeAvatarShape(this.optionAvatarShape());\r\n }\r\n\r\n return this.normalizeAvatarShape(\r\n resolvedOption[this.optionIconShape()] ?? this.optionAvatarShape(),\r\n );\r\n }\r\n\r\n getGroupLabelValue(group: any): string {\r\n if (group == null) return '';\r\n\r\n const groupLabelKey = this.optionGroupLabel();\r\n if (groupLabelKey && typeof group === 'object') {\r\n return group[groupLabelKey] ?? '';\r\n }\r\n\r\n return typeof group === 'object' ? (group.label ?? '') : String(group);\r\n }\r\n\r\n getGroupDisplayLabel(group: any): string {\r\n return this.getGroupLabelValue(group).trim() || EMPTY_LABEL_PLACEHOLDER;\r\n }\r\n\r\n getGroupIcon(group: any): string | undefined {\r\n if (!group || typeof group !== 'object') return undefined;\r\n return group[this.optionGroupIcon()];\r\n }\r\n\r\n shouldRenderGroupColorSwatch(group: any): boolean {\r\n return !!this.getGroupSwatchColor(group) && !this.getGroupIcon(group);\r\n }\r\n\r\n getGroupSwatchColor(group: any): string | null {\r\n return this.resolveDisplayColor(this.getGroupColor(group));\r\n }\r\n\r\n getGroupAvatarBackground(group: any): string | null {\r\n return this.getAvatarBackgroundByColor(this.getGroupColor(group));\r\n }\r\n\r\n getGroupAvatarColor(group: any): string | null {\r\n return this.getAvatarColorByColor(this.getGroupColor(group));\r\n }\r\n\r\n getGroupAvatarShape(group: any): 'circle' | 'square' {\r\n if (!group || typeof group !== 'object') {\r\n return this.normalizeAvatarShape(this.optionGroupAvatarShape());\r\n }\r\n\r\n return this.normalizeAvatarShape(\r\n group[this.optionGroupIconShape()] ?? this.optionGroupAvatarShape(),\r\n );\r\n }\r\n\r\n private getOptionColor(option: any): string | undefined {\r\n const resolvedOption = this.resolveOption(option);\r\n if (!resolvedOption || typeof resolvedOption !== 'object') return undefined;\r\n return resolvedOption[this.optionIconColor()];\r\n }\r\n\r\n private getGroupColor(group: any): string | undefined {\r\n if (!group || typeof group !== 'object') return undefined;\r\n return group[this.optionGroupIconColor()];\r\n }\r\n\r\n private getAvatarBackgroundByColor(color: string | undefined): string | null {\r\n if (!color) return null;\r\n if (color.startsWith('#')) return `${color}1a`;\r\n return `var(--p-${color}-100)`;\r\n }\r\n\r\n private getAvatarColorByColor(color: string | undefined): string | null {\r\n if (!color) return null;\r\n if (color.startsWith('#')) return color;\r\n return `var(--p-${color}-600)`;\r\n }\r\n\r\n private resolveDisplayColor(color: string | undefined): string | null {\r\n if (!color) return null;\r\n if (\r\n color.startsWith('#') ||\r\n color.startsWith('rgb') ||\r\n color.startsWith('hsl') ||\r\n color.startsWith('var(')\r\n ) {\r\n return color;\r\n }\r\n\r\n return `var(--p-${color}-500)`;\r\n }\r\n\r\n private normalizeAvatarShape(shape: unknown): 'circle' | 'square' {\r\n return shape === 'square' ? 'square' : 'circle';\r\n }\r\n\r\n /**\r\n * Resolves a nested dot-notation path (e.g. \"name.display\") on an object.\r\n * Falls back to direct property access for non-nested keys.\r\n */\r\n private resolveNestedValue(obj: any, path: string): any {\r\n if (!path.includes('.')) {\r\n return obj[path];\r\n }\r\n return path.split('.').reduce((current, key) => current?.[key], obj);\r\n }\r\n\r\n isCurrentUserOption(option: any): boolean {\r\n const user = this.currentUser();\r\n if (!user) return false;\r\n\r\n const id = user.id;\r\n const displayName = user.displayName;\r\n if (id == null && !displayName) return false;\r\n\r\n const resolvedOption = this.resolveOption(option);\r\n if (resolvedOption == null) return false;\r\n\r\n const optionValueKey = this.optionValue();\r\n const value =\r\n optionValueKey && typeof resolvedOption === 'object'\r\n ? this.resolveNestedValue(resolvedOption, optionValueKey)\r\n : typeof resolvedOption === 'object'\r\n ? (resolvedOption.value ?? resolvedOption)\r\n : resolvedOption;\r\n\r\n if (id != null && value != null && String(value) === String(id)) {\r\n return true;\r\n }\r\n\r\n if (displayName) {\r\n const label = this.getOptionLabelValue(option);\r\n if (label && label === displayName) return true;\r\n if (value != null && String(value) === displayName) return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private resolveOption(optionOrValue: any): any {\r\n if (optionOrValue == null || typeof optionOrValue === 'object') {\r\n return optionOrValue;\r\n }\r\n\r\n const options = this.options() ?? [];\r\n const optionValueKey = this.optionValue();\r\n\r\n if (!optionValueKey) {\r\n return (\r\n options.find((option) => option === optionOrValue) ?? optionOrValue\r\n );\r\n }\r\n\r\n if (this.group()) {\r\n const groupChildrenKey = this.optionGroupChildren();\r\n for (const group of options) {\r\n const children = group?.[groupChildrenKey];\r\n if (!Array.isArray(children)) continue;\r\n\r\n const match = children.find(\r\n (item: any) => item?.[optionValueKey] === optionOrValue,\r\n );\r\n if (match) return match;\r\n }\r\n return optionOrValue;\r\n }\r\n\r\n return (\r\n options.find((option) => option?.[optionValueKey] === optionOrValue) ??\r\n optionOrValue\r\n );\r\n }\r\n}\r\n","@if (label() || hint()) {\r\n <div class=\"flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n (click)=\"dropdown.show(); dropdown.focus()\"\r\n [class.required]=\"isRequiredField()\"\r\n [id]=\"labelId\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (hint()) {\r\n <span\r\n class=\"inline-flex text-surface-400\"\r\n [mtTooltip]=\"hint()\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n<!-- `inputId` only, never `id`: PrimeNG puts `inputId` on the focusable inner\r\n input and `id` on the host, so binding both stamped one id onto two\r\n elements. That is invalid HTML, and `<label for>` then resolves to\r\n whichever comes first in the document. The label needs the input. -->\r\n<p-select\r\n #dropdown\r\n appendTo=\"body\"\r\n [overlayOptions]=\"{ baseZIndex: 1051 }\"\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n [options]=\"displayOptions()\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n (onBlur)=\"onTouched()\"\r\n (onFilter)=\"onDropdownFilter()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"fieldId\"\r\n [ariaLabelledBy]=\"comboboxLabelledBy()\"\r\n [invalid]=\"!dropdown.overlayVisible && isInvalid(ngControl?.control)\"\r\n [placeholder]=\"placeholder() || label() || ''\"\r\n [filter]=\"filter()\"\r\n [filterBy]=\"filterBy()\"\r\n [dataKey]=\"dataKey()\"\r\n [styleClass]=\"size() === 'small' ? ' mt-select-sm' : ''\"\r\n [showClear]=\"isClearable()\"\r\n [group]=\"isGrouped()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [loading]=\"loading()\"\r\n [fluid]=\"true\"\r\n [size]=\"pSelectSize()\"\r\n [panelStyleClass]=\"panelSizeClass()\"\r\n [panelStyle]=\"panelStyle()\"\r\n>\r\n <ng-template let-option #selectedItem>\r\n @if (option) {\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 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionDisplayLabel(option) }}</span\r\n >\r\n </div>\r\n } @else {\r\n <span class=\"text-color-secondary\">{{\r\n placeholder() || label() || \"\"\r\n }}</span>\r\n }\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 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionDisplayLabel(option) }}</span\r\n >\r\n @if (isCurrentUserOption(option)) {\r\n <span\r\n class=\"shrink-0 text-xs px-1.5 py-0.5 rounded bg-primary-100 text-primary-700 dark:bg-primary-900/40 dark:text-primary-300 font-medium\"\r\n >\r\n {{ \"components.selectField.you\" | transloco }}\r\n </span>\r\n }\r\n </div>\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 flex-1 truncate font-medium\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getGroupDisplayLabel(group) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n</p-select>\r\n\r\n@if (ngControl) {\r\n <!-- Opening a filterable select moves focus into its search box, which blurs\r\n the field and marks it touched while the user is still choosing. Hold\r\n the error back until the panel closes; hidden, not removed, so the\r\n reserved line under the field does not jump. -->\r\n <mt-field-validation\r\n [control]=\"ngControl?.control\"\r\n [class.mt-select-validation-paused]=\"dropdown.overlayVisible\"\r\n ></mt-field-validation>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;SAcgB,8BAA8B,GAAA;AAC5C,IAAA,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;AACvC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI;QACF,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC;AACxC,QAAA,IAAI,CAAC,GAAG;AAAE,YAAA,OAAO,IAAI;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmC;AAChE,QAAA,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;AAAE,YAAA,OAAO,IAAI;AAEtD,QAAA,MAAM,IAAI,GACP,MAAM,CAAC,MAAM,CAAyC;AACrD,YAAA,MAAM,CAAC,OAAO,CAAyC,GAAG,MAAM,CAEpD;AAChB,QAAA,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,IAAI;AAElD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAwC;AAElE,QAAA,MAAM,EAAE,GACL,IAAI,CAAC,IAAI,CAAiC;YAC1C,MAAM,GAAG,IAAI,CAAiC;YAC9C,IAAI,CAAC,QAAQ,CAAiC;AAC/C,YAAA,IAAI;AAEN,QAAA,MAAM,WAAW,GACd,IAAI,CAAC,aAAa,CAAwB;YAC1C,MAAM,GAAG,aAAa,CAAwB;YAC9C,IAAI,CAAC,MAAM,CAAwB;AACpC,YAAA,IAAI;AAEN,QAAA,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,WAAW;AAAE,YAAA,OAAO,IAAI;AAE3C,QAAA,OAAO,EAAE,EAAE,EAAE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EAAA,WAAA,EAAA,IAAA,EACP,eAAe,gEACf,IAAI,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAaK,WAAW,EAAA,UAAA,EAAA,CAAA;kBAxBvB,SAAS;+BACE,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,OAAA,EACP;wBACP,WAAW;wBACX,MAAM;wBACN,eAAe;wBACf,eAAe;wBACf,MAAM;wBACN,OAAO;wBACP,eAAe;wBACf,IAAI;qBACL,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,MAAM;;;;AAIb,wBAAA,eAAe,EAAE,mBAAmB;AACrC,qBAAA,EAAA,QAAA,EAAA,otLAAA,EAAA,MAAA,EAAA,CAAA,6FAAA,CAAA,EAAA;;sBAUA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;sBA8GtC;;sBAEA,WAAW;uBAAC,OAAO;;;AE1LtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-select-field.mjs","sources":["../../../../packages/masterteam/components/select-field/current-user.util.ts","../../../../packages/masterteam/components/select-field/select-field.ts","../../../../packages/masterteam/components/select-field/select-field.html","../../../../packages/masterteam/components/select-field/masterteam-components-select-field.ts"],"sourcesContent":["/**\r\n * Resolves the current authenticated user (id + displayName) from\r\n * `localStorage`, where the host application persists its NGXS `auth`\r\n * slice. Used by table filters to mark \"You\" on options that match the\r\n * logged-in user.\r\n *\r\n * The persisted shape can vary slightly between apps, so we look for the\r\n * id/displayName under a few well-known paths.\r\n */\r\nexport interface CurrentUserInfo {\r\n id?: string | number | null;\r\n displayName?: string | null;\r\n}\r\n\r\nexport function getCurrentUserFromLocalStorage(): CurrentUserInfo | null {\r\n if (typeof localStorage === 'undefined') {\r\n return null;\r\n }\r\n\r\n try {\r\n const raw = localStorage.getItem('auth');\r\n if (!raw) return null;\r\n\r\n const parsed = JSON.parse(raw) as Record<string, unknown> | null;\r\n if (!parsed || typeof parsed !== 'object') return null;\r\n\r\n const user =\r\n (parsed['user'] as Record<string, unknown> | undefined) ??\r\n ((parsed['state'] as Record<string, unknown> | undefined)?.['user'] as\r\n | Record<string, unknown>\r\n | undefined);\r\n if (!user || typeof user !== 'object') return null;\r\n\r\n const nested = user['user'] as Record<string, unknown> | undefined;\r\n\r\n const id =\r\n (user['id'] as string | number | undefined) ??\r\n (nested?.['id'] as string | number | undefined) ??\r\n (user['userId'] as string | number | undefined) ??\r\n null;\r\n\r\n const displayName =\r\n (user['displayName'] as string | undefined) ??\r\n (nested?.['displayName'] as string | undefined) ??\r\n (user['name'] as string | undefined) ??\r\n null;\r\n\r\n if (id == null && !displayName) return null;\r\n\r\n return { id, displayName };\r\n } catch {\r\n return null;\r\n }\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n EventEmitter,\r\n HostBinding,\r\n NgZone,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n ViewChild,\r\n signal,\r\n input,\r\n inject,\r\n ChangeDetectorRef,\r\n ChangeDetectionStrategy,\r\n effect,\r\n computed,\r\n} from '@angular/core';\r\n\r\nimport {\r\n ControlValueAccessor,\r\n FormControlDirective,\r\n FormControlName,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { Select } from 'primeng/select';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid, newFieldId } from '@masterteam/components';\r\nimport { TranslocoModule } from '@jsverse/transloco';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Tooltip, TruncateTooltip } from '@masterteam/components/tooltip';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { getCurrentUserFromLocalStorage } from './current-user.util';\r\n\r\n/** Rendered in place of an option/group label that resolves to an empty value. */\r\nconst EMPTY_LABEL_PLACEHOLDER = '-';\r\n\r\n@Component({\r\n selector: 'mt-select-field',\r\n standalone: true,\r\n imports: [\r\n FormsModule,\r\n Select,\r\n FieldValidation,\r\n TranslocoModule,\r\n Avatar,\r\n Tooltip,\r\n TruncateTooltip,\r\n Icon,\r\n ],\r\n templateUrl: './select-field.html',\r\n styleUrls: ['./select-field.scss'],\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 SelectField\r\n implements ControlValueAccessor, OnInit, OnChanges, AfterViewInit\r\n{\r\n cdr = inject(ChangeDetectorRef);\r\n private el = inject(ElementRef);\r\n private zone = inject(NgZone);\r\n private destroyRef = inject(DestroyRef);\r\n\r\n @ViewChild('dropdown', { static: true })\r\n dropdown: Select;\r\n\r\n protected readonly panelStyle = signal<Record<string, string>>({});\r\n\r\n ngAfterViewInit(): void {\r\n this.zone.runOutsideAngular(() => {\r\n const ro = new ResizeObserver(() => {\r\n const width = this.el.nativeElement.offsetWidth;\r\n if (width > 0 && `${width}px` !== this.panelStyle()['width']) {\r\n this.panelStyle.set({ width: `${width}px` });\r\n }\r\n });\r\n ro.observe(this.el.nativeElement);\r\n this.destroyRef.onDestroy(() => ro.disconnect());\r\n });\r\n }\r\n\r\n /**\r\n * `false` marks a control that only looks like a field: a toolbar switcher, a\r\n * view or version picker. It always holds a value, so it never gets the\r\n * default clear button, even when bound to a reactive control.\r\n */\r\n readonly field = input<boolean>(true);\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-select-field');\r\n readonly labelId = `${this.fieldId}-label`;\r\n /**\r\n * PrimeNG's focusable element is a `span[role=combobox]`, which `<label for>`\r\n * cannot name, so assistive technology only heard the value (\"Any\"). Naming\r\n * it by the label plus itself announces \"Category, Any\".\r\n */\r\n protected readonly comboboxLabelledBy = computed(() =>\r\n this.label() ? `${this.labelId} ${this.fieldId}` : undefined,\r\n );\r\n readonly placeholder = input<string>('');\r\n readonly hasPlaceholderPrefix = input<boolean>(true);\r\n readonly class = input<string>('');\r\n readonly readonly = input<boolean>(false);\r\n readonly pInputs = input<Partial<Select>>();\r\n readonly options = input<any[] | undefined>(undefined);\r\n readonly optionValue = input<string | undefined>(undefined);\r\n readonly optionLabel = input<string | undefined>(undefined);\r\n /** Name of the option property that, when truthy, makes it unpickable. */\r\n readonly optionDisabled = input<string | undefined>(undefined);\r\n readonly filter = input<boolean | undefined>(undefined);\r\n readonly filterBy = input<string | undefined>(undefined);\r\n readonly dataKey = input<string | undefined>(undefined);\r\n /**\r\n * Clear button. Left unset it appears only on an optional field of a reactive\r\n * form, which has to be able to go back to empty. A required field, a\r\n * `[field]=\"false\"` switcher and a bare `ngModel` selector have nothing to\r\n * clear to. Pass an explicit `true` / `false` to override that.\r\n */\r\n readonly showClear = input<boolean | undefined>(undefined);\r\n readonly clearAfterSelect = input<boolean | undefined>(undefined);\r\n readonly required = input<boolean>(false); // Add readonly required input\r\n readonly group = input<boolean>(false);\r\n readonly size = input<'small' | 'large' | ''>('');\r\n\r\n readonly pSelectSize = computed(() => this.size() as 'small' | 'large' | '');\r\n\r\n readonly panelSizeClass = computed(() =>\r\n this.size() === 'small' ? 'mt-select-panel-small' : '',\r\n );\r\n readonly optionGroupLabel = input<string>('label');\r\n readonly optionGroupChildren = input<string>('items');\r\n readonly loading = input<boolean>(false);\r\n readonly optionIcon = input<string>('icon');\r\n readonly optionIconColor = input<string>('color');\r\n readonly optionIconShape = input<string>('shape');\r\n readonly optionAvatarShape = input<'circle' | 'square'>('square');\r\n readonly optionGroupIcon = input<string>('icon');\r\n readonly optionGroupIconColor = input<string>('color');\r\n readonly optionGroupIconShape = input<string>('shape');\r\n readonly optionGroupAvatarShape = input<'circle' | 'square'>('square');\r\n\r\n /**\r\n * When true, this select represents a user picker (e.g. a table filter for\r\n * a user column). The component reads the logged-in user from\r\n * `localStorage` and marks the matching option with a \"You\" badge.\r\n */\r\n readonly markCurrentUser = input<boolean>(false);\r\n\r\n protected readonly currentUser = computed(() =>\r\n this.markCurrentUser() ? getCurrentUserFromLocalStorage() : null,\r\n );\r\n\r\n /**\r\n * When `markCurrentUser` is on, hoist the option matching the current user\r\n * to the top of the list so it surfaces first in the dropdown.\r\n */\r\n protected readonly displayOptions = computed(() => {\r\n const options = this.options();\r\n if (!options?.length || !this.markCurrentUser() || !this.currentUser()) {\r\n return options;\r\n }\r\n\r\n const index = options.findIndex((option) =>\r\n this.isCurrentUserOption(option),\r\n );\r\n if (index <= 0) return options;\r\n\r\n const reordered = options.slice();\r\n const [currentUserOption] = reordered.splice(index, 1);\r\n reordered.unshift(currentUserOption);\r\n return reordered;\r\n });\r\n\r\n @Output() onChange: EventEmitter<any> = new EventEmitter();\r\n\r\n @HostBinding('class') styleClass: string;\r\n\r\n requiredValidator = Validators.required;\r\n value = signal<any>(null);\r\n disabled = signal<boolean>(false);\r\n\r\n onTouched: () => void = () => {};\r\n onModelChange: (value: any) => void = () => {};\r\n\r\n public ngControl: NgControl | null = null;\r\n\r\n isInvalid = isInvalid;\r\n\r\n constructor() {\r\n try {\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 } catch {\r\n this.ngControl = null;\r\n }\r\n effect(() => {\r\n if (this.ngControl?.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n applyInputsToDropdown() {\r\n // Object.assign(this.dropdown, this.pInputs());\r\n }\r\n\r\n ngOnInit() {\r\n this.styleClass = this.class();\r\n if (this.pInputs()) {\r\n this.applyInputsToDropdown();\r\n }\r\n }\r\n\r\n onValueChange(value: any) {\r\n this.onModelChange(value);\r\n this.value.set(value);\r\n this.onChange.emit(value);\r\n if (this.clearAfterSelect()) {\r\n this.clearSelection();\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['pInputs']) {\r\n this.applyInputsToDropdown();\r\n }\r\n }\r\n\r\n /**\r\n * The search leaves no option focused, so Enter picked nothing even when the\r\n * search narrowed the list to one option. Focus that option: Enter then\r\n * selects it, as it would after an arrow key.\r\n */\r\n protected onDropdownFilter(): void {\r\n const dropdown = this.dropdown;\r\n const selectable = (dropdown.visibleOptions() as unknown[])\r\n .map((option, index) => ({ option, index }))\r\n .filter(({ option }) => dropdown.isValidOption(option));\r\n if (selectable.length === 1) {\r\n dropdown.focusedOptionIndex.set(selectable[0].index);\r\n }\r\n }\r\n\r\n writeValue(value: string) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n\r\n isGrouped(): boolean {\r\n return this.group();\r\n }\r\n\r\n /**\r\n * Required through the input or through a `Validators.required` on the bound\r\n * control — DynamicForm and hand-written reactive forms take the second route.\r\n * A method, not a computed: validators are mutable and carry no signal, so\r\n * only re-reading them per change detection keeps this truthful.\r\n */\r\n isRequiredField(): boolean {\r\n return (\r\n this.required() ||\r\n !!this.ngControl?.control?.hasValidator(this.requiredValidator)\r\n );\r\n }\r\n\r\n /** Explicit `showClear` wins; otherwise only an optional form field clears. */\r\n isClearable(): boolean {\r\n if (this.readonly() || this.disabled()) return false;\r\n return this.showClear() ?? this.isOptionalFormField();\r\n }\r\n\r\n private isOptionalFormField(): boolean {\r\n const isReactiveField =\r\n this.ngControl instanceof FormControlName ||\r\n this.ngControl instanceof FormControlDirective;\r\n return isReactiveField && this.field() && !this.isRequiredField();\r\n }\r\n\r\n // TODO: make this method work\r\n public clearSelection() {\r\n this.dropdown.clear(this.value());\r\n this.dropdown.value = null;\r\n this.value.set(null);\r\n this.onModelChange(null);\r\n this.onChange.emit(null);\r\n this.cdr.detectChanges();\r\n }\r\n\r\n getOptionLabelValue(option: any): string {\r\n const resolvedOption = this.resolveOption(option);\r\n if (resolvedOption == null) return '';\r\n\r\n const labelKey = this.optionLabel();\r\n if (labelKey && typeof resolvedOption === 'object') {\r\n return this.resolveNestedValue(resolvedOption, labelKey) ?? '';\r\n }\r\n\r\n return typeof resolvedOption === 'object'\r\n ? (resolvedOption.label ?? '')\r\n : String(resolvedOption);\r\n }\r\n\r\n /**\r\n * Label used for rendering. Options whose label resolves to an empty string\r\n * would otherwise paint a blank, unreadable row, so they fall back to a dash.\r\n * Kept separate from {@link getOptionLabelValue} so value comparisons (e.g.\r\n * current-user matching) still see the real, empty label.\r\n */\r\n getOptionDisplayLabel(option: any): string {\r\n return this.getOptionLabelValue(option).trim() || EMPTY_LABEL_PLACEHOLDER;\r\n }\r\n\r\n getOptionIcon(option: any): string | undefined {\r\n const resolvedOption = this.resolveOption(option);\r\n if (!resolvedOption || typeof resolvedOption !== 'object') return undefined;\r\n return resolvedOption[this.optionIcon()];\r\n }\r\n\r\n shouldRenderOptionColorSwatch(option: any): boolean {\r\n return !!this.getOptionSwatchColor(option) && !this.getOptionIcon(option);\r\n }\r\n\r\n getOptionSwatchColor(option: any): string | null {\r\n return this.resolveDisplayColor(this.getOptionColor(option));\r\n }\r\n\r\n getOptionAvatarBackground(option: any): string | null {\r\n return this.getAvatarBackgroundByColor(this.getOptionColor(option));\r\n }\r\n\r\n getOptionAvatarColor(option: any): string | null {\r\n return this.getAvatarColorByColor(this.getOptionColor(option));\r\n }\r\n\r\n getOptionAvatarShape(option: any): 'circle' | 'square' {\r\n const resolvedOption = this.resolveOption(option);\r\n if (!resolvedOption || typeof resolvedOption !== 'object') {\r\n return this.normalizeAvatarShape(this.optionAvatarShape());\r\n }\r\n\r\n return this.normalizeAvatarShape(\r\n resolvedOption[this.optionIconShape()] ?? this.optionAvatarShape(),\r\n );\r\n }\r\n\r\n getGroupLabelValue(group: any): string {\r\n if (group == null) return '';\r\n\r\n const groupLabelKey = this.optionGroupLabel();\r\n if (groupLabelKey && typeof group === 'object') {\r\n return group[groupLabelKey] ?? '';\r\n }\r\n\r\n return typeof group === 'object' ? (group.label ?? '') : String(group);\r\n }\r\n\r\n getGroupDisplayLabel(group: any): string {\r\n return this.getGroupLabelValue(group).trim() || EMPTY_LABEL_PLACEHOLDER;\r\n }\r\n\r\n getGroupIcon(group: any): string | undefined {\r\n if (!group || typeof group !== 'object') return undefined;\r\n return group[this.optionGroupIcon()];\r\n }\r\n\r\n shouldRenderGroupColorSwatch(group: any): boolean {\r\n return !!this.getGroupSwatchColor(group) && !this.getGroupIcon(group);\r\n }\r\n\r\n getGroupSwatchColor(group: any): string | null {\r\n return this.resolveDisplayColor(this.getGroupColor(group));\r\n }\r\n\r\n getGroupAvatarBackground(group: any): string | null {\r\n return this.getAvatarBackgroundByColor(this.getGroupColor(group));\r\n }\r\n\r\n getGroupAvatarColor(group: any): string | null {\r\n return this.getAvatarColorByColor(this.getGroupColor(group));\r\n }\r\n\r\n getGroupAvatarShape(group: any): 'circle' | 'square' {\r\n if (!group || typeof group !== 'object') {\r\n return this.normalizeAvatarShape(this.optionGroupAvatarShape());\r\n }\r\n\r\n return this.normalizeAvatarShape(\r\n group[this.optionGroupIconShape()] ?? this.optionGroupAvatarShape(),\r\n );\r\n }\r\n\r\n private getOptionColor(option: any): string | undefined {\r\n const resolvedOption = this.resolveOption(option);\r\n if (!resolvedOption || typeof resolvedOption !== 'object') return undefined;\r\n return resolvedOption[this.optionIconColor()];\r\n }\r\n\r\n private getGroupColor(group: any): string | undefined {\r\n if (!group || typeof group !== 'object') return undefined;\r\n return group[this.optionGroupIconColor()];\r\n }\r\n\r\n private getAvatarBackgroundByColor(color: string | undefined): string | null {\r\n if (!color) return null;\r\n if (color.startsWith('#')) return `${color}1a`;\r\n return `var(--p-${color}-100)`;\r\n }\r\n\r\n private getAvatarColorByColor(color: string | undefined): string | null {\r\n if (!color) return null;\r\n if (color.startsWith('#')) return color;\r\n return `var(--p-${color}-600)`;\r\n }\r\n\r\n private resolveDisplayColor(color: string | undefined): string | null {\r\n if (!color) return null;\r\n if (\r\n color.startsWith('#') ||\r\n color.startsWith('rgb') ||\r\n color.startsWith('hsl') ||\r\n color.startsWith('var(')\r\n ) {\r\n return color;\r\n }\r\n\r\n return `var(--p-${color}-500)`;\r\n }\r\n\r\n private normalizeAvatarShape(shape: unknown): 'circle' | 'square' {\r\n return shape === 'square' ? 'square' : 'circle';\r\n }\r\n\r\n /**\r\n * Resolves a nested dot-notation path (e.g. \"name.display\") on an object.\r\n * Falls back to direct property access for non-nested keys.\r\n */\r\n private resolveNestedValue(obj: any, path: string): any {\r\n if (!path.includes('.')) {\r\n return obj[path];\r\n }\r\n return path.split('.').reduce((current, key) => current?.[key], obj);\r\n }\r\n\r\n isCurrentUserOption(option: any): boolean {\r\n const user = this.currentUser();\r\n if (!user) return false;\r\n\r\n const id = user.id;\r\n const displayName = user.displayName;\r\n if (id == null && !displayName) return false;\r\n\r\n const resolvedOption = this.resolveOption(option);\r\n if (resolvedOption == null) return false;\r\n\r\n const optionValueKey = this.optionValue();\r\n const value =\r\n optionValueKey && typeof resolvedOption === 'object'\r\n ? this.resolveNestedValue(resolvedOption, optionValueKey)\r\n : typeof resolvedOption === 'object'\r\n ? (resolvedOption.value ?? resolvedOption)\r\n : resolvedOption;\r\n\r\n if (id != null && value != null && String(value) === String(id)) {\r\n return true;\r\n }\r\n\r\n if (displayName) {\r\n const label = this.getOptionLabelValue(option);\r\n if (label && label === displayName) return true;\r\n if (value != null && String(value) === displayName) return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private resolveOption(optionOrValue: any): any {\r\n if (optionOrValue == null || typeof optionOrValue === 'object') {\r\n return optionOrValue;\r\n }\r\n\r\n const options = this.options() ?? [];\r\n const optionValueKey = this.optionValue();\r\n\r\n if (!optionValueKey) {\r\n return (\r\n options.find((option) => option === optionOrValue) ?? optionOrValue\r\n );\r\n }\r\n\r\n if (this.group()) {\r\n const groupChildrenKey = this.optionGroupChildren();\r\n for (const group of options) {\r\n const children = group?.[groupChildrenKey];\r\n if (!Array.isArray(children)) continue;\r\n\r\n const match = children.find(\r\n (item: any) => item?.[optionValueKey] === optionOrValue,\r\n );\r\n if (match) return match;\r\n }\r\n return optionOrValue;\r\n }\r\n\r\n return (\r\n options.find((option) => option?.[optionValueKey] === optionOrValue) ??\r\n optionOrValue\r\n );\r\n }\r\n}\r\n","@if (label() || hint()) {\r\n <div class=\"flex items-center gap-1\">\r\n @if (label()) {\r\n <label\r\n (click)=\"dropdown.show(); dropdown.focus()\"\r\n [class.required]=\"isRequiredField()\"\r\n [id]=\"labelId\"\r\n [for]=\"fieldId\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (hint()) {\r\n <span\r\n class=\"inline-flex text-surface-400\"\r\n [mtTooltip]=\"hint()\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"general.help-circle\" />\r\n </span>\r\n }\r\n </div>\r\n}\r\n<!-- `inputId` only, never `id`: PrimeNG puts `inputId` on the focusable inner\r\n input and `id` on the host, so binding both stamped one id onto two\r\n elements. That is invalid HTML, and `<label for>` then resolves to\r\n whichever comes first in the document. The label needs the input. -->\r\n<p-select\r\n #dropdown\r\n appendTo=\"body\"\r\n [overlayOptions]=\"{ baseZIndex: 1051 }\"\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n [options]=\"displayOptions()\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n [optionDisabled]=\"optionDisabled()\"\r\n (onBlur)=\"onTouched()\"\r\n (onFilter)=\"onDropdownFilter()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"fieldId\"\r\n [ariaLabelledBy]=\"comboboxLabelledBy()\"\r\n [invalid]=\"!dropdown.overlayVisible && isInvalid(ngControl?.control)\"\r\n [placeholder]=\"placeholder() || label() || ''\"\r\n [filter]=\"filter()\"\r\n [filterBy]=\"filterBy()\"\r\n [dataKey]=\"dataKey()\"\r\n [styleClass]=\"size() === 'small' ? ' mt-select-sm' : ''\"\r\n [showClear]=\"isClearable()\"\r\n [group]=\"isGrouped()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [loading]=\"loading()\"\r\n [fluid]=\"true\"\r\n [size]=\"pSelectSize()\"\r\n [panelStyleClass]=\"panelSizeClass()\"\r\n [panelStyle]=\"panelStyle()\"\r\n>\r\n <ng-template let-option #selectedItem>\r\n @if (option) {\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 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionDisplayLabel(option) }}</span\r\n >\r\n </div>\r\n } @else {\r\n <span class=\"text-color-secondary\">{{\r\n placeholder() || label() || \"\"\r\n }}</span>\r\n }\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 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getOptionDisplayLabel(option) }}</span\r\n >\r\n @if (isCurrentUserOption(option)) {\r\n <span\r\n class=\"shrink-0 text-xs px-1.5 py-0.5 rounded bg-primary-100 text-primary-700 dark:bg-primary-900/40 dark:text-primary-300 font-medium\"\r\n >\r\n {{ \"components.selectField.you\" | transloco }}\r\n </span>\r\n }\r\n </div>\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 flex-1 truncate font-medium\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getGroupDisplayLabel(group) }}</span\r\n >\r\n </div>\r\n </ng-template>\r\n</p-select>\r\n\r\n@if (ngControl) {\r\n <!-- Opening a filterable select moves focus into its search box, which blurs\r\n the field and marks it touched while the user is still choosing. Hold\r\n the error back until the panel closes; hidden, not removed, so the\r\n reserved line under the field does not jump. -->\r\n <mt-field-validation\r\n [control]=\"ngControl?.control\"\r\n [class.mt-select-validation-paused]=\"dropdown.overlayVisible\"\r\n ></mt-field-validation>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;SAcgB,8BAA8B,GAAA;AAC5C,IAAA,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;AACvC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI;QACF,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC;AACxC,QAAA,IAAI,CAAC,GAAG;AAAE,YAAA,OAAO,IAAI;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmC;AAChE,QAAA,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;AAAE,YAAA,OAAO,IAAI;AAEtD,QAAA,MAAM,IAAI,GACP,MAAM,CAAC,MAAM,CAAyC;AACrD,YAAA,MAAM,CAAC,OAAO,CAAyC,GAAG,MAAM,CAEpD;AAChB,QAAA,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,IAAI;AAElD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAwC;AAElE,QAAA,MAAM,EAAE,GACL,IAAI,CAAC,IAAI,CAAiC;YAC1C,MAAM,GAAG,IAAI,CAAiC;YAC9C,IAAI,CAAC,QAAQ,CAAiC;AAC/C,YAAA,IAAI;AAEN,QAAA,MAAM,WAAW,GACd,IAAI,CAAC,aAAa,CAAwB;YAC1C,MAAM,GAAG,aAAa,CAAwB;YAC9C,IAAI,CAAC,MAAM,CAAwB;AACpC,YAAA,IAAI;AAEN,QAAA,IAAI,EAAE,I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AAA,OAAA,EAAA,CAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACN,OAAO,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACP,eAAe,gEACf,IAAI,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAaK,WAAW,EAAA,UAAA,EAAA,CAAA;kBAxBvB,SAAS;+BACE,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,OAAA,EACP;wBACP,WAAW;wBACX,MAAM;wBACN,eAAe;wBACf,eAAe;wBACf,MAAM;wBACN,OAAO;wBACP,eAAe;wBACf,IAAI;qBACL,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,MAAM;;;;AAIb,wBAAA,eAAe,EAAE,mBAAmB;AACrC,qBAAA,EAAA,QAAA,EAAA,+vLAAA,EAAA,MAAA,EAAA,CAAA,6FAAA,CAAA,EAAA;;sBAUA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;sBAgHtC;;sBAEA,WAAW;uBAAC,OAAO;;;AE5LtB;;AAEG;;;;"}
|
|
@@ -14,7 +14,7 @@ import { Avatar } from '@masterteam/components/avatar';
|
|
|
14
14
|
import * as i1 from 'primeng/tieredmenu';
|
|
15
15
|
import { TieredMenuModule } from 'primeng/tieredmenu';
|
|
16
16
|
import { Drawer } from '@masterteam/components/drawer';
|
|
17
|
-
import { resolvePerformanceScoreStatus, parsePerformanceScore, EntityPreview } from '@masterteam/components/entities';
|
|
17
|
+
import { resolvePerformanceScoreStatus, parsePerformanceScore, normalizeNumerals, EntityPreview } from '@masterteam/components/entities';
|
|
18
18
|
import { parseClockTime, clockTimeToSeconds, toClockTimeParts, MTDateFormatPipe } from '@masterteam/components';
|
|
19
19
|
import { DateField } from '@masterteam/components/date-field';
|
|
20
20
|
import { NumberField } from '@masterteam/components/number-field';
|
|
@@ -772,6 +772,22 @@ class TableValueResolver {
|
|
|
772
772
|
}
|
|
773
773
|
return String(value);
|
|
774
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* The entity as its cell shows it: a submitted ChangeRequest's "after" side
|
|
777
|
+
* replaces `value`. `rawValue` is left as it was, so a caller that reads it
|
|
778
|
+
* must skip it for a comparison cell (it still holds the pre-change figure).
|
|
779
|
+
*/
|
|
780
|
+
static unwrapComparison(entityData) {
|
|
781
|
+
if (entityData.comparison?.kind !== 'Value') {
|
|
782
|
+
return entityData;
|
|
783
|
+
}
|
|
784
|
+
const after = entityData.comparison.newValue;
|
|
785
|
+
return {
|
|
786
|
+
...entityData,
|
|
787
|
+
value: (after.display ?? after.value ?? ''),
|
|
788
|
+
comparison: undefined,
|
|
789
|
+
};
|
|
790
|
+
}
|
|
775
791
|
static getEntityValueByType(value, usage) {
|
|
776
792
|
if (value === null || value === undefined) {
|
|
777
793
|
return null;
|
|
@@ -785,12 +801,7 @@ class TableValueResolver {
|
|
|
785
801
|
// export/sort/filter must resolve that same new value — not `entityData.value`,
|
|
786
802
|
// which is the pre-change base and would export identically for every row.
|
|
787
803
|
if (entityData.comparison?.kind === 'Value') {
|
|
788
|
-
|
|
789
|
-
return TableValueResolver.getEntityValueByType({
|
|
790
|
-
...entityData,
|
|
791
|
-
value: (after.display ?? after.value ?? ''),
|
|
792
|
-
comparison: undefined,
|
|
793
|
-
}, usage);
|
|
804
|
+
return TableValueResolver.getEntityValueByType(TableValueResolver.unwrapComparison(entityData), usage);
|
|
794
805
|
}
|
|
795
806
|
if (usage === 'sort' &&
|
|
796
807
|
TableValueResolver.UNSORTABLE_ENTITY_VIEW_TYPES.has(entityData.viewType)) {
|
|
@@ -1176,7 +1187,7 @@ class TableFilterField {
|
|
|
1176
1187
|
return Math.min(this.getNumberRangeMax(), Math.max(this.getNumberRangeMin(), numericValue));
|
|
1177
1188
|
}
|
|
1178
1189
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilterField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1179
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableFilterField, isStandalone: true, selector: "mt-table-filter-field", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "@switch (getFilterType()) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n />\r\n }\r\n @case (\"select\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"userSelect\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [markCurrentUser]=\"true\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"treeSelect\") {\r\n <mt-treeselect-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"treeOptions()\"\r\n [placeholder]=\"getTreePlaceholder()\"\r\n [selectionMode]=\"$any(column().filterConfig)?.selectionMode || 'single'\"\r\n [scrollHeight]=\"getTreeScrollHeight()\"\r\n [panelStyleClass]=\"getTreePanelStyleClass()\"\r\n [filter]=\"column().filterConfig?.['filter'] !== false\"\r\n [filterBy]=\"getTreeFilterBy()\"\r\n [filterPlaceholder]=\"getTreeFilterPlaceholder()\"\r\n [showClear]=\"column().filterConfig?.['showClear'] !== false\"\r\n [resetFilterOnHide]=\"\r\n column().filterConfig?.['resetFilterOnHide'] !== false\r\n \"\r\n [overlayOptions]=\"$any(column().filterConfig)?.overlayOptions\"\r\n />\r\n }\r\n @case (\"date\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"dateFrom()\"\r\n (ngModelChange)=\"updateDate('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n [maxDate]=\"dateTo()\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"dateTo()\"\r\n (ngModelChange)=\"updateDate('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n [minDate]=\"dateFrom()\"\r\n />\r\n </div>\r\n @if (isDateRangeReversed()) {\r\n <p-message\r\n severity=\"error\"\r\n variant=\"simple\"\r\n size=\"small\"\r\n role=\"alert\"\r\n [text]=\"'components.table.invalidDateRange' | transloco\"\r\n />\r\n }\r\n </div>\r\n }\r\n @case (\"boolean\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"booleanOptions()\"\r\n [placeholder]=\"'components.table.select' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n @case (\"user\") {\r\n <mt-user-search-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"column().filterConfig?.label || column().label\"\r\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\r\n [context]=\"column().filterConfig?.context\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('from')\"\r\n (ngModelChange)=\"updateNumber('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('to')\"\r\n (ngModelChange)=\"updateNumber('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showOnFocus", "showClear", "showTime", "timeOnly", "minDate", "maxDate", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "hideUnlinkedHint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "minLength", "context", "size"] }, { kind: "component", type: TreeSelectField, selector: "mt-treeselect-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "required", "pInputs", "options", "selectionMode", "display", "scrollHeight", "panelStyleClass", "containerStyleClass", "overlayOptions", "filter", "filterBy", "filterMode", "filterPlaceholder", "filterLocale", "filterInputAutoFocus", "showClear", "resetFilterOnHide", "propagateSelectionDown", "propagateSelectionUp", "virtualScroll", "virtualScrollItemSize", "loading", "loadingMode", "size", "variant", "fluid", "appendTo", "selectedLabelPath"], outputs: ["onChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2$1.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1190
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableFilterField, isStandalone: true, selector: "mt-table-filter-field", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "@switch (getFilterType()) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n />\r\n }\r\n @case (\"select\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"userSelect\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [markCurrentUser]=\"true\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"treeSelect\") {\r\n <mt-treeselect-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"treeOptions()\"\r\n [placeholder]=\"getTreePlaceholder()\"\r\n [selectionMode]=\"$any(column().filterConfig)?.selectionMode || 'single'\"\r\n [scrollHeight]=\"getTreeScrollHeight()\"\r\n [panelStyleClass]=\"getTreePanelStyleClass()\"\r\n [filter]=\"column().filterConfig?.['filter'] !== false\"\r\n [filterBy]=\"getTreeFilterBy()\"\r\n [filterPlaceholder]=\"getTreeFilterPlaceholder()\"\r\n [showClear]=\"column().filterConfig?.['showClear'] !== false\"\r\n [resetFilterOnHide]=\"\r\n column().filterConfig?.['resetFilterOnHide'] !== false\r\n \"\r\n [overlayOptions]=\"$any(column().filterConfig)?.overlayOptions\"\r\n />\r\n }\r\n @case (\"date\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"dateFrom()\"\r\n (ngModelChange)=\"updateDate('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n [maxDate]=\"dateTo()\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"dateTo()\"\r\n (ngModelChange)=\"updateDate('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n [minDate]=\"dateFrom()\"\r\n />\r\n </div>\r\n @if (isDateRangeReversed()) {\r\n <p-message\r\n severity=\"error\"\r\n variant=\"simple\"\r\n size=\"small\"\r\n role=\"alert\"\r\n [text]=\"'components.table.invalidDateRange' | transloco\"\r\n />\r\n }\r\n </div>\r\n }\r\n @case (\"boolean\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"booleanOptions()\"\r\n [placeholder]=\"'components.table.select' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n @case (\"user\") {\r\n <mt-user-search-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"column().filterConfig?.label || column().label\"\r\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\r\n [context]=\"column().filterConfig?.context\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('from')\"\r\n (ngModelChange)=\"updateNumber('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('to')\"\r\n (ngModelChange)=\"updateNumber('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "optionDisabled", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showOnFocus", "showClear", "showTime", "timeOnly", "minDate", "maxDate", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "hideUnlinkedHint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "minLength", "context", "markUnavailable", "size"] }, { kind: "component", type: TreeSelectField, selector: "mt-treeselect-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "required", "pInputs", "options", "selectionMode", "display", "scrollHeight", "panelStyleClass", "containerStyleClass", "overlayOptions", "filter", "filterBy", "filterMode", "filterPlaceholder", "filterLocale", "filterInputAutoFocus", "showClear", "resetFilterOnHide", "propagateSelectionDown", "propagateSelectionUp", "virtualScroll", "virtualScrollItemSize", "loading", "loadingMode", "size", "variant", "fluid", "appendTo", "selectedLabelPath"], outputs: ["onChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2$1.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1180
1191
|
}
|
|
1181
1192
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilterField, decorators: [{
|
|
1182
1193
|
type: Component,
|
|
@@ -1542,6 +1553,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1542
1553
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-button\r\n (onClick)=\"open(popover, $event)\"\r\n [icon]=\"\r\n hasActiveValue() ? 'general.filter-funnel-02' : 'general.filter-funnel-01'\r\n \"\r\n [severity]=\"hasActiveValue() ? 'primary' : 'secondary'\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [tooltip]=\"'components.table.filter' | transloco\"\r\n styleClass=\"!p-1 !text-sm\"\r\n/>\r\n\r\n<p-popover #popover [style]=\"{ width: '280px' }\" appendTo=\"body\">\r\n <div class=\"flex flex-col gap-3\" (keydown.enter)=\"apply(popover)\">\r\n <h4\r\n class=\"text-sm font-semibold text-gray-700 dark:text-gray-300 truncate\"\r\n [title]=\"column().filterConfig?.label || column().label\"\r\n >\r\n {{ column().filterConfig?.label || column().label }}\r\n </h4>\r\n\r\n <mt-table-filter-field\r\n [column]=\"column()\"\r\n [value]=\"pendingValue()\"\r\n (valueChange)=\"pendingValue.set($event)\"\r\n />\r\n\r\n <div\r\n class=\"flex justify-end gap-2 pt-2 border-t border-surface-200 dark:border-surface-700\"\r\n >\r\n <mt-button\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clear(popover)\"\r\n [label]=\"'components.table.reset' | transloco\"\r\n />\r\n <mt-button\r\n size=\"small\"\r\n (onClick)=\"apply(popover)\"\r\n [disabled]=\"hasReversedDateRange()\"\r\n [label]=\"'components.table.apply' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n</p-popover>\r\n" }]
|
|
1543
1554
|
}], ctorParameters: () => [], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], popoverRef: [{ type: i0.ViewChild, args: ['popover', { isSignal: true }] }] } });
|
|
1544
1555
|
|
|
1556
|
+
const NUMERIC_VIEW_TYPES = new Set(['Number', 'Percentage', 'Currency']);
|
|
1557
|
+
const MAX_FORMAT_DECIMALS = 6;
|
|
1558
|
+
const NUMBER_TOKEN = /[+-]?\d[\d,]*(?:\.\d+)?/;
|
|
1559
|
+
function parseNumber(source) {
|
|
1560
|
+
if (typeof source === 'number') {
|
|
1561
|
+
return Number.isFinite(source)
|
|
1562
|
+
? { value: source, prefix: '', suffix: '', decimals: 0, grouped: false }
|
|
1563
|
+
: null;
|
|
1564
|
+
}
|
|
1565
|
+
if (typeof source !== 'string') {
|
|
1566
|
+
return null;
|
|
1567
|
+
}
|
|
1568
|
+
const text = normalizeNumerals(source);
|
|
1569
|
+
const match = NUMBER_TOKEN.exec(text);
|
|
1570
|
+
if (!match) {
|
|
1571
|
+
return null;
|
|
1572
|
+
}
|
|
1573
|
+
const prefix = text.slice(0, match.index).trimStart();
|
|
1574
|
+
const suffix = text.slice(match.index + match[0].length).trimEnd();
|
|
1575
|
+
// A second number ('1-2', '10 / 20') is not one figure: leave it as text.
|
|
1576
|
+
if (/\d/.test(prefix) || /\d/.test(suffix)) {
|
|
1577
|
+
return null;
|
|
1578
|
+
}
|
|
1579
|
+
const value = Number.parseFloat(match[0].replace(/,/g, ''));
|
|
1580
|
+
if (!Number.isFinite(value)) {
|
|
1581
|
+
return null;
|
|
1582
|
+
}
|
|
1583
|
+
return {
|
|
1584
|
+
value,
|
|
1585
|
+
prefix,
|
|
1586
|
+
suffix,
|
|
1587
|
+
decimals: /\.(\d+)/.exec(match[0])?.[1]?.length ?? 0,
|
|
1588
|
+
grouped: match[0].includes(','),
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
/** A unit as an Excel literal. `"` cannot be escaped inside one, so drop it. */
|
|
1592
|
+
function literal(unit) {
|
|
1593
|
+
const clean = unit.replace(/"/g, '');
|
|
1594
|
+
return clean ? `"${clean}"` : '';
|
|
1595
|
+
}
|
|
1596
|
+
function numberFormat(display) {
|
|
1597
|
+
const digits = Math.min(display.decimals, MAX_FORMAT_DECIMALS);
|
|
1598
|
+
const body = (display.grouped ? '#,##0' : '0') +
|
|
1599
|
+
(digits ? `.${'0'.repeat(digits)}` : '');
|
|
1600
|
+
const format = `${literal(display.prefix)}${body}${literal(display.suffix)}`;
|
|
1601
|
+
return format === '0' ? null : format;
|
|
1602
|
+
}
|
|
1603
|
+
/** points / 100 without binary noise (78.3 / 100 → 0.783, not 0.7829999…). */
|
|
1604
|
+
function toFraction(points) {
|
|
1605
|
+
return Number((points / 100).toPrecision(15));
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* The Excel cell for a Number / Percentage / Currency entity, or `null` when
|
|
1609
|
+
* the entity is not one of those or holds no single figure (text stays text).
|
|
1610
|
+
*
|
|
1611
|
+
* The number comes from `rawValue` (the same source the on-screen percentage
|
|
1612
|
+
* reads), falling back to `value`; the display form decides the unit and
|
|
1613
|
+
* decimals, so the sheet reads like the screen while SUM stays exact.
|
|
1614
|
+
*/
|
|
1615
|
+
function resolveEntityExcelCell(entity) {
|
|
1616
|
+
if (!entity || typeof entity !== 'object') {
|
|
1617
|
+
return null;
|
|
1618
|
+
}
|
|
1619
|
+
const source = entity;
|
|
1620
|
+
if (!NUMERIC_VIEW_TYPES.has(source.viewType)) {
|
|
1621
|
+
return null;
|
|
1622
|
+
}
|
|
1623
|
+
const isComparison = source.comparison?.kind === 'Value';
|
|
1624
|
+
const resolved = TableValueResolver.unwrapComparison(source);
|
|
1625
|
+
const display = parseNumber(resolved.value);
|
|
1626
|
+
const raw = isComparison ? null : parseNumber(resolved.rawValue);
|
|
1627
|
+
const figure = raw ?? display;
|
|
1628
|
+
if (!figure) {
|
|
1629
|
+
return null;
|
|
1630
|
+
}
|
|
1631
|
+
if (source.viewType === 'Percentage') {
|
|
1632
|
+
return {
|
|
1633
|
+
value: toFraction(figure.value),
|
|
1634
|
+
format: '0.0%',
|
|
1635
|
+
text: `${Number(figure.value.toFixed(1))}%`,
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
const format = display ? numberFormat(display) : null;
|
|
1639
|
+
return {
|
|
1640
|
+
value: figure.value,
|
|
1641
|
+
format,
|
|
1642
|
+
text: typeof resolved.value === 'string'
|
|
1643
|
+
? resolved.value
|
|
1644
|
+
: String(figure.value),
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1647
|
+
/** `TableExportConfig.resolveExcelCell` for tables whose entity columns export. */
|
|
1648
|
+
function resolveEntityColumnExcelCell(row, column) {
|
|
1649
|
+
if (column.type !== 'entity') {
|
|
1650
|
+
return null;
|
|
1651
|
+
}
|
|
1652
|
+
return resolveEntityExcelCell(TableValueResolver.getProperty(row, column.key));
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1545
1655
|
function stripHtmlToPlainText(value) {
|
|
1546
1656
|
if (value === null || value === undefined) {
|
|
1547
1657
|
return '';
|
|
@@ -1635,7 +1745,8 @@ class TableExportService {
|
|
|
1635
1745
|
const worksheet = XLSX.utils.json_to_sheet(labeledRows, {
|
|
1636
1746
|
header: columns.map((column) => column.label),
|
|
1637
1747
|
});
|
|
1638
|
-
this.
|
|
1748
|
+
const numericCells = this.writeNumericCells(XLSX, worksheet, config, columns);
|
|
1749
|
+
this.configureWorksheet(worksheet, columns, labeledRows, numericCells);
|
|
1639
1750
|
const workbook = XLSX.utils.book_new();
|
|
1640
1751
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
1641
1752
|
if (this.isRtlExport()) {
|
|
@@ -1788,12 +1899,40 @@ class TableExportService {
|
|
|
1788
1899
|
? stripHtmlToPlainText(value)
|
|
1789
1900
|
: (value ?? null);
|
|
1790
1901
|
}
|
|
1791
|
-
|
|
1902
|
+
/**
|
|
1903
|
+
* Replaces the cells whose caller offered a numeric form with real number
|
|
1904
|
+
* cells carrying their format. A column-level `exportValue` always wins, and
|
|
1905
|
+
* a cell the hook declines (`null`) is left exactly as `json_to_sheet` wrote
|
|
1906
|
+
* it. Returns the cells by row then column so widths can measure their text.
|
|
1907
|
+
*/
|
|
1908
|
+
writeNumericCells(XLSX, worksheet, config, columns) {
|
|
1909
|
+
const resolve = config.resolveExcelCell;
|
|
1910
|
+
if (!resolve) {
|
|
1911
|
+
return [];
|
|
1912
|
+
}
|
|
1913
|
+
return config.rows.map((row, rowIndex) => columns.map((column, columnIndex) => {
|
|
1914
|
+
if (column.exportValue) {
|
|
1915
|
+
return null;
|
|
1916
|
+
}
|
|
1917
|
+
const cell = resolve(row, column);
|
|
1918
|
+
if (!cell) {
|
|
1919
|
+
return null;
|
|
1920
|
+
}
|
|
1921
|
+
worksheet[XLSX.utils.encode_cell({ r: rowIndex + 1, c: columnIndex })] =
|
|
1922
|
+
cell.format
|
|
1923
|
+
? { t: 'n', v: cell.value, z: cell.format }
|
|
1924
|
+
: { t: 'n', v: cell.value };
|
|
1925
|
+
return cell;
|
|
1926
|
+
}));
|
|
1927
|
+
}
|
|
1928
|
+
configureWorksheet(worksheet, columns, rows, numericCells = []) {
|
|
1792
1929
|
if (worksheet['!ref']) {
|
|
1793
1930
|
worksheet['!autofilter'] = { ref: worksheet['!ref'] };
|
|
1794
1931
|
}
|
|
1795
1932
|
worksheet['!cols'] = columns.map((column) => {
|
|
1796
|
-
const
|
|
1933
|
+
const columnIndex = columns.indexOf(column);
|
|
1934
|
+
const contentWidth = rows.reduce((width, row, rowIndex) => Math.max(width, (numericCells[rowIndex]?.[columnIndex]?.text ??
|
|
1935
|
+
String(row[column.label] ?? '')).length), column.label.length);
|
|
1797
1936
|
return { wch: Math.min(50, Math.max(10, contentWidth + 2)) };
|
|
1798
1937
|
});
|
|
1799
1938
|
}
|
|
@@ -2873,6 +3012,7 @@ class Table {
|
|
|
2873
3012
|
columns: this.columns(),
|
|
2874
3013
|
filename: this.exportFilename(),
|
|
2875
3014
|
resolveValue: (row, column) => this.getColumnExportValue(row, column),
|
|
3015
|
+
resolveExcelCell: resolveEntityColumnExcelCell,
|
|
2876
3016
|
});
|
|
2877
3017
|
}
|
|
2878
3018
|
printPdf() {
|
|
@@ -3642,5 +3782,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3642
3782
|
* Generated bundle index. Do not edit.
|
|
3643
3783
|
*/
|
|
3644
3784
|
|
|
3645
|
-
export { EMPTY_GROUP_KEY, Table, TableActionsMenu, TableCaption, TableColumnFilter, TableExportService, TableFilter, TableFilterField, TableGroupingController, TableValueResolver };
|
|
3785
|
+
export { EMPTY_GROUP_KEY, Table, TableActionsMenu, TableCaption, TableColumnFilter, TableExportService, TableFilter, TableFilterField, TableGroupingController, TableValueResolver, resolveEntityColumnExcelCell, resolveEntityExcelCell };
|
|
3646
3786
|
//# sourceMappingURL=masterteam-components-table.mjs.map
|