File size: 5,770 Bytes
04ec17f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
"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()); |