"use strict";

exports.__esModule = true;
exports.MultiBulkActionToolbarUniDriver = MultiBulkActionToolbarUniDriver;
var _unidriver = require("@wix/design-system/dist/testkit/unidriver");
var _unidriver2 = require("../../unidriver");
function MultiBulkActionToolbarUniDriver(base, body) {
  const button = (dataHook = 'bulk-action-button') => (0, _unidriver.ButtonUniDriver)(base.$(`[data-hook="${dataHook}"]`), body);
  const popover = dataHook => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="${dataHook}"]`), body);
  const tooltip = (dataHook = 'bulk-action-button') => (0, _unidriver.TooltipUniDriver)(base.$(`[data-hook="${dataHook}-tooltip"]`), body);
  const selectAll = () => (0, _unidriver.TextButtonUniDriver)(base.$(`[data-hook="select-all"]`), body);
  return {
    ...(0, _unidriver2.baseUniDriverFactory)(base),
    getButton: dataHook => button(dataHook),
    clickButton: dataHook => button(dataHook).click(),
    isButtonExists: dataHook => button(dataHook).exists(),
    isButtonDisabled: dataHook => button(dataHook).isButtonDisabled(),
    getButtonTextContent: dataHook => button(dataHook).getButtonTextContent(),
    getPopover: dataHook => popover(dataHook),
    isPopoverExists: dataHook => popover(dataHook).exists(),
    openMoreActionPopover: () => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="more-actions-popover"]`), body).getTriggerElement('more-actions').click(),
    getMoreActionsPopoverItemAt: index => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="more-actions-popover"]`), body).itemContentAt(index),
    clickMoreActionsPopoverItemAt: index => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="more-actions-popover"]`), body).clickAtChild(index),
    clickMoreActionsPopoverItem: dataHook => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="more-actions-popover"]`), body).clickAtChildByDataHook(dataHook),
    getMoreActionsItemsCount: () => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="more-actions-popover"]`), body).childrenCount(),
    isMoreActionsOpen: () => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="more-actions-popover"]`), body).isMenuOpen(),
    selectAll: () => selectAll().click(),
    selectAllText: () => selectAll().getButtonTextContent(),
    isTooltipExist: dataHook => tooltip(dataHook).exists(),
    isTooltipVisible: dataHook => tooltip(dataHook).tooltipExists(),
    getTooltipText: dataHook => tooltip(dataHook).getTooltipText(),
    clickOutsideTooltip: dataHook => tooltip(dataHook).clickOutside(),
    mouseEnterTooltip: dataHook => tooltip(dataHook).mouseEnter(),
    mouseLeaveTooltip: dataHook => tooltip(dataHook).mouseLeave(),
    getSelectedCountText: () => base.$('[data-hook="selected-count"]').text()
  };
}
//# sourceMappingURL=MultiBulkActionToolbar.uni.driver.js.map