Overview
ThePropertyInput component provides an input field for adding new property subscriptions to an object. It features intelligent autocomplete suggestions powered by Designer’s Python runtime, update frequency configuration, and keyboard shortcuts for quick subscription management.
Source: src/components/PropertyInput.vue
Props
The name of the Designer object for which properties will be subscribed. This is used to fetch autocomplete suggestions contextual to the specific object.
Events
Emitted when the user submits a property to subscribe. The event payload includes the property expression and subscription options (including
updateFrequencyMs).Features
Intelligent Autocomplete
The component provides context-aware autocomplete suggestions by calling a Python function in Designer. Suggestions are fetched as the user types, with a 250ms debounce to avoid excessive calls:src/components/PropertyInput.vue:82
The autocomplete function is injected globally by the app and uses Designer’s Python runtime to introspect the object and provide relevant property suggestions.
Keyboard Shortcuts
Submit the current property and create a subscription
Auto-complete with the first suggestion
src/components/PropertyInput.vue:3
Configurable Update Frequency
Users can specify how frequently (in milliseconds) the property value should be updated:src/components/PropertyInput.vue:18
The default update frequency is 50ms, providing smooth real-time updates while balancing performance.
Auto-clear on Submit
After successfully submitting a subscription, the input field is automatically cleared:src/components/PropertyInput.vue:57
Usage
Autocomplete Function
The component requires anautocomplete function to be provided via Vue’s dependency injection. This function is called with the object name and current input value:
src/components/PropertyInput.vue:52
The function should return suggestions based on the object’s available properties and methods, introspected from Designer’s Python runtime.
Component Structure
Methods
emitSubscribe()
Emits thesubscribe event with the current property and options. Only emits if the input is not empty.
completeSuggestion()
Auto-completes the input with the first available suggestion when Tab is pressed. Used for quick property selection from autocomplete suggestions. Location:src/components/PropertyInput.vue:70