Skip to content

Commit

Permalink
Merge pull request #561 from revolist/drag-model-info
Browse files Browse the repository at this point in the history
feat: provided drag model information in the event
  • Loading branch information
revolist authored Sep 8, 2024
2 parents 3a6d193 + c3eca49 commit 60c4961
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion formats/date
Submodule date updated 2 files
+1 −1 lib/style.css
+1 −1 package.json
4 changes: 3 additions & 1 deletion src/components/order/revogr-order-editor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Method, Event, EventEmitter, Prop } from '@stencil/core';
import debounce from 'lodash/debounce';

import { DSourceState } from '@store';
import { DSourceState, getSourceItem } from '@store';
import { DRAGG_TEXT } from '../../utils/consts';
import RowOrderService from './order-row.service';
import {
Expand Down Expand Up @@ -42,6 +42,7 @@ export class OrderEditor {
pos: PositionItem;
event: MouseEvent;
rowType: DimensionRows;
model: any;
}>;

/** Row drag ended started */
Expand Down Expand Up @@ -109,6 +110,7 @@ export class OrderEditor {
pos,
event: e.originalEvent,
rowType: this.rowType,
model: getSourceItem(this.dataStore, pos.itemIndex),
});
if (dragStartEvent.defaultPrevented) {
return;
Expand Down
6 changes: 1 addition & 5 deletions src/components/revoGrid/revo-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -893,11 +893,7 @@ export class RevoGridComponent {
// #region Listeners
/** Drag events */
@Listen('rowdragstartinit') onRowDragStarted(
e: CustomEvent<{
pos: PositionItem;
text: string;
event: MouseEvent;
}>,
e: CustomEvent<HTMLRevogrOrderEditorElementEventMap['rowdragstartinit']>,
) {
const dragStart = this.rowdragstart.emit(e.detail);
if (dragStart.defaultPrevented) {
Expand Down

0 comments on commit 60c4961

Please sign in to comment.