mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
* feature: size adjust * feature: design adjust * fix: popover width, height added * fix: li style override * refactor: improve component readability and maintainability per PR feedback - Replace CardGridList component with createGridStyle utility function - Add runtime validation for grid column values - Remove !important usage in MultiSelect, use cn() function instead - Extract popover sizing logic into usePopoverSizing composable - Improve class string readability by splitting into logical groups - Use Tailwind size utilities (size-8, size-10) instead of separate width/height - Remove magic numbers in SearchBox, align with button sizes - Rename BaseWidgetLayout to BaseModalLayout for clarity - Enhance SearchBox click area to cover entire component - Refactor long class strings using cn() utility across components * fix: BaseWidgetLayout => BaseModalLayout * fix: CardGrid deleted * fix: unused exported types * Update test expectations [skip ci] * chore: code review * Update test expectations [skip ci] * chore: restore screenshot --------- Co-authored-by: github-actions <github-actions@github.com>
31 lines
643 B
TypeScript
31 lines
643 B
TypeScript
import { type CSSProperties, type ComputedRef, computed } from 'vue'
|
|
|
|
interface PopoverSizeOptions {
|
|
minWidth?: string
|
|
maxWidth?: string
|
|
}
|
|
|
|
/**
|
|
* Composable for managing popover sizing styles
|
|
* @param options Popover size configuration
|
|
* @returns Computed style object for popover sizing
|
|
*/
|
|
export function usePopoverSizing(
|
|
options: PopoverSizeOptions
|
|
): ComputedRef<CSSProperties> {
|
|
return computed(() => {
|
|
const { minWidth, maxWidth } = options
|
|
const style: CSSProperties = {}
|
|
|
|
if (minWidth) {
|
|
style.minWidth = minWidth
|
|
}
|
|
|
|
if (maxWidth) {
|
|
style.maxWidth = maxWidth
|
|
}
|
|
|
|
return style
|
|
})
|
|
}
|