123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = void 0;
- var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator"));
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
- function _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."); }
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
- var properties = [['aria-activedescendant', {
- 'type': 'id'
- }], ['aria-atomic', {
- 'type': 'boolean'
- }], ['aria-autocomplete', {
- 'type': 'token',
- 'values': ['inline', 'list', 'both', 'none']
- }], ['aria-braillelabel', {
- 'type': 'string'
- }], ['aria-brailleroledescription', {
- 'type': 'string'
- }], ['aria-busy', {
- 'type': 'boolean'
- }], ['aria-checked', {
- 'type': 'tristate'
- }], ['aria-colcount', {
- type: 'integer'
- }], ['aria-colindex', {
- type: 'integer'
- }], ['aria-colspan', {
- type: 'integer'
- }], ['aria-controls', {
- 'type': 'idlist'
- }], ['aria-current', {
- type: 'token',
- values: ['page', 'step', 'location', 'date', 'time', true, false]
- }], ['aria-describedby', {
- 'type': 'idlist'
- }], ['aria-description', {
- 'type': 'string'
- }], ['aria-details', {
- 'type': 'id'
- }], ['aria-disabled', {
- 'type': 'boolean'
- }], ['aria-dropeffect', {
- 'type': 'tokenlist',
- 'values': ['copy', 'execute', 'link', 'move', 'none', 'popup']
- }], ['aria-errormessage', {
- 'type': 'id'
- }], ['aria-expanded', {
- 'type': 'boolean',
- 'allowundefined': true
- }], ['aria-flowto', {
- 'type': 'idlist'
- }], ['aria-grabbed', {
- 'type': 'boolean',
- 'allowundefined': true
- }], ['aria-haspopup', {
- 'type': 'token',
- 'values': [false, true, 'menu', 'listbox', 'tree', 'grid', 'dialog']
- }], ['aria-hidden', {
- 'type': 'boolean',
- 'allowundefined': true
- }], ['aria-invalid', {
- 'type': 'token',
- 'values': ['grammar', false, 'spelling', true]
- }], ['aria-keyshortcuts', {
- type: 'string'
- }], ['aria-label', {
- 'type': 'string'
- }], ['aria-labelledby', {
- 'type': 'idlist'
- }], ['aria-level', {
- 'type': 'integer'
- }], ['aria-live', {
- 'type': 'token',
- 'values': ['assertive', 'off', 'polite']
- }], ['aria-modal', {
- type: 'boolean'
- }], ['aria-multiline', {
- 'type': 'boolean'
- }], ['aria-multiselectable', {
- 'type': 'boolean'
- }], ['aria-orientation', {
- 'type': 'token',
- 'values': ['vertical', 'undefined', 'horizontal']
- }], ['aria-owns', {
- 'type': 'idlist'
- }], ['aria-placeholder', {
- type: 'string'
- }], ['aria-posinset', {
- 'type': 'integer'
- }], ['aria-pressed', {
- 'type': 'tristate'
- }], ['aria-readonly', {
- 'type': 'boolean'
- }], ['aria-relevant', {
- 'type': 'tokenlist',
- 'values': ['additions', 'all', 'removals', 'text']
- }], ['aria-required', {
- 'type': 'boolean'
- }], ['aria-roledescription', {
- type: 'string'
- }], ['aria-rowcount', {
- type: 'integer'
- }], ['aria-rowindex', {
- type: 'integer'
- }], ['aria-rowspan', {
- type: 'integer'
- }], ['aria-selected', {
- 'type': 'boolean',
- 'allowundefined': true
- }], ['aria-setsize', {
- 'type': 'integer'
- }], ['aria-sort', {
- 'type': 'token',
- 'values': ['ascending', 'descending', 'none', 'other']
- }], ['aria-valuemax', {
- 'type': 'number'
- }], ['aria-valuemin', {
- 'type': 'number'
- }], ['aria-valuenow', {
- 'type': 'number'
- }], ['aria-valuetext', {
- 'type': 'string'
- }]];
- var ariaPropsMap = {
- entries: function entries() {
- return properties;
- },
- forEach: function forEach(fn) {
- var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- for (var _i = 0, _properties = properties; _i < _properties.length; _i++) {
- var _properties$_i = _slicedToArray(_properties[_i], 2),
- key = _properties$_i[0],
- values = _properties$_i[1];
- fn.call(thisArg, values, key, properties);
- }
- },
- get: function get(key) {
- var item = properties.filter(function (tuple) {
- return tuple[0] === key ? true : false;
- })[0];
- return item && item[1];
- },
- has: function has(key) {
- return !!ariaPropsMap.get(key);
- },
- keys: function keys() {
- return properties.map(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 1),
- key = _ref2[0];
- return key;
- });
- },
- values: function values() {
- return properties.map(function (_ref3) {
- var _ref4 = _slicedToArray(_ref3, 2),
- values = _ref4[1];
- return values;
- });
- }
- };
- var _default = exports.default = (0, _iterationDecorator.default)(ariaPropsMap, ariaPropsMap.entries());
|