var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellCurrency/PisellCurrency.stories.tsx
var PisellCurrency_stories_exports = {};
__export(PisellCurrency_stories_exports, {
  AllowNegative: () => AllowNegative,
  Basic: () => Basic,
  DifferentCurrencies: () => DifferentCurrencies,
  DifferentPrecision: () => DifferentPrecision,
  Disabled: () => Disabled,
  EmptyValue: () => EmptyValue,
  InForm: () => InForm,
  InTable: () => InTable,
  NoNegative: () => NoNegative,
  ReadOnly: () => ReadOnly,
  ReadOnlyStyles: () => ReadOnlyStyles,
  WithoutSymbol: () => WithoutSymbol,
  default: () => PisellCurrency_stories_default
});
module.exports = __toCommonJS(PisellCurrency_stories_exports);
var import_PisellCurrency = require("./PisellCurrency");
var import_react = require("react");
var import_antd = require("antd");
var meta = {
  title: "表单/表单组件/PisellCurrency",
  component: import_PisellCurrency.PisellCurrency,
  tags: ["autodocs"],
  argTypes: {
    mode: {
      control: "radio",
      options: ["read", "edit"],
      description: "显示模式"
    },
    currencySymbol: {
      control: "text",
      description: "货币符号"
    },
    symbolPosition: {
      control: "radio",
      options: ["before", "after"],
      description: "符号位置"
    },
    value: {
      control: "number",
      description: "当前值"
    }
  }
};
var PisellCurrency_stories_default = meta;
var Basic = {
  args: {
    value: 1234.56,
    currencySymbol: "¥"
  },
  render: (args) => {
    const [value, setValue] = (0, import_react.useState)(args.value);
    return /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { ...args, value, onChange: setValue });
  }
};
var DifferentCurrencies = {
  render: () => {
    return /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 16 } }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8, width: 80, display: "inline-block" } }, "人民币："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 6999.99, currencySymbol: "¥" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8, width: 80, display: "inline-block" } }, "美元："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 1234.56, currencySymbol: "$" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8, width: 80, display: "inline-block" } }, "欧元："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 999.99, currencySymbol: "€", symbolPosition: "after" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8, width: 80, display: "inline-block" } }, "英镑："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 599.99, currencySymbol: "£" })));
  }
};
var ReadOnly = {
  args: {
    mode: "read",
    value: 6999.99,
    currencySymbol: "¥"
  }
};
var Disabled = {
  args: {
    disabled: true,
    value: 1e3,
    currencySymbol: "¥"
  }
};
var WithoutSymbol = {
  args: {
    mode: "read",
    value: 1234.56,
    showSymbol: false
  }
};
var NoNegative = {
  render: () => {
    const [price, setPrice] = (0, import_react.useState)(100);
    return /* @__PURE__ */ React.createElement(import_antd.Form.Item, { label: "商品价格" }, /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        value: price,
        onChange: setPrice,
        currencySymbol: "¥",
        allowNegative: false,
        placeholder: "请输入价格"
      }
    ));
  }
};
var AllowNegative = {
  render: () => {
    const [refund, setRefund] = (0, import_react.useState)(-150);
    return /* @__PURE__ */ React.createElement(import_antd.Form.Item, { label: "退款金额" }, /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        value: refund,
        onChange: setRefund,
        currencySymbol: "¥",
        allowNegative: true,
        placeholder: "请输入退款金额"
      }
    ));
  }
};
var InForm = {
  render: () => {
    const [price, setPrice] = (0, import_react.useState)(null);
    const [cost, setCost] = (0, import_react.useState)(null);
    const [shipping, setShipping] = (0, import_react.useState)(null);
    return /* @__PURE__ */ React.createElement(import_antd.Form, { layout: "vertical", style: { maxWidth: 400 } }, /* @__PURE__ */ React.createElement(import_antd.Form.Item, { label: "商品价格", required: true }, /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        value: price,
        onChange: setPrice,
        currencySymbol: "¥",
        min: 0,
        required: true,
        placeholder: "请输入价格",
        validateTrigger: "both"
      }
    )), /* @__PURE__ */ React.createElement(import_antd.Form.Item, { label: "成本价" }, /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        value: cost,
        onChange: setCost,
        currencySymbol: "¥",
        min: 0,
        placeholder: "请输入成本"
      }
    )), /* @__PURE__ */ React.createElement(import_antd.Form.Item, { label: "运费" }, /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        value: shipping,
        onChange: setShipping,
        currencySymbol: "¥",
        min: 0,
        placeholder: "请输入运费"
      }
    )));
  }
};
var InTable = {
  render: () => {
    const dataSource = [
      { id: 1, name: "笔记本电脑", price: 6999.99, sales: 12345 },
      { id: 2, name: "无线鼠标", price: 129.5, sales: 5678 },
      { id: 3, name: "机械键盘", price: 599, sales: 8901 }
    ];
    const columns = [
      {
        title: "商品名称",
        dataIndex: "name"
      },
      {
        title: "单价",
        dataIndex: "price",
        render: (value) => /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value, currencySymbol: "¥" }),
        sorter: (a, b) => a.price - b.price
      },
      {
        title: "销售额",
        dataIndex: "sales",
        render: (value) => /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value, currencySymbol: "¥" }),
        sorter: (a, b) => a.sales - b.sales
      }
    ];
    return /* @__PURE__ */ React.createElement(import_antd.Table, { dataSource, columns, pagination: false });
  }
};
var DifferentPrecision = {
  render: () => {
    return /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 16 } }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "默认（2位小数）："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 1234.567, currencySymbol: "¥" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "整数（0位小数）："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 1234.567, currencySymbol: "¥", precision: 0 })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "3位小数："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 1234.567, currencySymbol: "¥", precision: 3 })));
  }
};
var ReadOnlyStyles = {
  render: () => {
    return /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 16 } }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "默认："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: 1234.56, currencySymbol: "¥" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "大字号："), /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        mode: "read",
        value: 1234.56,
        currencySymbol: "¥",
        fontSize: 24,
        fontWeight: "bold"
      }
    )), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "红色（负债）："), /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        mode: "read",
        value: -1234.56,
        currencySymbol: "¥",
        color: "#ff4d4f"
      }
    )), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "绿色（收益）："), /* @__PURE__ */ React.createElement(
      import_PisellCurrency.PisellCurrency,
      {
        mode: "read",
        value: 1234.56,
        currencySymbol: "¥",
        color: "#52c41a"
      }
    )));
  }
};
var EmptyValue = {
  render: () => {
    return /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 16 } }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "默认空值："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: null, currencySymbol: "¥" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", { style: { marginRight: 8 } }, "自定义空值："), /* @__PURE__ */ React.createElement(import_PisellCurrency.PisellCurrency, { mode: "read", value: null, currencySymbol: "¥", emptyText: "暂无金额" })));
  }
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AllowNegative,
  Basic,
  DifferentCurrencies,
  DifferentPrecision,
  Disabled,
  EmptyValue,
  InForm,
  InTable,
  NoNegative,
  ReadOnly,
  ReadOnlyStyles,
  WithoutSymbol
});
