Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
for (var _index = baseIndex - 1; _index >= 0; _index--) {
[25000] Fix | Delete
if (!getItemNodeFromIndex(_index).hasAttribute('disabled')) {
[25001] Fix | Delete
return _index;
[25002] Fix | Delete
}
[25003] Fix | Delete
}
[25004] Fix | Delete
}
[25005] Fix | Delete
[25006] Fix | Delete
if (circular) {
[25007] Fix | Delete
return moveAmount > 0 ? getNextNonDisabledIndex(1, 0, itemCount, getItemNodeFromIndex, false) : getNextNonDisabledIndex(-1, itemCount - 1, itemCount, getItemNodeFromIndex, false);
[25008] Fix | Delete
}
[25009] Fix | Delete
[25010] Fix | Delete
return -1;
[25011] Fix | Delete
}
[25012] Fix | Delete
/**
[25013] Fix | Delete
* Checks if event target is within the downshift elements.
[25014] Fix | Delete
*
[25015] Fix | Delete
* @param {EventTarget} target Target to check.
[25016] Fix | Delete
* @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).
[25017] Fix | Delete
* @param {Window} environment The window context where downshift renders.
[25018] Fix | Delete
* @param {boolean} checkActiveElement Whether to also check activeElement.
[25019] Fix | Delete
*
[25020] Fix | Delete
* @returns {boolean} Whether or not the target is within downshift elements.
[25021] Fix | Delete
*/
[25022] Fix | Delete
[25023] Fix | Delete
[25024] Fix | Delete
function targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {
[25025] Fix | Delete
if (checkActiveElement === void 0) {
[25026] Fix | Delete
checkActiveElement = true;
[25027] Fix | Delete
}
[25028] Fix | Delete
[25029] Fix | Delete
return downshiftElements.some(function (contextNode) {
[25030] Fix | Delete
return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment));
[25031] Fix | Delete
});
[25032] Fix | Delete
} // eslint-disable-next-line import/no-mutable-exports
[25033] Fix | Delete
[25034] Fix | Delete
[25035] Fix | Delete
var validateControlledUnchanged = downshift_esm_noop;
[25036] Fix | Delete
/* istanbul ignore next */
[25037] Fix | Delete
[25038] Fix | Delete
if (false) {}
[25039] Fix | Delete
[25040] Fix | Delete
var cleanupStatus = debounce(function (documentProp) {
[25041] Fix | Delete
getStatusDiv(documentProp).textContent = '';
[25042] Fix | Delete
}, 500);
[25043] Fix | Delete
/**
[25044] Fix | Delete
* @param {String} status the status message
[25045] Fix | Delete
* @param {Object} documentProp document passed by the user.
[25046] Fix | Delete
*/
[25047] Fix | Delete
[25048] Fix | Delete
function setStatus(status, documentProp) {
[25049] Fix | Delete
var div = getStatusDiv(documentProp);
[25050] Fix | Delete
[25051] Fix | Delete
if (!status) {
[25052] Fix | Delete
return;
[25053] Fix | Delete
}
[25054] Fix | Delete
[25055] Fix | Delete
div.textContent = status;
[25056] Fix | Delete
cleanupStatus(documentProp);
[25057] Fix | Delete
}
[25058] Fix | Delete
/**
[25059] Fix | Delete
* Get the status node or create it if it does not already exist.
[25060] Fix | Delete
* @param {Object} documentProp document passed by the user.
[25061] Fix | Delete
* @return {HTMLElement} the status node.
[25062] Fix | Delete
*/
[25063] Fix | Delete
[25064] Fix | Delete
[25065] Fix | Delete
function getStatusDiv(documentProp) {
[25066] Fix | Delete
if (documentProp === void 0) {
[25067] Fix | Delete
documentProp = document;
[25068] Fix | Delete
}
[25069] Fix | Delete
[25070] Fix | Delete
var statusDiv = documentProp.getElementById('a11y-status-message');
[25071] Fix | Delete
[25072] Fix | Delete
if (statusDiv) {
[25073] Fix | Delete
return statusDiv;
[25074] Fix | Delete
}
[25075] Fix | Delete
[25076] Fix | Delete
statusDiv = documentProp.createElement('div');
[25077] Fix | Delete
statusDiv.setAttribute('id', 'a11y-status-message');
[25078] Fix | Delete
statusDiv.setAttribute('role', 'status');
[25079] Fix | Delete
statusDiv.setAttribute('aria-live', 'polite');
[25080] Fix | Delete
statusDiv.setAttribute('aria-relevant', 'additions text');
[25081] Fix | Delete
Object.assign(statusDiv.style, {
[25082] Fix | Delete
border: '0',
[25083] Fix | Delete
clip: 'rect(0 0 0 0)',
[25084] Fix | Delete
height: '1px',
[25085] Fix | Delete
margin: '-1px',
[25086] Fix | Delete
overflow: 'hidden',
[25087] Fix | Delete
padding: '0',
[25088] Fix | Delete
position: 'absolute',
[25089] Fix | Delete
width: '1px'
[25090] Fix | Delete
});
[25091] Fix | Delete
documentProp.body.appendChild(statusDiv);
[25092] Fix | Delete
return statusDiv;
[25093] Fix | Delete
}
[25094] Fix | Delete
[25095] Fix | Delete
var unknown = false ? undefined : 0;
[25096] Fix | Delete
var mouseUp = false ? undefined : 1;
[25097] Fix | Delete
var itemMouseEnter = false ? undefined : 2;
[25098] Fix | Delete
var keyDownArrowUp = false ? undefined : 3;
[25099] Fix | Delete
var keyDownArrowDown = false ? undefined : 4;
[25100] Fix | Delete
var keyDownEscape = false ? undefined : 5;
[25101] Fix | Delete
var keyDownEnter = false ? undefined : 6;
[25102] Fix | Delete
var keyDownHome = false ? undefined : 7;
[25103] Fix | Delete
var keyDownEnd = false ? undefined : 8;
[25104] Fix | Delete
var clickItem = false ? undefined : 9;
[25105] Fix | Delete
var blurInput = false ? undefined : 10;
[25106] Fix | Delete
var changeInput = false ? undefined : 11;
[25107] Fix | Delete
var keyDownSpaceButton = false ? undefined : 12;
[25108] Fix | Delete
var clickButton = false ? undefined : 13;
[25109] Fix | Delete
var blurButton = false ? undefined : 14;
[25110] Fix | Delete
var controlledPropUpdatedSelectedItem = false ? undefined : 15;
[25111] Fix | Delete
var touchEnd = false ? undefined : 16;
[25112] Fix | Delete
[25113] Fix | Delete
var stateChangeTypes$3 = /*#__PURE__*/Object.freeze({
[25114] Fix | Delete
__proto__: null,
[25115] Fix | Delete
unknown: unknown,
[25116] Fix | Delete
mouseUp: mouseUp,
[25117] Fix | Delete
itemMouseEnter: itemMouseEnter,
[25118] Fix | Delete
keyDownArrowUp: keyDownArrowUp,
[25119] Fix | Delete
keyDownArrowDown: keyDownArrowDown,
[25120] Fix | Delete
keyDownEscape: keyDownEscape,
[25121] Fix | Delete
keyDownEnter: keyDownEnter,
[25122] Fix | Delete
keyDownHome: keyDownHome,
[25123] Fix | Delete
keyDownEnd: keyDownEnd,
[25124] Fix | Delete
clickItem: clickItem,
[25125] Fix | Delete
blurInput: blurInput,
[25126] Fix | Delete
changeInput: changeInput,
[25127] Fix | Delete
keyDownSpaceButton: keyDownSpaceButton,
[25128] Fix | Delete
clickButton: clickButton,
[25129] Fix | Delete
blurButton: blurButton,
[25130] Fix | Delete
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
[25131] Fix | Delete
touchEnd: touchEnd
[25132] Fix | Delete
});
[25133] Fix | Delete
[25134] Fix | Delete
var _excluded$4 = ["refKey", "ref"],
[25135] Fix | Delete
_excluded2$3 = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"],
[25136] Fix | Delete
_excluded3$2 = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"],
[25137] Fix | Delete
_excluded4$1 = ["refKey", "ref"],
[25138] Fix | Delete
_excluded5$1 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"];
[25139] Fix | Delete
[25140] Fix | Delete
var downshift_esm_Downshift = /*#__PURE__*/function () {
[25141] Fix | Delete
var Downshift = /*#__PURE__*/function (_Component) {
[25142] Fix | Delete
inheritsLoose_inheritsLoose(Downshift, _Component);
[25143] Fix | Delete
[25144] Fix | Delete
function Downshift(_props) {
[25145] Fix | Delete
var _this;
[25146] Fix | Delete
[25147] Fix | Delete
_this = _Component.call(this, _props) || this; // fancy destructuring + defaults + aliases
[25148] Fix | Delete
// this basically says each value of state should either be set to
[25149] Fix | Delete
// the initial value or the default value if the initial value is not provided
[25150] Fix | Delete
[25151] Fix | Delete
_this.id = _this.props.id || "downshift-" + downshift_esm_generateId();
[25152] Fix | Delete
_this.menuId = _this.props.menuId || _this.id + "-menu";
[25153] Fix | Delete
_this.labelId = _this.props.labelId || _this.id + "-label";
[25154] Fix | Delete
_this.inputId = _this.props.inputId || _this.id + "-input";
[25155] Fix | Delete
[25156] Fix | Delete
_this.getItemId = _this.props.getItemId || function (index) {
[25157] Fix | Delete
return _this.id + "-item-" + index;
[25158] Fix | Delete
};
[25159] Fix | Delete
[25160] Fix | Delete
_this.input = null;
[25161] Fix | Delete
_this.items = [];
[25162] Fix | Delete
_this.itemCount = null;
[25163] Fix | Delete
_this.previousResultCount = 0;
[25164] Fix | Delete
_this.timeoutIds = [];
[25165] Fix | Delete
[25166] Fix | Delete
_this.internalSetTimeout = function (fn, time) {
[25167] Fix | Delete
var id = setTimeout(function () {
[25168] Fix | Delete
_this.timeoutIds = _this.timeoutIds.filter(function (i) {
[25169] Fix | Delete
return i !== id;
[25170] Fix | Delete
});
[25171] Fix | Delete
fn();
[25172] Fix | Delete
}, time);
[25173] Fix | Delete
[25174] Fix | Delete
_this.timeoutIds.push(id);
[25175] Fix | Delete
};
[25176] Fix | Delete
[25177] Fix | Delete
_this.setItemCount = function (count) {
[25178] Fix | Delete
_this.itemCount = count;
[25179] Fix | Delete
};
[25180] Fix | Delete
[25181] Fix | Delete
_this.unsetItemCount = function () {
[25182] Fix | Delete
_this.itemCount = null;
[25183] Fix | Delete
};
[25184] Fix | Delete
[25185] Fix | Delete
_this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) {
[25186] Fix | Delete
if (highlightedIndex === void 0) {
[25187] Fix | Delete
highlightedIndex = _this.props.defaultHighlightedIndex;
[25188] Fix | Delete
}
[25189] Fix | Delete
[25190] Fix | Delete
if (otherStateToSet === void 0) {
[25191] Fix | Delete
otherStateToSet = {};
[25192] Fix | Delete
}
[25193] Fix | Delete
[25194] Fix | Delete
otherStateToSet = pickState(otherStateToSet);
[25195] Fix | Delete
[25196] Fix | Delete
_this.internalSetState(extends_extends({
[25197] Fix | Delete
highlightedIndex: highlightedIndex
[25198] Fix | Delete
}, otherStateToSet));
[25199] Fix | Delete
};
[25200] Fix | Delete
[25201] Fix | Delete
_this.clearSelection = function (cb) {
[25202] Fix | Delete
_this.internalSetState({
[25203] Fix | Delete
selectedItem: null,
[25204] Fix | Delete
inputValue: '',
[25205] Fix | Delete
highlightedIndex: _this.props.defaultHighlightedIndex,
[25206] Fix | Delete
isOpen: _this.props.defaultIsOpen
[25207] Fix | Delete
}, cb);
[25208] Fix | Delete
};
[25209] Fix | Delete
[25210] Fix | Delete
_this.selectItem = function (item, otherStateToSet, cb) {
[25211] Fix | Delete
otherStateToSet = pickState(otherStateToSet);
[25212] Fix | Delete
[25213] Fix | Delete
_this.internalSetState(extends_extends({
[25214] Fix | Delete
isOpen: _this.props.defaultIsOpen,
[25215] Fix | Delete
highlightedIndex: _this.props.defaultHighlightedIndex,
[25216] Fix | Delete
selectedItem: item,
[25217] Fix | Delete
inputValue: _this.props.itemToString(item)
[25218] Fix | Delete
}, otherStateToSet), cb);
[25219] Fix | Delete
};
[25220] Fix | Delete
[25221] Fix | Delete
_this.selectItemAtIndex = function (itemIndex, otherStateToSet, cb) {
[25222] Fix | Delete
var item = _this.items[itemIndex];
[25223] Fix | Delete
[25224] Fix | Delete
if (item == null) {
[25225] Fix | Delete
return;
[25226] Fix | Delete
}
[25227] Fix | Delete
[25228] Fix | Delete
_this.selectItem(item, otherStateToSet, cb);
[25229] Fix | Delete
};
[25230] Fix | Delete
[25231] Fix | Delete
_this.selectHighlightedItem = function (otherStateToSet, cb) {
[25232] Fix | Delete
return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb);
[25233] Fix | Delete
};
[25234] Fix | Delete
[25235] Fix | Delete
_this.internalSetState = function (stateToSet, cb) {
[25236] Fix | Delete
var isItemSelected, onChangeArg;
[25237] Fix | Delete
var onStateChangeArg = {};
[25238] Fix | Delete
var isStateToSetFunction = typeof stateToSet === 'function'; // we want to call `onInputValueChange` before the `setState` call
[25239] Fix | Delete
// so someone controlling the `inputValue` state gets notified of
[25240] Fix | Delete
// the input change as soon as possible. This avoids issues with
[25241] Fix | Delete
// preserving the cursor position.
[25242] Fix | Delete
// See https://github.com/downshift-js/downshift/issues/217 for more info.
[25243] Fix | Delete
[25244] Fix | Delete
if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {
[25245] Fix | Delete
_this.props.onInputValueChange(stateToSet.inputValue, extends_extends({}, _this.getStateAndHelpers(), stateToSet));
[25246] Fix | Delete
}
[25247] Fix | Delete
[25248] Fix | Delete
return _this.setState(function (state) {
[25249] Fix | Delete
state = _this.getState(state);
[25250] Fix | Delete
var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet; // Your own function that could modify the state that will be set.
[25251] Fix | Delete
[25252] Fix | Delete
newStateToSet = _this.props.stateReducer(state, newStateToSet); // checks if an item is selected, regardless of if it's different from
[25253] Fix | Delete
// what was selected before
[25254] Fix | Delete
// used to determine if onSelect and onChange callbacks should be called
[25255] Fix | Delete
[25256] Fix | Delete
isItemSelected = newStateToSet.hasOwnProperty('selectedItem'); // this keeps track of the object we want to call with setState
[25257] Fix | Delete
[25258] Fix | Delete
var nextState = {}; // this is just used to tell whether the state changed
[25259] Fix | Delete
[25260] Fix | Delete
var nextFullState = {}; // we need to call on change if the outside world is controlling any of our state
[25261] Fix | Delete
// and we're trying to update that state. OR if the selection has changed and we're
[25262] Fix | Delete
// trying to update the selection
[25263] Fix | Delete
[25264] Fix | Delete
if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) {
[25265] Fix | Delete
onChangeArg = newStateToSet.selectedItem;
[25266] Fix | Delete
}
[25267] Fix | Delete
[25268] Fix | Delete
newStateToSet.type = newStateToSet.type || unknown;
[25269] Fix | Delete
Object.keys(newStateToSet).forEach(function (key) {
[25270] Fix | Delete
// onStateChangeArg should only have the state that is
[25271] Fix | Delete
// actually changing
[25272] Fix | Delete
if (state[key] !== newStateToSet[key]) {
[25273] Fix | Delete
onStateChangeArg[key] = newStateToSet[key];
[25274] Fix | Delete
} // the type is useful for the onStateChangeArg
[25275] Fix | Delete
// but we don't actually want to set it in internal state.
[25276] Fix | Delete
// this is an undocumented feature for now... Not all internalSetState
[25277] Fix | Delete
// calls support it and I'm not certain we want them to yet.
[25278] Fix | Delete
// But it enables users controlling the isOpen state to know when
[25279] Fix | Delete
// the isOpen state changes due to mouseup events which is quite handy.
[25280] Fix | Delete
[25281] Fix | Delete
[25282] Fix | Delete
if (key === 'type') {
[25283] Fix | Delete
return;
[25284] Fix | Delete
}
[25285] Fix | Delete
[25286] Fix | Delete
nextFullState[key] = newStateToSet[key]; // if it's coming from props, then we don't care to set it internally
[25287] Fix | Delete
[25288] Fix | Delete
if (!isControlledProp(_this.props, key)) {
[25289] Fix | Delete
nextState[key] = newStateToSet[key];
[25290] Fix | Delete
}
[25291] Fix | Delete
}); // if stateToSet is a function, then we weren't able to call onInputValueChange
[25292] Fix | Delete
// earlier, so we'll call it now that we know what the inputValue state will be.
[25293] Fix | Delete
[25294] Fix | Delete
if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {
[25295] Fix | Delete
_this.props.onInputValueChange(newStateToSet.inputValue, extends_extends({}, _this.getStateAndHelpers(), newStateToSet));
[25296] Fix | Delete
}
[25297] Fix | Delete
[25298] Fix | Delete
return nextState;
[25299] Fix | Delete
}, function () {
[25300] Fix | Delete
// call the provided callback if it's a function
[25301] Fix | Delete
cbToCb(cb)(); // only call the onStateChange and onChange callbacks if
[25302] Fix | Delete
// we have relevant information to pass them.
[25303] Fix | Delete
[25304] Fix | Delete
var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;
[25305] Fix | Delete
[25306] Fix | Delete
if (hasMoreStateThanType) {
[25307] Fix | Delete
_this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers());
[25308] Fix | Delete
}
[25309] Fix | Delete
[25310] Fix | Delete
if (isItemSelected) {
[25311] Fix | Delete
_this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers());
[25312] Fix | Delete
}
[25313] Fix | Delete
[25314] Fix | Delete
if (onChangeArg !== undefined) {
[25315] Fix | Delete
_this.props.onChange(onChangeArg, _this.getStateAndHelpers());
[25316] Fix | Delete
} // this is currently undocumented and therefore subject to change
[25317] Fix | Delete
// We'll try to not break it, but just be warned.
[25318] Fix | Delete
[25319] Fix | Delete
[25320] Fix | Delete
_this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers());
[25321] Fix | Delete
});
[25322] Fix | Delete
};
[25323] Fix | Delete
[25324] Fix | Delete
_this.rootRef = function (node) {
[25325] Fix | Delete
return _this._rootNode = node;
[25326] Fix | Delete
};
[25327] Fix | Delete
[25328] Fix | Delete
_this.getRootProps = function (_temp, _temp2) {
[25329] Fix | Delete
var _extends2;
[25330] Fix | Delete
[25331] Fix | Delete
var _ref = _temp === void 0 ? {} : _temp,
[25332] Fix | Delete
_ref$refKey = _ref.refKey,
[25333] Fix | Delete
refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
[25334] Fix | Delete
ref = _ref.ref,
[25335] Fix | Delete
rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$4);
[25336] Fix | Delete
[25337] Fix | Delete
var _ref2 = _temp2 === void 0 ? {} : _temp2,
[25338] Fix | Delete
_ref2$suppressRefErro = _ref2.suppressRefError,
[25339] Fix | Delete
suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
[25340] Fix | Delete
[25341] Fix | Delete
// this is used in the render to know whether the user has called getRootProps.
[25342] Fix | Delete
// It uses that to know whether to apply the props automatically
[25343] Fix | Delete
_this.getRootProps.called = true;
[25344] Fix | Delete
_this.getRootProps.refKey = refKey;
[25345] Fix | Delete
_this.getRootProps.suppressRefError = suppressRefError;
[25346] Fix | Delete
[25347] Fix | Delete
var _this$getState = _this.getState(),
[25348] Fix | Delete
isOpen = _this$getState.isOpen;
[25349] Fix | Delete
[25350] Fix | Delete
return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : null, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest);
[25351] Fix | Delete
};
[25352] Fix | Delete
[25353] Fix | Delete
_this.keyDownHandlers = {
[25354] Fix | Delete
ArrowDown: function ArrowDown(event) {
[25355] Fix | Delete
var _this2 = this;
[25356] Fix | Delete
[25357] Fix | Delete
event.preventDefault();
[25358] Fix | Delete
[25359] Fix | Delete
if (this.getState().isOpen) {
[25360] Fix | Delete
var amount = event.shiftKey ? 5 : 1;
[25361] Fix | Delete
this.moveHighlightedIndex(amount, {
[25362] Fix | Delete
type: keyDownArrowDown
[25363] Fix | Delete
});
[25364] Fix | Delete
} else {
[25365] Fix | Delete
this.internalSetState({
[25366] Fix | Delete
isOpen: true,
[25367] Fix | Delete
type: keyDownArrowDown
[25368] Fix | Delete
}, function () {
[25369] Fix | Delete
var itemCount = _this2.getItemCount();
[25370] Fix | Delete
[25371] Fix | Delete
if (itemCount > 0) {
[25372] Fix | Delete
var _this2$getState = _this2.getState(),
[25373] Fix | Delete
highlightedIndex = _this2$getState.highlightedIndex;
[25374] Fix | Delete
[25375] Fix | Delete
var nextHighlightedIndex = getNextWrappingIndex(1, highlightedIndex, itemCount, function (index) {
[25376] Fix | Delete
return _this2.getItemNodeFromIndex(index);
[25377] Fix | Delete
});
[25378] Fix | Delete
[25379] Fix | Delete
_this2.setHighlightedIndex(nextHighlightedIndex, {
[25380] Fix | Delete
type: keyDownArrowDown
[25381] Fix | Delete
});
[25382] Fix | Delete
}
[25383] Fix | Delete
});
[25384] Fix | Delete
}
[25385] Fix | Delete
},
[25386] Fix | Delete
ArrowUp: function ArrowUp(event) {
[25387] Fix | Delete
var _this3 = this;
[25388] Fix | Delete
[25389] Fix | Delete
event.preventDefault();
[25390] Fix | Delete
[25391] Fix | Delete
if (this.getState().isOpen) {
[25392] Fix | Delete
var amount = event.shiftKey ? -5 : -1;
[25393] Fix | Delete
this.moveHighlightedIndex(amount, {
[25394] Fix | Delete
type: keyDownArrowUp
[25395] Fix | Delete
});
[25396] Fix | Delete
} else {
[25397] Fix | Delete
this.internalSetState({
[25398] Fix | Delete
isOpen: true,
[25399] Fix | Delete
type: keyDownArrowUp
[25400] Fix | Delete
}, function () {
[25401] Fix | Delete
var itemCount = _this3.getItemCount();
[25402] Fix | Delete
[25403] Fix | Delete
if (itemCount > 0) {
[25404] Fix | Delete
var _this3$getState = _this3.getState(),
[25405] Fix | Delete
highlightedIndex = _this3$getState.highlightedIndex;
[25406] Fix | Delete
[25407] Fix | Delete
var nextHighlightedIndex = getNextWrappingIndex(-1, highlightedIndex, itemCount, function (index) {
[25408] Fix | Delete
return _this3.getItemNodeFromIndex(index);
[25409] Fix | Delete
});
[25410] Fix | Delete
[25411] Fix | Delete
_this3.setHighlightedIndex(nextHighlightedIndex, {
[25412] Fix | Delete
type: keyDownArrowUp
[25413] Fix | Delete
});
[25414] Fix | Delete
}
[25415] Fix | Delete
});
[25416] Fix | Delete
}
[25417] Fix | Delete
},
[25418] Fix | Delete
Enter: function Enter(event) {
[25419] Fix | Delete
if (event.which === 229) {
[25420] Fix | Delete
return;
[25421] Fix | Delete
}
[25422] Fix | Delete
[25423] Fix | Delete
var _this$getState2 = this.getState(),
[25424] Fix | Delete
isOpen = _this$getState2.isOpen,
[25425] Fix | Delete
highlightedIndex = _this$getState2.highlightedIndex;
[25426] Fix | Delete
[25427] Fix | Delete
if (isOpen && highlightedIndex != null) {
[25428] Fix | Delete
event.preventDefault();
[25429] Fix | Delete
var item = this.items[highlightedIndex];
[25430] Fix | Delete
var itemNode = this.getItemNodeFromIndex(highlightedIndex);
[25431] Fix | Delete
[25432] Fix | Delete
if (item == null || itemNode && itemNode.hasAttribute('disabled')) {
[25433] Fix | Delete
return;
[25434] Fix | Delete
}
[25435] Fix | Delete
[25436] Fix | Delete
this.selectHighlightedItem({
[25437] Fix | Delete
type: keyDownEnter
[25438] Fix | Delete
});
[25439] Fix | Delete
}
[25440] Fix | Delete
},
[25441] Fix | Delete
Escape: function Escape(event) {
[25442] Fix | Delete
event.preventDefault();
[25443] Fix | Delete
this.reset(extends_extends({
[25444] Fix | Delete
type: keyDownEscape
[25445] Fix | Delete
}, !this.state.isOpen && {
[25446] Fix | Delete
selectedItem: null,
[25447] Fix | Delete
inputValue: ''
[25448] Fix | Delete
}));
[25449] Fix | Delete
}
[25450] Fix | Delete
};
[25451] Fix | Delete
_this.buttonKeyDownHandlers = extends_extends({}, _this.keyDownHandlers, {
[25452] Fix | Delete
' ': function _(event) {
[25453] Fix | Delete
event.preventDefault();
[25454] Fix | Delete
this.toggleMenu({
[25455] Fix | Delete
type: keyDownSpaceButton
[25456] Fix | Delete
});
[25457] Fix | Delete
}
[25458] Fix | Delete
});
[25459] Fix | Delete
_this.inputKeyDownHandlers = extends_extends({}, _this.keyDownHandlers, {
[25460] Fix | Delete
Home: function Home(event) {
[25461] Fix | Delete
var _this4 = this;
[25462] Fix | Delete
[25463] Fix | Delete
var _this$getState3 = this.getState(),
[25464] Fix | Delete
isOpen = _this$getState3.isOpen;
[25465] Fix | Delete
[25466] Fix | Delete
if (!isOpen) {
[25467] Fix | Delete
return;
[25468] Fix | Delete
}
[25469] Fix | Delete
[25470] Fix | Delete
event.preventDefault();
[25471] Fix | Delete
var itemCount = this.getItemCount();
[25472] Fix | Delete
[25473] Fix | Delete
if (itemCount <= 0 || !isOpen) {
[25474] Fix | Delete
return;
[25475] Fix | Delete
} // get next non-disabled starting downwards from 0 if that's disabled.
[25476] Fix | Delete
[25477] Fix | Delete
[25478] Fix | Delete
var newHighlightedIndex = getNextNonDisabledIndex(1, 0, itemCount, function (index) {
[25479] Fix | Delete
return _this4.getItemNodeFromIndex(index);
[25480] Fix | Delete
}, false);
[25481] Fix | Delete
this.setHighlightedIndex(newHighlightedIndex, {
[25482] Fix | Delete
type: keyDownHome
[25483] Fix | Delete
});
[25484] Fix | Delete
},
[25485] Fix | Delete
End: function End(event) {
[25486] Fix | Delete
var _this5 = this;
[25487] Fix | Delete
[25488] Fix | Delete
var _this$getState4 = this.getState(),
[25489] Fix | Delete
isOpen = _this$getState4.isOpen;
[25490] Fix | Delete
[25491] Fix | Delete
if (!isOpen) {
[25492] Fix | Delete
return;
[25493] Fix | Delete
}
[25494] Fix | Delete
[25495] Fix | Delete
event.preventDefault();
[25496] Fix | Delete
var itemCount = this.getItemCount();
[25497] Fix | Delete
[25498] Fix | Delete
if (itemCount <= 0 || !isOpen) {
[25499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function