diff --git a/source/client/ui/explorer/styles.scss b/source/client/ui/explorer/styles.scss index 0d4bfd3e..2bb81337 100644 --- a/source/client/ui/explorer/styles.scss +++ b/source/client/ui/explorer/styles.scss @@ -1226,7 +1226,7 @@ $tour-entry-indent: 12px; //////////////////////////////////////////////////////////////////////////////// // PROPERTIES .sv-property{ - &[disabled] { + &[disabled], &[aria-disabled="true"] { filter: brightness(0.6); } diff --git a/source/client/ui/properties/PropertyBase.ts b/source/client/ui/properties/PropertyBase.ts index 212b963a..31a428c0 100644 --- a/source/client/ui/properties/PropertyBase.ts +++ b/source/client/ui/properties/PropertyBase.ts @@ -40,8 +40,8 @@ export default class PropertyBase extends CustomElement @property({ attribute: false }) language: CVLanguageManager = null; - @property({ type: Boolean, attribute: "aria-disabled"}) - disabled = false; + @property({ attribute: "aria-disabled"}) + ariaDisabled:"true"|"false"|null; protected firstConnected() { diff --git a/source/client/ui/properties/PropertyBoolean.ts b/source/client/ui/properties/PropertyBoolean.ts index b2b8aa9d..523d5d9d 100644 --- a/source/client/ui/properties/PropertyBoolean.ts +++ b/source/client/ui/properties/PropertyBoolean.ts @@ -64,7 +64,7 @@ export default class PropertyBoolean extends PropertyBase Array.isArray(text) ? text[0] : (text || "Off"); return html` -
`; +
`; } protected onButtonClick(event: IButtonClickEvent) diff --git a/source/client/ui/properties/PropertyColor.ts b/source/client/ui/properties/PropertyColor.ts index 8bce407b..cbb834f2 100644 --- a/source/client/ui/properties/PropertyColor.ts +++ b/source/client/ui/properties/PropertyColor.ts @@ -107,7 +107,7 @@ export default class PropertyColor extends PropertyBase return html` - ${this.compact?null:html`{ diff --git a/source/client/ui/properties/PropertyEvent.ts b/source/client/ui/properties/PropertyEvent.ts index 3fe02a95..f79c5de1 100644 --- a/source/client/ui/properties/PropertyEvent.ts +++ b/source/client/ui/properties/PropertyEvent.ts @@ -65,7 +65,7 @@ export default class PropertyEvent extends PropertyBase return html`
+
`; } diff --git a/source/client/ui/properties/PropertyNumber.ts b/source/client/ui/properties/PropertyNumber.ts index 3fbcb93d..cfcd8695 100644 --- a/source/client/ui/properties/PropertyNumber.ts +++ b/source/client/ui/properties/PropertyNumber.ts @@ -16,9 +16,8 @@ */ import Property from "@ff/graph/Property"; -import CustomElement, { customElement, property, PropertyValues, html } from "@ff/ui/CustomElement"; +import { customElement, property, PropertyValues, html } from "@ff/ui/CustomElement"; -import "@ff/ui/Button"; import PropertyField from "@ff/scene/ui/PropertyField"; import PropertyBase from "./PropertyBase"; @@ -50,7 +49,7 @@ export default class PropertyNumber extends PropertyBase } protected disconnected(): void { - if(!this.disabled){ + if(this.ariaDisabled !== "true"){ this.removeEventListener("pointerdown", this.onPointerDown); this.removeEventListener("pointerup", this.onPointerUp); this.removeEventListener("pointercancel", this.onPointerUp); @@ -71,8 +70,8 @@ export default class PropertyNumber extends PropertyBase } } - if(changedProperties.has("disabled")){ - if(this.disabled){ + if(changedProperties.has("ariaDisabled")){ + if(this.ariaDisabled === "true"){ this.removeEventListener("pointerdown", this.onPointerDown); this.removeEventListener("pointerup", this.onPointerUp); this.removeEventListener("pointercancel", this.onPointerUp); @@ -103,7 +102,7 @@ export default class PropertyNumber extends PropertyBase
${bounded? html``:null} - ${name} - { this.property.setValue(parseInt(e.target.value)) }}> ${optionsList} diff --git a/source/client/ui/properties/PropertySlider.ts b/source/client/ui/properties/PropertySlider.ts index 58c165d2..027a8dd9 100644 --- a/source/client/ui/properties/PropertySlider.ts +++ b/source/client/ui/properties/PropertySlider.ts @@ -70,7 +70,7 @@ export default class PropertySlider extends PropertyBase const v = (value - min) / (max - min); return html` - `; + `; } protected onSliderChange(event: ILinearSliderChangeEvent) diff --git a/source/client/ui/properties/PropertyString.ts b/source/client/ui/properties/PropertyString.ts index d9d3dc59..37abf763 100644 --- a/source/client/ui/properties/PropertyString.ts +++ b/source/client/ui/properties/PropertyString.ts @@ -18,7 +18,6 @@ import Property from "@ff/graph/Property"; import CustomElement, { customElement, property, PropertyValues, html } from "@ff/ui/CustomElement"; -import "@ff/ui/Button"; import PropertyBase from "./PropertyBase"; //////////////////////////////////////////////////////////////////////////////// @@ -33,9 +32,6 @@ export default class PropertyString extends PropertyBase @property({ type: String }) name = ""; - @property({ type: Boolean }) - disabled = false; - protected firstConnected() { super.firstConnected(); @@ -77,7 +73,7 @@ export default class PropertyString extends PropertyBase const text = property.value; return html`${name? html``:null} - { e.target.select();}}} diff --git a/source/client/ui/story/PropertyView.ts b/source/client/ui/story/PropertyView.ts index fb5edda2..531bc573 100644 --- a/source/client/ui/story/PropertyView.ts +++ b/source/client/ui/story/PropertyView.ts @@ -78,27 +78,27 @@ export default class PropertyView extends CustomElement return null; } if(property.type === "number" && property.schema.semantic === "color"){ - return html``; + return html``; }else if (property.type === "number" && property.isArray()) { let fields = []; for (let i = 0; i < property.elementCount; ++i) { let index_disabled = disabled || this.property.hasInLinks(i); const fieldLabel = property.schema.labels?.[i] ?? _defaultLabels[i]; - fields.push(html``); + fields.push(html``); } const headerElement = label ? html`
${label}
` : null; return html`${headerElement}
${fields}
`; }else if (schema.event) { - return html``; + return html``; }else if (schema.options) { - return html``; + return html``; }else if(property.type === "boolean"){ - return html``; + return html``; }else if(property.type === "string"){ - return html`` + return html`` }else if(property.type === "number"){ - return html`` + return html`` }else{ console.warn("Unhandled property :", property.name); return html`
${label}
${property.value} (not editable)
`;