|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Rev | Line | |
|---|
| [9af201e] | 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports["default"] = getImplicitRoleForInput;
|
|---|
| 7 | var _jsxAstUtils = require("jsx-ast-utils");
|
|---|
| 8 | /**
|
|---|
| 9 | * Returns the implicit role for an input tag.
|
|---|
| 10 | */
|
|---|
| 11 | function getImplicitRoleForInput(attributes) {
|
|---|
| 12 | var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
|---|
| 13 | if (type) {
|
|---|
| 14 | var value = (0, _jsxAstUtils.getLiteralPropValue)(type) || '';
|
|---|
| 15 | switch (typeof value === 'string' && value.toUpperCase()) {
|
|---|
| 16 | case 'BUTTON':
|
|---|
| 17 | case 'IMAGE':
|
|---|
| 18 | case 'RESET':
|
|---|
| 19 | case 'SUBMIT':
|
|---|
| 20 | return 'button';
|
|---|
| 21 | case 'CHECKBOX':
|
|---|
| 22 | return 'checkbox';
|
|---|
| 23 | case 'RADIO':
|
|---|
| 24 | return 'radio';
|
|---|
| 25 | case 'RANGE':
|
|---|
| 26 | return 'slider';
|
|---|
| 27 | case 'EMAIL':
|
|---|
| 28 | case 'PASSWORD':
|
|---|
| 29 | case 'SEARCH': // with [list] selector it's combobox
|
|---|
| 30 | case 'TEL': // with [list] selector it's combobox
|
|---|
| 31 | case 'URL': // with [list] selector it's combobox
|
|---|
| 32 | default:
|
|---|
| 33 | return 'textbox';
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
| 36 | return 'textbox';
|
|---|
| 37 | }
|
|---|
| 38 | module.exports = exports.default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.