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

'use strict';

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

var vue = require('vue');
var colorPicker_hooks = require('../hooks.js');
var colorPicker_panel_slider = require('./slider.js');
require('../../hooks/useConfig.js');
require('../../config-provider/useConfig.js');
require('lodash/cloneDeep');
require('lodash/isFunction');
require('lodash/isString');
require('../../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('lodash/isArray');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('../../_chunks/dep-f4db2590.js');
require('dayjs');
require('@babel/runtime/helpers/defineProperty');
require('./base-props.js');
require('../../_common/js/color-picker/constants.js');
require('../../_common/js/color-picker/draggable.js');
require('@babel/runtime/helpers/classCallCheck');
require('@babel/runtime/helpers/createClass');

var AlphaSlider = vue.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 = colorPicker_hooks.useBaseClassName();
    var handleChange = function handleChange(v, isDragEnd) {
      props.onChange(v / 100, isDragEnd);
    };
    var railStyle = vue.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 vue.createVNode(colorPicker_panel_slider["default"], {
      "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);
  }
});

exports["default"] = AlphaSlider;
//# sourceMappingURL=alpha.js.map
