feat(ui5-number-input): introduce NumberInput component - #13799
feat(ui5-number-input): introduce NumberInput component#13799GDamyanov wants to merge 34 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).
|
Please add it to FormSupport related pages and tests. Don't forget to put new badge in the documentation page. |
Fixed in 03306d9 |
| <ValuePrecision /> | ||
|
|
||
| ### States | ||
| NumberInput supports several semantic value states, readonly, disabled, etc. |
There was a problem hiding this comment.
| NumberInput supports several semantic value states, readonly, disabled, etc. | |
| The `ui5-number-input` component supports several semantic value states, read-only mode, and disabled mode. |
| /** | ||
| * Fired when the value of the component changes at each keystroke. | ||
| * @public | ||
| * @since 2.6.0 |
There was a problem hiding this comment.
Should this stay as it is or change to since 2.24.0?
| * Fired before the value state of the component is updated internally. | ||
| * The event is preventable, meaning that if it's default action is | ||
| * prevented, the component will not update the value state. | ||
| * @since 1.23.0 |
There was a problem hiding this comment.
Should this stay as it is or change to @SInCE 2.24.0?
| * Receives id(or many ids) of the elements that label the component. | ||
| * @default undefined | ||
| * @public | ||
| * @since 1.0.0-rc.15 |
There was a problem hiding this comment.
Should this stay as it is or change to since 2.24.0?
| * | ||
| * ### Overview | ||
| * | ||
| * The `ui5-number-input` is a numeric input field. It allows users to enter, edit, and select numeric values. |
There was a problem hiding this comment.
| * The `ui5-number-input` is a numeric input field. It allows users to enter, edit, and select numeric values. | |
| * The `ui5-number-input` component is a numeric input field. It allows users to enter, edit and select numeric values. |
There was a problem hiding this comment.
does it actually allow users to select values or just enter and edit?
| * Fired before the value state of the component is updated internally. | ||
| * The event is preventable, meaning that if it's default action is | ||
| * prevented, the component will not update the value state. |
There was a problem hiding this comment.
| * Fired before the value state of the component is updated internally. | |
| * The event is preventable, meaning that if it's default action is | |
| * prevented, the component will not update the value state. | |
| * Fired before the value state of the component is updated internally. | |
| * The event is preventable, meaning that if its default action is | |
| * prevented, the component will not update the value state. |
| * | ||
| * The default step is 1 but the app developer can set a different one. | ||
| * | ||
| * App developers can set a maximum and minimum value for the `NumberInput`. |
There was a problem hiding this comment.
| * App developers can set a maximum and minimum value for the `NumberInput`. | |
| * App developers can set a maximum and minimum value for `ui5-number-input`. |
| accessibleName?: string; | ||
|
|
||
| /** | ||
| * Receives id(or many ids) of the elements that label the component. |
There was a problem hiding this comment.
| * Receives id(or many ids) of the elements that label the component. | |
| * Receives ID (or many IDs) of the elements that label the component. |
| * Defines the accessible ARIA name of the component. | ||
| * @default undefined | ||
| * @public | ||
| * @since 1.0.0-rc.15 |
There was a problem hiding this comment.
Is this correct or should it be 2.24.0?
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 edited