Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(block-group, block): add block-group component #11319

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

driskull
Copy link
Member

@driskull driskull commented Jan 16, 2025

Related Issue: #10382

Summary

  • add new component calcite-block-group
    • allows dragging/sorting calcite-block elements
    • add tests
    • add story
    • add demo html
  • calcite-block
    • uses calcite-sort-handle instead of calcite-handle
    • new property dragDisabled
    • new property sortHandleOpen
    • new events for calcite-sort-handle opening/closing
      • calciteBlockSortHandleBeforeClose
      • calciteBlockSortHandleBeforeOpen
      • calciteBlockSortHandleClose
      • calciteBlockSortHandleOpen
    • adds tests
  • calcite-sort-handle to work without a setSize and setPosition for use with calcite-sortable-list.
  • remove unnecessary imports in css files (these are already apart of includes)

Notes:

  • Using calcite-sortable-list with calcite-block will no longer just work. A user would need to set the calcite-sortable-list's handleSelector property to be calcite-sort-handle instead of calcite-handle.
  • When we drag over a list-item, it will open. However, i'm not sure if we want to do that for block. Do we expect nested blocks? Would it be weird to open a collapsed block when dragging another block over it?

BlockGroup API Documentation

Properties

canPull

  • Type: (detail: BlockDragDetail) => boolean
  • Description: When provided, the method will be called to determine whether the element can move from the component.

canPut

  • Type: (detail: BlockDragDetail) => boolean
  • Description: When provided, the method will be called to determine whether the element can be added from another component.

disabled

  • Type: boolean
  • Default: false
  • Reflect: true
  • Description: When true, interaction is prevented and the component is displayed with lower opacity.

dragEnabled

  • Type: boolean
  • Default: false
  • Reflect: true
  • Description: When true, calcite-blocks are sortable via a draggable button.

group

  • Type: string
  • Description: The group identifier for the block group.

label

  • Type: string
  • Description: Specifies an accessible name for the component. When dragEnabled is true and multiple block-group sorting is enabled with group, specifies the component's name for dragging between block-groups.
  • Required: true

loading

  • Type: boolean
  • Default: false
  • Reflect: true
  • Description: When true, a busy indicator is displayed.

Methods

setFocus

  • Description: Sets focus on the component.
  • Returns: void

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Jan 16, 2025
@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. new component Issues tied to a new component. labels Jan 17, 2025
@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 17, 2025
@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 17, 2025
@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 17, 2025
@driskull driskull marked this pull request as ready for review January 17, 2025 18:32
@driskull driskull changed the title feat(block-group, block): add new block-group component for sorting blocks feat(block-group, block): add block-group component Jan 17, 2025
@driskull driskull removed the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 17, 2025
@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 17, 2025
@macandcheese
Copy link
Contributor

When we drag over a list-item, it will open. However, i'm not sure if we want to do that for block. Do we expect nested blocks? Would it be weird to open a collapsed block when dragging another block over it?

I could see the waters muddying between the components if we allowed that.. Not to say it won't be requested in the future - but I don't know if this first version needs to support nesting like that - just parent level Block adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. new component Issues tied to a new component. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants