@Nonnull public final ProviderBuilder<ST> value( @Nullable final ST value ) { _element.props().set( "value", value ); return this; }
/** * Adds a {@code data-} attribute to the element. * * @param name The name of the data attribute w/o the {@code data-} prefix. However it won't be added if it's * already present. */ public B data(String name, String value) { get().dataset.set(name.replaceFirst("^data-", ""), value); return that(); }
@Nonnull public final ReactNode children( final ReactNode... children ) { _element.props().set( "children", children ); return build(); }
@JsOverlay public final VNodeDirective modifier(String name, boolean modifier) { if (this.modifiers == null) { this.modifiers = JsPropertyMap.of(); } this.modifiers.set(name, modifier); return this; } }
@JsOverlay public final VNodeData on(String name, OnEvent on) { if (this.on == null) { this.on = JsPropertyMap.of(); } ((JsPropertyMap) this.on).set(name, on); return this; }
@JsOverlay public final VNodeData addStaticStyle(String name, Object value) { if (this.staticStyle == null) { this.staticStyle = JsPropertyMap.of(); } this.staticStyle.set(name, value); return this; }
@JsOverlay public final VNodeData prop(String name, Object prop) { if (this.props == null) { this.props = JsPropertyMap.of(); } this.props.set(name, prop); return this; }
@JsOverlay public final VNodeData attr(String name, Object attr) { if (this.attrs == null) { this.attrs = JsPropertyMap.of(); } this.attrs.set(name, attr); return this; }
@JsOverlay public final VNodeData domProp(String name, Object domProp) { if (this.domProps == null) { this.domProps = JsPropertyMap.of(); } this.domProps.set(name, domProp); return this; }
@JsOverlay public final VueConfig setKeyCode(String key, int value) { if (this.keyCodes == null) { this.keyCodes = JsPropertyMap.of(); } this.keyCodes.set(key, value); return this; } }
@JsOverlay public final T prop( @Nonnull final String key, @Nullable final Any value ) { Js.asPropertyMap( this ).set( key, value ); return self(); }
@JsOverlay public final VNodeData hook(String name, Object hook) { if (this.hook == null) { this.hook = JsPropertyMap.of(); } this.hook.set(name, hook); return this; }
@JsOverlay public final VNodeData nativeOn(String name, OnEvent nativeOn) { if (this.nativeOn == null) { this.nativeOn = JsPropertyMap.of(); } ((JsPropertyMap) this.nativeOn).set(name, nativeOn); return this; }
@SafeVarargs public static <T> JsPropertyMap<T> map(JsObjectEntry<T>... entries) { JsPropertyMap<T> jsObject = (JsPropertyMap<T>) JsPropertyMap.of(); for (JsObjectEntry<T> entry : entries) { jsObject.set(entry.getKey(), entry.getValue()); } return jsObject; }
@JsOverlay public final VNodeData scopedSlot(String name, ScopedSlot scopedSlot) { if (this.scopedSlots == null) { this.scopedSlots = Js.cast(JsPropertyMap.of()); } this.scopedSlots.set(name, scopedSlot); return this; }
/** * For the specified observer, collect all dependencies and record them in data to be emitted as debug data. * * @param observer the observer. * @param data the target in which to place debug data. */ public static void collectDependencyDebugData( @Nonnull final Observer observer, @Nonnull final JsPropertyMap<Object> data ) { final ObserverInfo observerInfo = observer.getContext().getSpy().asObserverInfo( observer ); observerInfo.getDependencies().forEach( d -> data.set( d.getName(), getValue( d ) ) ); } }
@JsOverlay public final VueComponentOptions addWatch(String name, Object watcher) { if (getWatch() == null) { setWatch(JsPropertyMap.of()); } getWatch().set(name, watcher); return this; }
@JsOverlay public final VueComponentOptions addMethod(String name, Function method) { if (getMethods() == null) { setMethods(cast(JsPropertyMap.of())); } getMethods().set(name, method); return this; }
@JsOverlay public final VueComponentOptions addProp(String name, PropOptions propOptions) { if (getProps() == null) { setProps(cast(JsPropertyMap.of())); } getProps().set(name, propOptions); return this; }
@JsOverlay public final VueComponentOptions addComputedOptions(String name, ComputedOptions computed) { if (getComputed() == null) { setComputed(cast(JsPropertyMap.of())); } getComputed().set(name, computed); return this; }