8eb540ac434254c9887b7b16cbcc30cd.json
7.09 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nexport var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];\nexport var responsiveMap = {\n xs: '(max-width: 575px)',\n sm: '(min-width: 576px)',\n md: '(min-width: 768px)',\n lg: '(min-width: 992px)',\n xl: '(min-width: 1200px)',\n xxl: '(min-width: 1600px)'\n};\nvar subscribers = new Map();\nvar subUid = -1;\nvar screens = {};\nvar responsiveObserve = {\n matchHandlers: {},\n dispatch: function dispatch(pointMap) {\n screens = pointMap;\n subscribers.forEach(function (func) {\n return func(screens);\n });\n return subscribers.size >= 1;\n },\n subscribe: function subscribe(func) {\n if (!subscribers.size) this.register();\n subUid += 1;\n subscribers.set(subUid, func);\n func(screens);\n return subUid;\n },\n unsubscribe: function unsubscribe(token) {\n subscribers[\"delete\"](token);\n if (!subscribers.size) this.unregister();\n },\n unregister: function unregister() {\n var _this = this;\n\n Object.keys(responsiveMap).forEach(function (screen) {\n var matchMediaQuery = responsiveMap[screen];\n var handler = _this.matchHandlers[matchMediaQuery];\n handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);\n });\n subscribers.clear();\n },\n register: function register() {\n var _this2 = this;\n\n Object.keys(responsiveMap).forEach(function (screen) {\n var matchMediaQuery = responsiveMap[screen];\n\n var listener = function listener(_ref) {\n var matches = _ref.matches;\n\n _this2.dispatch(_extends(_extends({}, screens), _defineProperty({}, screen, matches)));\n };\n\n var mql = window.matchMedia(matchMediaQuery);\n mql.addListener(listener);\n _this2.matchHandlers[matchMediaQuery] = {\n mql: mql,\n listener: listener\n };\n listener(mql);\n });\n }\n};\nexport default responsiveObserve;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/_util/responsiveObserve.js"],"names":["_defineProperty","_extends","responsiveArray","responsiveMap","xs","sm","md","lg","xl","xxl","subscribers","Map","subUid","screens","responsiveObserve","matchHandlers","dispatch","pointMap","forEach","func","size","subscribe","register","set","unsubscribe","token","unregister","_this","Object","keys","screen","matchMediaQuery","handler","mql","removeListener","listener","clear","_this2","_ref","matches","window","matchMedia","addListener"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;AACA,OAAO,IAAIC,eAAe,GAAG,CAAC,KAAD,EAAQ,IAAR,EAAc,IAAd,EAAoB,IAApB,EAA0B,IAA1B,EAAgC,IAAhC,CAAtB;AACP,OAAO,IAAIC,aAAa,GAAG;AACzBC,EAAAA,EAAE,EAAE,oBADqB;AAEzBC,EAAAA,EAAE,EAAE,oBAFqB;AAGzBC,EAAAA,EAAE,EAAE,oBAHqB;AAIzBC,EAAAA,EAAE,EAAE,oBAJqB;AAKzBC,EAAAA,EAAE,EAAE,qBALqB;AAMzBC,EAAAA,GAAG,EAAE;AANoB,CAApB;AAQP,IAAIC,WAAW,GAAG,IAAIC,GAAJ,EAAlB;AACA,IAAIC,MAAM,GAAG,CAAC,CAAd;AACA,IAAIC,OAAO,GAAG,EAAd;AACA,IAAIC,iBAAiB,GAAG;AACtBC,EAAAA,aAAa,EAAE,EADO;AAEtBC,EAAAA,QAAQ,EAAE,SAASA,QAAT,CAAkBC,QAAlB,EAA4B;AACpCJ,IAAAA,OAAO,GAAGI,QAAV;AACAP,IAAAA,WAAW,CAACQ,OAAZ,CAAoB,UAAUC,IAAV,EAAgB;AAClC,aAAOA,IAAI,CAACN,OAAD,CAAX;AACD,KAFD;AAGA,WAAOH,WAAW,CAACU,IAAZ,IAAoB,CAA3B;AACD,GARqB;AAStBC,EAAAA,SAAS,EAAE,SAASA,SAAT,CAAmBF,IAAnB,EAAyB;AAClC,QAAI,CAACT,WAAW,CAACU,IAAjB,EAAuB,KAAKE,QAAL;AACvBV,IAAAA,MAAM,IAAI,CAAV;AACAF,IAAAA,WAAW,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nB;;AAEAF,QAAAA,MAAM,CAACrB,QAAP,CAAgBf,QAAQ,CAACA,QAAQ,CAAC,EAAD,EAAKY,OAAL,CAAT,EAAwBb,eAAe,CAAC,EAAD,EAAK8B,MAAL,EAAaS,OAAb,CAAvC,CAAxB;AACD,OAJD;;AAMA,UAAIN,GAAG,GAAGO,MAAM,CAACC,UAAP,CAAkBV,eAAlB,CAAV;AACAE,MAAAA,GAAG,CAACS,WAAJ,CAAgBP,QAAhB;AACAE,MAAAA,MAAM,CAACtB,aAAP,CAAqBgB,eAArB,IAAwC;AACtCE,QAAAA,GAAG,EAAEA,GADiC;AAEtCE,QAAAA,QAAQ,EAAEA;AAF4B,OAAxC;AAIAA,MAAAA,QAAQ,CAACF,GAAD,CAAR;AACD,KAhBD;AAiBD;AAlDqB,CAAxB;AAoDA,eAAenB,iBAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nexport var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];\nexport var responsiveMap = {\n xs: '(max-width: 575px)',\n sm: '(min-width: 576px)',\n md: '(min-width: 768px)',\n lg: '(min-width: 992px)',\n xl: '(min-width: 1200px)',\n xxl: '(min-width: 1600px)'\n};\nvar subscribers = new Map();\nvar subUid = -1;\nvar screens = {};\nvar responsiveObserve = {\n matchHandlers: {},\n dispatch: function dispatch(pointMap) {\n screens = pointMap;\n subscribers.forEach(function (func) {\n return func(screens);\n });\n return subscribers.size >= 1;\n },\n subscribe: function subscribe(func) {\n if (!subscribers.size) this.register();\n subUid += 1;\n subscribers.set(subUid, func);\n func(screens);\n return subUid;\n },\n unsubscribe: function unsubscribe(token) {\n subscribers[\"delete\"](token);\n if (!subscribers.size) this.unregister();\n },\n unregister: function unregister() {\n var _this = this;\n\n Object.keys(responsiveMap).forEach(function (screen) {\n var matchMediaQuery = responsiveMap[screen];\n var handler = _this.matchHandlers[matchMediaQuery];\n handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);\n });\n subscribers.clear();\n },\n register: function register() {\n var _this2 = this;\n\n Object.keys(responsiveMap).forEach(function (screen) {\n var matchMediaQuery = responsiveMap[screen];\n\n var listener = function listener(_ref) {\n var matches = _ref.matches;\n\n _this2.dispatch(_extends(_extends({}, screens), _defineProperty({}, screen, matches)));\n };\n\n var mql = window.matchMedia(matchMediaQuery);\n mql.addListener(listener);\n _this2.matchHandlers[matchMediaQuery] = {\n mql: mql,\n listener: listener\n };\n listener(mql);\n });\n }\n};\nexport default responsiveObserve;"]},"metadata":{},"sourceType":"module"}