-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(text-area): add calcite-text-area component #5644
feat(text-area): add calcite-text-area component #5644
Conversation
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.
Awesome work, @anveshmekala!
One the last comments are addressed, this is good to merge! 🎉
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.
A few editorial comments below.
…nts (#6634) **Related Issue:** n/a ## Summary Document API consistency across components, in particular while working through the new component, `textarea`. cc: #5644 Update includes consistency with `input`, `input-number`, and `input-text` (in alignment with `textarea`) for the following: 1. `autofocus` prop: > When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus. 2. `selectText()` method: > Selects the text of the component's `value`.
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.
A couple comments but LGTM!
/** Selects the text of the component's `value`. */ | ||
@Method() | ||
async selectText(): Promise<void> { | ||
this.textAreaEl.select(); |
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.
Should selectText
await componentLoaded(this)
like setFocus
does?
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 think its better to add it .
…ocus-revert * origin/master: (30 commits) fix(modal): prevent error when calling setFocus on a recently rendered and opened modal (`dist-custom-elements`) (#6666) fix(tile-select): fix click not firing in custom-elements build (#6665) fix(card): provide more meaningful screen reader label for selectable cards (deprecates `deselect` message override) (#6657) fix(pagination): add current page information for screen readers (#6637) chore: update jsbin sample to CC 1.0 breaking changes and latest jsapi version (#6651) feat(text-area): add calcite-text-area component (#5644) chore(release): 1.1.1-next.2 fix(tile): adds styling to `tile` where `link` is present for additional distinction (#6628) docs(input, input-number, input-text): api consistency across components (#6634) docs(accordion-item): add actions-start and actions-end slots (#6631) docs(modal): kebab-case slot names and sticky context (#6625) chore(release): 1.1.1-next.1 fix: restore form control validation in Safari (#6623) chore(linting): fix linting errors (#6613) build(deps): Bump eslint-plugin-react from 7.31.11 to 7.32.2 (#6619) build(deps): Bump eslint from 8.35.0 to 8.36.0 (#6620) build(deps): Bump @types/lodash-es from 4.17.6 to 4.17.7 (#6621) build: fix peer dependency resolution error (#6611) ci: update user-defined priority (#6609) build: update browserslist db (#6527) ...
**Related Issue:** #5644 ## Summary Component methods need to be private if they are using a 3rd party package like lodash. Otherwise the package's types are included in dist and we would need to move the package's types from devDeps to deps.
Related Issue: #863
Summary
This PR will add new component
calcite-text-area
which will replace<calcite-input type="textarea" />
calcite-text-area
Usage
Basic
Properties
autofocus
autofocus
true
, the component is focused on page load.boolean
false
columns
columns
number
undefined
disabled
disabled
true
, interaction is prevented and the component is displayed with lower opacity.boolean
false
groupSeparator
group-separator
true
, number values are displayed with a group separator corresponding to the language and country format.boolean
false
label
label
string
undefined
maxLength
max-length
number
undefined
messageOverrides
{ invalid?: string; overLimit?: string; }
undefined
name
name
string
undefined
numberingSystem
numbering-system
"arab" | "arabext" | "bali" | "beng" | "deva" | "fullwide" | "gujr" | "guru" | "hanidec" | "khmr" | "knda" | "laoo" | "latn" | "limb" | "mlym" | "mong" | "mymr" | "orya" | "tamldec" | "telu" | "thai" | "tibt"
undefined
placeholder
placeholder
string
undefined
readonly
readonly
true
, the component's value can be read, but cannot be modified.boolean
false
required
required
true
, the component must have a value in order for the form to submit.boolean
false
resize
resize
true
, disables horizontally and vertically resizing the component."both" | "horizontal" | "none" | "vertical"
"both"
rows
rows
number
undefined
scale
scale
"l" | "m" | "s"
"m"
value
value
string
undefined
wrap
wrap
"hard" | "soft"
"soft"
Events
calciteTextAreaChange
value
is typed and committed.CustomEvent<void>
calciteTextAreaInput
value
is typed.CustomEvent<void>
Methods
selectText() => Promise<void>
Selects all text of the component's
value
.Returns
Type:
Promise<void>
setFocus() => Promise<void>
Sets focus on the component.
Returns
Type:
Promise<void>
Slots
"footer-end"
"footer-start"
Known limitations:
when the
calcite-text-area
with fixed height and width is wrapped inside a flex container with height and width, resizing behavior doesn't restrict the component from increasing both height and width.