1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"ast":null,"code":"'use strict';\n\nvar _typeof2 = require(\"D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src\\u554A/ElectronicMallVue/node_modules/@babel/runtime/helpers/typeof.js\").default;\n\nrequire(\"core-js/modules/es.symbol.js\");\n\nrequire(\"core-js/modules/es.symbol.description.js\");\n\nrequire(\"core-js/modules/es.object.to-string.js\");\n\nrequire(\"core-js/modules/es.symbol.iterator.js\");\n\nrequire(\"core-js/modules/es.string.iterator.js\");\n\nrequire(\"core-js/modules/web.dom-collections.iterator.js\");\n\nrequire(\"core-js/modules/es.error.cause.js\");\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\" ? function (obj) {\n return _typeof2(obj);\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n};\n\nvar _ariaUtils = require('./aria-utils');\n\nvar _ariaUtils2 = _interopRequireDefault(_ariaUtils);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n/**\n * @constructor\n * @desc Dialog object providing modal focus management.\n *\n * Assumptions: The element serving as the dialog container is present in the\n * DOM and hidden. The dialog container has role='dialog'.\n *\n * @param dialogId\n * The ID of the element serving as the dialog container.\n * @param focusAfterClosed\n * Either the DOM node or the ID of the DOM node to focus when the\n * dialog closes.\n * @param focusFirst\n * Optional parameter containing either the DOM node or the ID of the\n * DOM node to focus when the dialog opens. If not specified, the\n * first focusable element in the dialog will receive focus.\n */\n\n\nvar aria = aria || {};\nvar tabEvent;\n\naria.Dialog = function (dialog, focusAfterClosed, focusFirst) {\n var _this = this;\n\n this.dialogNode = dialog;\n\n if (this.dialogNode === null || this.dialogNode.getAttribute('role') !== 'dialog') {\n throw new Error('Dialog() requires a DOM element with ARIA role of dialog.');\n }\n\n if (typeof focusAfterClosed === 'string') {\n this.focusAfterClosed = document.getElementById(focusAfterClosed);\n } else if ((typeof focusAfterClosed === 'undefined' ? 'undefined' : _typeof(focusAfterClosed)) === 'object') {\n this.focusAfterClosed = focusAfterClosed;\n } else {\n this.focusAfterClosed = null;\n }\n\n if (typeof focusFirst === 'string') {\n this.focusFirst = document.getElementById(focusFirst);\n } else if ((typeof focusFirst === 'undefined' ? 'undefined' : _typeof(focusFirst)) === 'object') {\n this.focusFirst = focusFirst;\n } else {\n this.focusFirst = null;\n }\n\n if (this.focusFirst) {\n this.focusFirst.focus();\n } else {\n _ariaUtils2.default.focusFirstDescendant(this.dialogNode);\n }\n\n this.lastFocus = document.activeElement;\n\n tabEvent = function tabEvent(e) {\n _this.trapFocus(e);\n };\n\n this.addListeners();\n};\n\naria.Dialog.prototype.addListeners = function () {\n document.addEventListener('focus', tabEvent, true);\n};\n\naria.Dialog.prototype.removeListeners = function () {\n document.removeEventListener('focus', tabEvent, true);\n};\n\naria.Dialog.prototype.closeDialog = function () {\n var _this2 = this;\n\n this.removeListeners();\n\n if (this.focusAfterClosed) {\n setTimeout(function () {\n _this2.focusAfterClosed.focus();\n });\n }\n};\n\naria.Dialog.prototype.trapFocus = function (event) {\n if (_ariaUtils2.default.IgnoreUtilFocusChanges) {\n return;\n }\n\n if (this.dialogNode.contains(event.target)) {\n this.lastFocus = event.target;\n } else {\n _ariaUtils2.default.focusFirstDescendant(this.dialogNode);\n\n if (this.lastFocus === document.activeElement) {\n _ariaUtils2.default.focusLastDescendant(this.dialogNode);\n }\n\n this.lastFocus = document.activeElement;\n }\n};\n\nexports.default = aria.Dialog;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/element-ui/lib/utils/aria-dialog.js"],"names":["exports","__esModule","_typeof","Symbol","iterator","obj","constructor","prototype","_ariaUtils","require","_ariaUtils2","_interopRequireDefault","default","aria","tabEvent","Dialog","dialog","focusAfterClosed","focusFirst","_this","dialogNode","getAttribute","Error","document","getElementById","focus","focusFirstDescendant","lastFocus","activeElement","e","trapFocus","addListeners","addEventListener","removeListeners","removeEventListener","closeDialog","_this2","setTimeout","event","IgnoreUtilFocusChanges","contains","target","focusLastDescendant"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;AAEAA,OAAO,CAACC,UAAR,GAAqB,IAArB;;AAEA,IAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,IAAgC,SAAOA,MAAM,CAACC,QAAd,MAA2B,QAA3D,GAAsE,UAAUC,GAAV,EAAe;AAAE,kBAAcA,GAAd;AAAoB,CAA3G,GAA8G,UAAUA,GAAV,EAAe;AAAE,SAAOA,GAAG,IAAI,OAAOF,MAAP,KAAkB,UAAzB,IAAuCE,GAAG,CAACC,WAAJ,KAAoBH,MAA3D,IAAqEE,GAAG,KAAKF,MAAM,CAACI,SAApF,GAAgG,QAAhG,YAAkHF,GAAlH,CAAP;AAA+H,CAA5Q;;AAEA,IAAIG,UAAU,GAAGC,OAAO,CAAC,cAAD,CAAxB;;AAEA,IAAIC,WAAW,GAAGC,sBAAsB,CAACH,UAAD,CAAxC;;AAEA,SAASG,sBAAT,CAAgCN,GAAhC,EAAqC;AAAE,SAAOA,GAAG,IAAIA,GAAG,CAACJ,UAAX,GAAwBI,GAAxB,GAA8B;AAAEO,IAAAA,OAAO,EAAEP;AAAX,GAArC;AAAwD;AAE/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAIQ,IAAI,GAAGA,IAAI,IAAI,EAAnB;AACA,IAAIC,QAAJ;;AAEAD,IAAI,CAACE,MAAL,GAAc,UAAUC,MAAV,EAAkBC,gBAAlB,EAAoCC,UAApC,EAAgD;AAC5D,MAAIC,KAAK,GAAG,IAAZ;;AAEA,OAAKC,UAAL,GAAkBJ,MAAlB;;AACA,MAAI,KAAKI,UAAL,KAAoB,IAApB,IAA4B,KAAKA,UAAL,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terator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _ariaUtils = require('./aria-utils');\n\nvar _ariaUtils2 = _interopRequireDefault(_ariaUtils);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @constructor\n * @desc Dialog object providing modal focus management.\n *\n * Assumptions: The element serving as the dialog container is present in the\n * DOM and hidden. The dialog container has role='dialog'.\n *\n * @param dialogId\n * The ID of the element serving as the dialog container.\n * @param focusAfterClosed\n * Either the DOM node or the ID of the DOM node to focus when the\n * dialog closes.\n * @param focusFirst\n * Optional parameter containing either the DOM node or the ID of the\n * DOM node to focus when the dialog opens. If not specified, the\n * first focusable element in the dialog will receive focus.\n */\nvar aria = aria || {};\nvar tabEvent;\n\naria.Dialog = function (dialog, focusAfterClosed, focusFirst) {\n var _this = this;\n\n this.dialogNode = dialog;\n if (this.dialogNode === null || this.dialogNode.getAttribute('role') !== 'dialog') {\n throw new Error('Dialog() requires a DOM element with ARIA role of dialog.');\n }\n\n if (typeof focusAfterClosed === 'string') {\n this.focusAfterClosed = document.getElementById(focusAfterClosed);\n } else if ((typeof focusAfterClosed === 'undefined' ? 'undefined' : _typeof(focusAfterClosed)) === 'object') {\n this.focusAfterClosed = focusAfterClosed;\n } else {\n this.focusAfterClosed = null;\n }\n\n if (typeof focusFirst === 'string') {\n this.focusFirst = document.getElementById(focusFirst);\n } else if ((typeof focusFirst === 'undefined' ? 'undefined' : _typeof(focusFirst)) === 'object') {\n this.focusFirst = focusFirst;\n } else {\n this.focusFirst = null;\n }\n\n if (this.focusFirst) {\n this.focusFirst.focus();\n } else {\n _ariaUtils2.default.focusFirstDescendant(this.dialogNode);\n }\n\n this.lastFocus = document.activeElement;\n tabEvent = function tabEvent(e) {\n _this.trapFocus(e);\n };\n this.addListeners();\n};\n\naria.Dialog.prototype.addListeners = function () {\n document.addEventListener('focus', tabEvent, true);\n};\n\naria.Dialog.prototype.removeListeners = function () {\n document.removeEventListener('focus', tabEvent, true);\n};\n\naria.Dialog.prototype.closeDialog = function () {\n var _this2 = this;\n\n this.removeListeners();\n if (this.focusAfterClosed) {\n setTimeout(function () {\n _this2.focusAfterClosed.focus();\n });\n }\n};\n\naria.Dialog.prototype.trapFocus = function (event) {\n if (_ariaUtils2.default.IgnoreUtilFocusChanges) {\n return;\n }\n if (this.dialogNode.contains(event.target)) {\n this.lastFocus = event.target;\n } else {\n _ariaUtils2.default.focusFirstDescendant(this.dialogNode);\n if (this.lastFocus === document.activeElement) {\n _ariaUtils2.default.focusLastDescendant(this.dialogNode);\n }\n this.lastFocus = document.activeElement;\n }\n};\n\nexports.default = aria.Dialog;"]},"metadata":{},"sourceType":"script"} |