b714578ab3e9b36ee00817762d85f82e.json
7.01 KB
{"ast":null,"code":"import * as React from 'react';\nimport QuarterHeader from './QuarterHeader';\nimport QuarterBody from './QuarterBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\n\nfunction QuarterPanel(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, \"-quarter-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 * 3), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\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(QuarterHeader, 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(QuarterBody, Object.assign({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n _onSelect(date, 'mouse');\n }\n })));\n}\n\nexport default QuarterPanel;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-picker/es/panels/QuarterPanel/index.js"],"names":["React","QuarterHeader","QuarterBody","createKeyDownHandler","QuarterPanel","props","prefixCls","operationRef","onViewDateChange","generateConfig","value","viewDate","onPanelChange","_onSelect","onSelect","panelPrefixCls","concat","current","onKeyDown","event","onLeftRight","diff","addMonth","onCtrlLeftRight","addYear","onUpDown","onYearChange","newDate","createElement","className","Object","assign","onPrevYear","onNextYear","onYearClick","date"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA,SAASC,oBAAT,QAAqC,oBAArC;;AAEA,SAASC,YAAT,CAAsBC,KAAtB,EAA6B;AAC3B,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,gBAArB,CAArB,CAT2B,CASkC;;AAE7DC,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,QAAjC,EAA2CU,IAAI,GAAG,CAAlD,CAAD,EAAuD,KAAvD,CAAT;AACD,SAHgC;AAIjCE,QAAAA,eAAe,EAAE,SA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AAnC,CAFI,EAaf,aAAaX,KAAK,CAAC4B,aAAN,CAAoB1B,WAApB,EAAiC4B,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB1B,KAAlB,EAAyB;AAC1EC,IAAAA,SAAS,EAAEA,SAD+D;AAE1EQ,IAAAA,QAAQ,EAAE,SAASA,QAAT,CAAkBqB,IAAlB,EAAwB;AAChCtB,MAAAA,SAAS,CAACsB,IAAD,EAAO,OAAP,CAAT;AACD;AAJyE,GAAzB,CAAjC,CAbE,CAApB;AAmBD;;AAED,eAAe/B,YAAf","sourcesContent":["import * as React from 'react';\nimport QuarterHeader from './QuarterHeader';\nimport QuarterBody from './QuarterBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\n\nfunction QuarterPanel(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, \"-quarter-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 * 3), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\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(QuarterHeader, 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(QuarterBody, Object.assign({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n _onSelect(date, 'mouse');\n }\n })));\n}\n\nexport default QuarterPanel;"]},"metadata":{},"sourceType":"module"}