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

96 lines (95 loc) 4.56 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 }); exports.CardWrapper = exports.CardSectionWrapper = void 0; var dom_1 = require("@awsui/test-utils-core/dom"); var styles_selectors_js_1 = require("../../../cards/styles.selectors.js"); var styles_selectors_js_2 = require("../../../table/styles.selectors.js"); var collection_preferences_1 = require("../collection-preferences"); var container_1 = require("../container"); var pagination_1 = require("../pagination"); var text_filter_1 = require("../text-filter"); var CardSectionWrapper = (function (_super) { __extends(CardSectionWrapper, _super); function CardSectionWrapper() { return _super !== null && _super.apply(this, arguments) || this; } CardSectionWrapper.prototype.findSectionHeader = function () { return this.findByClassName(styles_selectors_js_1.default['section-header']); }; CardSectionWrapper.prototype.findContent = function () { return this.findByClassName(styles_selectors_js_1.default['section-content']); }; return CardSectionWrapper; }(dom_1.ComponentWrapper)); exports.CardSectionWrapper = CardSectionWrapper; var CardWrapper = (function (_super) { __extends(CardWrapper, _super); function CardWrapper() { return _super !== null && _super.apply(this, arguments) || this; } CardWrapper.prototype.findSections = function () { return this.findAllByClassName(styles_selectors_js_1.default.section).map(function (c) { return new CardSectionWrapper(c.getElement()); }); }; CardWrapper.prototype.findCardHeader = function () { return this.findByClassName(styles_selectors_js_1.default['card-header-inner']); }; CardWrapper.prototype.findSelectionArea = function () { return this.findByClassName(styles_selectors_js_1.default['selection-control']); }; return CardWrapper; }(dom_1.ComponentWrapper)); exports.CardWrapper = CardWrapper; var CardsWrapper = (function (_super) { __extends(CardsWrapper, _super); function CardsWrapper() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.containerWrapper = new container_1.default(_this.getElement()); return _this; } CardsWrapper.prototype.findItems = function () { return this.findAllByClassName(styles_selectors_js_1.default.card).map(function (c) { return new CardWrapper(c.getElement()); }); }; CardsWrapper.prototype.findSelectedItems = function () { return this.findAllByClassName(styles_selectors_js_1.default['card-selected']).map(function (c) { return new CardWrapper(c.getElement()); }); }; CardsWrapper.prototype.findHeader = function () { return this.containerWrapper.findHeader(); }; CardsWrapper.prototype.findHeaderRegion = function () { return this.findHeader(); }; CardsWrapper.prototype.findEmptyRegion = function () { return this.findEmptySlot(); }; CardsWrapper.prototype.findEmptySlot = function () { return this.findByClassName(styles_selectors_js_1.default.empty); }; CardsWrapper.prototype.findLoadingText = function () { return this.findByClassName(styles_selectors_js_1.default.loading); }; CardsWrapper.prototype.findTextFilter = function () { return this.findComponent("." + styles_selectors_js_2.default['tools-filtering'], text_filter_1.default); }; CardsWrapper.prototype.findPagination = function () { return this.findComponent("." + styles_selectors_js_2.default['tools-pagination'], pagination_1.default); }; CardsWrapper.prototype.findCollectionPreferences = function () { return this.findComponent("." + styles_selectors_js_2.default['tools-preferences'], collection_preferences_1.default); }; CardsWrapper.rootSelector = styles_selectors_js_1.default.root; return CardsWrapper; }(dom_1.ComponentWrapper)); exports.default = CardsWrapper;