PromoCursed/node_modules/.cache/babel-loader/26f9c3f4cceb50adfb64a7e12b1a109366664b9dda71e825055bbd421b6e47e4.json
2024-08-20 23:25:37 +04:00

1 line
6.6 KiB
JSON

{"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;\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] :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