/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

import { defineComponent, computed, createVNode } from 'vue';
import { useBaseClassName } from '../hooks.mjs';
import ColorSlider from './slider.mjs';
import '../../hooks/useConfig.mjs';
import '../../config-provider/useConfig.mjs';
import '../../_chunks/dep-095107f7.mjs';
import '../../_chunks/dep-eba0ea6e.mjs';
import '../../_chunks/dep-c989dff3.mjs';
import '../../_chunks/dep-9cf86cf1.mjs';
import '../../_chunks/dep-bc1d737a.mjs';
import '../../_chunks/dep-4d7a675b.mjs';
import '../../_chunks/dep-5717e263.mjs';
import '../../_chunks/dep-469b4ae0.mjs';
import '../../_chunks/dep-255303ba.mjs';
import '../../_chunks/dep-a8bcacea.mjs';
import '../../_chunks/dep-2e7f59b1.mjs';
import '../../_chunks/dep-855db8bc.mjs';
import '../../_chunks/dep-a87f3e4c.mjs';
import '../../_chunks/dep-1e566bb5.mjs';
import '../../_chunks/dep-1434aa15.mjs';
import '../../_chunks/dep-3da99438.mjs';
import '../../_chunks/dep-b57180d0.mjs';
import '../../_chunks/dep-c8d7b6b4.mjs';
import '../../_chunks/dep-e5eb9f23.mjs';
import '../../_chunks/dep-9fe2ef12.mjs';
import '../../_chunks/dep-672e7d1a.mjs';
import '../../_chunks/dep-42a19209.mjs';
import '../../_chunks/dep-9262ee2f.mjs';
import '../../_chunks/dep-334a4f6b.mjs';
import '../../_chunks/dep-8d3e9aa3.mjs';
import '../../_chunks/dep-876fb3ec.mjs';
import '../../_chunks/dep-40d69a9c.mjs';
import '../../_chunks/dep-dcc83161.mjs';
import '../../_chunks/dep-0fc02184.mjs';
import '../../_chunks/dep-f1994936.mjs';
import '../../_chunks/dep-345e1be3.mjs';
import '../../_common/js/global-config/default-config.mjs';
import '../../_common/js/global-config/locale/zh_CN.mjs';
import '../../_chunks/dep-9888611c.mjs';
import '../../_chunks/dep-697a1365.mjs';
import '../../config-provider/type.mjs';
import '../../_chunks/dep-2db7b3ec.mjs';
import '../const.mjs';
import '../../_common/js/color-picker/constants.mjs';
import '../utils/index.mjs';
import '../../_common/js/color-picker/index.mjs';
import '../../_common/js/color-picker/cmyk.mjs';
import '../../_common/js/color-picker/color.mjs';
import '../../_chunks/dep-84acf3c2.mjs';
import '../../_chunks/dep-b8d7992c.mjs';
import '../../_chunks/dep-ccbc47f4.mjs';
import '../../_chunks/dep-9ac6ced8.mjs';
import '../../_common/js/color-picker/gradient.mjs';
import '../../_chunks/dep-ed5ebb35.mjs';
import '../../_common/js/color-picker/draggable.mjs';
import './base-props.mjs';

var AlphaSlider = defineComponent({
  name: "AlphaSlider",
  inheritAttrs: false,
  props: {
    color: {
      type: Object
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    onChange: {
      type: Function,
      "default": function _default() {
        return function () {};
      }
    }
  },
  setup: function setup(props) {
    var baseClassName = useBaseClassName();
    var handleChange = function handleChange(v, isDragEnd) {
      props.onChange(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,
      handleChange: handleChange
    };
  },
  render: function render() {
    var baseClassName = this.baseClassName;
    return createVNode(ColorSlider, {
      "class": ["".concat(baseClassName, "__alpha"), "".concat(baseClassName, "--bg-alpha")],
      "color": this.color,
      "value": this.color.alpha * 100,
      "onChange": this.handleChange,
      "rail-style": this.railStyle,
      "max-value": 100,
      "disabled": this.disabled,
      "type": "alpha"
    }, null);
  }
});

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