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(plugin): add row move shadow item while moving/dragging row #527

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export class Example7 {
singleRowMove: true,
disableRowSelection: true,
cancelEditOnDrag: true,
hideRowMoveShadow: false,
onBeforeMoveRows: this.onBeforeMoveRow.bind(this),
onMoveRows: this.onMoveRows.bind(this),

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/extensions/rowMoveManagerExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class RowMoveManagerExtension implements Extension {
loadAddonWhenNotExists(columnDefinitions: Column[], gridOptions: GridOption): SlickRowMoveManager | null {
if (Array.isArray(columnDefinitions) && gridOptions) {
if (!this._addon) {
this._addon = new Slick.RowMoveManager(gridOptions?.rowMoveManager || { cancelEditOnDrag: true });
this._addon = new Slick.RowMoveManager(gridOptions?.rowMoveManager || { cancelEditOnDrag: true, hideRowMoveShadow: false, });
}
return this._addon;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface RowMoveManagerOption {
/** Defaults to False, do we want to disable the row selection? */
disableRowSelection?: boolean;

hideRowMoveShadow?: boolean;

/** Defaults to False, do we want a single row move? Setting this to false means that 1 or more rows can be selected to move together. */
singleRowMove?: boolean;

Expand Down
6 changes: 6 additions & 0 deletions packages/common/src/styles/slick-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@
opacity: 0.7;
}

.slick-reorder-shadow-row {
position: absolute;
z-index: 999999;
box-shadow: rgb(0 0 0 / 20%) 8px 2px 8px 4px, rgb(0 0 0 / 19%) 2px 2px 0px 0px;
}

.slick-selection {
z-index: 10;
position: absolute;
Expand Down
3 changes: 3 additions & 0 deletions packages/vanilla-bundle/src/salesforce-global-grid-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ export const SalesforceGlobalGridOptions = {
formatterPaddingWidthInPx: 8,
maxItemToInspectCellContentWidth: 500,
},
rowMoveManager: {
hideRowMoveShadow: false,
},
useSalesforceDefaultGridOptions: true,
} as GridOption;