aboutsummaryrefslogblamecommitdiffhomepage
path: root/examples/disabled.js.map
blob: 3e1ba90861120a407cc266af447ec49a76887949 (plain) (tree)
1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
{"version":3,"sources":["webpack:///./examples/disabled.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;qBAEO,CAAkC;;kCAEvB,CAAO;;;;qCACJ,GAAW;;;;8CAEF,GAAoB;;;;oDACvB,GAA2B;;;;4DACrC,GAAqC;;;;yCAE/B,GAAgB;;;;uDACV,GAAiC;;;;AAE9D,KAAM,UAAU,GAAG,IAAI,CAAC;AACxB,KAAM,GAAG,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;;AAE9C,KAAM,SAAS,GAAG,yCAAmB,GAAG,CAAC,CAAC;;AAE1C,KAAM,GAAG,GAAG,gFAA2B,CAAC;AACxC,IAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;;AAExB,UAAS,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE;AAChD,OAAM,GAAG,GAAG,EAAE,CAAC;AACf,QAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;AAC3C,SAAI,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AACtC,UAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MACjB;IACF;AACD,UAAO,GAAG,CAAC;EACZ;;AAED,UAAS,QAAQ,CAAC,KAAK,EAAE;AACvB,UAAO,CAAC,GAAG,CAAC,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;EAC/C;;AAED,UAAS,aAAa,GAAG;AACvB,UAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;EAC5C;;AAED,UAAS,eAAe,CAAC,CAAC,EAAE;AAC1B,WAAQ,CAAC;AACT,UAAK,CAAC;AACJ,cAAO,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACnC,UAAK,EAAE;AACL,cAAO,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC;AACE,cAAO,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAAA,IACrC;EACF;;AAED,UAAS,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE;AAC7B,UAAO,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;EACrB;;AAED,uBAAS,MAAM,CACb,8DAAY,SAAS,EAAE,SAAU,EAAC,MAAM,yCAAmB;AAC/C,aAAU,EAAE,UAAW;AACvB,eAAY,EAAE,GAAI;AAClB,YAAS,EAAC,KAAK;AACf,WAAQ,EAAE,QAAS;AACnB,gBAAa,EAAE,aAAc;AAC7B,kBAAe,EAAE,eAAgB;AACjC,kBAAe,EAAE,eAAgB,GAAG,EAChD,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAC3C,C","file":"disabled.js","sourcesContent":["/* eslint no-console:0 */\n\nimport 'rc-time-picker/assets/index.less';\n\nimport React from 'react';\nimport ReactDom from 'react-dom';\n\nimport GregorianCalendar from 'gregorian-calendar';\nimport DateTimeFormat from 'gregorian-calendar-format';\nimport zhCn from 'gregorian-calendar/lib/locale/zh_CN';\n\nimport TimePicker from 'rc-time-picker';\nimport TimePickerLocale from 'rc-time-picker/src/locale/zh_CN';\n\nconst showSecond = true;\nconst str = showSecond ? 'HH:mm:ss' : 'HH:mm';\n\nconst formatter = new DateTimeFormat(str);\n\nconst now = new GregorianCalendar(zhCn);\nnow.setTime(Date.now());\n\nfunction generateOptions(length, excludedOptions) {\n  const arr = [];\n  for (let value = 0; value < length; value++) {\n    if (excludedOptions.indexOf(value) < 0) {\n      arr.push(value);\n    }\n  }\n  return arr;\n}\n\nfunction onChange(value) {\n  console.log(value && formatter.format(value));\n}\n\nfunction disabledHours() {\n  return [0, 1, 2, 3, 4, 5, 6, 7, 8, 22, 23];\n}\n\nfunction disabledMinutes(h) {\n  switch (h) {\n  case 9:\n    return generateOptions(60, [30]);\n  case 21:\n    return generateOptions(60, [0]);\n  default:\n    return generateOptions(60, [0, 30]);\n  }\n}\n\nfunction disabledSeconds(h, m) {\n  return [h + m % 60];\n}\n\nReactDom.render(\n  <TimePicker formatter={formatter} locale={TimePickerLocale}\n              showSecond={showSecond}\n              defaultValue={now}\n              className=\"xxx\"\n              onChange={onChange}\n              disabledHours={disabledHours}\n              disabledMinutes={disabledMinutes}\n              disabledSeconds={disabledSeconds} />,\n  document.getElementById('__react-content')\n);\n\n\n\n/** WEBPACK FOOTER **\n ** ./examples/disabled.js\n **/"],"sourceRoot":""}