-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 modernized-built-in-components] First-pass implementation #19218
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
661 changes: 660 additions & 1 deletion
661
packages/@ember/-internals/glimmer/lib/components/input.ts
Large diffs are not rendered by default.
Oops, something went wrong.
98 changes: 91 additions & 7 deletions
98
packages/@ember/-internals/glimmer/lib/templates/input.hbs
This file contains 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 |
---|---|---|
@@ -1,7 +1,91 @@ | ||
{{~#let (component '-checkbox') (component '-text-field') as |Checkbox TextField|~}} | ||
{{~#if this.isCheckbox~}} | ||
<Checkbox @target={{this.caller}} @__ARGS__={{this.args}} ...attributes /> | ||
{{~else~}} | ||
<TextField @target={{this.caller}} @__ARGS__={{this.args}} ...attributes /> | ||
{{~/if~}} | ||
{{~/let~}} | ||
{{~#if this.modernized ~}} | ||
<input | ||
{{!-- for compatibility --}} | ||
id={{this.id}} | ||
class={{this.class}} | ||
|
||
{{!-- deprecated attribute bindings --}} | ||
autocapitalize={{this._autocapitalize}} | ||
autocorrect={{this._autocorrect}} | ||
autofocus={{this._autofocus}} | ||
disabled={{this._disabled}} | ||
form={{this._form}} | ||
maxlength={{this._maxlength}} | ||
minlength={{this._minlength}} | ||
placeholder={{this._placeholder}} | ||
readonly={{this._readonly}} | ||
required={{this._required}} | ||
selectionDirection={{this._selectionDirection}} | ||
spellcheck={{this._spellcheck}} | ||
tabindex={{this._tabindex}} | ||
title={{this._title}} | ||
accept={{this._accept}} | ||
autocomplete={{this._autocomplete}} | ||
autosave={{this._autosave}} | ||
dir={{this._dir}} | ||
formaction={{this._formaction}} | ||
formenctype={{this._formenctype}} | ||
formmethod={{this._formmethod}} | ||
formnovalidate={{this._formnovalidate}} | ||
formtarget={{this._formtarget}} | ||
height={{this._height}} | ||
inputmode={{this._inputmode}} | ||
lang={{this._lang}} | ||
list={{this._list}} | ||
max={{this._max}} | ||
min={{this._min}} | ||
multiple={{this._multiple}} | ||
name={{this._name}} | ||
pattern={{this._pattern}} | ||
size={{this._size}} | ||
step={{this._step}} | ||
width={{this._width}} | ||
indeterminate={{this._indeterminate}} | ||
|
||
...attributes | ||
|
||
type={{this.type}} | ||
checked={{this.checked}} | ||
value={{this.value}} | ||
|
||
{{on "change" this.change}} | ||
{{on "input" this.input}} | ||
{{on "keyup" this.keyUp}} | ||
{{on "paste" this.valueDidChange}} | ||
{{on "cut" this.valueDidChange}} | ||
|
||
{{!-- deprecated native event callbacks --}} | ||
{{on "touchstart" this._touchStart}} | ||
{{on "touchmove" this._touchMove}} | ||
{{on "touchend" this._touchEnd}} | ||
{{on "touchcancel" this._touchCancel}} | ||
{{on "keydown" this._keyDown}} | ||
{{on "keypress" this._keyPress}} | ||
{{on "mousedown" this._mouseDown}} | ||
{{on "mouseup" this._mouseUp}} | ||
{{on "contextmenu" this._contextMenu}} | ||
{{on "click" this._click}} | ||
{{on "dblclick" this._doubleClick}} | ||
{{on "focusin" this._focusIn}} | ||
{{on "focusout" this._focusOut}} | ||
{{on "submit" this._submit}} | ||
{{on "dragstart" this._dragStart}} | ||
{{on "drag" this._drag}} | ||
{{on "dragenter" this._dragEnter}} | ||
{{on "dragleave" this._dragLeave}} | ||
{{on "dragover" this._dragOver}} | ||
{{on "drop" this._drop}} | ||
{{on "dragend" this._dragEnd}} | ||
{{on "mouseenter" this._mouseEnter}} | ||
{{on "mouseleave" this._mouseLeave}} | ||
{{on "mousemove" this._mouseMove}} | ||
/> | ||
{{~else~}} | ||
{{~#let (component '-checkbox') (component '-text-field') as |Checkbox TextField|~}} | ||
{{~#if this.isCheckbox~}} | ||
<Checkbox @target={{this.caller}} @__ARGS__={{this.args}} ...attributes /> | ||
{{~else~}} | ||
<TextField @target={{this.caller}} @__ARGS__={{this.args}} ...attributes /> | ||
{{~/if~}} | ||
{{~/let~}} | ||
{{/if}} |
This file contains 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 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 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 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 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 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 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 @@ | ||
export let action: MethodDecorator; |
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.
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.
We should either read the event dispatcher for its values here, or just defer to it
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.
I actually wrote the code to address this and submitted #19269. However, as explained in that PR, I don't want to introduce a new global name for a one-off thing we are making here. Given that we expect the contextual modifier RFC to land pretty soon and this is still behind a flag, I would prefer to punt on addressing this for now.
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.
#19382