El Ignite UI for Web Components Accordion es un componente de GUI para construir paneles verticales expandibles con encabezados en los que se puede hacer clic y secciones de contenido asociadas, que se muestran en un solo contenedor. El acordeón se usa comúnmente para reducir la necesidad de desplazarse por varias secciones de contenido en una sola página. Ofrece navegación por teclado y API para controlar el estado de expansión de los paneles subyacentes.
Los usuarios pueden interactuar y navegar entre una lista de elementos, como miniaturas o etiquetas. Cada uno de esos elementos se puede alternar (expandir o contraer) para revelar la información que contiene. Dependiendo de la configuración, puede haber uno o varios elementos expandidos a la vez.
Web Components Accordion Example
El siguiente es un ejemplo básico de Ignite UI for Web Components Acordeón de una sección de preguntas frecuentes. Funciona como un acordeón, con secciones que funcionan individualmente. Puede alternar cada bloque de texto con un solo clic, mientras expande varios paneles al mismo tiempo. De este modo, se puede leer la información más fácilmente, sin tener que ir y venir entre un panel que se expande y se contrae automáticamente, lo que oculta la sección previamente abierta cada vez.
En él podrás ver cómo definir un acordeón y sus paneles de expansión. El ejemplo también demuestra los dos tipos de comportamiento de expansión. El botón de cambio establece la propiedad singleExpand para alternar entre una y varias ramas que se expandirán a la vez.
<!DOCTYPE html><html><head><title>Accordion Overview</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v6.css"type="text/css" /></head><body><divid="root"><igc-switchid="switch">Single Expand</igc-switch><divclass="sample-wrapper"><igc-accordionid="accordion"><igc-expansion-panel><h1slot="title">What has changed about subscription and pricing model?</h1><span>We have moved to a subscription-based pricing model for all our developer tools. This makes it easier
for you to manage your license subscriptions and allows us to provide a better level of service for you. We
updated our pricing and packages to provide you with flexible options and the best value. This includes Ignite UI
(formerly Ignite UI for JavaScript) which includes all of our JavaScript framework components for web development,
including: Angular, ASP.NET (Core and MVC), Blazor, JQuery, React and Web Components), as well as Infragistics Professional,
Infragistics Ultimate, our Ultimate UI products. We also offer multi-year subscriptions options with a built-in discount,
so you can see the value up front. With these updates we are confident that we are providing the best platforms and the best
price.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">Who will the updated changes impact?</h1><span>The license updates will impact all new and current customers using Ignite UI, Infragistics Professional and
Infragistics Ultimate. Specifically, we have also made updates to our product and packaging for Ignite UI for JavaScript,
Ignite UI for Angular, Ignite UI for React and Ignite UI for Web components. For more information, please refer to this
blog: Announcement: Changes to Ignite UI Product & Packaging The pricing has been updated for all products and packages.
So, all new or additional licenses will be sold based on our new pricing and packages. All existing license agreements will
be honored and renewed based upon the current agreement.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">What is the difference between your old model and your current subscription model for Ignite UI?</h1><span>For Ignite UI customers, we are moving away from NPM for licensed packages. The current NPM packages will be replaced with
packages that include a “Trial Version” watermark. Licensed packages for Ignite UI will be available from our cloud hosted ProGet
server. For more information, please refer to this article: Moving from Trial to Licensed Ignite UI NPM Packages</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">What happens if I don't renew my subscription?</h1><span>Any unlicensed or trial versions of Ignite UI for Angular, React and Web Components will now include this watermark.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">If I don't renew my subscription will I still have access to previous versions of Infragistics products?</h1><span>Any version of Infragistics software which you have downloaded can continue to be used perpetually. Access to download any new or
previous versions through our customer portal and package feeds will require maintaining an active subscription by continuing
to renew it.</span></igc-expansion-panel></igc-accordion></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
Para obtener una introducción completa a Ignite UI for Web Components, lea el tema Primeros pasos.
Ahora puede comenzar con una configuración básica del IgcAccordionComponent y sus paneles.
Usage
Cada sección del componente de acordeón Web Components se define mediante un Web Components Panel de expansión. Los paneles proporcionan Disabled y Open propiedades, que le brindan la capacidad de configurar los estados del panel según sus requisitos.
Declaring an Accordion
El acordeón envuelve todos los paneles de expansión declarados en su interior.
Usando el descriptor de acceso Panels puede obtener una referencia a la colección que contiene todos los paneles de expansión secundarios de IgcAccordionComponent.
If singleExpand property is set to true calling showAll method would expand only the focused panel.
Web Components Accordion Customization Example
Con el Web Components Accordion, puede personalizar la apariencia del encabezado y el panel de contenido.
El siguiente ejemplo demuestra cómo se pueden implementar opciones de filtrado elaboradas utilizando las ranuras integradas de IgcExpansionPanelComponent.
<!DOCTYPE html><html><head><title>Accordion Customization</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v6.css"type="text/css" /></head><body><divid="root"><divclass="sample-wrapper"><igc-accordionid="accordion"><igc-expansion-panel><h1slot="title"id="categories">Categories</h1><divclass="categories-container"><igc-checkbox>Bike</igc-checkbox><igc-checkbox>Motorcycle</igc-checkbox><igc-checkbox>Car</igc-checkbox><igc-checkbox>Taxi</igc-checkbox><igc-checkbox>Public Transport</igc-checkbox></div></igc-expansion-panel><igc-expansion-panel><h1slot="title">Cost: $<spanid="lowerCost">200</span> to $<spanid="upperCost">800</span></h1><igc-range-slidermin="0"max="1000"lower="200"upper="800"></igc-range-slider></igc-expansion-panel><igc-expansion-panel><h1slot="title"id="rating">Rating</h1><igc-radio-group><igc-radioname="rating"><igc-ratingclass="size-small"label="1 star or more"max="5"value="1.5"readonly></igc-rating></igc-radio><igc-radioname="rating"><igc-ratingclass="size-small"label="2 stars or more"max="5"value="2.5"readonly></igc-rating></igc-radio><igc-radioname="rating"><igc-ratingclass="size-small"label="3 stars or more"max="5"value="3.5"readonly></igc-rating></igc-radio><igc-radioname="rating"><igc-ratingclass="size-small"label="4 stars or more"max="5"value="4.5"readonly></igc-rating></igc-radio></igc-radio-group></igc-expansion-panel><igc-expansion-panel><h1slot="title"id="timeTitle">Time</h1><igc-date-time-inputclass="size-small"input-format="hh:mm tt"label="Arrive before"><igc-iconname="clock"collection="material"slot="prefix"></igc-icon><igc-iconname="clear"collection="material"slot="suffix"></igc-icon></igc-date-time-input></igc-expansion-panel></igc-accordion></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Nested Web Components Accordions Scenario
En el siguiente ejemplo de Web Components acordeón se crea una compleja sección de preguntas frecuentes para ilustrar cómo se puede llevar a cabo este escenario de aplicación común. En la muestra anidado IgcAccordionComponent se consigue añadiendo un acordeón dentro de un panel de expansión.
<!DOCTYPE html><html><head><title>Accordion Nested Scenario</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v6.css"type="text/css" /></head><body><divid="root"><igc-switchid="switch">Single Expand</igc-switch><divclass="sample-wrapper"><igc-accordionid="accordion"><igc-expansion-panel><h1slot="title">What has changed about subscription and pricing model?</h1><span>We have moved to a subscription-based pricing model for all our developer tools. This makes it easier
for you to manage your license subscriptions and allows us to provide a better level of service for you. We
updated our pricing and packages to provide you with flexible options and the best value. This includes Ignite UI
(formerly Ignite UI for JavaScript) which includes all of our JavaScript framework components for web development,
including: Angular, ASP.NET (Core and MVC), Blazor, JQuery, React and Web Components), as well as Infragistics Professional,
Infragistics Ultimate, our Ultimate UI products. We also offer multi-year subscriptions options with a built-in discount,
so you can see the value up front. With these updates we are confident that we are providing the best platforms and the best
price.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">Who will the updated changes impact?</h1><span>The license updates will impact all new and current customers using Ignite UI, Infragistics Professional and
Infragistics Ultimate. Specifically, we have also made updates to our product and packaging for Ignite UI for JavaScript,
Ignite UI for Angular, Ignite UI for React and Ignite UI for Web components. For more information, please refer to this
blog: Announcement: Changes to Ignite UI Product & Packaging The pricing has been updated for all products and packages.
So, all new or additional licenses will be sold based on our new pricing and packages. All existing license agreements will
be honored and renewed based upon the current agreement.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">What is the difference between your old model and your current subscription model for Ignite UI?</h1><span>For Ignite UI customers, we are moving away from NPM for licensed packages. The current NPM packages will be replaced with
packages that include a “Trial Version” watermark. Licensed packages for Ignite UI will be available from our cloud hosted ProGet
server. For more information, please refer to this article: Moving from Trial to Licensed Ignite UI NPM Packages</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">Common questions about renewal.</h1><igc-accordion><igc-expansion-panel><h1slot="title">What happens if I don't renew my subscription?</h1><span>Any unlicensed or trial versions of Ignite UI for Angular, React and Web Components will now include this watermark.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">If I don't renew my subscription will I still have access to previous versions of Infragistics products?</h1><span>Any version of Infragistics software which you have downloaded can continue to be used perpetually. Access to download any new or
previous versions through our customer portal and package feeds will require maintaining an active subscription by continuing
to renew it.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">Will I be automatically charged for my renewal/ Can I be automatically charged for renewal?</h1><span>Any new subscriptions purchased online, via our eCommerce system, will renew automatically. Subscription renewal can be canceled,
at any time, before the next automatic renewal date. Subscriptions purchased directly from Infragistics or Infragistics' partners are
subject to the renewal terms that were agreed upon as part of that purchase.</span></igc-expansion-panel></igc-accordion></igc-expansion-panel><igc-expansion-panel><h1slot="title">I split my work across two computers. Can I install on both using my single-user license?</h1><span>The Infragistics Ultimate license is tied to the user, and not the computer. That means you're welcome to install and use Ignite UI,
Infragistics Professional, and Infragistics Ultimate on any computer you use. However, if we notice a large number of activations using the
same license, we may contact you to verify this behavior.</span></igc-expansion-panel><igc-expansion-panel><h1slot="title">I used up my trial for an earlier version of Infragistics Ultimate. Can I start a new trial when a major version is released?</h1><span>Yes! If you have tried a previous version in the past, and used up your 30-day trial, you can try the next major version for another 30 days!
You can do this in the following two ways:
<ul><li>If you have days remaining in your 30-day trial period for the current version (e.g., the
Version 15.1 Volume Release), use the Check for Update option inside the Platform Installer or
your account. You will be able to start a fresh trial for the next major version (e.g., 20.1
Volume Release)</li><li>If you have used up the 30-day trial for the previous major version (e.g., the 19.2 Volume
Release), simply download and install Infragistics Ultimate from our <ahref="https://www.infragistics.com/products/ultimate">website</a> (This will also allow you
to start a new trial.)</li></ul></span></igc-expansion-panel></igc-accordion></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Keyboard Navigation
La navegación por teclado en el acordeón Web Components proporciona una amplia variedad de interacciones de teclado para el usuario final. Esta funcionalidad está habilitada de forma predeterminada y permite a los usuarios finales navegar fácilmente por los paneles.
La navegación en acordeón cumple con los estándares de accesibilidad W3C y es fácil de usar.
Combinaciones de teclas
↓: mueve el foco al panel de abajo
↑- mueve el foco al panel de arriba
Alt + ↓: abre el panel enfocado en el acordeón
Alt + ↑: cierra el panel enfocado en el acordeón
Shift + Alt + ↓: abre todos los paneles habilitados (si singleExpand está configurado en verdadero, abre el panel enfocado)
Shift + Alt + ↑- cierra todos los paneles habilitados
Inicio: navega al PRIMER panel habilitado en el acordeón
Fin: navega al ÚLTIMO panel habilitado en el acordeón