UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

35 lines (34 loc) 1.75 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var dom_1 = require("@awsui/test-utils-core/dom"); var styles_selectors_js_1 = require("../../../token-group/styles.selectors.js"); var styles_selectors_js_2 = require("../../../space-between/styles.selectors.js"); var token_1 = require("./token"); var TokenGroupWrapper = (function (_super) { __extends(TokenGroupWrapper, _super); function TokenGroupWrapper() { return _super !== null && _super.apply(this, arguments) || this; } TokenGroupWrapper.prototype.findTokens = function () { return this.findAllByClassName(token_1.default.rootSelector).map(function (tokenElement) { return new token_1.default(tokenElement.getElement()); }); }; TokenGroupWrapper.prototype.findToken = function (tokenIndex) { return this.findComponent("." + styles_selectors_js_2.default.child + ":nth-child(" + tokenIndex + ") > ." + token_1.default.rootSelector, token_1.default); }; TokenGroupWrapper.rootSelector = styles_selectors_js_1.default.root; return TokenGroupWrapper; }(dom_1.ComponentWrapper)); exports.default = TokenGroupWrapper;