import { ElementRef, QueryList, Renderer } from '@angular/core'; import { Button } from '../button/button'; import { Config } from '../../config/config'; import { Form } from '../../util/form'; import { Icon } from '../icon/icon'; import { Ion } from '../ion'; import { Label } from '../label/label'; import { ItemReorder } from './item-reorder'; /** * @name Item * @description * An item can contain text, images, and anything else. Generally it is placed in a list with other * items. It can easily be swiped, deleted, reordered, edited, and more. An item is only required to * be in a [List](../../list/List) if manipulating the item via gestures is required. It requires an * [ItemSliding](../ItemSliding) wrapper element in order to be swiped. * * * ## Common Usage * There are a few elements that are considered items, but not all of them are styled to look the same. * The basic item can be written as an `` element or it can be added to any element by adding * `ion-item` as an attribute. List headers and item dividers, although styled differently, are also items * and can be written as `` and ``, respectively. * * ### As an Element * A basic item should be written as a `` element when it is not clickable. * * ```html * * Item * * ``` * * A list header should be written as ``. * * ```html * * List Header * * ``` * * An item divider should be written as ``. * * ```html * * Item Divider * * ``` * * ### As an Attribute * The attribute `ion-item` should be added to a ` * * * Anchor Item * * ``` * * Note: do not add `ion-item` as an attribute to an `` or `` element * as they are already items and their styling will be changed to look like a basic item. * * ## Detail Arrows * By default, ` * * * Anchor Item with no Detail Arrow * * ``` * * This feature is not enabled by default for `md` and `wp` modes, but it can be enabled by setting the * Sass variables `$item-md-detail-push-show` and `$item-wp-detail-push-show`, respectively, to `true`. * It can also be disabled for ios by setting `$item-ios-detail-push-show` to `false`. See the * [theming documentation](http://ionicframework.com/docs/theming/overriding-ionic-variables/) for * more information on overriding Sass variables. * * * ## Item Placement * Items rely heavily on content projection to position content. The item grabs content based on the * element or attribute and positions it that way. This logic makes it possible to write a complex * item with simple, understandable markup without having to worry about styling and positioning * the elements. * * The below chart details the attributes item looks for and where it will place the element with * that attribute inside of the item: * * | Attribute | Description | * |----------------|----------------------------------------------------------------------------------------------------- | * | `item-start` | Placed to the left of all other elements, outside of the inner item. | * | `item-end` | Placed to the right of all other elements, inside of the inner item, outside of the input wrapper. | * | `item-content` | Placed to the right of any `ion-label`, inside of the input wrapper. | * * ### Checkboxes, Radios and Toggles * [Checkboxes](../../checkbox/Checkbox) are positioned in the same place as the `item-start` attribute. * [Radios](../../radio/RadioButton) and [Toggles](../../toggle/Toggle) are positioned in the same place * as the `item-end` attribute. All of these components can be positioned differently by adding the * `item-start` or `item-end` attribute. * * ### Content and Inputs * A [Label](../../label/Label) is placed inside of the item to the left of all content and inputs. The * following components are all placed in the same position as the `item-content` attribute: [Select](../../select/Select), * [Input](../../input/Input), [TextArea](../../input/TextArea), [DateTime](../../datetime/DateTime), and * [Range](../../range/Range). * * Any element directly placed inside of an `` that does not have one of the previously mentioned * attributes and isn't one of the above elements will be placed inside of a [Label](../../label/Label). * * ### Text Alignment * By default, Items will align text to the left and add an ellipsis when the text is wider than the item. * See the [Utility Attributes Documentation](../../../../theming/css-utilities/) for attributes that can * be added to `ion-item` to transform the text. * * @usage * * ```html * * * * Header * * * * Item * * * * Item with Detail Arrow * * * * * * Item Divider * * * * * * Anchor Item * * * * Item with no border * * * * Multiline text that should wrap when it is too long * to fit on one line in the item. * * * * ``` * * * @advanced * * ```html * * * * * * List Header * * * * * * Item {% raw %}{{item}}{% endraw %} * * * * * * * * * Item Label * *
* Item Content next to the label *
*
* * * * * Item * * * * * * Item Divider * * * * * * Disabled Button Item * * * * * * * * * Avatar Item * * * * * *

Item

*

Item Paragraph

* * * *
* * * * * Item * * * * * * *
* ``` * * * @demo /docs/demos/src/item/ * @see {@link /docs/components#lists List Component Docs} * @see {@link ../../list/List List API Docs} * @see {@link ../ItemSliding ItemSliding API Docs} */ export declare class Item extends Ion { _ids: number; _inputs: Array; _label: Label; _viewLabel: boolean; _name: string; _hasReorder: boolean; /** * @hidden */ id: string; /** * @hidden */ labelId: string; constructor(form: Form, config: Config, elementRef: ElementRef, renderer: Renderer, reorder: ItemReorder); /** * @hidden */ registerInput(type: string): string; /** * @hidden */ ngAfterContentInit(): void; /** * @hidden */ _updateColor(newColor: string, componentName?: string): void; /** * @hidden */ _setName(elementRef: ElementRef): void; /** * @hidden */ getLabelText(): string; /** * @hidden */ contentLabel: Label; /** * @hidden */ viewLabel: Label; /** * @hidden */ _buttons: QueryList