import WVIcon from "../WIcon";
import WVSpinner from "../WSpinner";
import PopupMixin from "../../../es5/mixins/popup";
import mixins from "../../../es5/utils/mixins";
export default mixins(PopupMixin).extend({
  name: 'w-toast',
  props: {
    mask: {
      type: Boolean,
      default: true
    },
    icon: {
      type: String,
      default: 'success-no-circle'
    },
    type: {
      type: String,
      default: 'success',
      validator: function validator(val) {
        return ['success', 'fail', 'loading', 'text', 'html'].indexOf(val) !== -1;
      }
    },
    spinnerType: {
      type: String,
      default: 'default'
    },
    message: {
      type: String,
      default: ''
    },
    maskClass: {
      type: String,
      default: 'weui-mask'
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("transition", {
      "attrs": {
        "enter-active-class": "weui-animate-fade-in",
        "leave-active-class": "weui-animate-fade-out"
      }
    }, [h("div", {
      "class": {
        'weui-toast': true,
        'weui-toast_text': this.type === 'text'
      },
      "ref": "toast",
      "directives": [{
        name: "show",
        value: this.visible
      }]
    }, [this.type !== 'text' && this.type !== 'loading' && h(WVIcon, {
      "attrs": {
        "type": this.icon
      },
      "class": "weui-icon_toast"
    }), this.type === 'loading' && this.spinnerType !== 'none' && h(WVSpinner, {
      "attrs": {
        "size": 25,
        "type": this.spinnerType
      },
      "class": "weui-icon_toast"
    }), h("p", {
      "class": "weui-toast__content",
      "domProps": {
        "textContent": this.message
      }
    })])]);
  }
});
//# sourceMappingURL=WToast.js.map