-
Notifications
You must be signed in to change notification settings - Fork 77
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
[Block] Provide consistent use of sorting similar to list
#10382
Comments
Spike needed to determine the structure of the component needed to provide sorting on specified |
list
list
For blocks to be sortable, they need to be child items which means that they need some kind of parent component to allow them to be sortable which would replace the sortable-list component. What would this component be called? What about block-sections, would they ever need sorting as well? |
@geospatialem I think this would be a new component so should probably be tagged like that |
What should this new component be called? @geospatialem @DitwanP |
Maybe we should approach the naming in case we would need to apply the same functionality to block-sections? @driskull, do you think we should accommodate sorting on both components, As far as naming, WDYT about something like |
I'm not sure. is there a request to sort sections? @geospatialem can you setup a quick meeting to discuss the options and how we want to move forward? |
I don't think we've had a request for Block Groups - although it seems like it would make sense in the future as an additional feature. I think |
@geospatialem @jcfranco
|
…ests (#11263) **Related Issue:** #9922 ## Summary Add automation to issues when the `calcite-ui-icons` label is added, where Icon team leads will receive an `@` notification via a comment, similar to the [new component label automation](#10382 (comment)) from the [notifyAboutNewComponent script](https://github.com/Esri/calcite-design-system/blob/dev/.github/scripts/notifyAboutNewComponent.js). cc @allieorth, @arowles
**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-block`s 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` --------- Co-authored-by: Kitty Hurley <[email protected]>
Installed and assigned for verification. |
Verified with <p>City observations</p>
<calcite-block-group drag-enabled group="my-group" label="Group 1">
<calcite-block collapsible heading="White squirrels">
...
</calcite-block>
<calcite-block collapsible heading="Black squirrels">
...
</calcite-block>
</calcite-block-group>
<p>Neighborhood observations</p>
<calcite-block-group drag-enabled group="my-group" label="Group 2">
<calcite-block collapsible heading="Gray squirrels">
...
</calcite-block>
<calcite-block collapsible heading="Red squirrels">
...
</calcite-block>
</calcite-block-group> |
…ests (#11263) **Related Issue:** #9922 ## Summary Add automation to issues when the `calcite-ui-icons` label is added, where Icon team leads will receive an `@` notification via a comment, similar to the [new component label automation](#10382 (comment)) from the [notifyAboutNewComponent script](https://github.com/Esri/calcite-design-system/blob/dev/.github/scripts/notifyAboutNewComponent.js). cc @allieorth, @arowles
**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-block`s 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` --------- Co-authored-by: Kitty Hurley <[email protected]>
Check existing issues
Description
block
currently offers ahandle
attribute, but the sorting functionality is handled via a parent internal unsupported and undocumented component. Instead we should offer support to a set of groupedblocks
in alignment withlist
andlist-item
.Blocked issues: #10572
Acceptance Criteria
block-group
withdragEnabled
that allows specifiedblock
's to be movablesort-handle
componenthandle
property (to be removed in4.0
)sortable-list
(to be removed in4.0
)Relevant Info
block
componentsWhich Component
block
Example Use Case
https://codepen.io/geospatialem/pen/XWvJbEm
Priority impact
impact - p2 - want for an upcoming milestone
Calcite package
Esri team
Calcite (dev)
The text was updated successfully, but these errors were encountered: