Various fixes

This commit is contained in:
barsdeveloper
2022-09-25 17:26:09 +02:00
parent 4d35c198db
commit e0186fc408
13 changed files with 31 additions and 52 deletions

View File

@@ -10,8 +10,9 @@ import Utility from "../../Utility"
export default class IPointing extends IInput {
constructor(target, blueprint, options) {
options.movementSpace ??= blueprint?.getGridDOMElement() ?? document.documentElement
super(target, blueprint, options)
this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement
this.movementSpace = options.movementSpace
}
/** @param {MouseEvent} mouseEvent */

View File

@@ -77,7 +77,6 @@ export default class BlueprintTemplate extends ITemplate {
}
/**
* Computes the html content of the target element.
* @param {Blueprint} element Target element
* @returns The computed html
*/

View File

@@ -35,7 +35,7 @@ export default class BoolPinTemplate extends IInputPinTemplate {
renderInput(pin) {
if (pin.isInput()) {
return html`
<input type="checkbox" class="ueb-pin-input" .checked=${pin.defaultValue=="true" } />
<input type="checkbox" class="ueb-pin-input" .checked=${pin.entity.getDefaultValue()} />
`
}
return super.renderInput(pin)

View File

@@ -9,7 +9,7 @@ export default class ExecPinTemplate extends PinTemplate {
renderIcon(pin) {
return html`
<svg viewBox="-2 0 16 16">
<path class="ueb-pin-tofill" stroke-width="1.25" stroke="white"
<path class="ueb-pin-tofill" stroke-width="1.25" stroke="white" fill="none"
d="M 2 1 a 2 2 0 0 0 -2 2 v 10 a 2 2 0 0 0 2 2 h 4 a 2 2 0 0 0 1.519 -0.698 l 4.843 -5.651 a 1 1 0 0 0 0 -1.302 L 7.52 1.7 a 2 2 0 0 0 -1.519 -0.698 z" />
</svg>
`

View File

@@ -9,21 +9,6 @@ import RealPinTemplate from "./RealPinTemplate"
export default class VectorPinTemplate extends RealPinTemplate {
/**
* @param {PinElement} pin
* @param {String[]?} values
*/
setInputs(pin, values = [], updateDefaultValue = true) {
this.inputContentElements.forEach(
(element, i) => element.innerText = values[i]
)
if (updateDefaultValue) {
pin.setDefaultValue(values
.map(v => IInputPinTemplate.stringFromInputToUE(v)) // Double newline at the end of a contenteditable element
.reduce((acc, cur) => acc + cur, ""))
}
}
/** @param {PinElement} pin */
renderInput(pin) {
if (pin.isInput()) {

View File

@@ -21,9 +21,18 @@ export default class WindowTemplate extends IDraggableTemplate {
draggableElement: this.getDraggableElement(element),
looseTarget: true,
stepSize: 1,
movementSpace: element.blueprint,
})
}
/** @param {T} element */
createInputObjects(element) {
return [
...super.createInputObjects(element),
this.createDraggableObject(element),
]
}
/** @param {WindowElement} element */
render(element) {
return html`