0e8336adf8d8e847b0f0480585edf43a.json
8.21 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport PickerButton from '../PickerButton';\nimport PickerTag from '../PickerTag';\nimport generateSinglePicker from './generateSinglePicker';\nimport generateRangePicker from './generateRangePicker';\nexport var Components = {\n button: PickerButton,\n rangeItem: PickerTag\n};\n\nfunction toArray(list) {\n if (!list) {\n return [];\n }\n\n return Array.isArray(list) ? list : [list];\n}\n\nexport function getTimeProps(props) {\n var format = props.format,\n picker = props.picker,\n showHour = props.showHour,\n showMinute = props.showMinute,\n showSecond = props.showSecond,\n use12Hours = props.use12Hours;\n var firstFormat = toArray(format)[0];\n\n var showTimeObj = _extends({}, props);\n\n if (firstFormat && typeof firstFormat === 'string') {\n if (!firstFormat.includes('s') && showSecond === undefined) {\n showTimeObj.showSecond = false;\n }\n\n if (!firstFormat.includes('m') && showMinute === undefined) {\n showTimeObj.showMinute = false;\n }\n\n if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) {\n showTimeObj.showHour = false;\n }\n\n if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) {\n showTimeObj.use12Hours = true;\n }\n }\n\n if (picker === 'time') {\n return showTimeObj;\n }\n\n if (typeof firstFormat === 'function') {\n // format of showTime should use default when format is custom format function\n delete showTimeObj.format;\n }\n\n return {\n showTime: showTimeObj\n };\n}\n\nfunction generatePicker(generateConfig) {\n // =========================== Picker ===========================\n var _generateSinglePicker = generateSinglePicker(generateConfig),\n DatePicker = _generateSinglePicker.DatePicker,\n WeekPicker = _generateSinglePicker.WeekPicker,\n MonthPicker = _generateSinglePicker.MonthPicker,\n YearPicker = _generateSinglePicker.YearPicker,\n TimePicker = _generateSinglePicker.TimePicker,\n QuarterPicker = _generateSinglePicker.QuarterPicker; // ======================== Range Picker ========================\n\n\n var RangePicker = generateRangePicker(generateConfig);\n var MergedDatePicker = DatePicker;\n MergedDatePicker.WeekPicker = WeekPicker;\n MergedDatePicker.MonthPicker = MonthPicker;\n MergedDatePicker.YearPicker = YearPicker;\n MergedDatePicker.RangePicker = RangePicker;\n MergedDatePicker.TimePicker = TimePicker;\n MergedDatePicker.QuarterPicker = QuarterPicker;\n return MergedDatePicker;\n}\n\nexport default generatePicker;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/date-picker/generatePicker/index.js"],"names":["_extends","PickerButton","PickerTag","generateSinglePicker","generateRangePicker","Components","button","rangeItem","toArray","list","Array","isArray","getTimeProps","props","format","picker","showHour","showMinute","showSecond","use12Hours","firstFormat","showTimeObj","includes","undefined","showTime","generatePicker","generateConfig","_generateSinglePicker","DatePicker","WeekPicker","MonthPicker","YearPicker","TimePicker","QuarterPicker","RangePicker","MergedDatePicker"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,oBAAP,MAAiC,wBAAjC;AACA,OAAOC,mBAAP,MAAgC,uBAAhC;AACA,OAAO,IAAIC,UAAU,GAAG;AACtBC,EAAAA,MAAM,EAAEL,YADc;AAEtBM,EAAAA,SAAS,EAAEL;AAFW,CAAjB;;AAKP,SAASM,OAAT,CAAiBC,IAAjB,EAAuB;AACrB,MAAI,CAACA,IAAL,EAAW;AACT,WAAO,EAAP;AACD;;AAED,SAAOC,KAAK,CAACC,OAAN,CAAcF,IAAd,IAAsBA,IAAtB,GAA6B,CAACA,IAAD,CAApC;AACD;;AAED,OAAO,SAASG,YAAT,CAAsBC,KAAtB,EAA6B;AAClC,MAAIC,MAAM,GAAGD,KAAK,CAACC,MAAnB;AAAA,MACIC,MAAM,GAAGF,KAAK,CAACE,MADnB;AAAA,MAEIC,QAAQ,GAAGH,KAAK,CAACG,QAFrB;AAAA,MAGIC,UAAU,GAAGJ,KAAK,CAACI,UAHvB;AAAA,MAIIC,UAAU,GAAGL,KAAK,CAACK,UAJvB;AAAA,M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AD,CAAhD;AAAA,MACIE,UAAU,GAAGD,qBAAqB,CAACC,UADvC;AAAA,MAEIC,UAAU,GAAGF,qBAAqB,CAACE,UAFvC;AAAA,MAGIC,WAAW,GAAGH,qBAAqB,CAACG,WAHxC;AAAA,MAIIC,UAAU,GAAGJ,qBAAqB,CAACI,UAJvC;AAAA,MAKIC,UAAU,GAAGL,qBAAqB,CAACK,UALvC;AAAA,MAMIC,aAAa,GAAGN,qBAAqB,CAACM,aAN1C,CAFsC,CAQmB;;;AAGzD,MAAIC,WAAW,GAAG9B,mBAAmB,CAACsB,cAAD,CAArC;AACA,MAAIS,gBAAgB,GAAGP,UAAvB;AACAO,EAAAA,gBAAgB,CAACN,UAAjB,GAA8BA,UAA9B;AACAM,EAAAA,gBAAgB,CAACL,WAAjB,GAA+BA,WAA/B;AACAK,EAAAA,gBAAgB,CAACJ,UAAjB,GAA8BA,UAA9B;AACAI,EAAAA,gBAAgB,CAACD,WAAjB,GAA+BA,WAA/B;AACAC,EAAAA,gBAAgB,CAACH,UAAjB,GAA8BA,UAA9B;AACAG,EAAAA,gBAAgB,CAACF,aAAjB,GAAiCA,aAAjC;AACA,SAAOE,gBAAP;AACD;;AAED,eAAeV,cAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport PickerButton from '../PickerButton';\nimport PickerTag from '../PickerTag';\nimport generateSinglePicker from './generateSinglePicker';\nimport generateRangePicker from './generateRangePicker';\nexport var Components = {\n button: PickerButton,\n rangeItem: PickerTag\n};\n\nfunction toArray(list) {\n if (!list) {\n return [];\n }\n\n return Array.isArray(list) ? list : [list];\n}\n\nexport function getTimeProps(props) {\n var format = props.format,\n picker = props.picker,\n showHour = props.showHour,\n showMinute = props.showMinute,\n showSecond = props.showSecond,\n use12Hours = props.use12Hours;\n var firstFormat = toArray(format)[0];\n\n var showTimeObj = _extends({}, props);\n\n if (firstFormat && typeof firstFormat === 'string') {\n if (!firstFormat.includes('s') && showSecond === undefined) {\n showTimeObj.showSecond = false;\n }\n\n if (!firstFormat.includes('m') && showMinute === undefined) {\n showTimeObj.showMinute = false;\n }\n\n if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) {\n showTimeObj.showHour = false;\n }\n\n if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) {\n showTimeObj.use12Hours = true;\n }\n }\n\n if (picker === 'time') {\n return showTimeObj;\n }\n\n if (typeof firstFormat === 'function') {\n // format of showTime should use default when format is custom format function\n delete showTimeObj.format;\n }\n\n return {\n showTime: showTimeObj\n };\n}\n\nfunction generatePicker(generateConfig) {\n // =========================== Picker ===========================\n var _generateSinglePicker = generateSinglePicker(generateConfig),\n DatePicker = _generateSinglePicker.DatePicker,\n WeekPicker = _generateSinglePicker.WeekPicker,\n MonthPicker = _generateSinglePicker.MonthPicker,\n YearPicker = _generateSinglePicker.YearPicker,\n TimePicker = _generateSinglePicker.TimePicker,\n QuarterPicker = _generateSinglePicker.QuarterPicker; // ======================== Range Picker ========================\n\n\n var RangePicker = generateRangePicker(generateConfig);\n var MergedDatePicker = DatePicker;\n MergedDatePicker.WeekPicker = WeekPicker;\n MergedDatePicker.MonthPicker = MonthPicker;\n MergedDatePicker.YearPicker = YearPicker;\n MergedDatePicker.RangePicker = RangePicker;\n MergedDatePicker.TimePicker = TimePicker;\n MergedDatePicker.QuarterPicker = QuarterPicker;\n return MergedDatePicker;\n}\n\nexport default generatePicker;"]},"metadata":{},"sourceType":"module"}