Skip to content

v3.0.19

Choose a tag to compare

@gmpassos gmpassos released this 13 Aug 02:38
2269818

3.0.19

  • UIComponent:

    • onChildRendered: fixed the notification passing the parent component instead of the
      rendered child (_callOnChildRendered called onChildRendered(this)).
    • _parseOnEventKeyPress: an onEventKeyPress attribute without a key:action delimiter
      threw a RangeError that aborted the whole render (toContentElements returned an empty
      list). The value is now handled as an action triggered by any key.
    • focusField: was looking for the text input in the component itself instead of in the
      resolved field component.
    • getFieldsComponentsMap: for a repeated field name it now keeps the UIField component
      instead of letting a plain element overwrite it. getFieldsExtended had a sort with the
      same intent, but it compared MapEntry is UIComponent (always false) over an
      already deduplicated map.
    • appendStyle: ensures the previous declarations are terminated before appending.
  • UIAsyncContent:

    • _ensureElementForDOM: an HTML content with multiple root nodes returned the raw
      String instead of the built element (missing return in the branch).
  • UILayout:

    • _getElementIndexByID: an element without an id built the invalid CSS selector #,
      throwing a SyntaxError. This broke any evaluated uiLayout command
      (e.g. x(10px)) on elements without an id.
    • _parseValuePx: crashed with a FormatException on fractional values (e.g. 4.5px);
      now parsed as a num and ignored when not a plain px value (e.g. calc(...)).
    • _valueXY: returned the invalid CSS value '0 px' (with a space) when the parent had
      no dimensions.
    • The window resize listener is now registered once per Window (it was registered by
      every UILayout instance, since _registeredWindow was not static).
    • _configure: removed a no-op split() over a regex passed as a literal String.
    • _getElementIndex/_getElementIndexByID: null-safe for detached elements.
  • UINavigator:

    • navigateOnClick: a null/empty route threw a null-check error; it now clears a
      previously registered route and returns null.
    • _navigateTo: the "navigable not found" retry dropped the fromURL flag, pushing a
      duplicated entry in the browser history for URL-driven navigations.
  • UIElementExtension.resolveUIComponent: no longer throws when there is no UIRoot.

  • $uiButtonLoader:

    • button-style was only emitted when buttonClasses was provided (and was emitted empty
      when only buttonClasses was given).
    • loaded-text-classes was built from buttonClasses instead of loadedTextClass.
    • UIButtonLoader.generator now also accepts the loaded-text-classes attribute
      (the one generated by $uiButtonLoader).
  • UIEventHandler.trackAllRegisteredEventListeners: fixed an empty-check using isElement.

  • getUILoadingType: the dualRing case was unreachable, since the value is lower-cased
    before the switch. UILoadingType.dualRing could never be parsed from a String and
    silently fell back to UILoadingType.ring. Also accepts dual-ring and dual_ring.

  • UILoadingConfig:

    • toInlineProperties emitted textZoom, but fromMap only read text-zoom, and
      withProgress was not emitted at all. Both were silently lost on a
      toInlineProperties → parse round-trip (used by the ui-button-loader tag).
  • UIDialog.getAllDialogs/removeAllDialogs: resolved the dialogs by mapping the
    .ui-dialog elements back to their components through an Expando. An Expando is
    keyed by identity, and on dart2wasm an element re-read from the DOM is a new Dart
    wrapper, so the lookup always missed and both methods were no-ops. They now resolve
    the instances through UIRootComponent.getInstances.

  • Lints (dart analyze --fatal-infos --fatal-warnings):

    • BUIViewProvider.fromManifestContent: the return of the async
      fromManifestTree was inside a try block, so its errors were never caught by the
      catch (unawaited_return_in_try_block). Moved out of the try, which keeps the
      behavior and makes the guarded scope explicit.
    • Converted the forwarded constructor parameters to super parameters in UIDocument,
      BUIRender, UIButtonCapture, UIDialogInput, UIDialogAlert and UIDialogLoading
      (use_super_parameters).
  • Tests:

    • Added test/bones_ui_component_test.dart, test/bones_ui_async_content_test.dart,
      test/bones_ui_layout_test.dart, test/bones_ui_navigator_test.dart and
      test/bones_ui_button_test.dart.
    • Coverage: added test/bones_ui_extension_test.dart,
      test/bones_ui_component_async_test.dart, test/bones_ui_fields_test.dart,
      test/bones_ui_navigable_test.dart, test/bones_ui_utils_test.dart and
      test/bones_ui_dialog_test.dart.
    • Line coverage: 47.8% → 60.8%.