var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellPhone/PisellPhone.stories.tsx
var PisellPhone_stories_exports = {};
__export(PisellPhone_stories_exports, {
  AutoFormatComparison: () => AutoFormatComparison,
  Basic: () => Basic,
  CommonCountriesTop: () => CommonCountriesTop,
  CompleteExample: () => CompleteExample,
  Disabled: () => Disabled,
  FilteredCountries: () => FilteredCountries,
  FormatValidation: () => FormatValidation,
  MaskingComparison: () => MaskingComparison,
  MultiCountryDisplay: () => MultiCountryDisplay,
  ReadMode: () => ReadMode,
  ReadModeDialable: () => ReadModeDialable,
  ReadModeMaskedLast: () => ReadModeMaskedLast,
  ReadModeMaskedMiddle: () => ReadModeMaskedMiddle,
  Required: () => Required,
  USPhone: () => USPhone,
  WithCountrySelector: () => WithCountrySelector,
  default: () => PisellPhone_stories_default
});
module.exports = __toCommonJS(PisellPhone_stories_exports);
var import_PisellPhone = require("./PisellPhone");
var import_react = __toESM(require("react"));
var meta = {
  title: "表单/表单组件/PisellPhone",
  component: import_PisellPhone.PisellPhone,
  parameters: {
    layout: "centered",
    docs: {
      description: {
        component: "电话号码输入/展示组件，支持国家码选择和自动格式化。"
      }
    }
  },
  tags: ["autodocs"],
  argTypes: {
    mode: {
      control: "radio",
      options: ["read", "edit"],
      description: "状态模式"
    },
    disabled: {
      control: "boolean",
      description: "是否禁用"
    },
    countryCode: {
      control: "text",
      description: "国家码"
    },
    showCountrySelector: {
      control: "boolean",
      description: "显示国家码选择器"
    },
    autoFormat: {
      control: "boolean",
      description: "自动格式化"
    },
    enableDial: {
      control: "boolean",
      description: "启用拨号（移动端）"
    },
    enableMasking: {
      control: "boolean",
      description: "启用脱敏"
    },
    showFlag: {
      control: "boolean",
      description: "显示国旗图标"
    }
  }
};
var PisellPhone_stories_default = meta;
var Basic = {
  args: {
    mode: "edit",
    placeholder: "请输入手机号",
    countryCode: "+86"
  }
};
var WithCountrySelector = {
  args: {
    mode: "edit",
    showCountrySelector: true,
    placeholder: "请输入电话号码"
  }
};
var FilteredCountries = {
  args: {
    mode: "edit",
    showCountrySelector: true,
    availableCountryCodes: ["+86", "+852", "+1", "+44"],
    placeholder: "请输入电话号码"
  }
};
var CommonCountriesTop = {
  args: {
    mode: "edit",
    showCountrySelector: true,
    commonCountryCodes: ["+86", "+1"],
    placeholder: "请输入电话号码"
  }
};
var ReadMode = {
  args: {
    mode: "read",
    value: "13800000000",
    countryCode: "+86"
  }
};
var ReadModeMaskedMiddle = {
  args: {
    mode: "read",
    value: "13800000000",
    countryCode: "+86",
    enableMasking: true,
    maskPattern: "middle"
  }
};
var ReadModeMaskedLast = {
  args: {
    mode: "read",
    value: "13800000000",
    countryCode: "+86",
    enableMasking: true,
    maskPattern: "last"
  }
};
var ReadModeDialable = {
  args: {
    mode: "read",
    value: "13800000000",
    countryCode: "+86",
    enableDial: true,
    showDialIcon: true
  }
};
var Disabled = {
  args: {
    mode: "edit",
    value: "13800000000",
    disabled: true
  }
};
var Required = {
  args: {
    mode: "edit",
    placeholder: "请输入手机号（必填）",
    required: true,
    validateTrigger: "onBlur"
  }
};
var FormatValidation = {
  args: {
    mode: "edit",
    placeholder: "请输入手机号",
    countryCode: "+86",
    validateFormat: true,
    validateTrigger: "onChange"
  }
};
var USPhone = {
  args: {
    mode: "edit",
    countryCode: "+1",
    showCountrySelector: false,
    placeholder: "请输入电话号码"
  }
};
var AutoFormatComparison = {
  render: () => /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "20px", width: "400px" } }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h4", null, "自动格式化（开启）"), /* @__PURE__ */ import_react.default.createElement(
    import_PisellPhone.PisellPhone,
    {
      defaultValue: "13800000000",
      countryCode: "+86",
      autoFormat: true,
      showCountrySelector: false
    }
  )), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h4", null, "自动格式化（关闭）"), /* @__PURE__ */ import_react.default.createElement(
    import_PisellPhone.PisellPhone,
    {
      defaultValue: "13800000000",
      countryCode: "+86",
      autoFormat: false,
      showCountrySelector: false
    }
  )))
};
var MultiCountryDisplay = {
  render: () => /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "16px", width: "400px" } }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "中国 (+86):"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "13800000000", countryCode: "+86" })), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "美国 (+1):"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "5551234567", countryCode: "+1" })), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "英国 (+44):"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "2012345678", countryCode: "+44" })), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "香港 (+852):"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "12345678", countryCode: "+852" })))
};
var MaskingComparison = {
  render: () => /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "16px", width: "400px" } }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "不脱敏:"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "13800000000", enableMasking: false })), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "中间脱敏:"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "13800000000", enableMasking: true, maskPattern: "middle" })), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("strong", null, "末尾脱敏:"), /* @__PURE__ */ import_react.default.createElement(import_PisellPhone.PisellPhone, { mode: "read", value: "13800000000", enableMasking: true, maskPattern: "last" })))
};
var CompleteExample = {
  render: () => {
    const [value, setValue] = import_react.default.useState("");
    const [countryCode, setCountryCode] = import_react.default.useState("+86");
    return /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "500px", display: "flex", flexDirection: "column", gap: "24px" } }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h3", null, "编辑态 - 完整功能"), /* @__PURE__ */ import_react.default.createElement(
      import_PisellPhone.PisellPhone,
      {
        value,
        onChange: setValue,
        countryCode,
        showCountrySelector: true,
        commonCountryCodes: ["+86", "+1", "+44"],
        onCountryCodeChange: (code) => {
          setCountryCode(code);
          console.log("国家码变更:", code);
        },
        placeholder: "请输入电话号码",
        required: true,
        validateFormat: true,
        validateTrigger: "both",
        allowClear: true,
        onValidate: (isValid, errors) => {
          console.log("校验结果:", isValid, errors);
        }
      }
    ), /* @__PURE__ */ import_react.default.createElement("p", { style: { marginTop: "8px", color: "#667085", fontSize: "12px" } }, "当前国家码：", countryCode)), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h3", null, "只读态 - 格式化显示"), /* @__PURE__ */ import_react.default.createElement(
      import_PisellPhone.PisellPhone,
      {
        mode: "read",
        value: value || "13800000000",
        countryCode,
        enableDial: true,
        showDialIcon: true,
        onDial: (phone) => {
          console.log("拨号:", phone);
        }
      }
    )), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h3", null, "只读态 - 脱敏显示"), /* @__PURE__ */ import_react.default.createElement(
      import_PisellPhone.PisellPhone,
      {
        mode: "read",
        value: value || "13800000000",
        countryCode,
        enableMasking: true,
        maskPattern: "middle"
      }
    )));
  }
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AutoFormatComparison,
  Basic,
  CommonCountriesTop,
  CompleteExample,
  Disabled,
  FilteredCountries,
  FormatValidation,
  MaskingComparison,
  MultiCountryDisplay,
  ReadMode,
  ReadModeDialable,
  ReadModeMaskedLast,
  ReadModeMaskedMiddle,
  Required,
  USPhone,
  WithCountrySelector
});
