open-consul/ui/packages/consul-ui/app/components/text-input
John Cowen 3d1b859533
ui: Support for SSO with Admin Partitions (#11604)
* Upgrade AuthForm and document current state a little better
* Hoist SSO out of the AuthForm
* Bare minimum admin partitioned SSO

also:

ui: Tabbed Login with Token or SSO interface (#11619)

- I upgraded our super old, almost the first ember component I wrote, to use glimmer/almost template only. This should use slots/contextual components somehow, but thats a bigger upgrade so I didn't go that far.
- I've been wanting to upgrade the shape of our StateChart component for a very long while now, here its very apparent that it would be much better to do this sooner rather than later. I left it as is for now, but there will be a PR coming soon with a slight reshaping of this component.
- Added a did-upsert modifier which is a mix of did-insert/did-update
- Documentation added/amended for all the new things.
2021-11-24 14:53:12 +00:00
..
index.hbs ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
README.mdx ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00

# TextInput

Form component to be used for entering text values, both short form and long
form. Currently an inline component but as and when we get chance this will be
changed to also accept slots for specifying specific parts of the component.

```hbs preview-template
  <TextInput
    @name="single"
    @label="Single Line Text Input"
    @item={{hash
      single=""
    }}
    @placeholder="Placeholder: Enter some single line text here"
    @help="Help me if you can, I'm feeling down"
  />
  <hr />
  <TextInput
    @expanded={{true}}
    @name="Description"
    @label="Multiline Input"
    @item={{hash
      Description="Long form text"
    }}
  />
```

## Arguments

| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `item` | `Object` |  | An object whose properties are to be edited |
| `name` | `String` | '' | An identifier for the property to be edited on the `item` |
| `label` | `String` | `@name` | A label to use to label the text input element |
| `placeholder` | `String` | | Equivalent to the HTML `placeholder=""` attribute |
| `help` | `String` | | Provide some help text for the input (consider using `@validations` instead) |
| `expanded` | `Boolean` | `false` | Whether to use an expanded textarea or just a normal single line input |
| `validations` | `Object` |  | A `validations` object to be passed to the underlying `validate` modifier |
| `chart` | `Object` | | A StateChart object (implementing `state` and `dispatch` to be passed to the underlying `validate` modifier  |
| `oninput` | `Function` | | An event listener fired oninput to the text input |

## See

- [Validate Modifier](../modifiers/validate.mdx)
- [Template Source Code](./index.hbs)

---