1 line
10 KiB
JSON
1 line
10 KiB
JSON
{"ast":null,"code":"import * as React from 'react';\nimport useSelectIcons from '../select/useIcons';\nexport function getPlaceholder(locale, picker, customizePlaceholder) {\n if (customizePlaceholder !== undefined) {\n return customizePlaceholder;\n }\n if (picker === 'year' && locale.lang.yearPlaceholder) {\n return locale.lang.yearPlaceholder;\n }\n if (picker === 'quarter' && locale.lang.quarterPlaceholder) {\n return locale.lang.quarterPlaceholder;\n }\n if (picker === 'month' && locale.lang.monthPlaceholder) {\n return locale.lang.monthPlaceholder;\n }\n if (picker === 'week' && locale.lang.weekPlaceholder) {\n return locale.lang.weekPlaceholder;\n }\n if (picker === 'time' && locale.timePickerLocale.placeholder) {\n return locale.timePickerLocale.placeholder;\n }\n return locale.lang.placeholder;\n}\nexport function getRangePlaceholder(locale, picker, customizePlaceholder) {\n if (customizePlaceholder !== undefined) {\n return customizePlaceholder;\n }\n if (picker === 'year' && locale.lang.yearPlaceholder) {\n return locale.lang.rangeYearPlaceholder;\n }\n if (picker === 'quarter' && locale.lang.quarterPlaceholder) {\n return locale.lang.rangeQuarterPlaceholder;\n }\n if (picker === 'month' && locale.lang.monthPlaceholder) {\n return locale.lang.rangeMonthPlaceholder;\n }\n if (picker === 'week' && locale.lang.weekPlaceholder) {\n return locale.lang.rangeWeekPlaceholder;\n }\n if (picker === 'time' && locale.timePickerLocale.placeholder) {\n return locale.timePickerLocale.rangePlaceholder;\n }\n return locale.lang.rangePlaceholder;\n}\nexport function transPlacement2DropdownAlign(direction, placement) {\n const overflow = {\n adjustX: 1,\n adjustY: 1\n };\n switch (placement) {\n case 'bottomLeft':\n {\n return {\n points: ['tl', 'bl'],\n offset: [0, 4],\n overflow\n };\n }\n case 'bottomRight':\n {\n return {\n points: ['tr', 'br'],\n offset: [0, 4],\n overflow\n };\n }\n case 'topLeft':\n {\n return {\n points: ['bl', 'tl'],\n offset: [0, -4],\n overflow\n };\n }\n case 'topRight':\n {\n return {\n points: ['br', 'tr'],\n offset: [0, -4],\n overflow\n };\n }\n default:\n {\n return {\n points: direction === 'rtl' ? ['tr', 'br'] : ['tl', 'bl'],\n offset: [0, 4],\n overflow\n };\n }\n }\n}\nexport function useIcons(props, prefixCls) {\n const {\n allowClear = true\n } = props;\n const {\n clearIcon,\n removeIcon\n } = useSelectIcons(Object.assign(Object.assign({}, props), {\n prefixCls,\n componentName: 'DatePicker'\n }));\n const mergedAllowClear = React.useMemo(() => {\n if (allowClear === false) {\n return false;\n }\n const allowClearConfig = allowClear === true ? {} : allowClear;\n return Object.assign({\n clearIcon: clearIcon\n }, allowClearConfig);\n }, [allowClear, clearIcon]);\n return [mergedAllowClear, removeIcon];\n}","map":{"version":3,"names":["React","useSelectIcons","getPlaceholder","locale","picker","customizePlaceholder","undefined","lang","yearPlaceholder","quarterPlaceholder","monthPlaceholder","weekPlaceholder","timePickerLocale","placeholder","getRangePlaceholder","rangeYearPlaceholder","rangeQuarterPlaceholder","rangeMonthPlaceholder","rangeWeekPlaceholder","rangePlaceholder","transPlacement2DropdownAlign","direction","placement","overflow","adjustX","adjustY","points","offset","useIcons","props","prefixCls","allowClear","clearIcon","removeIcon","Object","assign","componentName","mergedAllowClear","useMemo","allowClearConfig"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/date-picker/util.js"],"sourcesContent":["import * as React from 'react';\nimport useSelectIcons from '../select/useIcons';\nexport function getPlaceholder(locale, picker, customizePlaceholder) {\n if (customizePlaceholder !== undefined) {\n return customizePlaceholder;\n }\n if (picker === 'year' && locale.lang.yearPlaceholder) {\n return locale.lang.yearPlaceholder;\n }\n if (picker === 'quarter' && locale.lang.quarterPlaceholder) {\n return locale.lang.quarterPlaceholder;\n }\n if (picker === 'month' && locale.lang.monthPlaceholder) {\n return locale.lang.monthPlaceholder;\n }\n if (picker === 'week' && locale.lang.weekPlaceholder) {\n return locale.lang.weekPlaceholder;\n }\n if (picker === 'time' && locale.timePickerLocale.placeholder) {\n return locale.timePickerLocale.placeholder;\n }\n return locale.lang.placeholder;\n}\nexport function getRangePlaceholder(locale, picker, customizePlaceholder) {\n if (customizePlaceholder !== undefined) {\n return customizePlaceholder;\n }\n if (picker === 'year' && locale.lang.yearPlaceholder) {\n return locale.lang.rangeYearPlaceholder;\n }\n if (picker === 'quarter' && locale.lang.quarterPlaceholder) {\n return locale.lang.rangeQuarterPlaceholder;\n }\n if (picker === 'month' && locale.lang.monthPlaceholder) {\n return locale.lang.rangeMonthPlaceholder;\n }\n if (picker === 'week' && locale.lang.weekPlaceholder) {\n return locale.lang.rangeWeekPlaceholder;\n }\n if (picker === 'time' && locale.timePickerLocale.placeholder) {\n return locale.timePickerLocale.rangePlaceholder;\n }\n return locale.lang.rangePlaceholder;\n}\nexport function transPlacement2DropdownAlign(direction, placement) {\n const overflow = {\n adjustX: 1,\n adjustY: 1\n };\n switch (placement) {\n case 'bottomLeft':\n {\n return {\n points: ['tl', 'bl'],\n offset: [0, 4],\n overflow\n };\n }\n case 'bottomRight':\n {\n return {\n points: ['tr', 'br'],\n offset: [0, 4],\n overflow\n };\n }\n case 'topLeft':\n {\n return {\n points: ['bl', 'tl'],\n offset: [0, -4],\n overflow\n };\n }\n case 'topRight':\n {\n return {\n points: ['br', 'tr'],\n offset: [0, -4],\n overflow\n };\n }\n default:\n {\n return {\n points: direction === 'rtl' ? ['tr', 'br'] : ['tl', 'bl'],\n offset: [0, 4],\n overflow\n };\n }\n }\n}\nexport function useIcons(props, prefixCls) {\n const {\n allowClear = true\n } = props;\n const {\n clearIcon,\n removeIcon\n } = useSelectIcons(Object.assign(Object.assign({}, props), {\n prefixCls,\n componentName: 'DatePicker'\n }));\n const mergedAllowClear = React.useMemo(() => {\n if (allowClear === false) {\n return false;\n }\n const allowClearConfig = allowClear === true ? {} : allowClear;\n return Object.assign({\n clearIcon: clearIcon\n }, allowClearConfig);\n }, [allowClear, clearIcon]);\n return [mergedAllowClear, removeIcon];\n}"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,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