PromoCursed/node_modules/.cache/babel-loader/1c0bc396d2e3d3ec066e37eaf94ecf928b1e3c9ca1b22aea2aeb22a5c6900805.json

1 line
8.3 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport React from 'react';\nexport function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {\n var timeFormat = '';\n\n // Base HH:mm:ss\n var cells = [];\n if (showHour) {\n cells.push(showMeridiem ? 'hh' : 'HH');\n }\n if (showMinute) {\n cells.push('mm');\n }\n if (showSecond) {\n cells.push('ss');\n }\n timeFormat = cells.join(':');\n\n // Millisecond\n if (showMillisecond) {\n timeFormat += '.SSS';\n }\n\n // Meridiem\n if (showMeridiem) {\n timeFormat += ' A';\n }\n return timeFormat;\n}\n\n/**\n * Used for `useFilledProps` since it already in the React.useMemo\n */\nfunction fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {\n // Not fill `monthFormat` since `locale.shortMonths` handle this\n // Not fill `cellMeridiemFormat` since AM & PM by default\n var fieldDateTimeFormat = locale.fieldDateTimeFormat,\n fieldDateFormat = locale.fieldDateFormat,\n fieldTimeFormat = locale.fieldTimeFormat,\n fieldMonthFormat = locale.fieldMonthFormat,\n fieldYearFormat = locale.fieldYearFormat,\n fieldWeekFormat = locale.fieldWeekFormat,\n fieldQuarterFormat = locale.fieldQuarterFormat,\n yearFormat = locale.yearFormat,\n cellYearFormat = locale.cellYearFormat,\n cellQuarterFormat = locale.cellQuarterFormat,\n dayFormat = locale.dayFormat,\n cellDateFormat = locale.cellDateFormat;\n var timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);\n return _objectSpread(_objectSpread({}, locale), {}, {\n fieldDateTimeFormat: fieldDateTimeFormat || \"YYYY-MM-DD \".concat(timeFormat),\n fieldDateFormat: fieldDateFormat || 'YYYY-MM-DD',\n fieldTimeFormat: fieldTimeFormat || timeFormat,\n fieldMonthFormat: fieldMonthFormat || 'YYYY-MM',\n fieldYearFormat: fieldYearFormat || 'YYYY',\n fieldWeekFormat: fieldWeekFormat || 'gggg-wo',\n fieldQuarterFormat: fieldQuarterFormat || 'YYYY-[Q]Q',\n yearFormat: yearFormat || 'YYYY',\n cellYearFormat: cellYearFormat || 'YYYY',\n cellQuarterFormat: cellQuarterFormat || '[Q]Q',\n cellDateFormat: cellDateFormat || dayFormat || 'D'\n });\n}\n\n/**\n * Fill locale format as start up\n */\nexport default function useLocale(locale, showProps) {\n var showHour = showProps.showHour,\n showMinute = showProps.showMinute,\n showSecond = showProps.showSecond,\n showMillisecond = showProps.showMillisecond,\n use12Hours = showProps.use12Hours;\n return React.useMemo(function () {\n return fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours);\n }, [locale, showHour, showMinute, showSecond, showMillisecond, use12Hours]);\n}","map":{"version":3,"names":["_objectSpread","React","fillTimeFormat","showHour","showMinute","showSecond","showMillisecond","showMeridiem","timeFormat","cells","push","join","fillLocale","locale","use12Hours","fieldDateTimeFormat","fieldDateFormat","fieldTimeFormat","fieldMonthFormat","fieldYearFormat","fieldWeekFormat","fieldQuarterFormat","yearFormat","cellYearFormat","cellQuarterFormat","dayFormat","cellDateFormat","concat","useLocale","showProps","useMemo"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-picker/es/hooks/useLocale.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport React from 'react';\nexport function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {\n var timeFormat = '';\n\n // Base HH:mm:ss\n var cells = [];\n if (showHour) {\n cells.push(showMeridiem ? 'hh' : 'HH');\n }\n if (showMinute) {\n cells.push('mm');\n }\n if (showSecond) {\n cells.push('ss');\n }\n timeFormat = cells.join(':');\n\n // Millisecond\n if (showMillisecond) {\n timeFormat += '.SSS';\n }\n\n // Meridiem\n if (showMeridiem) {\n timeFormat += ' A';\n }\n return timeFormat;\n}\n\n/**\n * Used for `useFilledProps` since it a