/**
 * tdesign v0.41.7
 * (c) 2022 tdesign
 * @license MIT
 */

import { defineComponent, computed } from '@vue/composition-api';
import ColorSlider from './slider.js';
import { useBaseClassName } from '../hooks.js';
import '@babel/runtime/helpers/defineProperty';
import '../const.js';
import '../../_common/js/color-picker/constants.js';
import '../../select/index.js';
import '../../select/select.js';
import '../../_chunks/dep-37d5b9c4.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/typeof';
import 'vue';
import 'lodash/isFunction';
import 'lodash/debounce';
import 'lodash/get';
import 'lodash/set';
import 'tdesign-icons-vue';
import '../../loading/index.js';
import '../../loading/loading.js';
import '../../loading/icon/gradient.js';
import '../../config.js';
import '../../_common/js/loading/circle-adapter.js';
import '../../_common/js/utils/set-style.js';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import '../../utils/classnames.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../utils/easing.js';
import '../../utils/render-tnode.js';
import '../../utils/transfer-dom.js';
import '../../loading/props.js';
import '../../utils/withInstall.js';
import 'lodash/capitalize';
import './style/index.js';
import '../../loading/type.js';
import '../../loading/plugin.js';
import '../../popup/index.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../utils/helper.js';
import 'lodash/camelCase';
import '../../popup/props.js';
import '../../popup/container.js';
import '../../utils/map-props.js';
import '../../popup/type.js';
import '../../utils/mixins.js';
import '../../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import '../../config-provider/context.js';
import 'lodash/merge';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../config-provider/type.js';
import '../../input/index.js';
import '../../input/addon.js';
import '../../input/input.js';
import 'lodash/kebabCase';
import '../../utils/event.js';
import '../../input/props.js';
import '../../input/input-group.js';
import '../../input/type.js';
import '../../tag/index.js';
import '../../tag/tag.js';
import '../../tag/props.js';
import '../../tag/check-tag.js';
import '../../tag/check-tag-props.js';
import '../../tag/type.js';
import '../../common-components/fake-arrow.js';
import '../../select/option.js';
import '../../utils/ripple.js';
import '../../select/option-props.js';
import '../../checkbox/index.js';
import '../../checkbox/group.js';
import 'lodash/intersection';
import '../../checkbox/checkbox.js';
import '../../checkbox/props.js';
import '../../checkbox/checkbox-group-props.js';
import '../../checkbox/type.js';
import '../../select/props.js';
import '../../select/optionGroup.js';
import '../../select/option-group-props.js';
import '../../select/type.js';
import '../utils/index.js';
import '../../_common/js/color-picker/index.js';
import '../../_common/js/color-picker/cmyk.js';
import '../../_common/js/color-picker/color.js';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import 'tinycolor2';
import '../../_common/js/color-picker/gradient.js';
import '../../_common/js/color-picker/draggable.js';
import './base-props.js';
import '../../config-provider/index.js';
import '../../config-provider/config-provider.js';
import '../../config-provider/useConfig.js';
import 'lodash/cloneDeep';

var AlphaSlider = defineComponent({
  name: "AlphaSlider",
  components: {
    ColorSlider: ColorSlider
  },
  inheritAttrs: false,
  props: {
    color: {
      type: Object
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    handleChange: {
      type: Function,
      "default": function _default() {
        return function () {};
      }
    }
  },
  setup: function setup(props) {
    var baseClassName = useBaseClassName();

    var handleValueChange = function handleValueChange(v, isDragEnd) {
      props.handleChange(v / 100, isDragEnd);
    };

    var railStyle = computed(function () {
      return {
        background: "linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(props.color.rgb, ")")
      };
    });
    return {
      baseClassName: baseClassName,
      railStyle: railStyle,
      handleValueChange: handleValueChange
    };
  },
  render: function render() {
    var h = arguments[0];
    var baseClassName = this.baseClassName;
    return h("color-slider", {
      "class": ["".concat(baseClassName, "__alpha"), "".concat(baseClassName, "--bg-alpha")],
      "attrs": {
        "color": this.color,
        "value": this.color.alpha * 100,
        "handleChange": this.handleValueChange,
        "rail-style": this.railStyle,
        "max-value": 100,
        "disabled": this.disabled
      }
    });
  }
});

export { AlphaSlider as default };
//# sourceMappingURL=alpha.js.map
