index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. exports.__esModule = true;
  4. exports.default = void 0;
  5. var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
  6. var _utils = require("../utils");
  7. var _TimePicker = _interopRequireDefault(require("./TimePicker"));
  8. var _DatePicker = _interopRequireDefault(require("./DatePicker"));
  9. var _createNamespace = (0, _utils.createNamespace)('datetime-picker'),
  10. createComponent = _createNamespace[0],
  11. bem = _createNamespace[1];
  12. var _default = createComponent({
  13. props: (0, _extends2.default)({}, _TimePicker.default.props, _DatePicker.default.props),
  14. methods: {
  15. // @exposed-api
  16. getPicker: function getPicker() {
  17. return this.$refs.root.getProxiedPicker();
  18. }
  19. },
  20. render: function render() {
  21. var h = arguments[0];
  22. var Component = this.type === 'time' ? _TimePicker.default : _DatePicker.default;
  23. return h(Component, {
  24. "ref": "root",
  25. "class": bem(),
  26. "scopedSlots": this.$scopedSlots,
  27. "props": (0, _extends2.default)({}, this.$props),
  28. "on": (0, _extends2.default)({}, this.$listeners)
  29. });
  30. }
  31. });
  32. exports.default = _default;