@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
40 lines (39 loc) • 1.89 kB
JavaScript
;
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 selectors_1 = require("@awsui/test-utils-core/selectors");
var utils_1 = require("@awsui/test-utils-core/utils");
var tile_1 = require("./tile");
var styles_selectors_js_1 = require("../../../tiles/styles.selectors.js");
var TilesWrapper = (function (_super) {
__extends(TilesWrapper, _super);
function TilesWrapper() {
return _super !== null && _super.apply(this, arguments) || this;
}
TilesWrapper.prototype.findItems = function () {
return this.findAllByClassName(styles_selectors_js_1.default['tile-container']).map(function (r) { return new tile_1.default(r.getElement()); });
};
TilesWrapper.prototype.findInputByValue = function (value) {
var safeValue = utils_1.escapeSelector(value);
return this.find("input[value=\"" + safeValue + "\"]");
};
TilesWrapper.prototype.findItemByValue = function (value) {
var toReplace = utils_1.escapeSelector(value);
return this.findComponent("." + tile_1.default.rootSelector + "[data-value=\"" + toReplace + "\"", tile_1.default);
};
TilesWrapper.rootSelector = styles_selectors_js_1.default.root;
return TilesWrapper;
}(selectors_1.ComponentWrapper));
exports.default = TilesWrapper;