'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');

function getRanges({
  prefixCls,
  components = {},
  needConfirmButton,
  onNow,
  onOk,
  okDisabled,
  showNow,
  locale
}) {
  let presetNode;
  let okNode;
  if (needConfirmButton) {
    const Button = components.button || "button";
    if (onNow && showNow !== false) {
      presetNode = vue.createVNode("li", {
        "class": `${prefixCls}-now`
      }, [vue.createVNode("a", {
        "class": `${prefixCls}-now-btn`,
        "onClick": onNow
      }, [locale.now])]);
    }
    okNode = needConfirmButton && vue.createVNode("li", {
      "class": `${prefixCls}-ok`
    }, [vue.createVNode(Button, {
      "disabled": okDisabled,
      "onClick": (e) => {
        e.stopPropagation();
        onOk && onOk();
      }
    }, {
      default: () => [locale.ok]
    })]);
  }
  if (!presetNode && !okNode)
    return null;
  return vue.createVNode("ul", {
    "class": `${prefixCls}-ranges`
  }, [presetNode, okNode]);
}

exports.default = getRanges;
//# sourceMappingURL=getRanges.cjs.map
