wix-style-react
Version:
40 lines (35 loc) • 1.28 kB
JavaScript
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import { dataHooks } from './constants';
export var floatingHelperContentDriverFactory = function floatingHelperContentDriverFactory(_element) {
var getElementByDataHook = function getElementByDataHook(dataHook) {
return _element.$("[data-hook='".concat(dataHook, "']"));
};
var actionButton = function actionButton() {
return getElementByDataHook(dataHooks.actionButton);
};
return {
element: function element() {
return _element;
},
hasActionButton: function () {
var _hasActionButton = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", actionButton().isPresent());
case 1:
case "end":
return _context.stop();
}
}
}, _callee);
}));
function hasActionButton() {
return _hasActionButton.apply(this, arguments);
}
return hasActionButton;
}()
};
};