Skip to content

Commit

Permalink
feat(plugin): add row move shadown item while moving/dragging row
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Oct 26, 2021
1 parent 8d6e16b commit c665ec8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
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;

0 comments on commit c665ec8

Please sign in to comment.