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

'use strict';

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

var VueCompositionAPI = require('@vue/composition-api');
var colorPicker_panel_slider = require('./slider.js');
var colorPicker_hooks = require('../hooks.js');
require('@babel/runtime/helpers/defineProperty');
require('../../select/index.js');
require('../../select/select.js');
require('../../_chunks/dep-d7a1e02c.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/slicedToArray');
require('lodash/isFunction');
require('lodash/debounce');
require('lodash/get');
require('lodash/cloneDeep');
require('lodash/isArray');
require('../../hooks/useDefaultValue.js');
require('../../hooks/useVModel.js');
require('../../hooks/tnode.js');
require('lodash/isEmpty');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../hooks/render-tnode.js');
require('lodash/isString');
require('lodash/isObject');
require('../../config-provider/useConfig.js');
require('../../config-provider/context.js');
require('lodash/merge');
require('lodash/mergeWith');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('../../select/props.js');
require('../../loading/index.js');
require('../../loading/loading.js');
require('../../loading/icon/gradient.js');
require('../../_common/js/loading/circle-adapter.js');
require('../../_common/js/utils/set-style.js');
require('../../_common/js/utils/helper.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../../config-provider/config-receiver.js');
require('vue');
require('../../utils/mixins.js');
require('../../utils/dom.js');
require('raf');
require('../../utils/easing.js');
require('../../utils/render-tnode.js');
require('@babel/runtime/helpers/typeof');
require('../../utils/transfer-dom.js');
require('../../loading/props.js');
require('../../utils/withInstall.js');
require('lodash/capitalize');
require('../../loading/plugin.js');
require('../../config.js');
require('../../popup/index.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('../../utils/helper.js');
require('../../popup/props.js');
require('../../popup/container.js');
require('../../utils/map-props.js');
require('../../input/index.js');
require('../../input/input.js');
require('tdesign-icons-vue');
require('../../utils/event.js');
require('../../input/props.js');
require('../../input/input-group.js');
require('../../tag/index.js');
require('../../tag/tag.js');
require('../../tag/props.js');
require('../../tag/check-tag.js');
require('../../tag/check-tag-props.js');
require('../../select-input/index.js');
require('../../select-input/select-input.js');
require('../../select-input/props.js');
require('../../select-input/useSingle.js');
require('lodash/pick');
require('../../hooks/useConfig.js');
require('../../select-input/useMultiple.js');
require('../../tag-input/index.js');
require('../../tag-input/tag-input.js');
require('../../tag-input/props.js');
require('../../tag-input/hooks/useTagScroll.js');
require('../../tag-input/useTagList.js');
require('../../tag-input/hooks/useHover.js');
require('../../tag-input/hooks/useDragSorter.js');
require('../../hooks/useGlobalIcon.js');
require('../../select-input/useOverlayInnerStyle.js');
require('../../common-components/fake-arrow.js');
require('../../select/option.js');
require('../../utils/ripple.js');
require('../../select/option-props.js');
require('../../checkbox/index.js');
require('../../checkbox/group.js');
require('lodash/intersection');
require('../../checkbox/checkbox.js');
require('../../checkbox/props.js');
require('../../checkbox/checkbox-group-props.js');
require('../../hooks/useLazyLoad.js');
require('../../_common/js/utils/observe.js');
require('../../select/util.js');
require('../../hooks/useCommonClassName.js');
require('../../select/select-panel.js');
require('../../hooks/useVirtualScroll.js');
require('../../select/hooks/useSelectOptions.js');
require('../../select/optionGroup.js');
require('../../select/option-group-props.js');
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 = VueCompositionAPI.defineComponent({
  name: "AlphaSlider",
  components: {
    ColorSlider: colorPicker_panel_slider["default"]
  },
  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 = colorPicker_hooks.useBaseClassName();

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

    var railStyle = VueCompositionAPI.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,
        "type": "alpha"
      }
    });
  }
});

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