mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-07 08:07:29 +08:00
Closeable color picker window
This commit is contained in:
@@ -9,9 +9,9 @@ import Utility from "../../Utility"
|
||||
*/
|
||||
export default class IPointing extends IInput {
|
||||
|
||||
constructor(target, blueprint, options) {
|
||||
constructor(target, blueprint, options = {}) {
|
||||
options.ignoreTranslateCompensate ??= false
|
||||
options.movementSpace ??= blueprint?.getGridDOMElement() ?? document.documentElement
|
||||
options.movementSpace ??= blueprint.getGridDOMElement() ?? document.documentElement
|
||||
super(target, blueprint, options)
|
||||
this.movementSpace = options.movementSpace
|
||||
}
|
||||
|
||||
28
js/input/mouse/MouseClickAction.js
Normal file
28
js/input/mouse/MouseClickAction.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import IMouseClick from "./IMouseClick"
|
||||
|
||||
export default class MouseClickAction extends IMouseClick {
|
||||
|
||||
static #ignoreEvent =
|
||||
/** @param {MouseClickAction} self */
|
||||
self => { }
|
||||
|
||||
constructor(
|
||||
target,
|
||||
blueprint,
|
||||
options,
|
||||
onMouseDown = MouseClickAction.#ignoreEvent,
|
||||
onMouseUp = MouseClickAction.#ignoreEvent
|
||||
) {
|
||||
super(target, blueprint, options)
|
||||
this.onMouseDown = onMouseDown
|
||||
this.onMouseUp = onMouseUp
|
||||
}
|
||||
|
||||
clicked() {
|
||||
this.onMouseDown(this)
|
||||
}
|
||||
|
||||
unclicked() {
|
||||
this.onMouseUp(this)
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import IMouseClick from "./IMouseClick"
|
||||
import WindowElement from "../../element/WindowElement"
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
* @extends {IMouseClick<T>}
|
||||
*/
|
||||
export default class MouseOpenWindow extends IMouseClick {
|
||||
|
||||
#window
|
||||
|
||||
clicked(location) {
|
||||
}
|
||||
|
||||
unclicked(location) {
|
||||
this.#window = new WindowElement({
|
||||
type: this.options.windowType,
|
||||
windowOptions: this.options.windowOptions,
|
||||
})
|
||||
this.blueprint.append(this.#window)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user