/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

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

var VueCompositionAPI = require('@vue/composition-api');
var components_colorPicker_hooks_index = require('../hooks/index.js');
var components_colorPicker_panel_slider = require('./slider.js');
require('../../../hooks/use-config.js');
require('../../config-provider/useConfig.js');
require('../../config-provider/context.js');
require('lodash');
require('../../../chunks/zh_CN.js');
require('../../../chunks/constants.js');
require('../../select/index.js');
require('../../../utils/with-install.js');
require('vue');
require('../../../config.js');
require('../../select/select.js');
require('../../../chunks/helper.js');
require('lodash/isFunction');
require('lodash/debounce');
require('lodash/get');
require('lodash/cloneDeep');
require('lodash/isArray');
require('lodash/isObject');
require('../../../chunks/log.js');
require('../../../chunks/_commonjsHelpers-2e6815bd.js');
require('../../../hooks/use-default-value.js');
require('../../../hooks/use-vmodel.js');
require('lodash/kebabCase');
require('../../../hooks/lnode.js');
require('lodash/isEmpty');
require('lodash/camelCase');
require('../../../hooks/render-lnode.js');
require('../../loading/index.js');
require('../../loading/loading.js');
require('../../../utils/dom.js');
require('raf');
require('lodash/isString');
require('../../../utils/easing.js');
require('../../../utils/render-node.js');
require('../../../utils/transfer-dom.js');
require('../../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../../utils/mixins.js');
require('../../loading/props.js');
require('../../loading/icon/gradient.js');
require('../../../chunks/defineProperty-838e4192.js');
require('../../../chunks/set-style.js');
require('../../../chunks/helper2.js');
require('../../loading/plugin.js');
require('../../popup/index.js');
require('../../../utils/map-props.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('../../../utils/helper.js');
require('../../popup/props.js');
require('../../popup/container.js');
require('../../input/index.js');
require('../../input/input.js');
require('@ldesign/icons-vue');
require('../../../utils/event.js');
require('../../input/props.js');
require('../../input/group.js');
require('../../tag/index.js');
require('../../tag/tag.js');
require('../../tag/props.js');
require('../../tag/check-tag.js');
require('../../select-input/index.js');
require('../../select-input/select-input.js');
require('../../select-input/props.js');
require('../../select-input/hooks/use-single.js');
require('lodash/pick');
require('../../select-input/hooks/use-multiple.js');
require('../../tag-input/index.js');
require('../../tag-input/tag-input.js');
require('../../../hooks/use-global-icon.js');
require('../../tag-input/props.js');
require('../../tag-input/hooks/use-tag-scroll.js');
require('../../tag-input/hooks/use-tag-list.js');
require('../../tag-input/hooks/use-hover.js');
require('../../tag-input/hooks/use-drag-sorter.js');
require('../../select-input/hooks/use-overlay-innerstyle.js');
require('../../common/fake-arrow.js');
require('../../../hooks/use-form-disabled.js');
require('../../select/option.js');
require('../../../utils/ripple.js');
require('../../checkbox/index.js');
require('../../checkbox/group.js');
require('lodash/intersection');
require('../../checkbox/checkbox.js');
require('../../checkbox/props.js');
require('../../../hooks/use-lazy-load.js');
require('../../../chunks/observe.js');
require('../../../hooks/use-common-classname.js');
require('../../select/utils.js');
require('../../select/props.js');
require('../../select/select-panel.js');
require('../../../hooks/use-virtual-scroll.js');
require('../../select/hooks/use-select-options.js');
require('../../select/option-group.js');
require('../../../chunks/color.js');
require('../../../chunks/draggable.js');
require('./base-props.js');

var AlphaSlider = VueCompositionAPI.defineComponent({
  name: "AlphaSlider",
  components: {
    ColorSlider: components_colorPicker_panel_slider["default"]
  },
  inheritAttrs: false,
  props: {
    color: {
      type: Object
    },
    disabled: {
      type: Boolean,
      default: false
    },
    handleChange: {
      type: Function,
      default: () => () => {}
    }
  },
  setup(props) {
    const baseClassName = components_colorPicker_hooks_index.useBaseClassName();
    const handleValueChange = (v, isDragEnd) => {
      props.handleChange(v / 100, isDragEnd);
    };
    const railStyle = VueCompositionAPI.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"
      }
    });
  }
});

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