UNPKG

wix-style-react

Version:
125 lines (106 loc) 4.93 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } import _regeneratorRuntime from "@babel/runtime/regenerator"; import { inputWithOptionsUniDriverFactory } from '../InputWithOptions/InputWithOptions.uni.driver'; export var multiSelectCheckboxUniDriverFactory = function multiSelectCheckboxUniDriverFactory(base, body) { var _inputWithOptionsUniD = inputWithOptionsUniDriverFactory(base, body), driver = _inputWithOptionsUniD.driver, inputDriver = _inputWithOptionsUniD.inputDriver, dropdownLayoutDriver = _inputWithOptionsUniD.dropdownLayoutDriver; var _getLabels = /*#__PURE__*/function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { var delimiter, _args = arguments; return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: delimiter = _args.length > 0 && _args[0] !== undefined ? _args[0] : ", "; _context.next = 3; return inputDriver.getValue(); case 3: return _context.abrupt("return", _context.sent.split(delimiter)); case 4: case "end": return _context.stop(); } } }, _callee); })); return function getLabels() { return _ref.apply(this, arguments); }; }(); return { driver: _objectSpread(_objectSpread({}, driver), {}, { getNumOfLabels: function () { var _getNumOfLabels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { return _regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return _getLabels(); case 2: return _context2.abrupt("return", _context2.sent.length); case 3: case "end": return _context2.stop(); } } }, _callee2); })); function getNumOfLabels() { return _getNumOfLabels.apply(this, arguments); } return getNumOfLabels; }(), getLabels: function () { var _getLabels2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(delimiter) { return _regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: return _context3.abrupt("return", _getLabels(delimiter)); case 1: case "end": return _context3.stop(); } } }, _callee3); })); function getLabels(_x) { return _getLabels2.apply(this, arguments); } return getLabels; }(), getLabelAt: function () { var _getLabelAt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(index, delimiter) { return _regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.next = 2; return _getLabels(delimiter); case 2: _context4.t0 = index; return _context4.abrupt("return", _context4.sent[_context4.t0]); case 4: case "end": return _context4.stop(); } } }, _callee4); })); function getLabelAt(_x2, _x3) { return _getLabelAt.apply(this, arguments); } return getLabelAt; }() }), inputDriver: inputDriver, dropdownLayoutDriver: dropdownLayoutDriver }; };