f2e32b90974d643ce07b3f8e0b38fe01.json
7.1 KB
{"ast":null,"code":"import * as React from 'react';\nimport { formatValue, isSameQuarter } from '../../utils/dateUtil';\nimport RangeContext from '../../RangeContext';\nimport useCellClassName from '../../hooks/useCellClassName';\nimport PanelBody from '../PanelBody';\nexport var QUARTER_COL_COUNT = 4;\nvar QUARTER_ROW_COUNT = 1;\n\nfunction QuarterBody(props) {\n var prefixCls = props.prefixCls,\n locale = props.locale,\n value = props.value,\n viewDate = props.viewDate,\n generateConfig = props.generateConfig;\n\n var _React$useContext = React.useContext(RangeContext),\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var getCellClassName = useCellClassName({\n cellPrefixCls: cellPrefixCls,\n value: value,\n generateConfig: generateConfig,\n rangedValue: rangedValue,\n hoverRangedValue: hoverRangedValue,\n isSameCell: function isSameCell(current, target) {\n return isSameQuarter(generateConfig, current, target);\n },\n isInView: function isInView() {\n return true;\n },\n offsetCell: function offsetCell(date, offset) {\n return generateConfig.addMonth(date, offset * 3);\n }\n });\n var baseQuarter = generateConfig.setDate(generateConfig.setMonth(viewDate, 0), 1);\n return /*#__PURE__*/React.createElement(PanelBody, Object.assign({}, props, {\n rowNum: QUARTER_ROW_COUNT,\n colNum: QUARTER_COL_COUNT,\n baseDate: baseQuarter,\n getCellText: function getCellText(date) {\n return formatValue(date, {\n locale: locale,\n format: locale.quarterFormat || '[Q]Q',\n generateConfig: generateConfig\n });\n },\n getCellClassName: getCellClassName,\n getCellDate: function getCellDate(date, offset) {\n return generateConfig.addMonth(date, offset * 3);\n },\n titleCell: function titleCell(date) {\n return formatValue(date, {\n locale: locale,\n format: 'YYYY-[Q]Q',\n generateConfig: generateConfig\n });\n }\n }));\n}\n\nexport default QuarterBody;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-picker/es/panels/QuarterPanel/QuarterBody.js"],"names":["React","formatValue","isSameQuarter","RangeContext","useCellClassName","PanelBody","QUARTER_COL_COUNT","QUARTER_ROW_COUNT","QuarterBody","props","prefixCls","locale","value","viewDate","generateConfig","_React$useContext","useContext","rangedValue","hoverRangedValue","cellPrefixCls","concat","getCellClassName","isSameCell","current","target","isInView","offsetCell","date","offset","addMonth","baseQuarter","setDate","setMonth","createElement","Object","assign","rowNum","colNum","baseDate","getCellText","format","quarterFormat","getCellDate","titleCell"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,sBAA3C;AACA,OAAOC,YAAP,MAAyB,oBAAzB;AACA,OAAOC,gBAAP,MAA6B,8BAA7B;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAO,IAAIC,iBAAiB,GAAG,CAAxB;AACP,IAAIC,iBAAiB,GAAG,CAAxB;;AAEA,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AAC1B,MAAIC,SAAS,GAAGD,KAAK,CAACC,SAAtB;AAAA,MACIC,MAAM,GAAGF,KAAK,CAACE,MADnB;AAAA,MAEIC,KAAK,GAAGH,KAAK,CAACG,KAFlB;AAAA,MAGIC,QAAQ,GAAGJ,KAAK,CAACI,QAHrB;AAAA,MAIIC,cAAc,GAAGL,KAAK,CAACK,cAJ3B;;AAMA,MAAIC,iBAAiB,GAAGf,KAAK,CAACgB,UAAN,CAAiBb,YAAjB,CAAxB;AAAA,MACIc,WAAW,GAAGF,iBAAiB,CAACE,WADpC;AAAA,MAEIC,gBAAgB,GAAGH,iBAAiB,CAACG,gBAFzC;;AAIA,MAAIC,aAAa,GAAG,GAAGC,MAAH,CAAUV,SAAV,EAAqB,OAArB,CAApB;AACA,MAAIW,gBAAgB,GAAGjB,gBAAgB,CAAC;AACtCe,IAAAA,aAAa,EAAEA,aADuB;AAEtCP,IAAAA,KAAK,EAAEA,KAF+B;AAGtCE,IAAAA,cAAc,EAAEA,cAHsB;AAItCG,IAA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C;AAC9C,aAAOd,cAAc,CAACe,QAAf,CAAwBF,IAAxB,EAA8BC,MAAM,GAAG,CAAvC,CAAP;AACD,KAdyE;AAe1Ee,IAAAA,SAAS,EAAE,SAASA,SAAT,CAAmBhB,IAAnB,EAAyB;AAClC,aAAO1B,WAAW,CAAC0B,IAAD,EAAO;AACvBhB,QAAAA,MAAM,EAAEA,MADe;AAEvB6B,QAAAA,MAAM,EAAE,WAFe;AAGvB1B,QAAAA,cAAc,EAAEA;AAHO,OAAP,CAAlB;AAKD;AArByE,GAAzB,CAA/B,CAApB;AAuBD;;AAED,eAAeN,WAAf","sourcesContent":["import * as React from 'react';\nimport { formatValue, isSameQuarter } from '../../utils/dateUtil';\nimport RangeContext from '../../RangeContext';\nimport useCellClassName from '../../hooks/useCellClassName';\nimport PanelBody from '../PanelBody';\nexport var QUARTER_COL_COUNT = 4;\nvar QUARTER_ROW_COUNT = 1;\n\nfunction QuarterBody(props) {\n var prefixCls = props.prefixCls,\n locale = props.locale,\n value = props.value,\n viewDate = props.viewDate,\n generateConfig = props.generateConfig;\n\n var _React$useContext = React.useContext(RangeContext),\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var getCellClassName = useCellClassName({\n cellPrefixCls: cellPrefixCls,\n value: value,\n generateConfig: generateConfig,\n rangedValue: rangedValue,\n hoverRangedValue: hoverRangedValue,\n isSameCell: function isSameCell(current, target) {\n return isSameQuarter(generateConfig, current, target);\n },\n isInView: function isInView() {\n return true;\n },\n offsetCell: function offsetCell(date, offset) {\n return generateConfig.addMonth(date, offset * 3);\n }\n });\n var baseQuarter = generateConfig.setDate(generateConfig.setMonth(viewDate, 0), 1);\n return /*#__PURE__*/React.createElement(PanelBody, Object.assign({}, props, {\n rowNum: QUARTER_ROW_COUNT,\n colNum: QUARTER_COL_COUNT,\n baseDate: baseQuarter,\n getCellText: function getCellText(date) {\n return formatValue(date, {\n locale: locale,\n format: locale.quarterFormat || '[Q]Q',\n generateConfig: generateConfig\n });\n },\n getCellClassName: getCellClassName,\n getCellDate: function getCellDate(date, offset) {\n return generateConfig.addMonth(date, offset * 3);\n },\n titleCell: function titleCell(date) {\n return formatValue(date, {\n locale: locale,\n format: 'YYYY-[Q]Q',\n generateConfig: generateConfig\n });\n }\n }));\n}\n\nexport default QuarterBody;"]},"metadata":{},"sourceType":"module"}