text: ["^ ","~:resource-id",["~:shadow.build.npm/resource","node_modules/dom-align/lib/adjustForViewport.js"],"~:js","shadow$provide.module$node_modules$dom_align$lib$adjustForViewport=function(global,process,require,module,exports,shadow$shims){Object.defineProperty(exports,\"__esModule\",{value:!0});var _utils2=(global=require(\"module$node_modules$dom_align$lib$utils\"))&&global.__esModule?global:{\"default\":global};exports[\"default\"]=function(elFuturePos,elRegion,visibleRect,overflow){elFuturePos=_utils2[\"default\"].clone(elFuturePos);elRegion={width:elRegion.width,height:elRegion.height};overflow.adjustX&&elFuturePos.left<\nvisibleRect.left&&(elFuturePos.left=visibleRect.left);overflow.resizeWidth&&elFuturePos.left>=visibleRect.left&&elFuturePos.left+elRegion.width>visibleRect.right&&(elRegion.width-=elFuturePos.left+elRegion.width-visibleRect.right);overflow.adjustX&&elFuturePos.left+elRegion.width>visibleRect.right&&(elFuturePos.left=Math.max(visibleRect.right-elRegion.width,visibleRect.left));overflow.adjustY&&elFuturePos.top<visibleRect.top&&(elFuturePos.top=visibleRect.top);overflow.resizeHeight&&elFuturePos.top>=\nvisibleRect.top&&elFuturePos.top+elRegion.height>visibleRect.bottom&&(elRegion.height-=elFuturePos.top+elRegion.height-visibleRect.bottom);overflow.adjustY&&elFuturePos.top+elRegion.height>visibleRect.bottom&&(elFuturePos.top=Math.max(visibleRect.bottom-elRegion.height,visibleRect.top));return _utils2[\"default\"].mix(elFuturePos,elRegion)};module.exports=exports[\"default\"]}","~:source","shadow$provide[\"module$node_modules$dom_align$lib$adjustForViewport\"] = function(global,process,require,module,exports,shadow$shims) {\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _utils = require('./utils');\n\nvar _utils2 = _interopRequireDefault(_utils);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {\n  var pos = _utils2['default'].clone(elFuturePos);\n  var size = {\n    width: elRegion.width,\n    height: elRegion.height\n  };\n\n  if (overflow.adjustX && pos.left < visibleRect.left) {\n    pos.left = visibleRect.left;\n  }\n\n  // Left edge inside and right edge outside viewport, try to resize it.\n  if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {\n    size.width -= pos.left + size.width - visibleRect.right;\n  }\n\n  // Right edge outside viewport, try to move it.\n  if (overflow.adjustX && pos.left + size.width > visibleRect.right) {\n    // 保证左边界和可视区域左边界对齐\n    pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);\n  }\n\n  // Top edge outside viewport, try to move it.\n  if (overflow.adjustY && pos.top < visibleRect.top) {\n    pos.top = visibleRect.top;\n  }\n\n  // Top edge inside and bottom edge outside viewport, try to resize it.\n  if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {\n    size.height -= pos.top + size.height - visibleRect.bottom;\n  }\n\n  // Bottom edge outside viewport, try to move it.\n  if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {\n    // 保证上边界和可视区域上边界对齐\n    pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);\n  }\n\n  return _utils2['default'].mix(pos, size);\n}\n\nexports['default'] = adjustForViewport;\nmodule.exports = exports['default'];\n};","~:removed-requires",["~#set",[]],"~:actual-requires",["^5",["~$module$node_modules$dom_align$lib$utils","~$shadow.js"]],"~:properties",["^5",["width","top","height","__esModule","value","default","left"]],"~:compiled-at",1532351401805,"~:source-map-json","{\n\"version\":3,\n\"file\":\"module$node_modules$dom_align$lib$adjustForViewport.js\",\n\"lineCount\":3,\n\"mappings\":\"AAAAA,cAAA,oDAAA,CAAwE,QAAQ,CAACC,MAAD,CAAQC,OAAR,CAAgBC,OAAhB,CAAwBC,MAAxB,CAA+BC,OAA/B,CAAuCC,YAAvC,CAAqD,CAGrIC,MAAAC,eAAA,CAAsBH,OAAtB,CAA+B,YAA/B,CAA6C,CAC3CI,MAAO,CAAA,CADoC,CAA7C,CAMA,KAAIC,QAE0C,CAJ1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,SAAAY,QAAJ,EAAwBX,WAAAY,IAAxB,CAAkCV,QAAAE,OAAlC,CAAgDN,WAAAgB,OAAhD,GAEEd,WAAAY,IAFF,CAEYH,IAAAC,IAAA,CAASZ,WAAAgB,OAAT,CAA8BZ,QAAAE,OAA9B,CAA2CN,WAAAc,IAA3C,CAFZ,CAKA,OAAOpB,QAAA,CAAQ,SAAR,CAAAuB,IAAA,CAAuBf,WAAvB,CAA4BE,QAA5B,CAtCgE,CA0CzEhB,OAAAC,QAAA,CAAiBA,OAAA,CAAQ,SAAR,CAvDoH;\",\n\"sources\":[\"node_modules/dom-align/lib/adjustForViewport.js\"],\n\"sourcesContent\":[\"shadow$provide[\\\"module$node_modules$dom_align$lib$adjustForViewport\\\"] = function(global,process,require,module,exports,shadow$shims) {\\n'use strict';\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _utils = require('./utils');\\n\\nvar _utils2 = _interopRequireDefault(_utils);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\\n\\nfunction adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {\\n  var pos = _utils2['default'].clone(elFuturePos);\\n  var size = {\\n    width: elRegion.width,\\n    height: elRegion.height\\n  };\\n\\n  if (overflow.adjustX && pos.left < visibleRect.left) {\\n    pos.left = visibleRect.left;\\n  }\\n\\n  // Left edge inside and right edge outside viewport, try to resize it.\\n  if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {\\n    size.width -= pos.left + size.width - visibleRect.right;\\n  }\\n\\n  // Right edge outside viewport, try to move it.\\n  if (overflow.adjustX && pos.left + size.width > visibleRect.right) {\\n    // \\u4fdd\\u8bc1\\u5de6\\u8fb9\\u754c\\u548c\\u53ef\\u89c6\\u533a\\u57df\\u5de6\\u8fb9\\u754c\\u5bf9\\u9f50\\n    pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);\\n  }\\n\\n  // Top edge outside viewport, try to move it.\\n  if (overflow.adjustY && pos.top < visibleRect.top) {\\n    pos.top = visibleRect.top;\\n  }\\n\\n  // Top edge inside and bottom edge outside viewport, try to resize it.\\n  if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {\\n    size.height -= pos.top + size.height - visibleRect.bottom;\\n  }\\n\\n  // Bottom edge outside viewport, try to move it.\\n  if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {\\n    // \\u4fdd\\u8bc1\\u4e0a\\u8fb9\\u754c\\u548c\\u53ef\\u89c6\\u533a\\u57df\\u4e0a\\u8fb9\\u754c\\u5bf9\\u9f50\\n    pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);\\n  }\\n\\n  return _utils2['default'].mix(pos, size);\\n}\\n\\nexports['default'] = adjustForViewport;\\nmodule.exports = exports['default'];\\n};\"],\n\"names\":[\"shadow$provide\",\"global\",\"process\",\"require\",\"module\",\"exports\",\"shadow$shims\",\"Object\",\"defineProperty\",\"value\",\"_utils2\",\"_utils\",\"__esModule\",\"adjustForViewport\",\"elFuturePos\",\"elRegion\",\"visibleRect\",\"overflow\",\"pos\",\"clone\",\"size\",\"width\",\"height\",\"adjustX\",\"left\",\"resizeWidth\",\"right\",\"Math\",\"max\",\"adjustY\",\"top\",\"resizeHeight\",\"bottom\",\"mix\"]\n}\n"]