UIComponent class abstract
Base class to create Bones_UI components.
- Inheritance
-
- Object
- UIEventHandler
- UIComponent
- Implementers
- Available extensions
Constructors
-
UIComponent(Object? parent, {dynamic componentClass, dynamic componentStyle, dynamic classes, dynamic classes2, dynamic style, dynamic style2, UIComponentClearParent? clearParent, bool inline = true, bool construct = true, bool renderOnConstruction = false, bool preserveRender = false, dynamic id, UIComponentGenerator<
UIComponent> ? generator}) - Creates a UI component.
-
UIComponent.subComponent(Object? parent, {required UIComponent parentComponent, dynamic componentClass, dynamic componentStyle, dynamic classes, dynamic classes2, dynamic style, dynamic style2, UIComponentClearParent? clearParent, bool inline = true, bool construct = true, bool renderOnConstruction = false, bool preserveRender = false, dynamic id, UIComponentGenerator<
UIComponent> ? generator}) -
Creates a component attached to an existing
parentComponent.
Properties
- clearParent → UIComponentClearParent?
-
final
- componentInternals → UIComponentInternals
-
no setter
- constructing → bool?
-
no setter
- content → HTMLElement?
-
no setter
- dataSource → DataSource?
-
no setter
- dataSourceCall ↔ DataSourceCall?
-
getter/setter pair
- dataSourceCallString → String
-
no setter
- disposeCount → int
-
no setter
-
domTreeMap
→ DOMTreeMap<
UINode> -
DOMTreeMap for this component (lazily-created).
no setter
-
domTreeMapIfInitialized
→ DOMTreeMap<
UINode> ? -
Returns the DOMTreeMap if it has already been initialized.
no setter
-
eventListeners
→ List<
MapEntry< String, List< >UIEventListener> > -
no setterinherited
- globalID → int
-
final
- hasDataSource → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ dynamic
-
getter/setter pair
- isDisposed → bool
-
Whether this instance has been disposed.
no setter
- isInDOM → bool
-
no setter
- isLoadingUIAsyncContent → bool
-
no setter
- isRefreshFromExternalCall → bool
-
no setter
- isRendered → bool
-
no setter
- isRenderedWithError → bool
-
Returns
trueif current/last render had errors.no setter - isRendering → bool
-
no setter
- isShowing → bool
-
no setter
- localeChangedFromLastRender → bool
-
no setter
- onChange → EventStream
-
no setter
-
onRender
→ EventStream<
UIComponent> -
no setter
- parent → UIElement?
-
no setter
- parentUIComponent → UIComponent?
-
The parent UIComponent.
no setter
- preserveRender ↔ bool
-
If
truewill preserve last render in next calls to render.getter/setter pair - preserveRenderCount → int
-
no setter
-
getter/setter pair
- renderCount → int
-
no setter
-
renderedElements
→ List<
Object> ? -
no setter
- renderedElementsAsync → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
subUIComponents
→ List<
UIComponent> -
Returns a List of sub UIComponent.
no setter
-
subUIComponentsDeeply
→ Iterable<
UIComponent> -
Returns a List of sub UIComponent deeply in the tree.
no setter
- uiRoot → UIRoot?
-
Returns the UIRoot that is parent of this UIComponent instance,
or
nullif it's not in an UIRoot components tree.no setter - uiRootComponent → UIRootComponent?
-
Returns the UIRootComponent that is parent of this UIComponent instance,
or
nullif it's not in an UIRoot components tree.no setter
Methods
-
action(
String action) → void -
addEventListener(
String type, UIEventListener listener) → void -
inherited
-
addTo(
UIElement parent, {UIComponent? parentUIComponent}) → void -
addTrackedEventListener<
T extends EventTarget, E extends Event> (T target, EventType< E> type, EventCallback<E> callback) → RegisteredEventListener -
inherited
-
appendAttribute(
String? name, dynamic value) → bool -
appendAttributes(
Iterable< DOMAttribute> attributes) → bool -
appendClasses(
Object? classes1, [Object? classes2]) → void -
appendStyle(
Object? style1, [Object? style2, Object? style3]) → void -
appendToContent(
List< UINode> nodes) → bool -
applyData(
dynamic data) → bool -
callRender(
{bool clear = false, bool clearPreservedRender = false}) → void -
callRenderAndWait(
{Duration timeout = const Duration(seconds: 3)}) → Future< bool> -
callRenderAsync(
) → void -
cancelRegisteredEventListeners(
) → void -
inherited
-
clear(
{bool force = false, bool removeFromParent = false}) → void - Clears the component, removing the last rendered content.
-
clearAttribute(
String? name) → bool -
clearContent(
) → bool -
clearEventListeners(
) → void -
inherited
-
clearPreservedRender(
) → void - Clears previous rendered elements. Only relevant if preserveRender is true.
-
click(
) → void -
Calls:
content.click -
clone(
) → UIComponent? -
configure(
) → void - Called by constructor, to configure this component.
-
configureClasses(
Object? classes1, [Object? classes2, Object? componentClasses]) → void -
configureID(
) → void -
configureStyle(
Object? style1, [Object? style2, Object? componentStyle]) → void -
connectDataSource(
) → void -
createContentElement(
bool inline) → HTMLElement -
delete(
) → void -
deniedAccessRoute(
) → String? -
deviceSizeChangedFromLastRender(
{double tolerance = 0.10, bool onlyWidth = false, bool onlyHeight = false}) → bool -
dispose(
) → void - Disposes this instance and releases all associated resources.
-
ensureRendered(
[bool force = false]) → void -
findChildDeep(
FilterElement filter) → List< UIElement> -
findChildrenDeep(
String fieldName, {bool resolveUIComponents = true}) → MapEntry< String, Object> ? -
findInContentChildDeep(
FilterElement filter) → UIElement? -
findUIComponentByChild(
UIElement? child) → UIComponent? -
findUIComponentByContent(
UIElement? content) → UIComponent? -
findUIComponentByID(
String id) → UIComponent? -
fireEvent(
String type, dynamic event, [List? params]) → void -
inherited
-
focusField(
String? fieldName) → bool -
forEachEmptyFieldComponent(
ForEachComponent f) → int -
forEachEmptyFieldElement(
ForEachElement f) → int -
forEachFieldComponent(
ForEachComponent f) → int -
forEachFieldElement(
ForEachElement f) → int -
getAllRenderedElements(
FilterRendered filter, [bool deep = false]) → List? -
getAttribute(
String? name) → String? -
getComponentFieldName(
Object obj) → String? -
getContentChildren(
{FilterElement? filter, bool deep = true}) → List< UIElement> -
getElementFieldName(
UIElement element, {bool resolveUIComponents = true}) → String? -
getEmptyFields(
) → List< String> -
getField(
String? fieldName, [String? def]) → String? -
getFieldAs<
T> (String? fieldName, [T? def]) → T? -
getFieldComponent(
String? fieldName, {bool resolveUIComponents = true}) → Object? -
getFieldElementByValue(
String? fieldName, String value, {bool resolveUIComponents = true}) → UIElement? -
getFieldElementNonTyped(
String? fieldName) → Element? -
getFieldElements(
String? fieldName) → List< UIElement> -
getFieldElementTyped<
E extends HTMLElement> (String? fieldName, Web< E> webType) → E? -
getFieldExtended<
V> (String? fieldName, [V? def]) → V? -
getFields(
{List< String> ? fields, List<String> ? ignoreFields, bool resolveUIComponents = true}) → Map<String, String?> -
getFieldsComponents(
) → List< Object> -
getFieldsComponentsMap(
{List< String> ? fields, List<String> ? ignoreFields}) → Map<String, Object> -
getFieldsElements(
) → List< UIElement> -
getFieldsElementsMap(
{List< String> ? fields, List<String> ? ignoreFields, bool resolveUIComponents = true}) → Map<String, UIElement> -
getFieldsExtended(
{List< String> ? fields, List<String> ? ignoreFields}) → Map<String, Object?> -
getFieldsGroupByPrefix<
K, V> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, V? valueAs(String key)?, bool filter(K key, V? value)?}) → Map<K, V?> -
getFieldsGroupCheckedKeys<
K> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?}) → List<K> -
getFieldsGroupChecks<
K> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, bool filter(K key, bool? value)?}) → Map<K, bool> -
getFieldsGroupEntriesByPrefix<
K, V> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, V? valueAs(String key)?, bool filter(K key, V? value)?}) → List<MapEntry< K, V?> > -
getFieldsGroupKeysByPrefix<
K> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, bool filter(K key, Object? value)?}) → List<K> -
getFieldsGroupListByPrefix<
K, V> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, V? valueAs(String key)?, bool filter(K key, V? value)?}) → Map<K, List< V> > -
getFieldsGroupValuesByPrefix<
V> (String groupPrefix, {Map< String, String?> ? fields, String keyDelimiter = '_', String keyPart(String key)?, V? valueAs(String key)?, bool filter(Object key, V? value)?}) → List<V> -
getFieldsNames(
) → List< String> -
getPreviousRenderedFieldValue(
String? fieldName) → dynamic -
getRenderedElement(
FilterRendered filter, [bool? deep]) → dynamic -
getRenderedElementById(
dynamic id, [bool deep = false]) → dynamic -
getRenderedElementValueById(
dynamic id, [bool deep = false]) → dynamic -
getRenderedUIComponentById<
T extends UIComponent> (dynamic id, [bool? deep]) → T? -
getRenderedUIComponentByType<
T> ([bool? deep]) → List< T> -
getRenderedUIComponents(
[bool? deep]) → Iterable< UIComponent> -
getRenderedUIComponentsByIds<
T extends UIComponent> (List ids, [bool? deep]) → List< UIComponent> -
hasEmptyField(
) → bool -
hide(
) → void - Hide component.
-
insertTo(
int index, UIElement parent, {UIComponent? parentUIComponent}) → void -
isAccessible(
) → bool -
isEmptyField(
String? fieldName) → bool -
markRenderedWithError(
) → void - Marks current/last render with error.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChildRendered(
UIComponent child) → void -
onPreConstruct(
) → void - Called in the beginning of constructor.
-
parseChildElementValue(
UIElement? childElement, {UIComponent? childUiComponent, bool allowTextAsValue = true, bool resolveUIComponents = true}) → String? -
posAsyncRender(
) → void -
posRender(
) → void - Called after render.
-
preRender(
) → void - Called before render.
-
preRenderClear(
) → void -
querySelectorAllNonTyped(
String? selectors) → List< UIElement> -
Alias to
content.querySelectorAll. -
querySelectorAllTyped<
T extends UIElement> (String? selectors, Web< T> webType) → List<T> -
Alias to
content.querySelectorAll. -
querySelectorNonTyped(
String? selectors) → Element? -
Alias to
content.querySelector. -
querySelectorTyped<
E extends Element> (String? selectors, Web< E> webType) → E? -
Alias to
content.querySelector. -
refresh(
{bool forceRender = false, bool clearPreservedRender = false}) → void - Refreshes the component, calling render.
-
refreshDataSource(
) → void -
refreshIfLocaleChanged(
) → void -
refreshInternal(
) → void -
registerInUIRoot(
) → void - Called by constructor to register this component in the UIRoot tree.
-
removeEventListener(
String type) → void -
inherited
-
render(
) → dynamic - Renders the elements of this component.
-
renderError(
dynamic error) → dynamic -
Called when render returns a
Futurevalue, to render the content when Future has an error. -
renderLoading(
) → dynamic -
Called when render returns a Future value, to render the content
while loading
Future. -
renderTestUI(
{int ms = 100}) → Future< int> -
Available on UIComponent, provided by the TestUIComponentExtension extension
-
requestRefresh(
{Duration? delay, bool clearPreservedRender = false}) → void - Requests a refresh using Future.microtask or Future.delayed.
-
resolveTextIntl(
String text) → String -
Resolves
text{{intl:key}}messages. -
select(
String? selectors) → Element? -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
selectAll(
String? selectors) → List< Element> -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
selectAllTyped<
E extends Element> (String? selectors, Web< E> webType) → List<E> -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
selectElementNonTyped(
String? selectors) → Element? -
Alias to
content.querySelector. -
selectElementsNonTyped(
String? selectors) → List< UIElement> -
Alias to
content.querySelectorAll. -
selectElementsNonTypedValues(
String? selectors) → Map< String, String?> -
Alias to
content.querySelectorAll. -
selectElementsTyped<
T extends UIElement> (String? selectors, Web< T> webType) → List<T> -
Alias to
content.querySelectorAll. -
selectElementsTypedValues<
T extends UIElement> (String? selectors, Web< T> webType) → Map<String, String?> -
Alias to
content.querySelectorAll. -
selectElementTyped<
E extends UIElement> (String? selectors, Web< E> webType) → E? -
Alias to
content.querySelector. -
selectExpected(
String? selectors) → Element -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
selectExpectedTyped<
E extends UIElement> (String? selectors, Web< E> webType) → E -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
selectTyped<
E extends UIElement> (String? selectors, Web< E> webType) → E? -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
setAttribute(
String? name, dynamic value) → bool -
setAttributes(
Iterable< DOMAttribute> attributes) → bool -
setContentNodes(
List< UINode> nodes) → bool -
setData(
dynamic data) → bool -
setField(
String fieldName, dynamic value) → void -
setID(
Object? id) → void -
setParent(
UIElement parent, {UIComponent? parentUIComponent}) → UIElement? -
Sets the
parentUIElement. -
show(
) → void - Show component.
-
simplify(
{bool trim = true, bool collapseSpaces = true, bool lowerCase = true, String nullValue = ''}) → String -
Available on UIComponent?, provided by the TestUIComponentNullableExtension extension
-
toContentElements(
dynamic rendered, {bool append = false, bool parseAttributes = true}) → List< Object> -
toRenderableList(
Object? list, [DOMContext< UINode> ? domContext]) → List<Object> ? -
toString(
) → String -
A string representation of this object.
inherited
-
trackAllRegisteredEventListeners(
List< RegisteredEventListener> registeredEventListener) → void -
inherited
-
trackRegisteredEventListener(
RegisteredEventListener registeredEventListener) → void -
inherited
-
untrackRegisteredEventListener(
RegisteredEventListener registeredEventListener) → bool -
inherited
-
updateRenderedFieldElementValue(
UIElement fieldElem) → void -
updateRenderedFieldValue(
String fieldName) → void -
waiteRender(
{Duration timeout = const Duration(seconds: 3)}) → Future< bool>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
domContext
→ DOMContext<
UINode> -
The DOMContext of the domGenerator.
no setter
- domGenerator → UIDOMGenerator
-
The UIDOMGenerator used by
Bones_UI.final -
domTreeMapDummy
→ DOMTreeMap<
UINode> -
Global dummy DOMTreeMap instance.
final
- isAnyComponentRendering → bool
-
no setter
- purgeSliceTime ↔ Duration
-
The maximum time the purge after rendering runs before yielding to the
event loop (it purges the rendered components in time slices).
getter/setter pair
- renderingUIComponent → UIComponent?
-
Returns the current synchronous rendering UIComponent in the rendering stack.
no setter
Static Methods
-
copyRenderable(
dynamic element, [dynamic def]) → dynamic -
getContentUIComponent(
UIElement content) → UIComponent? -
hasUIComponentClass(
UIElement element) → bool -
isRenderable(
Object? element) → bool -
parentRenderingUIComponent(
UIComponent uiComponent) → UIComponent? -
Returns the parent rendering UIComponent of
uiComponent, if any. -
parseAttributeValueAsString(
dynamic value, [String? delimiter, Pattern? delimiterPattern]) → String -
parseAttributeValueAsStringList(
dynamic value, [Pattern? delimiter]) → List< String> ? -
parseClasses(
Object? classes1, [Object? classes2]) → List< String> -
parseStyle(
Object? style1) → List< String> -
purgeGlobals(
) → Future< void> - Purges all global UI state and resources.
-
registerGenerator(
UIComponentGenerator< UIComponent> generator) → bool -
Register a
generatorfor a type of UIComponent. -
resolveParentUIComponent(
{UINode? parent, UINode? element, UIComponent? parentUIComponent, UIComponent? elementUIComponent, bool recursive = false}) → void
Constants
-
handledElementAttributes
→ const List<
String>