1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { formatValue } from \"../../utils/dateUtil\";\nimport { PanelContext, useInfo } from \"../context\";\nimport PanelBody from \"../PanelBody\";\nimport PanelHeader from \"../PanelHeader\";\nexport default function MonthPanel(props) {\n var prefixCls = props.prefixCls,\n locale = props.locale,\n generateConfig = props.generateConfig,\n pickerValue = props.pickerValue,\n disabledDate = props.disabledDate,\n onPickerValueChange = props.onPickerValueChange,\n onModeChange = props.onModeChange;\n var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\");\n\n // ========================== Base ==========================\n var _useInfo = useInfo(props, 'month'),\n _useInfo2 = _slicedToArray(_useInfo, 1),\n info = _useInfo2[0];\n var baseDate = generateConfig.setMonth(pickerValue, 0);\n\n // ========================= Month ==========================\n var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);\n\n // ========================= Cells ==========================\n var getCellDate = function getCellDate(date, offset) {\n return generateConfig.addMonth(date, offset);\n };\n var getCellText = function getCellText(date) {\n var month = generateConfig.getMonth(date);\n return locale.monthFormat ? formatValue(date, {\n locale: locale,\n format: locale.monthFormat,\n generateConfig: generateConfig\n }) : monthsLocale[month];\n };\n var getCellClassName = function getCellClassName() {\n return _defineProperty({}, \"\".concat(prefixCls, \"-cell-in-view\"), true);\n };\n\n // ======================== Disabled ========================\n var mergedDisabledDate = disabledDate ? function (currentDate, disabledInfo) {\n var startDate = generateConfig.setDate(currentDate, 1);\n var nextMonthStartDate = generateConfig.setMonth(startDate, generateConfig.getMonth(startDate) + 1);\n var endDate = generateConfig.addDate(nextMonthStartDate, -1);\n return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);\n } : null;\n\n // ========================= Header =========================\n var yearNode = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n key: \"year\",\n \"aria-label\": \"year panel\",\n onClick: function onClick() {\n onModeChange('year');\n },\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-year-btn\")\n }, formatValue(pickerValue, {\n locale: locale,\n format: locale.yearFormat,\n generateConfig: generateConfig\n }));\n\n // ========================= Render =========================\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: info\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(PanelHeader, {\n superOffset: function superOffset(distance) {\n return generateConfig.addYear(pickerValue, distance);\n },\n onChange: onPickerValueChange\n // Limitation\n ,\n\n getStart: function getStart(date) {\n return generateConfig.setMonth(date, 0);\n },\n getEnd: function getEnd(date) {\n return generateConfig.setMonth(date, 11);\n }\n }, yearNode), /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n disabledDate: mergedDisabledDate,\n titleFormat: locale.fieldMonthFormat,\n colNum: 3,\n rowNum: 4,\n baseDate: baseDate\n // Body\n ,\n\n getCellDate: getCellDate,\n getCellText: getCellText,\n getCellClassName: getCellClassName\n }))));\n}","map":{"version":3,"names":["_extends","_defineProperty","_slicedToArray","React","formatValue","PanelContext","useInfo","PanelBody","PanelHeader","MonthPanel","props","prefixCls","locale","generateConfig","pickerValue","disabledDate","onPickerValueChange","onModeChange","panelPrefixCls","concat","_useInfo","_useInfo2","info","baseDate","setMonth","monthsLocale","shortMonths","getShortMonths","getCellDate","date","offset","addMonth","getCellText","month","getMonth","monthFormat","format","getCellClassName","mergedDisabledDate","currentDate","disabledInfo","startDate","setDate","nextMonthStartDate","endDate","addDate","yearNode","createElement","type","key","onClick","tabIndex","className","yearFormat","Provider","value","superOffset","distance","addYear","onChange","getStart","getEnd","titleFormat","fieldMonthFormat","colNum","rowNum"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-picker/es/PickerPanel/MonthPanel/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { formatValue } from \"../../utils/dateUtil\";\nimport { PanelContext, useInfo } from \"../context\";\nimport PanelBody from \"../PanelBody\";\nimport PanelHeader from \"../PanelHeader\";\nexport default function MonthPanel(props) {\n var prefixCls = props.prefixCls,\n locale = props.locale,\n generateConfig = props.generateConfig,\n pickerValue = props.pickerValue,\n disabledDate = props.disabledDate,\n onPickerValueChange = props.onPickerValueChange,\n onModeChange = props.onModeChange;\n var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\");\n\n // ========================== Base ==========================\n var _useInfo = useInfo(props, 'month'),\n _useInfo2 = _slicedToArray(_useInfo, 1),\n info = _useInfo2[0];\n var baseDate = generateConfig.setMonth(pickerValue, 0);\n\n // ========================= Month ==========================\n var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);\n\n // ========================= Cells ==========================\n var getCellDate = function getCellDate(date, offset) {\n return generateConfig.addMonth(date, offset);\n };\n var getCellText = function getCellText(date) {\n var month = generateConfig.getMonth(date);\n return locale.monthFormat ? formatValue(date, {\n locale: locale,\n format: locale.monthFormat,\n generateConfig: generateConfig\n }) : monthsLocale[month];\n };\n var getCellClassName = function getCellClassName() {\n return _defineProperty({}, \"\".concat(prefixCls, \"-cell-in-view\"), true);\n };\n\n // ======================== Disabled ========================\n var mergedDisabledDate = disabledDate ? function (currentDate, disabledInfo) {\n var startDate = generateConfig.setDate(currentDate, 1);\n var nextMonthStartDate = generateConfig.setMonth(startDate, generateConfig.getMonth(startDate) + 1);\n var endDate = generateConfig.addDate(nextMonthStartDate, -1);\n return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);\n } : null;\n\n // ========================= Header =========================\n var yearNode = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n key: \"year\",\n \"aria-label\": \"year panel\",\n onClick: function onClick() {\n onModeChange('year');\n },\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-year-btn\")\n }, formatValue(pickerValue, {\n locale: locale,\n format: locale.yearFormat,\n generateConfig: generateConfig\n }));\n\n // ========================= Render =========================\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: info\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(PanelHeader, {\n superOffset: function superOffset(distance) {\n return generateConfig.addYear(pickerValue, distance);\n },\n onChange: onPickerValueChange\n // Limitation\n ,\n getStart: function getStart(date) {\n return generateConfig.setMonth(date, 0);\n },\n getEnd: function getEnd(date) {\n return generateConfig.setMonth(date, 11);\n }\n }, yearNode), /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n disabledDate: mergedDisabledDate,\n titleFormat: locale.fieldMonthFormat,\n colNum: 3,\n rowNum: 4,\n baseDate: baseDate\n // Body\n ,\n getCellDate: getCellDate,\n getCellText: getCellText,\n getCellClassName: getCellClassName\n }))));\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,YAAY,EAAEC,OAAO,QAAQ,YAAY;AAClD,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,WAAW,MAAM,gBAAgB;AACxC,eAAe,SAASC,UAAUA,CAACC,KAAK,EAAE;EACxC,IAAIC,SAAS,GAAGD,KAAK,CAACC,SAAS;IAC7BC,MAAM,GAAGF,KAAK,CAACE,MAAM;IACrBC,cAAc,GAAGH,KAAK,CAACG,cAAc;IACrCC,WAAW,GAAGJ,KAAK,CAACI,WAAW;IAC/BC,YAAY,GAAGL,KAAK,CAACK,YAAY;IACjCC,mBAAm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