PromoCursed/node_modules/.cache/babel-loader/26f9c3f4cceb50adfb64a7e12b1a109366664b9dda71e825055bbd421b6e47e4.json

1 line
6.6 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nexport function leftPad(str, length) {\n var fill = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';\n var current = String(str);\n while (current.length < length) {\n current = \"\".concat(fill).concat(current);\n }\n return current;\n}\n\n/**\n * Convert `value` to array. Will provide `[]` if is null or undefined.\n */\nexport function toArray(val) {\n if (val === null || val === undefined) {\n return [];\n }\n return Array.isArray(val) ? val : [val];\n}\nexport function fillIndex(ori, index, value) {\n var clone = _toConsumableArray(ori);\n clone[index] = value;\n return clone;\n}\n\n/** Pick props from the key list. Will filter empty value */\nexport function pickProps(props, keys) {\n var clone = {};\n var mergedKeys = keys || Object.keys(props);\n mergedKeys.forEach(function (key) {\n if (props[key] !== undefined) {\n clone[key] = props[key];\n }\n });\n return clone;\n}\nexport function getRowFormat(picker, locale, format) {\n if (format) {\n return format;\n }\n switch (picker) {\n // All from the `locale.fieldXXXFormat` first\n case 'time':\n return locale.fieldTimeFormat;\n case 'datetime':\n return locale.fieldDateTimeFormat;\n case 'month':\n return locale.fieldMonthFormat;\n case 'year':\n return locale.fieldYearFormat;\n case 'quarter':\n return locale.fieldQuarterFormat;\n case 'week':\n return locale.fieldWeekFormat;\n default:\n return locale.fieldDateFormat;\n }\n}\nexport function getFromDate(calendarValues, activeIndexList, activeIndex) {\n var mergedActiveIndex = activeIndex !== undefined ? activeIndex : activeIndexList[activeIndexList.length - 1];\n var firstValuedIndex = activeIndexList.find(function (index) {\n return calendarValues[index];\n });\n return mergedActiveIndex !== firstValuedIndex ? calendarValues[firstValuedIndex] : undefined;\n}","map":{"version":3,"names":["_toConsumableArray","leftPad","str","length","fill","arguments","undefined","current","String","concat","toArray","val","Array","isArray","fillIndex","ori","index","value","clone","pickProps","props","keys","mergedKeys","Object","forEach","key","getRowFormat","picker","locale","format","fieldTimeFormat","fieldDateTimeFormat","fieldMonthFormat","fieldYearFormat","fieldQuarterFormat","fieldWeekFormat","fieldDateFormat","getFromDate","calendarValues","activeIndexList","activeIndex","mergedActiveIndex","firstValuedIndex","find"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-picker/es/utils/miscUtil.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nexport function leftPad(str, length) {\n var fill = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';\n var current = String(str);\n while (current.length < length) {\n current = \"\".concat(fill).concat(current);\n }\n return current;\n}\n\n/**\n * Convert `value` to array. Will provide `[]` if is null or undefined.\n */\nexport function toArray(val) {\n if (val === null || val === undefined) {\n return [];\n }\n return Array.isArray(val) ? val : [val];\n}\nexport function fillIndex(ori, index, value) {\n var clone = _toConsumableArray(ori);\n clone[index] = value;\n return clone;\n}\n\n/** Pick props from the key list. Will filter empty value */\nexport function pickProps(props, keys) {\n var clone = {};\n var mergedKeys = keys || Object.keys(props);\n mergedKeys.forEach(function (key) {\n if (props[key] !== undefined) {\n clone[key] = props[key];\n }\n });\n return clone;\n}\nexport function getRowFormat(picker, locale, format) {\n if (format) {\n return format;\n }\n switch (picker) {\n // All from the `locale.fieldXXXFormat` first\n case 'time':\n return locale.fieldTimeFormat;\n case 'datetime':\n return locale.fieldDateTimeFormat;\n case 'month':\n return locale.fieldMonthFormat;\