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

61 lines (60 loc) 2.96 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.CalendarWrapper = void 0; var selectors_1 = require("@awsui/test-utils-core/selectors"); var styles_selectors_js_1 = require("../../../date-picker/styles.selectors.js"); var button_1 = require("../button"); var base_input_1 = require("../input/base-input"); var dropdown_1 = require("../internal/dropdown"); var DatePickerWrapper = (function (_super) { __extends(DatePickerWrapper, _super); function DatePickerWrapper() { return _super !== null && _super.apply(this, arguments) || this; } DatePickerWrapper.prototype.findCalendar = function () { return this.findComponent("." + styles_selectors_js_1.default.calendar, CalendarWrapper); }; DatePickerWrapper.prototype.findCalendarDropdown = function () { var dropdown = new dropdown_1.default(this.getElement()); return dropdown.findOpenDropdown(); }; DatePickerWrapper.rootSelector = styles_selectors_js_1.default.root; return DatePickerWrapper; }(base_input_1.default)); exports.default = DatePickerWrapper; var CalendarWrapper = (function (_super) { __extends(CalendarWrapper, _super); function CalendarWrapper() { return _super !== null && _super.apply(this, arguments) || this; } CalendarWrapper.prototype.findDateAt = function (row, column) { return this.find("." + styles_selectors_js_1.default['calendar-week'] + ":nth-child(" + row + ") ." + styles_selectors_js_1.default['calendar-day'] + ":nth-child(" + column + ")"); }; CalendarWrapper.prototype.findHeader = function () { return this.findByClassName(styles_selectors_js_1.default['calendar-header']); }; CalendarWrapper.prototype.findPreviousMonthButton = function () { return this.findComponent("." + styles_selectors_js_1.default['calendar-prev-month-btn'], button_1.default); }; CalendarWrapper.prototype.findNextMonthButton = function () { return this.findComponent("." + styles_selectors_js_1.default['calendar-next-month-btn'], button_1.default); }; CalendarWrapper.prototype.findSelectedDate = function () { return this.find("." + styles_selectors_js_1.default['calendar-day-selected']); }; return CalendarWrapper; }(selectors_1.ComponentWrapper)); exports.CalendarWrapper = CalendarWrapper;