Skip to content

Commit

Permalink
Merge pull request #3340 from VisActor/feat/react-dom-component
Browse files Browse the repository at this point in the history
Feat/react dom component
  • Loading branch information
Rui-Sun authored Jan 26, 2025
2 parents b9a7945 + 6c2dae9 commit b129782
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/react-vtable/src/eventsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export interface EventsProps {

onChangCellValue?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['change_cell_value']>;
onEmptyTipClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['empty_tip_click']>;
onEmptyTipDblclick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['empty_tip_dblclick']>;
onEmptyTipDblClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['empty_tip_dblclick']>;
}

export const TABLE_EVENTS = {
Expand Down Expand Up @@ -156,7 +156,7 @@ export const TABLE_EVENTS = {

onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
onEmptyTipClick: EVENT_TYPE.EMPTY_TIP_CLICK,
onEmptyTipDblclick: EVENT_TYPE.EMPTY_TIP_DBLCLICK
onEmptyTipDblClick: EVENT_TYPE.EMPTY_TIP_DBLCLICK
};

export const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
Expand Down
5 changes: 5 additions & 0 deletions packages/vtable-editors/src/date-input-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,10 @@ export class DateInputEditor extends InputEditor implements IEditor {
e.stopPropagation();
}
});

// hack for preventing drag touch cause page jump
input.addEventListener('wheel', e => {
e.preventDefault();
});
}
}
5 changes: 5 additions & 0 deletions packages/vtable-editors/src/input-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export class InputEditor implements IEditor {
e.stopPropagation();
}
});

// hack for preventing drag touch cause page jump
input.addEventListener('wheel', e => {
e.preventDefault();
});
}

setValue(value: string) {
Expand Down
8 changes: 4 additions & 4 deletions packages/vtable/src/components/empty-tip/empty-tip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ export class EmptyTip {
private _cacheAttrs: EmptyTipAttributes;
constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {
this.table = table;
this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);
// deal with displayMode
if (!isBoolean(emptyTipOption) && !isValid(emptyTipOption.displayMode)) {
if (!isValid(this._emptyTipOption.displayMode)) {
// for list table and pivot table current display effect
if (this.table.isListTable()) {
emptyTipOption.displayMode = 'basedOnTable';
this._emptyTipOption.displayMode = 'basedOnTable';
} else {
emptyTipOption.displayMode = 'basedOnContainer';
this._emptyTipOption.displayMode = 'basedOnContainer';
}
}
this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);
this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());
}

Expand Down

0 comments on commit b129782

Please sign in to comment.