MCPcopy
hub / github.com/apache/echarts / setSelectInputState

Function setSelectInputState

test/lib/testHelper.js:1272–1306  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

1270 }
1271
1272 function setSelectInputState(state) {
1273 if (!isObject(state)) {
1274 console.error(
1275 errMsgPrefix + ' Invalid select input state: ' + printObject(state)
1276 + ' May caused by test case change.'
1277 );
1278 return;
1279 }
1280 if (!validateOptionIndex(state.optionIndex)) {
1281 return;
1282 }
1283
1284 var optionStateMap = state.optionStateMap || {};
1285 for (var optionIdx in optionStateMap) {
1286 if (state.optionStateMap.hasOwnProperty(optionIdx)) {
1287 var subInput = selectCtx._optionIdxToSubInput[optionIdx];
1288 if (!subInput) {
1289 console.error(
1290 errMsgPrefix + ' Invalid select input state: ' + printObject(state)
1291 + ' Can not find a sub-input by optionIndex: ' + optionIdx + '.'
1292 + ' May caused by test case change.'
1293 );
1294 return;
1295 }
1296 }
1297 }
1298 for (var optionIdx in optionStateMap) {
1299 if (state.optionStateMap.hasOwnProperty(optionIdx)) {
1300 var subInput = selectCtx._optionIdxToSubInput[optionIdx];
1301 subInput.setState(state.optionStateMap[optionIdx]);
1302 }
1303 }
1304 resetSelectInputDisabled({disabled: state.disabled});
1305 resetSelectInputOptionIndex(state.optionIndex);
1306 }
1307
1308 function validateOptionIndex(optionIndex) {
1309 if (getType(optionIndex) !== 'number'

Callers

nothing calls this directly

Calls 4

validateOptionIndexFunction · 0.85
resetSelectInputDisabledFunction · 0.85
isObjectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…