@acorex/components 22.0.0-next.2 → 22.0.0-next.21
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/combo-box/README.md +3 -0
- package/fesm2022/acorex-components-calendar.mjs +12 -14
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +2 -2
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-combo-box.mjs +669 -0
- package/fesm2022/acorex-components-combo-box.mjs.map +1 -0
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs +50 -0
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs.map +1 -0
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs → acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs} +2 -2
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs.map → acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +194 -5768
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +12 -12
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +44 -12
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +332 -312
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +11 -1
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +2 -2
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-file-viewer.mjs +346 -125
- package/fesm2022/acorex-components-file-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +4 -3
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +265 -19
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +1170 -13712
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +211 -74
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +6 -6
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +388 -78
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +6 -2
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs +2 -2
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs +2 -2
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +16 -16
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +2 -2
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +176 -451
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +0 -4
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/package.json +7 -7
- package/select-box/README.md +2 -0
- package/types/acorex-components-combo-box.d.ts +202 -0
- package/types/acorex-components-conversation.d.ts +11 -25
- package/types/acorex-components-datetime-box.d.ts +16 -4
- package/types/acorex-components-datetime-input.d.ts +62 -68
- package/types/acorex-components-file-viewer.d.ts +109 -17
- package/types/acorex-components-list.d.ts +65 -3
- package/types/acorex-components-map.d.ts +299 -45
- package/types/acorex-components-menu.d.ts +26 -4
- package/types/acorex-components-phone-box.d.ts +2 -2
- package/types/acorex-components-popup.d.ts +143 -35
- package/types/acorex-components-query-builder.d.ts +10 -9
- package/types/acorex-components-select-box.d.ts +36 -147
- package/types/acorex-components-selection-list.d.ts +1 -2
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-CNHiM1Sp.mjs +0 -106
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-CNHiM1Sp.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-acorex-components-modal-Djl-uo9b.mjs +0 -388
- package/fesm2022/acorex-components-modal-acorex-components-modal-Djl-uo9b.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-modal-content.component-BpUsCI8D.mjs +0 -247
- package/fesm2022/acorex-components-modal-modal-content.component-BpUsCI8D.mjs.map +0 -1
- package/fesm2022/acorex-components-modal.mjs +0 -2
- package/fesm2022/acorex-components-modal.mjs.map +0 -1
- package/modal/README.md +0 -3
- package/types/acorex-components-modal.d.ts +0 -132
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-components-combo-box.mjs","sources":["../../../../packages/components/combo-box/src/lib/combo-box.component.ts","../../../../packages/components/combo-box/src/lib/combo-box.component.html","../../../../packages/components/combo-box/src/lib/combo-box.module.ts","../../../../packages/components/combo-box/src/acorex-components-combo-box.ts"],"sourcesContent":["import {\n AXClearableComponent,\n AXClosableComponent,\n AXComponent,\n AXDataSource,\n AXEvent,\n AXFocusableComponent,\n AXHotkeysService,\n AXItemClickEvent,\n AXItemSelectedEvent,\n AXSearchableComponent,\n AXValuableComponent,\n AXValueChangedEvent,\n AX_SELECTION_DATA_TOKEN,\n MXLookComponent,\n MXSelectionBridgeService,\n MXSelectionValueComponent,\n convertArrayToDataSource,\n} from '@acorex/cdk/common';\nimport { AXDecoratorCloseButtonComponent, AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXDropdownBoxComponent, MXDropdownBoxBaseComponent } from '@acorex/components/dropdown';\nimport { AXListComponent } from '@acorex/components/list';\nimport { AXLoadingSpinnerComponent } from '@acorex/components/loading';\nimport { AXSearchBoxComponent } from '@acorex/components/search-box';\nimport { AXTagComponent } from '@acorex/components/tag';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { AXUnsubscriber } from '@acorex/core/utils';\nimport { AsyncPipe, NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n ContentChild,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n afterNextRender,\n forwardRef,\n inject,\n input,\n linkedSignal,\n signal,\n} from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { findLastIndex, get, isEqual, last, nth } from 'lodash-es';\nimport { classes } from 'polytype';\nimport { Observable, Subscription } from 'rxjs';\n\n/**\n * The ComboBox is a component which supports static arrays and advanced AXDataSource with lazy loading.\n * @category\n */\n@Component({\n selector: 'ax-combo-box',\n templateUrl: './combo-box.component.html',\n styleUrl: './combo-box.component.css',\n inputs: [\n 'disabled',\n 'readonly',\n 'tabIndex',\n 'placeholder',\n 'minValue',\n 'maxValue',\n 'value',\n 'state',\n 'name',\n 'id',\n 'type',\n 'look',\n 'multiple',\n 'valueField',\n 'textField',\n 'disabledField',\n 'textTemplate',\n 'selectedItems',\n ],\n outputs: [\n 'valueChange',\n 'stateChange',\n 'onValueChanged',\n 'onBlur',\n 'onFocus',\n 'readonlyChange',\n 'disabledChange',\n 'onOpened',\n 'onClosed',\n 'onItemSelected',\n 'onItemClick',\n ],\n\n encapsulation: ViewEncapsulation.None,\n providers: [\n { provide: AXComponent, useExisting: AXComboBoxComponent },\n { provide: AXFocusableComponent, useExisting: AXComboBoxComponent },\n { provide: AXValuableComponent, useExisting: AXComboBoxComponent },\n { provide: AXClearableComponent, useExisting: AXComboBoxComponent },\n { provide: AXClosableComponent, useExisting: AXComboBoxComponent },\n { provide: AXSearchableComponent, useExisting: AXComboBoxComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXComboBoxComponent),\n multi: true,\n },\n {\n provide: AX_SELECTION_DATA_TOKEN,\n useClass: MXSelectionBridgeService,\n },\n AXUnsubscriber,\n ],\n host: { ngSkipHydration: 'true' },\n imports: [\n AXDropdownBoxComponent,\n NgTemplateOutlet,\n NgClass,\n AXDecoratorGenericComponent,\n AXDecoratorCloseButtonComponent,\n AXListComponent,\n FormsModule,\n AsyncPipe,\n AXTranslatorPipe,\n AXTagComponent,\n AXLoadingSpinnerComponent,\n ],\n})\nexport class AXComboBoxComponent\n extends classes(MXDropdownBoxBaseComponent, MXSelectionValueComponent, MXLookComponent)\n implements OnDestroy\n{\n /**\n * Determines if an item is truncated.\n *\n * @defaultValue true\n */\n readonly isItemTruncated = input(true);\n\n /**\n * Determines if a tooltip is shown for an item.\n *\n * @defaultValue false\n */\n readonly showItemTooltip = input(false);\n\n /** Height of each list item in pixels, or 'auto' to let list measure. */\n itemHeight = input<number | 'auto'>(40);\n\n /** Maximum number of visible items before scrolling. */\n maxVisibleItems = input(5);\n\n /** @ignore */\n private hotKeyService: AXHotkeysService = inject(AXHotkeysService);\n\n /** @ignore */\n protected isLoading = signal(false);\n\n /** @ignore */\n protected searchValue = signal('');\n\n /** @ignore */\n protected renderList = signal(false);\n\n /** @ignore */\n protected _dropdownWidth = linkedSignal<string>(() => this.dropdownWidth());\n\n /** @ignore */\n protected _dropdownHeight = signal<string>('auto');\n\n /** @ignore */\n protected _listDataSource: AXDataSource<any> = convertArrayToDataSource([], {\n key: this.valueField,\n pageSize: 10,\n });\n\n /** @ignore */\n private _originalDataSource: AXDataSource<any> | any[];\n\n /** @ignore */\n private onChangedSubscription: Subscription;\n\n /** @ignore */\n private onLoadingChangedSubscription: Subscription;\n\n #init = afterNextRender(() => {\n const formField = this.getHostElement().closest('ax-form-field');\n if (formField?.classList.contains('ax-state-floating-label')) {\n this.getHostElement().classList.add('ax-float-label');\n }\n });\n\n /**\n * Gets the data source for the component, which can be either an `AXDataSource` or an array of items.\n * @returns {AXDataSource<any> | any[]}\n */\n public get dataSource(): AXDataSource<any> | any[] {\n return this._originalDataSource;\n }\n\n /**\n * Sets the data source, either as an `AXDataSource` or an array.\n * @param {AXDataSource<any> | any[]} v\n */\n @Input()\n public set dataSource(v: AXDataSource<any> | any[]) {\n // check if the data source is the same\n if (Array.isArray(v) && Array.isArray(this._originalDataSource) && isEqual(v, this._originalDataSource)) {\n return;\n }\n if (v instanceof AXDataSource && v == this._originalDataSource) {\n return;\n }\n //\n this._originalDataSource = v;\n if (Array.isArray(v)) {\n this._listDataSource = convertArrayToDataSource(v, {\n key: this.valueField,\n pageSize: v.length || 10,\n });\n } else {\n this._listDataSource = this.dataSource as AXDataSource<any>;\n }\n //\n this.onChangedSubscription?.unsubscribe();\n this.onChangedSubscription = this._listDataSource.onChanged\n .pipe(this._unsubscriber.takeUntilDestroy)\n .subscribe(() => {\n this.updateDropdownSize();\n // Force refresh of selected items when data source changes\n this.forceRefreshSelectedItems();\n if (this.isOpen) {\n this.scheduleRevealSelected();\n }\n });\n //\n this.onLoadingChangedSubscription?.unsubscribe();\n this.onLoadingChangedSubscription = this._listDataSource.onLoadingChanged\n .pipe(this._unsubscriber.takeUntilDestroy)\n .subscribe((loading) => {\n this.isLoading.set(loading);\n // After async load completes while open, scroll/focus the selected item.\n if (!loading && this.isOpen) {\n this.scheduleRevealSelected();\n }\n });\n\n // After setting data source, try to fetch item data if needed\n setTimeout(() => this.fetchItemDataIfNeeded(), 0);\n }\n\n /**\n * The placeholder text displayed when the component is empty.\n * @param {string} placeholder\n */\n @Input()\n placeholder: string;\n\n /**\n * The minRecordsForSearch defines the minimum number of records required to display the search box.\n * @param {number} minRecordsForSearch\n */\n @Input()\n minRecordsForSearch: number;\n\n /**\n * The caption text to be displayed in the component.\n * @param {string} caption\n */\n @Input()\n caption: string;\n\n /**\n * The template used to customize the rendering of items.\n * @param {TemplateRef<any>} itemTemplate\n */\n @Input()\n itemTemplate: TemplateRef<any>;\n\n /**\n * The template used to customize the rendering of selected items.\n * @param {TemplateRef<any>} selectedTemplate\n */\n @Input()\n selectedTemplate: TemplateRef<any>;\n\n /**\n * The template used to display when there are no items.\n * @param {TemplateRef<any>} emptyTemplate\n */\n @Input()\n emptyTemplate: TemplateRef<any>;\n\n /**\n * The template used to display while loading.\n * @param {TemplateRef<any>} loadingTemplate\n */\n @Input()\n loadingTemplate: TemplateRef<any>;\n\n /**\n * The width of the dropdown in pixels.\n * @defaultValue null\n */\n dropdownWidth = input<string>(null);\n\n /** @ignore */\n @ViewChild('panel') panel!: ElementRef<HTMLDivElement>;\n\n /** @ignore */\n @ViewChild(AXListComponent)\n list: AXListComponent;\n\n /** @ignore */\n @ContentChild(AXSearchBoxComponent)\n searchBox: AXSearchBoxComponent;\n\n searchBoxAutoFocus = input(true);\n\n /** @ignore */\n @ViewChild(AXDropdownBoxComponent, { static: true })\n protected dropdown: AXDropdownBoxComponent;\n\n /**\n * Service for managing selection data, injected via `AX_SELECTION_DATA_TOKEN`.\n */\n public selectionService = inject(AX_SELECTION_DATA_TOKEN);\n\n searchEvent: Observable<any>;\n\n /** @ignore */\n private _unsubscriber = inject(AXUnsubscriber);\n\n /** @ignore */\n protected override ngOnInit(): void {\n super.ngOnInit();\n //\n this.registerValidation();\n // Proactively fetch item data if we have a value but no corresponding item\n this.fetchItemDataIfNeeded();\n }\n\n /**\n * Proactively fetches item data if the component has a value but no corresponding item data.\n * This prevents showing \"loading...\" when the component has a value.\n */\n private async fetchItemDataIfNeeded(): Promise<void> {\n const isEmptyValue = this.value == null || (Array.isArray(this.value) && this.value.length === 0);\n\n if (!isEmptyValue && this._listDataSource && !this.selectedItems?.length) {\n try {\n const item = await this.getItemByKey(this.value);\n if (item) {\n // Force refresh to update the display\n this.forceRefreshSelectedItems();\n }\n } catch (error) {\n console.warn('Failed to fetch item data:', error);\n }\n }\n }\n\n /** @ignore */\n override ngOnDestroy(): void {\n this.searchBox?.onKeyDown.unsubscribe();\n this.onChangedSubscription?.unsubscribe();\n this.onLoadingChangedSubscription?.unsubscribe();\n }\n\n /**\n * Retrieves an item by its key.\n * @param {any} key\n */\n getItemByKey(key: any): Promise<any> | any {\n // Static array data sources resolve synchronously to avoid a false loading state\n // for primitive values (e.g. color format \"hex\" / \"rgba\").\n if (Array.isArray(this._originalDataSource)) {\n for (const candidate of this._originalDataSource) {\n if (candidate != null && typeof candidate === 'object') {\n if (get(candidate, this.valueField) == key || get(candidate, this.textField) == key) {\n return candidate;\n }\n } else if (candidate == key) {\n return { [this.valueField]: candidate, [this.textField]: String(candidate ?? '') };\n }\n }\n return null;\n }\n\n if (this._listDataSource && typeof this._listDataSource.find === 'function') {\n return this._listDataSource.find(key);\n }\n\n // If neither method is available, return null\n console.warn('No find method available on data source');\n return null;\n }\n\n /** @ignore */\n protected _handleOnOpenedEvent(e: AXEvent) {\n if (!this.renderList()) {\n this.renderList.set(true);\n } else if (!this._listDataSource.totalCount || this._listDataSource.totalCount == 0) {\n this.list?.refresh(false);\n }\n this._handleFocus();\n //\n this.onOpened.emit({\n component: this,\n isUserInteraction: e.isUserInteraction,\n });\n this.updateDropdownSize();\n\n // Force refresh of selected items when opening to show updated text\n this.forceRefreshSelectedItems();\n // Keep retrying until async pages arrive and the viewport has a real size.\n this.scheduleRevealSelected();\n }\n\n /** @ignore */\n protected _handleOnClosedEvent(e: AXEvent) {\n this.list?.cancelRevealSelected();\n this.onClosed.emit({\n component: this,\n isUserInteraction: e.isUserInteraction,\n });\n this._unsubscriber.unsubscribe();\n }\n\n /** @ignore */\n protected _handleFocus() {\n // Wait a tick so the list is created (first open) and dropdown height is applied.\n setTimeout(() => {\n if (this.searchBox) {\n this.searchBox.look = 'flat';\n if (this.searchBoxAutoFocus()) {\n this.searchBox.focus();\n }\n //TODO: unsubscribe\n this.hotKeyService\n .addShortcut({ keys: 'Control.f', element: this.panel.nativeElement })\n .pipe(this._unsubscriber.takeUntilDestroy)\n .subscribe(() => {\n this.searchBox.focus();\n });\n this.searchBox.onKeyDown.pipe(this._unsubscriber.takeUntilDestroy).subscribe((e) => {\n if (e.nativeEvent.code === 'ArrowDown' || e.nativeEvent.key === 'ArrowDown') {\n this.list?.focus();\n e.nativeEvent.preventDefault();\n }\n });\n } else {\n this.list?.focus();\n }\n });\n }\n\n /**\n * Scroll (and focus when there is no search autofocus) to the selected item once the list is ready.\n * @ignore\n */\n private scheduleRevealSelected(): void {\n const focusList = !this.searchBox || !this.searchBoxAutoFocus();\n setTimeout(() => {\n this.list?.revealSelected({ focus: focusList });\n });\n }\n\n /** @ignore */\n protected _handleBadgeRemove(e: MouseEvent, item) {\n this.unselectItems(item);\n e.stopPropagation();\n }\n\n /** @ignore */\n protected _handleValueChanged(e: AXValueChangedEvent) {\n if (e.isUserInteraction) {\n if (!this.multiple) {\n this.close();\n }\n this.commitValue(e.component.selectedItems, true);\n }\n }\n\n /** @ignore */\n protected _handleItemClick(e: AXItemClickEvent) {\n this.onItemClick.emit(e);\n if (!this.multiple) {\n this.close();\n }\n }\n\n /** @ignore */\n protected _handleItemSelected(e: AXItemSelectedEvent) {\n this.onItemSelected.emit(e);\n this.resetSearchAfterSelection();\n if (!this.multiple) {\n this.close();\n }\n }\n\n private resetSearchAfterSelection(): void {\n if (!this.searchBox && !this.searchBox?.value) return;\n if (this.searchBox && this.searchBox?.value) this.searchBox.commitValue('', false);\n }\n\n /** @ignore */\n private setDropdownSize(count = 0) {\n const itemPx = typeof this.itemHeight() === 'number' ? (this.itemHeight() as number) : 40;\n const isActionsheet = this.dropdown.isActionsheetStyle;\n\n if (isActionsheet) {\n this._dropdownWidth.set('100%');\n // Prefer maxVisibleItems on actionsheet too; still clamp to the pane afterwards.\n const maxItems = Math.max(Number(this.maxVisibleItems()) || 5, 1);\n this._dropdownHeight.set(`${Math.min(maxItems, Math.max(count, 1)) * itemPx}px`);\n } else {\n const hostWidth = Math.max(this.getHostElement().offsetWidth, Number(this.dropdownWidth()) || 0);\n const maxItems = Number(this.maxVisibleItems());\n this._dropdownWidth.set(`${hostWidth}px`);\n this._dropdownHeight.set(count == 0 ? 'auto' : `${Math.min(maxItems, count) * itemPx}px`);\n }\n\n setTimeout(() => {\n this._fitListHeightToAvailableSpace(itemPx);\n this.dropdown.updatePosition();\n this.list?.render();\n // Second pass after the overlay pane applies max-height / overflow constraints.\n // Height changes invalidate the previous scroll offset — scroll again after fit.\n requestAnimationFrame(() => {\n setTimeout(() => {\n this._fitListHeightToAvailableSpace(itemPx);\n this.list?.render();\n requestAnimationFrame(() => this.scheduleRevealSelected());\n }, 0);\n });\n });\n }\n\n /**\n * Shrinks list height to the visible overlay area so virtual scroll ends on fully\n * visible rows instead of inside an overflow:hidden clipped region.\n * @ignore\n */\n private _fitListHeightToAvailableSpace(itemPx: number) {\n if (itemPx <= 0 || this._dropdownHeight() === 'auto') {\n return;\n }\n\n const panel = this.panel?.nativeElement as HTMLElement | undefined;\n const listEl = this.list?.getHostElement?.() as HTMLElement | undefined;\n if (!panel || !listEl) {\n return;\n }\n\n const pane = panel.closest('.ax-overlay-pane') as HTMLElement | null;\n if (!pane) {\n return;\n }\n\n const listRect = listEl.getBoundingClientRect();\n const paneRect = pane.getBoundingClientRect();\n const paneOverflow = listRect.bottom - paneRect.bottom;\n const viewportOverflow = listRect.bottom - window.innerHeight;\n const overflow = Math.max(paneOverflow, viewportOverflow);\n\n let nextHeight = listEl.clientHeight || parseFloat(this._dropdownHeight());\n if (!Number.isFinite(nextHeight) || nextHeight <= 0) {\n return;\n }\n\n // When the list extends past the overlay pane or screen, shrink it to the visible area.\n if (overflow > 1) {\n nextHeight = Math.max(itemPx, nextHeight - overflow);\n }\n\n // Keep height as whole rows so the last item is never permanently cropped.\n nextHeight = Math.max(itemPx, Math.floor(nextHeight / itemPx) * itemPx);\n\n const current = parseFloat(this._dropdownHeight());\n if (!Number.isFinite(current) || nextHeight !== current) {\n this._dropdownHeight.set(`${nextHeight}px`);\n }\n }\n\n private updateDropdownPosition() {\n setTimeout(() => {\n this.dropdown.updatePosition();\n });\n }\n\n private updateDropdownSize() {\n setTimeout(() => {\n this.setDropdownSize(this._listDataSource.totalCount);\n this.updateDropdownPosition();\n this.list?.render();\n if (!this.isItemTruncated()) {\n setTimeout(() => {\n this._fitDropdownToContent();\n setTimeout(() => this._fitDropdownToContent(), 100);\n });\n }\n });\n }\n\n private _fitDropdownToContent() {\n const panel = this.panel?.nativeElement;\n if (!panel) return;\n\n const hostWidth = Math.max(this.getHostElement().offsetWidth, Number(this.dropdownWidth()) || 0);\n let contentWidth = hostWidth;\n\n panel.querySelectorAll<HTMLElement>('li.list-item').forEach((item) => {\n const label = item.querySelector<HTMLElement>('.ax-label-container span');\n if (label) {\n const labelContainer = label.parentElement;\n const horizontalPadding = labelContainer ? item.offsetWidth - labelContainer.clientWidth : 0;\n contentWidth = Math.max(contentWidth, label.scrollWidth + horizontalPadding);\n } else {\n contentWidth = Math.max(contentWidth, item.scrollWidth);\n }\n });\n\n const nextWidth = `${Math.max(hostWidth, contentWidth)}px`;\n if (this._dropdownWidth() !== nextWidth) {\n this._dropdownWidth.set(nextWidth);\n this.dropdown.updatePosition();\n }\n }\n\n override internalValueChanged(value: any) {\n super.internalValueChanged(value);\n this.updateDropdownPosition();\n // Try to fetch item data when value changes\n setTimeout(() => this.fetchItemDataIfNeeded(), 0);\n }\n\n /** @ignore */\n @HostListener('keydown', ['$event'])\n _handleKeydown(e: KeyboardEvent) {\n if (e.code === 'ArrowDown' || e.code === 'ArrowUp') {\n this.selectItemByNav(e.code === 'ArrowDown' ? 1 : -1);\n e.preventDefault();\n } else if (e.code === 'Backspace') {\n this.unselectItems(this.selectedItems.pop());\n e.preventDefault();\n }\n }\n\n /** @ignore */\n private selectItemByNav(sign: 1 | -1) {\n if (Array.isArray(this.dataSource) && !this.multiple) {\n const items = this.normalizeItemsList(this.dataSource);\n const _last: any = last(this.selectedItems);\n let i = -1;\n if (_last) {\n i = findLastIndex(items, [this.valueField, get(_last as Record<string, unknown>, this.valueField)]);\n }\n i += sign;\n if (i < 0 || i >= items.length) return;\n const next = nth<any>(items, i);\n if (next) {\n this.selectItems(next);\n }\n } else {\n this.open();\n }\n }\n\n /**\n * Filters the data source based on the provided search term.\n * @param {string} term\n */\n search(term: string) {\n this.searchValue.set(term);\n if (term) {\n this._listDataSource.filter({\n field: this.textField,\n value: term,\n operator: { type: 'contains' },\n });\n } else {\n this._listDataSource.clearFilter();\n }\n this._listDataSource.refresh();\n }\n\n /**\n * Refreshes the component by resetting state, clearing selection cache, refreshing the list, and closing the component.\n */\n refresh() {\n this.reset(false);\n this.clearSelectionCache();\n this.list?.refresh();\n this.close();\n }\n\n @HostListener('click')\n hostClickListener() {\n this.toggle();\n }\n}\n","<ax-dropdown-box\n [class.ax-state-multiple]=\"multiple\"\n (onOpened)=\"_handleOnOpenedEvent($event)\"\n (onClosed)=\"_handleOnClosedEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [disabled]=\"disabled\"\n [look]=\"look\"\n [popoverWidth]=\"dropdownWidth()\"\n>\n <ng-container input>\n <ng-content select=\"ax-prefix\"> </ng-content>\n <div\n class=\"ax-editor ax-chips-container ax-content ax-input\"\n [class.ax-state-multiple]=\"multiple\"\n [tabindex]=\"tabIndex\"\n >\n @if (selectedItems.length === 0) {\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\">\n {{ placeholder | translate | async }}\n </div>\n }\n @for (item of selectedItems; track $index) {\n @if (selectedTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"selectedTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: { data: item } }\"\n ></ng-template>\n } @else {\n @if (multiple) {\n <ax-tag [text]=\"getDisplayText(item) | translate | async\" look=\"twotone\">\n @if (!disabled && !readonly && multiple) {\n <ax-suffix>\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleBadgeRemove($event, item)\"></span>\n </ax-suffix>\n }\n </ax-tag>\n } @else {\n {{ getDisplayText(item) | translate | async }}\n }\n }\n }\n </div>\n @if (selectedItems?.length && !disabled && !readonly) {\n <ng-content select=\"ax-clear-button\"></ng-content>\n }\n <button type=\"button\" [disabled]=\"disabled\" [tabIndex]=\"-1\" class=\"ax-general-button-icon\">\n @if (isLoading()) {\n <ax-loading-spinner [size]=\"16\" [stroke]=\"1\"></ax-loading-spinner>\n } @else {\n <span\n class=\"ax-icon\"\n [ngClass]=\"{\n 'ax-icon-chevron-down': !isOpen,\n 'ax-icon-chevron-up': isOpen,\n }\"\n ></span>\n }\n </button>\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-template #search>\n <ng-content select=\"ax-search-box\"> </ng-content>\n </ng-template>\n </ng-container>\n <ng-container panel>\n <div\n #panel\n class=\"ax-combo-box-panel\"\n [class.ax-no-truncate]=\"!isItemTruncated()\"\n [style.min-width]=\"_dropdownWidth()\"\n >\n @if (dropdown.isActionsheetStyle) {\n <ax-header class=\"ax-solid\">\n <ax-title>{{ caption || placeholder || '@acorex:selectbox.popover.title' | translate | async }}</ax-title>\n <ax-close-button [icon]=\"multiple ? 'ax-icon ax-icon-check' : 'ax-icon ax-icon-close'\"></ax-close-button>\n </ax-header>\n }\n @if (searchBox && (!minRecordsForSearch || _listDataSource.totalCount >= minRecordsForSearch || searchValue())) {\n <div class=\"ax-search-container\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n </div>\n }\n @if (renderList()) {\n <ax-list\n [name]=\"name\"\n [ngModel]=\"value\"\n [readonly]=\"readonly\"\n [multiple]=\"multiple\"\n [textField]=\"textField\"\n [selectionMode]=\"'item'\"\n [valueField]=\"valueField\"\n [itemHeight]=\"itemHeight()\"\n [itemTemplate]=\"itemTemplate\"\n [textTemplate]=\"textTemplate\"\n [dataSource]=\"_listDataSource\"\n [style.height]=\"_dropdownHeight()\"\n [loadingTemplate]=\"loadingTemplate\"\n [isItemTruncated]=\"isItemTruncated()\"\n [showItemTooltip]=\"showItemTooltip()\"\n (onItemClick)=\"_handleItemClick($event)\"\n [emptyTemplate]=\"emptyTemplate ?? empty\"\n (onValueChanged)=\"_handleValueChanged($event)\"\n (onItemSelected)=\"_handleItemSelected($event)\"\n >\n </ax-list>\n <ng-template #empty>\n {{ '@acorex:common.general.no-result-found' | translate | async }}\n </ng-template>\n }\n\n @if (isLoading()) {\n @if (loadingTemplate) {\n <ng-template [ngTemplateOutlet]=\"loadingTemplate\"></ng-template>\n }\n }\n\n <ng-content select=\"ax-footer\"> </ng-content>\n </div>\n </ng-container>\n</ax-dropdown-box>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n","import { AXBadgeModule } from '@acorex/components/badge';\nimport { AXCheckBoxModule } from '@acorex/components/check-box';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXPopoverModule } from '@acorex/components/popover';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AXCommonModule } from '@acorex/cdk/common';\nimport { AXDropdownModule } from '@acorex/components/dropdown';\nimport { AXListModule } from '@acorex/components/list';\nimport { AXTextBoxModule } from '@acorex/components/text-box';\nimport { AXComboBoxComponent } from './combo-box.component';\n\n@NgModule({\n imports: [\n CommonModule,\n AXCommonModule,\n FormsModule,\n AXCheckBoxModule,\n AXBadgeModule,\n AXDecoratorModule,\n AXTranslationModule,\n AXPopoverModule,\n AXLoadingModule,\n A11yModule,\n AXTextBoxModule,\n AXDropdownModule,\n AXListModule,\n AXComboBoxComponent,\n ],\n exports: [AXComboBoxComponent],\n providers: [],\n})\nexport class AXComboBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkDA;;;AAGG;AAyEG,MAAO,mBACX,SAAQ,OAAO,CAAC,0BAA0B,EAAE,yBAAyB,EAAE,eAAe,CAAC,CAAA;AAzEzF,IAAA,WAAA,GAAA;;AA4EE;;;;AAIG;QACM,IAAA,CAAA,eAAe,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AAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAlBzB,YAAY;YACZ,cAAc;YACd,WAAW;YACX,gBAAgB;YAChB,aAAa;YACb,iBAAiB;YACjB,mBAAmB;YACnB,eAAe;YACf,eAAe;YACf,UAAU;YACV,eAAe;YACf,gBAAgB;YAChB,YAAY;AACZ,YAAA,mBAAmB,aAEX,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAGlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAlBzB,YAAY;YACZ,cAAc;YACd,WAAW;YACX,gBAAgB;YAChB,aAAa;YACb,iBAAiB;YACjB,mBAAmB;YACnB,eAAe;YACf,eAAe;YACf,UAAU;YACV,eAAe;YACf,gBAAgB;YAChB,YAAY;YACZ,mBAAmB,CAAA,EAAA,CAAA,CAAA;;2FAKV,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBApB5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,WAAW;wBACX,gBAAgB;wBAChB,aAAa;wBACb,iBAAiB;wBACjB,mBAAmB;wBACnB,eAAe;wBACf,eAAe;wBACf,UAAU;wBACV,eAAe;wBACf,gBAAgB;wBAChB,YAAY;wBACZ,mBAAmB;AACpB,qBAAA;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC9B,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACpCD;;AAEG;;;;"}
|
package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AXComponentCloseEvent, AXClosableComponent } from '@acorex/cdk/common';
|
|
2
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, input, computed, EventEmitter, ViewEncapsulation, Component } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
class AXConversationComposerActionChoiceDialogComponent {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.translation = inject(AXTranslationService);
|
|
9
|
+
this.actions = input.required(/* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
11
|
+
this.fileCount = input(1, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "fileCount" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.composerActionRegistry = input.required(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "composerActionRegistry" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.__popup__ = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "__popup__" }] : /* istanbul ignore next */ []));
|
|
17
|
+
this.hintText = computed(() => {
|
|
18
|
+
const count = this.fileCount();
|
|
19
|
+
if (count === 1) {
|
|
20
|
+
return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-single');
|
|
21
|
+
}
|
|
22
|
+
return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-multiple', {
|
|
23
|
+
params: { count },
|
|
24
|
+
});
|
|
25
|
+
}, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "hintText" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.onClosed = new EventEmitter();
|
|
28
|
+
}
|
|
29
|
+
getActionLabel(action) {
|
|
30
|
+
return this.composerActionRegistry().getActionLabel(action);
|
|
31
|
+
}
|
|
32
|
+
getActionTooltip(action) {
|
|
33
|
+
return this.composerActionRegistry().getActionTooltip(action);
|
|
34
|
+
}
|
|
35
|
+
choose(action) {
|
|
36
|
+
const event = new AXComponentCloseEvent();
|
|
37
|
+
event.component = this;
|
|
38
|
+
event.data = action;
|
|
39
|
+
this.onClosed.emit(event);
|
|
40
|
+
}
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXConversationComposerActionChoiceDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXConversationComposerActionChoiceDialogComponent, isStandalone: true, selector: "ax-conversation-composer-action-choice-dialog", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: true, transformFunction: null }, fileCount: { classPropertyName: "fileCount", publicName: "fileCount", isSignal: true, isRequired: false, transformFunction: null }, composerActionRegistry: { classPropertyName: "composerActionRegistry", publicName: "composerActionRegistry", isSignal: true, isRequired: true, transformFunction: null }, __popup__: { classPropertyName: "__popup__", publicName: "__popup__", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: AXClosableComponent, useExisting: AXConversationComposerActionChoiceDialogComponent }], ngImport: i0, template: " <div class=\"composer-action-choice\" role=\"dialog\" aria-modal=\"true\">\n <p class=\"composer-action-choice__hint\">{{ hintText() }}</p>\n <ul class=\"composer-action-choice__list\" role=\"listbox\">\n @for (action of actions(); track action.id) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n class=\"composer-action-choice__option\"\n role=\"option\"\n (click)=\"choose(action)\"\n [attr.aria-label]=\"getActionLabel(action)\"\n >\n <span class=\"composer-action-choice__icon\" aria-hidden=\"true\">\n <i [class]=\"action.icon\"></i>\n </span>\n <span class=\"composer-action-choice__text\">\n <span class=\"composer-action-choice__title\">{{ getActionLabel(action) }}</span>\n @if (getActionTooltip(action); as tip) {\n <span class=\"composer-action-choice__subtitle\">{{ tip }}</span>\n }\n </span>\n <i class=\"fa-light fa-chevron-right composer-action-choice__chevron\" aria-hidden=\"true\"></i>\n </button>\n </li>\n }\n </ul>\n </div>\n", styles: ["@layer properties;@layer components{ax-conversation-composer-action-choice-dialog{display:block}ax-conversation-composer-action-choice-dialog .composer-action-choice{display:flex;min-width:calc(var(--spacing, .25rem) * 64);flex-direction:column;gap:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 2)}ax-conversation-composer-action-choice-dialog .composer-action-choice__hint{margin:calc(var(--spacing, .25rem) * 0);font-size:.8125rem;--tw-leading: var(--leading-snug, 1.375);line-height:var(--leading-snug, 1.375);color:rgba(var(--ax-sys-color-on-surface),.7)}ax-conversation-composer-action-choice-dialog .composer-action-choice__list{margin:calc(var(--spacing, .25rem) * 0);display:flex;list-style-type:none;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 0)}ax-conversation-composer-action-choice-dialog .composer-action-choice__option{display:flex;width:100%;cursor:pointer;align-items:center;gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-light-surface));background-color:rgba(var(--ax-sys-color-surface));padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2.5);text-align:start;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}ax-conversation-composer-action-choice-dialog .composer-action-choice__option:hover,ax-conversation-composer-action-choice-dialog .composer-action-choice__option:focus-visible{border-color:rgba(var(--ax-sys-color-primary-surface));--tw-outline-style: none;outline-style:none;background:rgba(var(--ax-sys-color-primary-500),.06);box-shadow:0 0 0 1px rgba(var(--ax-sys-color-primary-500),.25)}ax-conversation-composer-action-choice-dialog .composer-action-choice__icon{display:flex;height:calc(var(--spacing, .25rem) * 10);width:calc(var(--spacing, .25rem) * 10);flex-shrink:0;align-items:center;justify-content:center;border-radius:var(--ax-sys-border-radius);font-size:var(--text-lg, 1.125rem);line-height:var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));color:rgba(var(--ax-sys-color-primary-600));background:rgba(var(--ax-sys-color-primary-500),.1)}ax-conversation-composer-action-choice-dialog .composer-action-choice__text{display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;gap:calc(var(--spacing, .25rem) * .5)}ax-conversation-composer-action-choice-dialog .composer-action-choice__title{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgba(var(--ax-sys-color-on-surface))}ax-conversation-composer-action-choice-dialog .composer-action-choice__subtitle{overflow:hidden;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));text-overflow:ellipsis;white-space:nowrap;color:rgba(var(--ax-sys-color-on-surface),.6)}ax-conversation-composer-action-choice-dialog .composer-action-choice__chevron{flex-shrink:0;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgba(var(--ax-sys-color-on-surface),.45)}}@property --tw-leading{syntax: \"*\"; inherits: false;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial;--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXConversationComposerActionChoiceDialogComponent, decorators: [{
|
|
45
|
+
type: Component,
|
|
46
|
+
args: [{ selector: 'ax-conversation-composer-action-choice-dialog', encapsulation: ViewEncapsulation.None, providers: [{ provide: AXClosableComponent, useExisting: AXConversationComposerActionChoiceDialogComponent }], template: " <div class=\"composer-action-choice\" role=\"dialog\" aria-modal=\"true\">\n <p class=\"composer-action-choice__hint\">{{ hintText() }}</p>\n <ul class=\"composer-action-choice__list\" role=\"listbox\">\n @for (action of actions(); track action.id) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n class=\"composer-action-choice__option\"\n role=\"option\"\n (click)=\"choose(action)\"\n [attr.aria-label]=\"getActionLabel(action)\"\n >\n <span class=\"composer-action-choice__icon\" aria-hidden=\"true\">\n <i [class]=\"action.icon\"></i>\n </span>\n <span class=\"composer-action-choice__text\">\n <span class=\"composer-action-choice__title\">{{ getActionLabel(action) }}</span>\n @if (getActionTooltip(action); as tip) {\n <span class=\"composer-action-choice__subtitle\">{{ tip }}</span>\n }\n </span>\n <i class=\"fa-light fa-chevron-right composer-action-choice__chevron\" aria-hidden=\"true\"></i>\n </button>\n </li>\n }\n </ul>\n </div>\n", styles: ["@layer properties;@layer components{ax-conversation-composer-action-choice-dialog{display:block}ax-conversation-composer-action-choice-dialog .composer-action-choice{display:flex;min-width:calc(var(--spacing, .25rem) * 64);flex-direction:column;gap:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 2)}ax-conversation-composer-action-choice-dialog .composer-action-choice__hint{margin:calc(var(--spacing, .25rem) * 0);font-size:.8125rem;--tw-leading: var(--leading-snug, 1.375);line-height:var(--leading-snug, 1.375);color:rgba(var(--ax-sys-color-on-surface),.7)}ax-conversation-composer-action-choice-dialog .composer-action-choice__list{margin:calc(var(--spacing, .25rem) * 0);display:flex;list-style-type:none;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 0)}ax-conversation-composer-action-choice-dialog .composer-action-choice__option{display:flex;width:100%;cursor:pointer;align-items:center;gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-light-surface));background-color:rgba(var(--ax-sys-color-surface));padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2.5);text-align:start;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}ax-conversation-composer-action-choice-dialog .composer-action-choice__option:hover,ax-conversation-composer-action-choice-dialog .composer-action-choice__option:focus-visible{border-color:rgba(var(--ax-sys-color-primary-surface));--tw-outline-style: none;outline-style:none;background:rgba(var(--ax-sys-color-primary-500),.06);box-shadow:0 0 0 1px rgba(var(--ax-sys-color-primary-500),.25)}ax-conversation-composer-action-choice-dialog .composer-action-choice__icon{display:flex;height:calc(var(--spacing, .25rem) * 10);width:calc(var(--spacing, .25rem) * 10);flex-shrink:0;align-items:center;justify-content:center;border-radius:var(--ax-sys-border-radius);font-size:var(--text-lg, 1.125rem);line-height:var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));color:rgba(var(--ax-sys-color-primary-600));background:rgba(var(--ax-sys-color-primary-500),.1)}ax-conversation-composer-action-choice-dialog .composer-action-choice__text{display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-direction:column;gap:calc(var(--spacing, .25rem) * .5)}ax-conversation-composer-action-choice-dialog .composer-action-choice__title{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgba(var(--ax-sys-color-on-surface))}ax-conversation-composer-action-choice-dialog .composer-action-choice__subtitle{overflow:hidden;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));text-overflow:ellipsis;white-space:nowrap;color:rgba(var(--ax-sys-color-on-surface),.6)}ax-conversation-composer-action-choice-dialog .composer-action-choice__chevron{flex-shrink:0;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgba(var(--ax-sys-color-on-surface),.45)}}@property --tw-leading{syntax: \"*\"; inherits: false;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial;--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
47
|
+
}], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: true }] }], fileCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileCount", required: false }] }], composerActionRegistry: [{ type: i0.Input, args: [{ isSignal: true, alias: "composerActionRegistry", required: true }] }], __popup__: [{ type: i0.Input, args: [{ isSignal: true, alias: "__popup__", required: false }] }] } });
|
|
48
|
+
|
|
49
|
+
export { AXConversationComposerActionChoiceDialogComponent };
|
|
50
|
+
//# sourceMappingURL=acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/composer-action-choice-dialog.component.ts","../../../../packages/components/conversation/src/lib/components/message-list/composer-action-choice-dialog.component.html"],"sourcesContent":["import { AXClosableComponent, AXComponentCloseEvent } from '@acorex/cdk/common';\nimport type { AXPopupRef } from '@acorex/components/popup';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Component, EventEmitter, ViewEncapsulation, computed, inject, input } from '@angular/core';\nimport type {\n AXConversationComposerAction,\n AXConversationComposerActionRegistry,\n} from '../../registries/composer-action.registry';\n\n@Component({\n selector: 'ax-conversation-composer-action-choice-dialog',\n encapsulation: ViewEncapsulation.None,\n\n templateUrl: './composer-action-choice-dialog.component.html',\n styleUrl: './composer-action-choice-dialog.component.css',\n providers: [{ provide: AXClosableComponent, useExisting: AXConversationComposerActionChoiceDialogComponent }],\n})\nexport class AXConversationComposerActionChoiceDialogComponent {\n private readonly translation = inject(AXTranslationService);\n\n readonly actions = input.required<AXConversationComposerAction[]>();\n readonly fileCount = input(1);\n readonly composerActionRegistry = input.required<AXConversationComposerActionRegistry>();\n readonly __popup__ = input<AXPopupRef | undefined>();\n\n readonly hintText = computed(() => {\n const count = this.fileCount();\n if (count === 1) {\n return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-single');\n }\n return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-multiple', {\n params: { count },\n });\n });\n\n readonly onClosed = new EventEmitter<AXComponentCloseEvent>();\n\n getActionLabel(action: AXConversationComposerAction): string {\n return this.composerActionRegistry().getActionLabel(action);\n }\n\n getActionTooltip(action: AXConversationComposerAction): string | undefined {\n return this.composerActionRegistry().getActionTooltip(action);\n }\n\n choose(action: AXConversationComposerAction): void {\n const event = new AXComponentCloseEvent();\n event.component = this;\n event.data = action;\n this.onClosed.emit(event);\n }\n}\n"," <div class=\"composer-action-choice\" role=\"dialog\" aria-modal=\"true\">\n <p class=\"composer-action-choice__hint\">{{ hintText() }}</p>\n <ul class=\"composer-action-choice__list\" role=\"listbox\">\n @for (action of actions(); track action.id) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n class=\"composer-action-choice__option\"\n role=\"option\"\n (click)=\"choose(action)\"\n [attr.aria-label]=\"getActionLabel(action)\"\n >\n <span class=\"composer-action-choice__icon\" aria-hidden=\"true\">\n <i [class]=\"action.icon\"></i>\n </span>\n <span class=\"composer-action-choice__text\">\n <span class=\"composer-action-choice__title\">{{ getActionLabel(action) }}</span>\n @if (getActionTooltip(action); as tip) {\n <span class=\"composer-action-choice__subtitle\">{{ tip }}</span>\n }\n </span>\n <i class=\"fa-light fa-chevron-right composer-action-choice__chevron\" aria-hidden=\"true\"></i>\n </button>\n </li>\n }\n </ul>\n </div>\n"],"names":[],"mappings":";;;;;MAiBa,iDAAiD,CAAA;AAR9D,IAAA,WAAA,GAAA;AASmB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;QAEl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EAAA,iDAAmD,EAAE,CAAC,EAAA,QAAA,EAAA,wuCAAA,EAAA,MAAA,EAAA,CAAA,0xHAAA,CAAA,EAAA;;;;;"}
|
|
@@ -108,7 +108,7 @@ async function resolvePickerActionsForAllFiles(deps, files) {
|
|
|
108
108
|
return analysis.actions;
|
|
109
109
|
}
|
|
110
110
|
async function promptComposerActionChoice(deps, actions, fileCount) {
|
|
111
|
-
const { AXConversationComposerActionChoiceDialogComponent } = await import('./acorex-components-conversation-composer-action-choice-dialog.component-
|
|
111
|
+
const { AXConversationComposerActionChoiceDialogComponent } = await import('./acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs');
|
|
112
112
|
const result = await deps.popupService.open(AXConversationComposerActionChoiceDialogComponent, {
|
|
113
113
|
title: deps.translation.translateSync('@acorex:chat.dialog.choose-send-option.title'),
|
|
114
114
|
size: 'sm',
|
|
@@ -220,4 +220,4 @@ async function handleConversationFilePaste(event, host, deps) {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
export { filesFromClipboardEvent, handleConversationFilePaste, isPasteTargetInChatPanel, openComposerPickerForFiles, resolvePickerActionsForAllFiles };
|
|
223
|
-
//# sourceMappingURL=acorex-components-conversation-open-composer-picker-for-files-
|
|
223
|
+
//# sourceMappingURL=acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-popup.ts","../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-for-files.ts"],"sourcesContent":["import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport type { AXConversation } from '../../models';\nimport { resolveComposerMaxFiles } from '../../plugins/composer/composer-upload.config';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\n\nexport async function openComposerPickerPopup(\n popupService: AXPopupService,\n composerService: AXConversationComposerService,\n registry: AXConversationComposerActionRegistry,\n action: AXConversationComposerAction,\n conversation: AXConversation,\n files: File[],\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>,\n): Promise<void> {\n const component = action.component ?? (action.componentLoader ? await action.componentLoader() : undefined);\n if (!component || files.length === 0) {\n return;\n }\n\n await popupService.open(component, {\n title: registry.getActionLabel(action),\n size: 'md',\n closeButton: true,\n header: false,\n panelClass: ['ax-conversation-composer-picker-popup'],\n inputs: {\n conversation,\n maxFiles: resolveComposerMaxFiles(action, config),\n initialFiles: files,\n service: composerService,\n },\n });\n}\n","import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXFileService } from '@acorex/core/file';\nimport type { AXValidationRuleResult } from '@acorex/core/validation';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversation } from '../../models';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport { notifyPickerValidationErrors } from '../../plugins/composer/components/shared/picker-upload';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\nimport { openComposerPickerPopup } from './open-composer-picker-popup';\n\nexport interface AXConversationOpenComposerPickerForFilesDeps {\n fileService: AXFileService;\n composerService: AXConversationComposerService;\n composerActionRegistry: AXConversationComposerActionRegistry;\n popupService: AXPopupService;\n toast: AXToastService;\n translation: AXTranslationService;\n conversation: AXConversation | null | undefined;\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>;\n}\n\n/** Catalogs registered on picker actions (conversation-image, conversation-file, …). */\nfunction pickerCatalogNames(registry: AXConversationComposerActionRegistry): string[] {\n const names = new Set<string>();\n for (const action of registry.actions()) {\n if ((action.component || action.componentLoader) && action.fileType) {\n names.add(action.fileType);\n }\n }\n return [...names];\n}\n\ninterface AXConversationInboundFilesAnalysis {\n matchingCatalogs: string[];\n actions: AXConversationComposerAction[];\n supportedFiles: File[];\n unsupportedFiles: { file: File; errors: AXValidationRuleResult[] }[];\n}\n\n/** Files that are not accepted by any registered picker catalog. */\nasync function collectUnsupportedInboundFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerActionRegistry'>,\n files: File[],\n catalogs: string[],\n): Promise<{ file: File; errors: AXValidationRuleResult[] }[]> {\n const unsupported: { file: File; errors: AXValidationRuleResult[] }[] = [];\n\n for (const file of files) {\n let acceptedByAny = false;\n let lastErrors: AXValidationRuleResult[] = [];\n\n for (const catalog of catalogs) {\n const errors = await deps.fileService.validate(file, catalog);\n if (errors.length === 0) {\n acceptedByAny = true;\n break;\n }\n lastErrors = errors;\n }\n\n if (!acceptedByAny) {\n unsupported.push({ file, errors: lastErrors });\n }\n }\n\n return unsupported;\n}\n\nasync function analyzeInboundFiles(\n deps: Pick<\n AXConversationOpenComposerPickerForFilesDeps,\n 'fileService' | 'composerService' | 'composerActionRegistry'\n >,\n files: File[],\n): Promise<AXConversationInboundFilesAnalysis> {\n if (!files.length) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles: [] };\n }\n\n const catalogs = pickerCatalogNames(deps.composerActionRegistry);\n const unsupportedFiles = await collectUnsupportedInboundFiles(deps, files, catalogs);\n const unsupportedSet = new Set(unsupportedFiles.map((entry) => entry.file));\n const supportedFiles = files.filter((file) => !unsupportedSet.has(file));\n\n if (supportedFiles.length === 0) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles };\n }\n\n const context = deps.composerService.actionContext();\n const matchingCatalogs: string[] = [];\n\n for (const catalog of catalogs) {\n const { rejected } = await deps.fileService.validateMany(supportedFiles, catalog);\n if (rejected.length === 0) {\n matchingCatalogs.push(catalog);\n }\n }\n\n const seen = new Set<string>();\n const actions: AXConversationComposerAction[] = [];\n\n for (const catalog of matchingCatalogs) {\n for (const action of deps.composerActionRegistry.findPickerActionsForFileType(catalog, context)) {\n if (!seen.has(action.id)) {\n seen.add(action.id);\n actions.push(action);\n }\n }\n }\n\n return {\n matchingCatalogs,\n actions: actions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)),\n supportedFiles,\n unsupportedFiles,\n };\n}\n\nfunction notifyInboundFilesValidationFailures(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'toast' | 'translation'>,\n analysis: AXConversationInboundFilesAnalysis,\n): void {\n if (analysis.supportedFiles.length === 0) {\n if (analysis.unsupportedFiles.length === 0) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n }\n return;\n }\n\n if (analysis.actions.length === 0) {\n const key =\n analysis.matchingCatalogs.length === 0\n ? '@acorex:chat.errors.inbound-files-none-supported'\n : '@acorex:chat.errors.inbound-files-no-send-option';\n deps.toast.warning(deps.translation.translateSync(key));\n }\n}\n\n/**\n * File catalogs that accept every supported file in the batch, then matching visible picker actions.\n */\nexport async function resolvePickerActionsForAllFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerService' | 'composerActionRegistry'>,\n files: File[],\n): Promise<AXConversationComposerAction[]> {\n const analysis = await analyzeInboundFiles(deps, files);\n return analysis.actions;\n}\n\nasync function promptComposerActionChoice(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n actions: AXConversationComposerAction[],\n fileCount: number,\n): Promise<AXConversationComposerAction | undefined> {\n const { AXConversationComposerActionChoiceDialogComponent } = await import('./composer-action-choice-dialog.component');\n const result = await deps.popupService.open(AXConversationComposerActionChoiceDialogComponent, {\n title: deps.translation.translateSync('@acorex:chat.dialog.choose-send-option.title'),\n size: 'sm',\n closeButton: true,\n header: true,\n inputs: {\n actions,\n fileCount,\n composerActionRegistry: deps.composerActionRegistry,\n },\n });\n\n const action = result?.data as AXConversationComposerAction | undefined;\n if (!action?.component && !action?.componentLoader) {\n return undefined;\n }\n return action;\n}\n\n/**\n * Match dropped/pasted files to composer picker action(s) and open the popup.\n * Unsupported files are skipped after a warning toast; supported files continue.\n * @returns true when a picker popup was opened\n */\nexport async function openComposerPickerForFiles(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n files: File[],\n): Promise<boolean> {\n if (!files.length) {\n return false;\n }\n\n const conversation = deps.conversation;\n if (!conversation) {\n return false;\n }\n\n const analysis = await analyzeInboundFiles(deps, files);\n\n if (analysis.unsupportedFiles.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, analysis.unsupportedFiles);\n }\n\n if (!analysis.supportedFiles.length || !analysis.actions.length) {\n notifyInboundFilesValidationFailures(deps, analysis);\n return false;\n }\n\n let action = analysis.actions[0];\n if (analysis.actions.length > 1) {\n const chosen = await promptComposerActionChoice(deps, analysis.actions, analysis.supportedFiles.length);\n if (!chosen) {\n return false;\n }\n action = chosen;\n }\n\n const catalog = action.fileType;\n if (!catalog) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n return false;\n }\n\n const { accepted, rejected } = await deps.fileService.validateMany(analysis.supportedFiles, catalog);\n if (rejected.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, rejected);\n }\n if (accepted.length === 0) {\n return false;\n }\n\n await openComposerPickerPopup(\n deps.popupService,\n deps.composerService,\n deps.composerActionRegistry,\n action,\n conversation,\n accepted,\n deps.config,\n );\n return true;\n}\n\n/** Extract OS-copied files from a paste event (e.g. Ctrl+V after copying a file in Explorer). */\nexport function filesFromClipboardEvent(event: ClipboardEvent): File[] {\n const items = event.clipboardData?.items;\n if (!items?.length) {\n return [];\n }\n\n const files: File[] = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) {\n files.push(file);\n }\n }\n }\n return files;\n}\n\n/** Whether a paste event target lies in the chat panel (not sidebar). */\nexport function isPasteTargetInChatPanel(host: HTMLElement, target: EventTarget | null): boolean {\n if (!(target instanceof Node) || !host.contains(target)) {\n return false;\n }\n\n const excluded = host.querySelector('.conversation-sidebar-container, .sidebar-container');\n if (excluded?.contains(target)) {\n return false;\n }\n\n const chatMain = host.querySelector('.conversation-main-container, .main-area, .conversation-view');\n if (chatMain) {\n return chatMain.contains(target);\n }\n\n return true;\n}\n\n/** Handle Ctrl+V / paste when the clipboard holds files copied from the OS. */\nexport async function handleConversationFilePaste(\n event: ClipboardEvent,\n host: HTMLElement,\n deps: AXConversationOpenComposerPickerForFilesDeps,\n): Promise<void> {\n if (!isPasteTargetInChatPanel(host, event.target)) {\n return;\n }\n\n const files = filesFromClipboardEvent(event);\n if (!files.length) {\n return;\n }\n\n const handled = await openComposerPickerForFiles(deps, files);\n if (handled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n}\n"],"names":[],"mappings":";;AAOO,eAAe,uBAAuB,CAC3C,YAA4B,EAC5B,eAA8C,EAC9C,QAA8C,EAC9C,MAAoC,EACpC,YAA4B,EAC5B,KAAa,EACb,MAAkE,EAAA;IAElE,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,eAAe,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,GAAG,SAAS,CAAC;IAC3G,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACpC;IACF;AAEA,IAAA,MAAM,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE;AACjC,QAAA,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC;AACtC,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,CAAC,uCAAuC,CAAC;AACrD,QAAA,MAAM,EAAE;YACN,YAAY;AACZ,YAAA,QAAQ,EAAE,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC;AACjD,YAAA,YAAY,EAAE,KAAK;AACnB,YAAA,OAAO,EAAE,eAAe;AACzB,SAAA;AAC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AC,KAAK,CAAC,MAAM,EAAE;QACjB;IACF;IAEA,MAAM,OAAO,GAAG,MAAM,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC;IAC7D,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,wBAAwB,EAAE;IAClC;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-popup.ts","../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-for-files.ts"],"sourcesContent":["import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport type { AXConversation } from '../../models';\nimport { resolveComposerMaxFiles } from '../../plugins/composer/composer-upload.config';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\n\nexport async function openComposerPickerPopup(\n popupService: AXPopupService,\n composerService: AXConversationComposerService,\n registry: AXConversationComposerActionRegistry,\n action: AXConversationComposerAction,\n conversation: AXConversation,\n files: File[],\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>,\n): Promise<void> {\n const component = action.component ?? (action.componentLoader ? await action.componentLoader() : undefined);\n if (!component || files.length === 0) {\n return;\n }\n\n await popupService.open(component, {\n title: registry.getActionLabel(action),\n size: 'md',\n closeButton: true,\n header: false,\n panelClass: ['ax-conversation-composer-picker-popup'],\n inputs: {\n conversation,\n maxFiles: resolveComposerMaxFiles(action, config),\n initialFiles: files,\n service: composerService,\n },\n });\n}\n","import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXFileService } from '@acorex/core/file';\nimport type { AXValidationRuleResult } from '@acorex/core/validation';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversation } from '../../models';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport { notifyPickerValidationErrors } from '../../plugins/composer/components/shared/picker-upload';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\nimport { openComposerPickerPopup } from './open-composer-picker-popup';\n\nexport interface AXConversationOpenComposerPickerForFilesDeps {\n fileService: AXFileService;\n composerService: AXConversationComposerService;\n composerActionRegistry: AXConversationComposerActionRegistry;\n popupService: AXPopupService;\n toast: AXToastService;\n translation: AXTranslationService;\n conversation: AXConversation | null | undefined;\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>;\n}\n\n/** Catalogs registered on picker actions (conversation-image, conversation-file, …). */\nfunction pickerCatalogNames(registry: AXConversationComposerActionRegistry): string[] {\n const names = new Set<string>();\n for (const action of registry.actions()) {\n if ((action.component || action.componentLoader) && action.fileType) {\n names.add(action.fileType);\n }\n }\n return [...names];\n}\n\ninterface AXConversationInboundFilesAnalysis {\n matchingCatalogs: string[];\n actions: AXConversationComposerAction[];\n supportedFiles: File[];\n unsupportedFiles: { file: File; errors: AXValidationRuleResult[] }[];\n}\n\n/** Files that are not accepted by any registered picker catalog. */\nasync function collectUnsupportedInboundFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerActionRegistry'>,\n files: File[],\n catalogs: string[],\n): Promise<{ file: File; errors: AXValidationRuleResult[] }[]> {\n const unsupported: { file: File; errors: AXValidationRuleResult[] }[] = [];\n\n for (const file of files) {\n let acceptedByAny = false;\n let lastErrors: AXValidationRuleResult[] = [];\n\n for (const catalog of catalogs) {\n const errors = await deps.fileService.validate(file, catalog);\n if (errors.length === 0) {\n acceptedByAny = true;\n break;\n }\n lastErrors = errors;\n }\n\n if (!acceptedByAny) {\n unsupported.push({ file, errors: lastErrors });\n }\n }\n\n return unsupported;\n}\n\nasync function analyzeInboundFiles(\n deps: Pick<\n AXConversationOpenComposerPickerForFilesDeps,\n 'fileService' | 'composerService' | 'composerActionRegistry'\n >,\n files: File[],\n): Promise<AXConversationInboundFilesAnalysis> {\n if (!files.length) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles: [] };\n }\n\n const catalogs = pickerCatalogNames(deps.composerActionRegistry);\n const unsupportedFiles = await collectUnsupportedInboundFiles(deps, files, catalogs);\n const unsupportedSet = new Set(unsupportedFiles.map((entry) => entry.file));\n const supportedFiles = files.filter((file) => !unsupportedSet.has(file));\n\n if (supportedFiles.length === 0) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles };\n }\n\n const context = deps.composerService.actionContext();\n const matchingCatalogs: string[] = [];\n\n for (const catalog of catalogs) {\n const { rejected } = await deps.fileService.validateMany(supportedFiles, catalog);\n if (rejected.length === 0) {\n matchingCatalogs.push(catalog);\n }\n }\n\n const seen = new Set<string>();\n const actions: AXConversationComposerAction[] = [];\n\n for (const catalog of matchingCatalogs) {\n for (const action of deps.composerActionRegistry.findPickerActionsForFileType(catalog, context)) {\n if (!seen.has(action.id)) {\n seen.add(action.id);\n actions.push(action);\n }\n }\n }\n\n return {\n matchingCatalogs,\n actions: actions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)),\n supportedFiles,\n unsupportedFiles,\n };\n}\n\nfunction notifyInboundFilesValidationFailures(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'toast' | 'translation'>,\n analysis: AXConversationInboundFilesAnalysis,\n): void {\n if (analysis.supportedFiles.length === 0) {\n if (analysis.unsupportedFiles.length === 0) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n }\n return;\n }\n\n if (analysis.actions.length === 0) {\n const key =\n analysis.matchingCatalogs.length === 0\n ? '@acorex:chat.errors.inbound-files-none-supported'\n : '@acorex:chat.errors.inbound-files-no-send-option';\n deps.toast.warning(deps.translation.translateSync(key));\n }\n}\n\n/**\n * File catalogs that accept every supported file in the batch, then matching visible picker actions.\n */\nexport async function resolvePickerActionsForAllFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerService' | 'composerActionRegistry'>,\n files: File[],\n): Promise<AXConversationComposerAction[]> {\n const analysis = await analyzeInboundFiles(deps, files);\n return analysis.actions;\n}\n\nasync function promptComposerActionChoice(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n actions: AXConversationComposerAction[],\n fileCount: number,\n): Promise<AXConversationComposerAction | undefined> {\n const { AXConversationComposerActionChoiceDialogComponent } = await import('./composer-action-choice-dialog.component');\n const result = await deps.popupService.open(AXConversationComposerActionChoiceDialogComponent, {\n title: deps.translation.translateSync('@acorex:chat.dialog.choose-send-option.title'),\n size: 'sm',\n closeButton: true,\n header: true,\n inputs: {\n actions,\n fileCount,\n composerActionRegistry: deps.composerActionRegistry,\n },\n });\n\n const action = result?.data as AXConversationComposerAction | undefined;\n if (!action?.component && !action?.componentLoader) {\n return undefined;\n }\n return action;\n}\n\n/**\n * Match dropped/pasted files to composer picker action(s) and open the popup.\n * Unsupported files are skipped after a warning toast; supported files continue.\n * @returns true when a picker popup was opened\n */\nexport async function openComposerPickerForFiles(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n files: File[],\n): Promise<boolean> {\n if (!files.length) {\n return false;\n }\n\n const conversation = deps.conversation;\n if (!conversation) {\n return false;\n }\n\n const analysis = await analyzeInboundFiles(deps, files);\n\n if (analysis.unsupportedFiles.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, analysis.unsupportedFiles);\n }\n\n if (!analysis.supportedFiles.length || !analysis.actions.length) {\n notifyInboundFilesValidationFailures(deps, analysis);\n return false;\n }\n\n let action = analysis.actions[0];\n if (analysis.actions.length > 1) {\n const chosen = await promptComposerActionChoice(deps, analysis.actions, analysis.supportedFiles.length);\n if (!chosen) {\n return false;\n }\n action = chosen;\n }\n\n const catalog = action.fileType;\n if (!catalog) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n return false;\n }\n\n const { accepted, rejected } = await deps.fileService.validateMany(analysis.supportedFiles, catalog);\n if (rejected.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, rejected);\n }\n if (accepted.length === 0) {\n return false;\n }\n\n await openComposerPickerPopup(\n deps.popupService,\n deps.composerService,\n deps.composerActionRegistry,\n action,\n conversation,\n accepted,\n deps.config,\n );\n return true;\n}\n\n/** Extract OS-copied files from a paste event (e.g. Ctrl+V after copying a file in Explorer). */\nexport function filesFromClipboardEvent(event: ClipboardEvent): File[] {\n const items = event.clipboardData?.items;\n if (!items?.length) {\n return [];\n }\n\n const files: File[] = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) {\n files.push(file);\n }\n }\n }\n return files;\n}\n\n/** Whether a paste event target lies in the chat panel (not sidebar). */\nexport function isPasteTargetInChatPanel(host: HTMLElement, target: EventTarget | null): boolean {\n if (!(target instanceof Node) || !host.contains(target)) {\n return false;\n }\n\n const excluded = host.querySelector('.conversation-sidebar-container, .sidebar-container');\n if (excluded?.contains(target)) {\n return false;\n }\n\n const chatMain = host.querySelector('.conversation-main-container, .main-area, .conversation-view');\n if (chatMain) {\n return chatMain.contains(target);\n }\n\n return true;\n}\n\n/** Handle Ctrl+V / paste when the clipboard holds files copied from the OS. */\nexport async function handleConversationFilePaste(\n event: ClipboardEvent,\n host: HTMLElement,\n deps: AXConversationOpenComposerPickerForFilesDeps,\n): Promise<void> {\n if (!isPasteTargetInChatPanel(host, event.target)) {\n return;\n }\n\n const files = filesFromClipboardEvent(event);\n if (!files.length) {\n return;\n }\n\n const handled = await openComposerPickerForFiles(deps, files);\n if (handled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n}\n"],"names":[],"mappings":";;AAOO,eAAe,uBAAuB,CAC3C,YAA4B,EAC5B,eAA8C,EAC9C,QAA8C,EAC9C,MAAoC,EACpC,YAA4B,EAC5B,KAAa,EACb,MAAkE,EAAA;IAElE,MAAM,SAAS,GAAG,MAAM,CA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