Compare commits

...

8 Commits

Author SHA1 Message Date
cae8625feb fix: don't hide when click on color picker (#3172) 2023-01-29 14:47:43 +08:00
d8f1729f09 chore: update contributors [skip ci] 2023-01-28 07:57:12 +00:00
20c170b44a Fix/edge mousedown (#3169)
* fix: onMousedown add event notify

* fix: onMousedown add super event notify

* fix: use notifyMouseDown

---------

Co-authored-by: seven <lijianqiang.seven@bytedance.com>
2023-01-28 15:56:54 +08:00
0e8769642a chore: update contributors [skip ci] 2023-01-28 06:20:00 +00:00
bd30f7f61d fix: prevent highlighting new edge (#3170) 2023-01-28 14:19:38 +08:00
e3e7cfc66f chore: update CONTRIBUTORS [skip ci] 2023-01-28 02:17:37 +00:00
c86ed1a031 chore: use find to repalce forEach (#3159)
Co-authored-by: seven <lijianqiang.seven@bytedance.com>
2023-01-28 10:09:53 +08:00
ae179eb2cd chore(release): release 1 package [skip ci]
[@antv/x6@2.1.6](https://www.npmjs.com/package/@antv/x6/v/2.1.6)
[@antv/x6@2.1.6](https://github.com/antvis/X6/releases/tag/%40antv/x6%402.1.6)
2023-01-19 02:28:11 +00:00
8 changed files with 64 additions and 58 deletions

View File

@ -30,6 +30,7 @@ RuiLin <on>
SSC <273702440@qq.com>
Simon <>
Sindori <441933726@qq.com>
Struggle <ou>
Susan <527971893@qq.com>
Thomas <eugne>
Tony <>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 MiB

After

Width:  |  Height:  |  Size: 12 MiB

View File

@ -37,7 +37,9 @@ export class ColorPicker extends React.Component<
onDocumentClick = (e: React.MouseEvent) => {
const target = e.target as HTMLDivElement
if (target === this.container || this.container.contains(target)) {
const picker = this.container.querySelector('.sketch-picker')!
if (target === picker || picker.contains(target)) {
return
}
@ -59,12 +61,9 @@ export class ColorPicker extends React.Component<
if (this.props.onChange) {
this.props.onChange(value, event)
}
this.setState({
active: false,
color: value.rgb,
})
this.unbindDocEvent()
}
handleClick = (e: React.MouseEvent) => {
@ -84,8 +83,10 @@ export class ColorPicker extends React.Component<
}
}
refContainer = (container: HTMLDivElement) => {
this.container = container
refContainer = (popoverRef: { getContainer: () => HTMLDivElement }) => {
if (popoverRef) {
this.container = popoverRef.getContainer()
}
}
renderPicker() {
@ -123,10 +124,12 @@ export class ColorPicker extends React.Component<
{...popoverProps}
content={this.renderPicker()}
overlayClassName={`${baseCls}-overlay`}
destroyTooltipOnHide
ref={this.refContainer}
trigger={[]}
>
<div
style={style}
ref={this.refContainer}
onClick={this.handleClick}
className={classNames(baseCls, {
[`${baseCls}-disabled`]: disabled,

View File

@ -1,3 +1,5 @@
## @antv/x6 [2.1.6](https://github.com/antvis/x6/compare/@antv/x6@2.1.5...@antv/x6@2.1.6) (2023-01-19)
## @antv/x6 [2.1.5](https://github.com/antvis/x6/compare/@antv/x6@2.1.4...@antv/x6@2.1.5) (2023-01-13)

View File

@ -1,6 +1,6 @@
{
"name": "@antv/x6",
"version": "2.1.5",
"version": "2.1.6",
"description": "JavaScript diagramming library that uses SVG and HTML for rendering",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -1193,15 +1193,9 @@ export class Graph extends Basecoat<EventArgs> {
}
getPlugin<T extends Graph.Plugin>(pluginName: string): T | undefined {
let result: Graph.Plugin | undefined
this.installedPlugins.forEach((plugin) => {
if (plugin.name === pluginName) {
result = plugin
}
})
return result as T
return Array.from(this.installedPlugins).find(
(plugin) => plugin.name === pluginName,
) as T
}
// #endregion

View File

@ -1398,6 +1398,7 @@ export class EdgeView<
}
onMouseDown(e: Dom.MouseDownEvent, x: number, y: number) {
this.notifyMouseDown(e, x, y)
this.startEdgeDragging(e, x, y)
}
@ -2191,7 +2192,9 @@ export class EdgeView<
for (let i = 0, ii = cells.length; i < ii; i += 1) {
const view = graph.findViewByCell(cells[i])
if (!view) {
// Prevent highlighting new edge
// Close https://github.com/antvis/X6/issues/2853
if (!view || view.cell.id === this.cell.id) {
continue
}

View File

@ -62,8 +62,8 @@ graph.use(
| className | string | - | | 附加样式名,用于定制样式 |
| multiple | boolean | `true` | | 是否启用点击多选,启用后按住 `ctrl``command` 键点击节点实现多选 |
| multipleSelectionModifiers | ModifierKey | `['ctrl', 'meta']` | | 用于设置上面点击多选配套的修饰键 |
| rubberband | boolean | `false` | | 是否启用选节点功能 |
| modifiers | ModifierKey | - | | 设置修饰键后需要点击鼠标并按下修饰键才能触发多选 |
| rubberband | boolean | `false` | | 是否启用选节点功能 |
| modifiers | ModifierKey | - | | 用于设置上面框选配套的修饰键 |
| strict | boolean | `false` | | 选框是否需要完全包围节点时才选中节点 |
| movable | boolean | `true` | | 拖动选框时框选的节点是否一起移动 |
| content | string | - | | 设置附加显示的内容 |