-
Notifications
You must be signed in to change notification settings - Fork 13.5k
feat(input-otp): add new input-otp component #30386
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
brandyscarney
wants to merge
82
commits into
feature-8.6
Choose a base branch
from
FW-6410
base: feature-8.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,480
−79
Open
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
12b7500
feat(input-otp): add input-otp component
brandyscarney 231b2b0
test(input-otp): add tests for different props
brandyscarney eb1a8d5
fix(input-otp): fix styles for sizes, spaces and separators
brandyscarney ce38d95
style: lint
brandyscarney ee6f29d
fix(input-otp): design fixes and invalid state
brandyscarney d5c7c22
Merge branch 'feature-8.6' into FW-6410
brandyscarney 2d0441c
fix(input-otp): update implementation to match input's more closely
brandyscarney 5214878
feat(input-otp): add readonly support
brandyscarney 30eed51
feat(input-otp): support disabled and readonly colors
brandyscarney 46e69c8
fix(input-otp): resolve a11y error with input labels
brandyscarney 2e2eebd
refactor(input-otp): clean up and build
brandyscarney fcb8e1d
test(input-otp): add tests for basic, color, fill, separators, shape,…
brandyscarney 3e4fe5a
fix(input-otp): shift input boxes over 1 when clearing a value in the…
brandyscarney aeace76
refactor(input-otp): rename allowedKeys to pattern
brandyscarney 5c7a311
fix(input-otp): paste from first empty box or first box if all are fi…
brandyscarney b260644
test(input-otp): paste functionality
brandyscarney 9aaeef2
fix(input-otp): improve separator collapse
brandyscarney 6175dfb
fix(input-otp): move focus to last input when all are filled
brandyscarney bb7065b
fix(input-otp): always start value at first empty input when typing
brandyscarney ecf1c11
fix(input-otp): allow entering keys in the middle of the input group
brandyscarney 46a3fb7
refactor(input-otp): return when pasted text is empty
brandyscarney 97649a0
fix(input-otp): respect case when checking pattern
brandyscarney eb6ae3f
test(input-otp): add another focus test
brandyscarney 9b39100
fix(input-otp): update emitted events to match the input component
brandyscarney 1666307
fix(input-otp): handle arrow navigation in RTL and add RTL tests
brandyscarney f9a33ae
test(input): revert logs
brandyscarney a9a31ab
fix(input-otp): print a warning when separators exceed length
brandyscarney 618575d
fix(input-otp): warn for incorrectly formatted separator strings
brandyscarney 344c72a
feat(input-otp): expose reset and setFocus methods
brandyscarney c4743fe
fix(input-otp): move separator next to native wrapper to properly col…
brandyscarney f0fba1d
refactor(input-otp): ignore Fragment error in eslint
brandyscarney a7d14f2
fix(input-otp): don't allow focus in boxes without values except last
brandyscarney 6190d0c
fix(input-otp): update colors and valid/invalid states design
brandyscarney 6b65ceb
fix(input-otp): do not shift values right if the input value is selected
brandyscarney 9b6ee1e
style: lint
brandyscarney cb989bf
fix(input-otp): update ios and md designs
brandyscarney f4dca87
test(input-otp): fix duplicate names and old test structure
brandyscarney 535b737
chore: build
brandyscarney 64cf4e7
fix(input-otp): update disabled text color
brandyscarney 3ae2fff
test(input-otp): set explicit height to capture full screenshot
brandyscarney 2c610e8
chore(): add updated snapshots
brandyscarney a968721
style: remove escapes
brandyscarney b47fa98
feat(input-otp): support autocapitalize
brandyscarney ccedd96
chore(): add updated snapshots
Ionitron a9008cd
Revert "chore(): add updated snapshots"
brandyscarney a46322b
revert
brandyscarney 18e0f70
test(input-otp): simplify basic test with helper function to verify v…
brandyscarney cbf963d
test(input-otp): add helper functions and constants, warn for duplica…
brandyscarney dd7476b
fix(input-otp): extract pattern to a function
brandyscarney e02aa1a
Update core/src/components/input-otp/input-otp.tsx
brandyscarney e8be93a
fix(angular): add input-otp to Angular's value accessors
brandyscarney c6ae0d4
test(angular): add tests for input-otp in lazy tests
brandyscarney d53b808
test(angular): add tests for input-otp in standalone tests
brandyscarney 26349c5
refactor(input-otp): naming update
brandyscarney eb7f838
refactor(input-otp): remove redundant code
brandyscarney 2a9c274
fix(input-otp): allow characters outside of latin when type is text
brandyscarney 72755ce
style: lint
brandyscarney ec35637
refactor(input-otp): change for loop to findIndex
brandyscarney b0fea61
style: lint
brandyscarney 1c9c939
fix(input-otp): allow any kind of numeric character in any script for…
brandyscarney d1dc603
docs(input-otp): add code blocks in docs
brandyscarney ff4bb55
docs(input-otp): document as single slash
brandyscarney acbba7c
test(input-otp): use script pattern in e2e test
brandyscarney c5e97c3
fix(input-otp): inherit aria attributes and hide empty input boxes fr…
brandyscarney 9d905b2
fix(input-otp): hide description when there is no content
brandyscarney 4015ee4
fix(input-otp): properly handle value updates and add tests
brandyscarney 82d086f
test(input-otp): clarify the JS behavior of RTL languages in the e2e …
brandyscarney 8c29200
fix(input-otp): correct paste behavior to always start at first box
brandyscarney 24accec
test(vue): add tests for input-otp
brandyscarney a6cfbb4
chore(scripts): improve test app build scripts to be faster and more …
brandyscarney 72ad44a
fix(vue): add v-model binding for input-otp
brandyscarney 0461608
chore(scripts): update build scripts for test app to remove deleted f…
brandyscarney 1ffbc0d
test(vue): use proper v-model instead of debug code
brandyscarney 6b17afc
test(react): add inputs test to test input-otp and other inputs
brandyscarney e47f1e7
Merge branch 'feature-8.6' into FW-6410
brandyscarney 2698faf
chore(scripts): revert build test apps back to cp
brandyscarney 0094604
fix(angular): exclude ion-input-otp from standalone proxy generation
brandyscarney 0c457b7
docs(component-guide): add information on new input components
brandyscarney 3ee6fe8
docs(component-guide): add info on updating angular value accessors
brandyscarney 15c3ac8
style: order
brandyscarney 30067b0
docs(component-guide): update output target config steps
brandyscarney 2de1519
refactor(input-otp): reorganize functions to group by functionality
brandyscarney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Values are converted to strings when emitted which is | ||
* why we do not have a `number` type here even though the | ||
* `value` prop accepts a `number` type. | ||
*/ | ||
export interface InputOtpInputEventDetail { | ||
value?: string | null; | ||
event?: Event; | ||
} | ||
export interface InputOtpChangeEventDetail { | ||
value?: string | null; | ||
event?: Event; | ||
} | ||
|
||
export interface InputOtpCompleteEventDetail { | ||
value?: string | null; | ||
event?: Event; | ||
} | ||
|
||
export interface InputOtpCustomEvent<T = InputOtpChangeEventDetail> extends CustomEvent { | ||
detail: T; | ||
target: HTMLIonInputOtpElement; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@import "./input-otp"; | ||
@import "../../themes/ionic.globals.ios"; | ||
|
||
// iOS Input OTP | ||
// -------------------------------------------------- | ||
|
||
:host { | ||
--border-width: #{$hairlines-width}; | ||
} | ||
|
||
:host(.has-focus) .native-input:focus { | ||
--border-width: 1px; | ||
} | ||
Comment on lines
+7
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These borders will only be visible on devices that support hairline (half pixel) border widths |
||
|
||
// Fills | ||
// -------------------------------------------------- | ||
|
||
:host(.input-otp-fill-outline) { | ||
--border-color: #{$item-ios-border-color}; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was required in order to use
<>
ininput-otp.tsx