/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

import { defineComponent, computed } from '@vue/composition-api';
import { useBaseClassName } from '../hooks/index.js';
import ColorSlider from './slider.js';
import '../../../hooks/useConfig.js';
import '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../../../_chunks/dep-b4fd1955.js';
import '../../../_chunks/dep-560aa956.js';
import '../../select/index.js';
import '../../../utils/withInstall.js';
import 'vue';
import 'lodash/capitalize';
import '../../../config.js';
import '../../select/select.js';
import '../../../_chunks/dep-b0f1ed22.js';
import 'lodash/isFunction';
import 'lodash/debounce';
import 'lodash/get';
import 'lodash/cloneDeep';
import 'lodash/isArray';
import 'lodash/isObject';
import '../../../_chunks/dep-eaa95999.js';
import '../../../_chunks/dep-102361be.js';
import '../../../hooks/useDefaultValue.js';
import '../../../hooks/useVModel.js';
import 'lodash/kebabCase';
import '../../../hooks/lnode.js';
import 'lodash/isEmpty';
import 'lodash/camelCase';
import '../../../hooks/render-lnode.js';
import 'lodash';
import '../../loading/index.js';
import '../../loading/loading.js';
import '../../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../../utils/easing.js';
import '../../../utils/render-node.js';
import '../../../utils/transfer-dom.js';
import '../../config-provider/config-receiver.js';
import '../../../utils/mixins.js';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../../_chunks/dep-aacc31a3.js';
import '../../../_chunks/dep-c68dc4b6.js';
import '../../../_chunks/dep-1a6bca30.js';
import '../../loading/plugin.js';
import '../../popup/index.js';
import '../../../utils/map-props.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../../utils/helper.js';
import '../../popup/props.js';
import '../../popup/container.js';
import '../../input/index.js';
import '../../input/input.js';
import '@ldesign/icons-vue';
import '../../../utils/event.js';
import '../../input/props.js';
import '../../input/group.js';
import '../../tag/index.js';
import '../../tag/tag.js';
import '../../tag/props.js';
import '../../tag/check-tag.js';
import '../../select-input/index.js';
import '../../select-input/select-input.js';
import '../../select-input/props.js';
import '../../select-input/hooks/use-single.js';
import 'lodash/pick';
import '../../select-input/hooks/use-multiple.js';
import '../../tag-input/index.js';
import '../../tag-input/tag-input.js';
import '../../../hooks/useGlobalIcon.js';
import '../../tag-input/props.js';
import '../../tag-input/hooks/use-tag-scroll.js';
import '../../tag-input/hooks/use-tag-list.js';
import '../../tag-input/hooks/use-hover.js';
import '../../tag-input/hooks/use-drag-sorter.js';
import '../../select-input/hooks/use-overlay-innerstyle.js';
import '../../common/fake-arrow.js';
import '../../../hooks/useFormDisabled.js';
import '../../select/option.js';
import '../../../utils/ripple.js';
import '../../checkbox/index.js';
import '../../checkbox/group.js';
import 'lodash/intersection';
import '../../checkbox/checkbox.js';
import '../../checkbox/props.js';
import '../../../hooks/useLazyLoad.js';
import '../../../_chunks/dep-62ed000f.js';
import '../../../hooks/useCommonClassName.js';
import '../../select/utils.js';
import '../../select/props.js';
import '../../select/select-panel.js';
import '../../../hooks/useVirtualScroll.js';
import '../../select/hooks/use-select-options.js';
import '../../select/option-group.js';
import '../../../_chunks/dep-836dea4a.js';
import '../../../_chunks/dep-c1fcce9c.js';
import './base-props.js';

var AlphaSlider = defineComponent({
  name: "AlphaSlider",
  components: {
    ColorSlider
  },
  inheritAttrs: false,
  props: {
    color: {
      type: Object
    },
    disabled: {
      type: Boolean,
      default: false
    },
    handleChange: {
      type: Function,
      default: () => () => {}
    }
  },
  setup(props) {
    const baseClassName = useBaseClassName();
    const handleValueChange = (v, isDragEnd) => {
      props.handleChange(v / 100, isDragEnd);
    };
    const railStyle = computed(() => ({
      background: `linear-gradient(to right, rgba(0, 0, 0, 0), ${props.color.rgb})`
    }));
    return {
      baseClassName,
      railStyle,
      handleValueChange
    };
  },
  render() {
    const h = arguments[0];
    const {
      baseClassName
    } = this;
    return h("color-slider", {
      "class": [`${baseClassName}__alpha`, `${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,
        "type": "alpha"
      }
    });
  }
});

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