CoolFace
Apppublic

Umama-at-Bluchip/Quick-UI

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
ariaPropsMap.js178 linesDownload Raw Back to lib
1"use strict";2 3Object.defineProperty(exports, "__esModule", {4  value: true5});6exports.default = void 0;7var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator"));8function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }9function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }10function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }11function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }12function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }13function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }14function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }15function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }16var properties = [['aria-activedescendant', {17  'type': 'id'18}], ['aria-atomic', {19  'type': 'boolean'20}], ['aria-autocomplete', {21  'type': 'token',22  'values': ['inline', 'list', 'both', 'none']23}], ['aria-braillelabel', {24  'type': 'string'25}], ['aria-brailleroledescription', {26  'type': 'string'27}], ['aria-busy', {28  'type': 'boolean'29}], ['aria-checked', {30  'type': 'tristate'31}], ['aria-colcount', {32  type: 'integer'33}], ['aria-colindex', {34  type: 'integer'35}], ['aria-colspan', {36  type: 'integer'37}], ['aria-controls', {38  'type': 'idlist'39}], ['aria-current', {40  type: 'token',41  values: ['page', 'step', 'location', 'date', 'time', true, false]42}], ['aria-describedby', {43  'type': 'idlist'44}], ['aria-description', {45  'type': 'string'46}], ['aria-details', {47  'type': 'id'48}], ['aria-disabled', {49  'type': 'boolean'50}], ['aria-dropeffect', {51  'type': 'tokenlist',52  'values': ['copy', 'execute', 'link', 'move', 'none', 'popup']53}], ['aria-errormessage', {54  'type': 'id'55}], ['aria-expanded', {56  'type': 'boolean',57  'allowundefined': true58}], ['aria-flowto', {59  'type': 'idlist'60}], ['aria-grabbed', {61  'type': 'boolean',62  'allowundefined': true63}], ['aria-haspopup', {64  'type': 'token',65  'values': [false, true, 'menu', 'listbox', 'tree', 'grid', 'dialog']66}], ['aria-hidden', {67  'type': 'boolean',68  'allowundefined': true69}], ['aria-invalid', {70  'type': 'token',71  'values': ['grammar', false, 'spelling', true]72}], ['aria-keyshortcuts', {73  type: 'string'74}], ['aria-label', {75  'type': 'string'76}], ['aria-labelledby', {77  'type': 'idlist'78}], ['aria-level', {79  'type': 'integer'80}], ['aria-live', {81  'type': 'token',82  'values': ['assertive', 'off', 'polite']83}], ['aria-modal', {84  type: 'boolean'85}], ['aria-multiline', {86  'type': 'boolean'87}], ['aria-multiselectable', {88  'type': 'boolean'89}], ['aria-orientation', {90  'type': 'token',91  'values': ['vertical', 'undefined', 'horizontal']92}], ['aria-owns', {93  'type': 'idlist'94}], ['aria-placeholder', {95  type: 'string'96}], ['aria-posinset', {97  'type': 'integer'98}], ['aria-pressed', {99  'type': 'tristate'100}], ['aria-readonly', {101  'type': 'boolean'102}], ['aria-relevant', {103  'type': 'tokenlist',104  'values': ['additions', 'all', 'removals', 'text']105}], ['aria-required', {106  'type': 'boolean'107}], ['aria-roledescription', {108  type: 'string'109}], ['aria-rowcount', {110  type: 'integer'111}], ['aria-rowindex', {112  type: 'integer'113}], ['aria-rowspan', {114  type: 'integer'115}], ['aria-selected', {116  'type': 'boolean',117  'allowundefined': true118}], ['aria-setsize', {119  'type': 'integer'120}], ['aria-sort', {121  'type': 'token',122  'values': ['ascending', 'descending', 'none', 'other']123}], ['aria-valuemax', {124  'type': 'number'125}], ['aria-valuemin', {126  'type': 'number'127}], ['aria-valuenow', {128  'type': 'number'129}], ['aria-valuetext', {130  'type': 'string'131}]];132var ariaPropsMap = {133  entries: function entries() {134    return properties;135  },136  forEach: function forEach(fn) {137    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;138    var _iterator = _createForOfIteratorHelper(properties),139      _step;140    try {141      for (_iterator.s(); !(_step = _iterator.n()).done;) {142        var _step$value = _slicedToArray(_step.value, 2),143          key = _step$value[0],144          values = _step$value[1];145        fn.call(thisArg, values, key, properties);146      }147    } catch (err) {148      _iterator.e(err);149    } finally {150      _iterator.f();151    }152  },153  get: function get(key) {154    var item = properties.find(function (tuple) {155      return tuple[0] === key ? true : false;156    });157    return item && item[1];158  },159  has: function has(key) {160    return !!ariaPropsMap.get(key);161  },162  keys: function keys() {163    return properties.map(function (_ref) {164      var _ref2 = _slicedToArray(_ref, 1),165        key = _ref2[0];166      return key;167    });168  },169  values: function values() {170    return properties.map(function (_ref3) {171      var _ref4 = _slicedToArray(_ref3, 2),172        values = _ref4[1];173      return values;174    });175  }176};177var _default = (0, _iterationDecorator.default)(ariaPropsMap, ariaPropsMap.entries());178exports.default = _default;