Skip to content

fix(space): review and enhance Space component#8505

Open
OPBR wants to merge 1 commit intovueComponent:feat/vaporfrom
OPBR:review/space
Open

fix(space): review and enhance Space component#8505
OPBR wants to merge 1 commit intovueComponent:feat/vaporfrom
OPBR:review/space

Conversation

@OPBR
Copy link
Copy Markdown

@OPBR OPBR commented Mar 24, 2026

Changes

Space.vue

  • Add ConfigProvider size inheritance (sm/md/lg -> small/middle/large)
  • Add RTL support via useConfigInject
  • Add $attrs passthrough with inheritAttrs: false
  • Add wrap mode with negative marginBottom
  • Add empty children handling (return null if no valid children)
  • Use filterEmpty for VNode filtering with Fragment support

SpaceCompact.vue

  • Add RTL support
  • Add $attrs passthrough
  • Add nested SpaceCompact detection via provide/inject
  • Add default size ('md')
  • Add align prop support

CompactItem.vue (new)

  • Internal component for providing context to children
  • Support nested SpaceCompact detection
  • Provide isFirstItem/isLastItem context

types.ts

  • Add GLOBAL_SIZE_MAP for ConfigProvider size conversion
  • Add spaceCompactContextKey for nested detection
  • Enhance filterEmpty to handle Fragment children
  • Export SizeType

style/index.css

  • Add RTL styles for Space and SpaceCompact
  • Update selectors for CompactItem wrapper
  • Add align styles for SpaceCompact

Tests

  • Add tests for RTL support
  • Add tests for ConfigProvider size inheritance
  • Add tests for align prop
  • Add tests for Space.Compact static property
  • Update snapshots

- Add ConfigProvider size inheritance (sm/md/lg -> small/middle/large)
- Add RTL support via useConfigInject
- Add $attrs passthrough with inheritAttrs: false
- Add wrap mode with negative marginBottom
- Add empty children handling (return null if no valid children)
- Use filterEmpty for VNode filtering with Fragment support

- Add RTL support
- Add $attrs passthrough
- Add nested SpaceCompact detection via provide/inject
- Add default size ('md')
- Add align prop support

- Internal component for providing context to children
- Support nested SpaceCompact detection
- Provide isFirstItem/isLastItem context

- Add GLOBAL_SIZE_MAP for ConfigProvider size conversion
- Add spaceCompactContextKey for nested detection
- Enhance filterEmpty to handle Fragment children
- Export SizeType

- Add RTL styles for Space and SpaceCompact
- Update selectors for CompactItem wrapper
- Add align styles for SpaceCompact

- Add tests for RTL support
- Add tests for ConfigProvider size inheritance
- Add tests for align prop
- Add tests for Space.Compact static property
- Update snapshots

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant