65f4ba865c7133abc87e68f65188d610.json
7.51 KB
{"ast":null,"code":"import * as React from 'react';\nimport MonthHeader from './MonthHeader';\nimport MonthBody, { MONTH_COL_COUNT } from './MonthBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\n\nfunction MonthPanel(props) {\n var prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n onViewDateChange = props.onViewDateChange,\n generateConfig = props.generateConfig,\n value = props.value,\n viewDate = props.viewDate,\n onPanelChange = props.onPanelChange,\n _onSelect = props.onSelect;\n var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\"); // ======================= Keyboard =======================\n\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff * MONTH_COL_COUNT), 'key');\n },\n onEnter: function onEnter() {\n onPanelChange('date', value || viewDate);\n }\n });\n }\n }; // ==================== View Operation ====================\n\n var onYearChange = function onYearChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(MonthHeader, Object.assign({}, props, {\n prefixCls: prefixCls,\n onPrevYear: function onPrevYear() {\n onYearChange(-1);\n },\n onNextYear: function onNextYear() {\n onYearChange(1);\n },\n onYearClick: function onYearClick() {\n onPanelChange('year', viewDate);\n }\n })), /*#__PURE__*/React.createElement(MonthBody, Object.assign({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n _onSelect(date, 'mouse');\n\n onPanelChange('date', date);\n }\n })));\n}\n\nexport default MonthPanel;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-picker/es/panels/MonthPanel/index.js"],"names":["React","MonthHeader","MonthBody","MONTH_COL_COUNT","createKeyDownHandler","MonthPanel","props","prefixCls","operationRef","onViewDateChange","generateConfig","value","viewDate","onPanelChange","_onSelect","onSelect","panelPrefixCls","concat","current","onKeyDown","event","onLeftRight","diff","addMonth","onCtrlLeftRight","addYear","onUpDown","onEnter","onYearChange","newDate","createElement","className","Object","assign","onPrevYear","onNextYear","onYearClick","date"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,SAAP,IAAoBC,eAApB,QAA2C,aAA3C;AACA,SAASC,oBAAT,QAAqC,oBAArC;;AAEA,SAASC,UAAT,CAAoBC,KAApB,EAA2B;AACzB,MAAIC,SAAS,GAAGD,KAAK,CAACC,SAAtB;AAAA,MACIC,YAAY,GAAGF,KAAK,CAACE,YADzB;AAAA,MAEIC,gBAAgB,GAAGH,KAAK,CAACG,gBAF7B;AAAA,MAGIC,cAAc,GAAGJ,KAAK,CAACI,cAH3B;AAAA,MAIIC,KAAK,GAAGL,KAAK,CAACK,KAJlB;AAAA,MAKIC,QAAQ,GAAGN,KAAK,CAACM,QALrB;AAAA,MAMIC,aAAa,GAAGP,KAAK,CAACO,aAN1B;AAAA,MAOIC,SAAS,GAAGR,KAAK,CAACS,QAPtB;AAQA,MAAIC,cAAc,GAAG,GAAGC,MAAH,CAAUV,SAAV,EAAqB,cAArB,CAArB,CATyB,CASkC;;AAE3DC,EAAAA,YAAY,CAACU,OAAb,GAAuB;AACrBC,IAAAA,SAAS,EAAE,SAASA,SAAT,CAAmBC,KAAnB,EAA0B;AACnC,aAAOhB,oBAAoB,CAACgB,KAAD,EAAQ;AACjCC,QAAAA,WAAW,EAAE,SAASA,WAAT,CAAqBC,IAArB,EAA2B;AACtCR,UAAAA,SAAS,CAACJ,cAAc,CAACa,QAAf,CAAwBZ,KAAK,IAAIC,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AZ;AACD,KAJuE;AAKxEO,IAAAA,UAAU,EAAE,SAASA,UAAT,GAAsB;AAChCP,MAAAA,YAAY,CAAC,CAAD,CAAZ;AACD,KAPuE;AAQxEQ,IAAAA,WAAW,EAAE,SAASA,WAAT,GAAuB;AAClCvB,MAAAA,aAAa,CAAC,MAAD,EAASD,QAAT,CAAb;AACD;AAVuE,GAAzB,CAAjC,CAFI,EAaf,aAAaZ,KAAK,CAAC8B,aAAN,CAAoB5B,SAApB,EAA+B8B,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB3B,KAAlB,EAAyB;AACxEC,IAAAA,SAAS,EAAEA,SAD6D;AAExEQ,IAAAA,QAAQ,EAAE,SAASA,QAAT,CAAkBsB,IAAlB,EAAwB;AAChCvB,MAAAA,SAAS,CAACuB,IAAD,EAAO,OAAP,CAAT;;AAEAxB,MAAAA,aAAa,CAAC,MAAD,EAASwB,IAAT,CAAb;AACD;AANuE,GAAzB,CAA/B,CAbE,CAApB;AAqBD;;AAED,eAAehC,UAAf","sourcesContent":["import * as React from 'react';\nimport MonthHeader from './MonthHeader';\nimport MonthBody, { MONTH_COL_COUNT } from './MonthBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\n\nfunction MonthPanel(props) {\n var prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n onViewDateChange = props.onViewDateChange,\n generateConfig = props.generateConfig,\n value = props.value,\n viewDate = props.viewDate,\n onPanelChange = props.onPanelChange,\n _onSelect = props.onSelect;\n var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\"); // ======================= Keyboard =======================\n\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff * MONTH_COL_COUNT), 'key');\n },\n onEnter: function onEnter() {\n onPanelChange('date', value || viewDate);\n }\n });\n }\n }; // ==================== View Operation ====================\n\n var onYearChange = function onYearChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(MonthHeader, Object.assign({}, props, {\n prefixCls: prefixCls,\n onPrevYear: function onPrevYear() {\n onYearChange(-1);\n },\n onNextYear: function onNextYear() {\n onYearChange(1);\n },\n onYearClick: function onYearClick() {\n onPanelChange('year', viewDate);\n }\n })), /*#__PURE__*/React.createElement(MonthBody, Object.assign({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n _onSelect(date, 'mouse');\n\n onPanelChange('date', date);\n }\n })));\n}\n\nexport default MonthPanel;"]},"metadata":{},"sourceType":"module"}