import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import "core-js/modules/es.symbol.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.for-each.js";
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.object.define-properties.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.get-own-property-descriptor.js";
import "core-js/modules/es.object.get-own-property-descriptors.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/web.dom-collections.for-each.js";
import "core-js/modules/web.timers.js";
import { FcrSlider } from '.';
import { useEffect, useState } from 'react';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var meta = {
  title: 'Components/FcrSlider',
  tags: ['autodocs'],
  args: {}
};
export var Basic = {
  render: function render(props) {
    var _useState = useState(10),
      _useState2 = _slicedToArray(_useState, 2),
      value = _useState2[0],
      setValue = _useState2[1];
    var _useState3 = useState(10),
      _useState4 = _slicedToArray(_useState3, 1),
      value1 = _useState4[0];
    var _useState5 = useState(10),
      _useState6 = _slicedToArray(_useState5, 2),
      value2 = _useState6[0],
      setValue2 = _useState6[1];
    var _useState7 = useState(555),
      _useState8 = _slicedToArray(_useState7, 2),
      value3 = _useState8[0],
      setValue3 = _useState8[1];
    var _useState9 = useState(0),
      _useState0 = _slicedToArray(_useState9, 2),
      value4 = _useState0[0],
      setValue4 = _useState0[1];
    var _useState1 = useState(-0.5),
      _useState10 = _slicedToArray(_useState1, 2),
      min = _useState10[0],
      setMin = _useState10[1];
    useEffect(function () {
      var timer = setInterval(function () {
        setMin(Math.random() > 0.5 ? -0.5 : -1);
      }, 1000);
      return function () {
        clearInterval(timer);
      };
    }, []);
    return /*#__PURE__*/_jsxs("div", {
      children: [/*#__PURE__*/_jsx("h3", {
        children: "\u7981\u7528"
      }), /*#__PURE__*/_jsx("div", {
        style: {
          width: 200,
          marginTop: 16,
          marginBottom: 50
        },
        children: /*#__PURE__*/_jsx(FcrSlider, _objectSpread(_objectSpread({}, props), {}, {
          defaultValue: 40,
          onChange: function onChange(v) {
            return setValue(v);
          },
          disabled: true
        }))
      }), /*#__PURE__*/_jsxs("h3", {
        children: ["\u53EA\u8BBE\u7F6E\u9ED8\u8BA4\u503C\uFF0C\u975E\u53EF\u63A7\u7EC4\u4EF6\uFF0C\u901A\u8FC7 onChange \u83B7\u53D6\u503C\u3002value:", value]
      }), /*#__PURE__*/_jsx("div", {
        style: {
          width: 200,
          marginTop: 16,
          marginBottom: 50
        },
        children: /*#__PURE__*/_jsx(FcrSlider, _objectSpread(_objectSpread({}, props), {}, {
          defaultValue: 10,
          onChange: function onChange(v) {
            return setValue(v);
          }
        }))
      }), /*#__PURE__*/_jsxs("h3", {
        children: ["\u8BBE\u7F6E value\uFF0C\u8F6C\u4E3A\u53EF\u63A7\u7EC4\u4EF6\uFF0ConChange \u4E0D\u66F4\u6539 value \u65F6\u4E0D\u53EF\u62D6\u52A8\u3002value:", value1]
      }), /*#__PURE__*/_jsx("div", {
        style: {
          width: 200,
          marginTop: 16,
          marginBottom: 50
        },
        children: /*#__PURE__*/_jsx(FcrSlider, _objectSpread(_objectSpread({}, props), {}, {
          value: value1
        }))
      }), /*#__PURE__*/_jsxs("h3", {
        children: ["\u8BBE\u7F6E value\uFF0C\u8F6C\u4E3A\u53EF\u63A7\u7EC4\u4EF6\uFF0C\u53EF\u4EA4\u4E92\u3002value:", value2]
      }), /*#__PURE__*/_jsx("div", {
        style: {
          width: 200,
          marginTop: 16,
          marginBottom: 50
        },
        children: /*#__PURE__*/_jsx(FcrSlider, _objectSpread(_objectSpread({}, props), {}, {
          value: value2,
          onChange: function onChange(v) {
            return setValue2(v);
          }
        }))
      }), /*#__PURE__*/_jsxs("h3", {
        children: ["\u8BBE\u7F6E step: 5 \u548C min: 500 \u548C max: 1000 value:", value3]
      }), /*#__PURE__*/_jsx("div", {
        style: {
          width: 200,
          marginTop: 16,
          marginBottom: 50
        },
        children: /*#__PURE__*/_jsx(FcrSlider, _objectSpread(_objectSpread({}, props), {}, {
          value: value3,
          min: 500,
          max: 1000,
          step: 5,
          onChange: function onChange(v) {
            return setValue3(v);
          }
        }))
      }), /*#__PURE__*/_jsxs("h3", {
        children: ["\u8BBE\u7F6E step: 0.01 \u548C min: -0.5 \u548C max: 0.5 value:", value4]
      }), /*#__PURE__*/_jsx("div", {
        style: {
          width: 200,
          marginTop: 16,
          marginBottom: 50
        },
        children: /*#__PURE__*/_jsx(FcrSlider, _objectSpread(_objectSpread({}, props), {}, {
          value: value4,
          min: min,
          max: 0.5,
          step: 0.01,
          onChange: function onChange(v) {
            return setValue4(v);
          }
        }))
      })]
    });
  }
};
export default meta;