Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Negative Number Input #37

Open
sbscan opened this issue Dec 23, 2024 · 0 comments · May be fixed by #38
Open

[Feature]: Negative Number Input #37

sbscan opened this issue Dec 23, 2024 · 0 comments · May be fixed by #38
Labels
enhancement New feature or request

Comments

@sbscan
Copy link

sbscan commented Dec 23, 2024

Module

stdf (STDF component)

Feature Description

Number Input doesn't allow negative numbers. A 'negative' prop would be nice to accept negative numbers.

Example

No response

Your Idea

We can make optional because not every situation need negative values. Can be like this:
value = e.value.replace(negative ? /[^\d^.\-]+/g : /[^\d^.]+/g, '');

@sbscan sbscan added the enhancement New feature or request label Dec 23, 2024
rizmyabdulla added a commit to rizmyabdulla/stdf that referenced this issue Jan 18, 2025
Fixes any-tdf#37

Add support for negative numbers in the Number Input component.

* Add a new `negative` prop to the `Input` component in `packages/stdf/components/input/Input.svelte`.
* Update the `valueChangeFun` function in `packages/stdf/components/input/Input.svelte` to handle negative numbers when the `negative` prop is set.
* Update the `type` prop in `doc/components/input/api_en.md` and `doc/components/input/api.md` to include a 'negative' option.
* Add a description for the `negative` prop in `doc/components/input/api_en.md` and `doc/components/input/api.md`.
* Add examples of the `negative` prop in `demo/src/routes/en_US/input/+page.svelte` and `demo/src/routes/zh_CN/input/+page.svelte`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/any-tdf/stdf/issues/37?shareId=XXXX-XXXX-XXXX-XXXX).
@rizmyabdulla rizmyabdulla linked a pull request Jan 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant