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

Number component #1155

Merged
merged 27 commits into from
Mar 28, 2022
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2a3da91
Loosen some linting rules
seancolsen Mar 10, 2022
563e9e5
Add InputFormatter interfac
seancolsen Mar 10, 2022
ab0bd70
Add NumberFormatter
seancolsen Mar 10, 2022
ff118a9
Merge branch 'master' into number_component
seancolsen Mar 18, 2022
93c71ed
Ensure numbers are formatted with latin characters
seancolsen Mar 17, 2022
aa3fce3
Split NumberFormatter into separate classes
seancolsen Mar 18, 2022
e072967
Begin using FormattedInput for NumberInput
seancolsen Mar 18, 2022
0040c40
Use beforeinput event to prevent loss of precision
seancolsen Mar 19, 2022
a1ec258
Make allowFloat and allowNegative default to false
seancolsen Mar 19, 2022
7828de8
Set inputmode
seancolsen Mar 19, 2022
cf2a05c
Fix bug causing failing test
seancolsen Mar 20, 2022
fe90541
Set default value for FormattedInput
seancolsen Mar 20, 2022
0794b8b
Install @testing-library/user-event
seancolsen Mar 20, 2022
bf36489
Allow NumberInput to accept NumberFormatter opts
seancolsen Mar 21, 2022
e19c7f8
Add NumberInput test
seancolsen Mar 21, 2022
0ad93e0
Fix import type
seancolsen Mar 21, 2022
5f96193
Use alias for import within component library
seancolsen Mar 21, 2022
26f9a36
Refactor lookbehind assertions out of RegEx
seancolsen Mar 21, 2022
b66b5a1
Fix linting error
seancolsen Mar 21, 2022
5556cfb
Merge branch 'master' into number_component
seancolsen Mar 21, 2022
d921437
Improve NumberInput story controls
seancolsen Mar 21, 2022
b1293f6
Minor tweaks to getOutcomeOfBeforeInputEvent fn
seancolsen Mar 21, 2022
a23fa7f
Allow null and undefined on low level components
seancolsen Mar 21, 2022
c0a8b38
Merge branch 'master' into number_component
seancolsen Mar 21, 2022
867c203
Merge branch 'master' into number_component
seancolsen Mar 22, 2022
a71bfb2
Merge branch 'master' into number_component
pavish Mar 25, 2022
d57d3b6
Merge branch 'master' into number_component
pavish Mar 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve NumberInput story controls
  • Loading branch information
seancolsen committed Mar 21, 2022
commit d92143793efecae0a771204536b3baab4196f932
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
disable: true,
},
},
allowFloat: { control: 'boolean', defaultValue: false },
allowNegative: { control: 'boolean', defaultValue: false },
locale: {
type: { name: 'string', required: false },
control: 'select',
options: ['en-US', 'de-DE'],
},
},
parameters: {
controls: {
Expand All @@ -28,9 +35,9 @@

<Meta {...meta} />

<Story name="Basic">
<Story name="Basic" let:args>
<div class="wrapper">
<NumberInput bind:value />
<NumberInput {...args} bind:value />
</div>
<div>
Value:
Expand All @@ -47,18 +54,6 @@
</div>
</Story>

<!-- <Story
name="Integer input"
args={{
value: 10,
isInteger: true,
}}
let:args
>
<div style="position:relative;height:30px;width:280px;">
<NumberInput {...args} />
</div>
</Story> -->
<style>
.wrapper {
width: 280px;
Expand Down