feat(ui5-number-input): introduce NumberInput component#13799
feat(ui5-number-input): introduce NumberInput component#13799GDamyanov wants to merge 29 commits into
Conversation
👋 Heads-up: dev close is in effectThanks for the contribution! This repository is currently in dev close ahead of release This PR appears to introduce public-API changes (detected by diffing the Custom Elements Manifest against the latest published version on npm):
Could you please hold off on merging into If this change must ship in the current release, please request a review from one or two members of @UI5/ui5-team-webc so the team can sign off explicitly.
Posted automatically by the Dev Close Notice workflow. |
|
🚀 Deployed on https://pr-13799--ui5-webcomponents-preview.netlify.app |
| } | ||
|
|
||
| get _displayValue() { | ||
| if (this._languageChanged) { |
There was a problem hiding this comment.
getters invoked from templates should be pure, so i think we have to move this flag reset out of the getter (e.g. into onBeforeRendering or the language handler).
| value = this._preciseValue(value); | ||
| if (value !== this.value) { | ||
| this.value = value; | ||
| this._inputValue = this._formatNumber(value); |
There was a problem hiding this comment.
the _inputValue is never set back to undefined
the template renders value={this._inputValue ?? this._displayValue}
The language-change handler resets the formatter/delimiters and sets _languageChanged = true, but does not clear _inputValue. So once the user has interacted, switching locale will not re-format the displayed number (e.g. 1,234.50 won't become 1.234,50).
Summary
Introduces a new
ui5-number-inputcomponent as the dedicated numeric input primitive, and refactorsui5-step-inputto be built on top of it.New Component:
ui5-number-inputA numeric input field
ui5-number-inputhas been extracted as a standalone component. It handles all numeric input logic internally:_showStepButtons)Refactored: ui5-step-input
ui5-step-inputis now a thin wrapper aroundui5-number-input, delegating all numeric logic to itA new private property is added in the
ui5-number-input:_showStepButtonsis a @Private, noAttribute boolean property onui5-number-input(defaults to false) that controls whether the increment/decrement buttons are rendered. When false,ui5-number-inputrenders as a plain numeric input with no step buttons — suitable for standalone use.ui5-step-inputsets_showStepButtons={true}in its template, which activates the buttons and the associated CSS modifier class (ui5-number-input-root--with-buttons). This means the step button UI lives entirely insideui5-number-input;ui5-step-inputdoes not render any buttons of its own.Breaking Changes
BREAKING CHANGE: ui5-step-input shadow DOM internals changed
ui5-step-input now composes ui5-number-input internally instead of ui5-input.
Any CSS, querySelector, or ::part() targeting the previous inner [ui5-input]
(.ui5-step-input-root, .ui5-step-input-input) will no longer work and must be