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/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.tsx
var PisellReservationScheduleBand_stories_exports = {};
__export(PisellReservationScheduleBand_stories_exports, {
  Controlled: () => Controlled,
  CustomTimeNavigator: () => CustomTimeNavigator,
  Default: () => Default,
  InitialPastDay: () => InitialPastDay,
  ScheduleMinMax: () => ScheduleMinMax,
  WithScheduleSlots: () => WithScheduleSlots,
  default: () => PisellReservationScheduleBand_stories_default
});
module.exports = __toCommonJS(PisellReservationScheduleBand_stories_exports);
var import_react = __toESM(require("react"));
var import_dayjs = __toESM(require("dayjs"));
var import_PisellReservationScheduleBand = require("./PisellReservationScheduleBand");
var meta = {
  title: "Data Entry/PisellReservationScheduleBand",
  component: import_PisellReservationScheduleBand.PisellReservationScheduleBand,
  tags: ["autodocs"],
  parameters: {
    layout: "padded",
    docs: {
      description: {
        component: "纵向组合 PisellReservationSchedule 与 PisellTimeNavigator：选中日 `date` 与轴上时刻 `at` 由单一状态驱动；换日时会保留原时刻的时分并映射到新日。可通过 `scheduleProps` / `timeNavigatorProps` 透传子组件配置，适合作为 RecordBoard 等容器的 toolBar 顶栏。"
      }
    }
  },
  argTypes: {
    value: {
      description: "受控：{ date: Dayjs, at: Dayjs }",
      control: "object"
    },
    defaultValue: {
      description: "非受控初始值，可只传 date 或 at",
      control: "object"
    },
    scheduleProps: {
      description: "透传给 PisellReservationSchedule（不含 value/onChange/defaultValue）",
      control: "object"
    },
    timeNavigatorProps: {
      description: "透传给 PisellTimeNavigator（不含 value/onChange/referenceDate）",
      control: "object"
    },
    onChange: {
      action: "onChange",
      description: "date 或 at 变化时触发，参数已归一化"
    },
    className: { control: "text" },
    scheduleStartSlot: {
      description: "日程行左侧插槽（如标题）",
      control: false
    },
    scheduleEndSlot: {
      description: "日程行右侧插槽（如状态、主按钮）",
      control: false
    }
  }
};
var PisellReservationScheduleBand_stories_default = meta;
var wideDecorator = (StoryComp) => /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "100%", maxWidth: 960, minWidth: 480 } }, /* @__PURE__ */ import_react.default.createElement(StoryComp, null));
var Default = {
  args: {},
  decorators: [wideDecorator]
};
var CustomTimeNavigator = {
  args: {
    timeNavigatorProps: {
      stepMinutes: 30,
      majorStepMinutes: 120,
      showNowButton: true
    }
  },
  decorators: [wideDecorator]
};
var ScheduleMinMax = {
  args: {
    scheduleProps: {
      minDate: (0, import_dayjs.default)().subtract(7, "day"),
      maxDate: (0, import_dayjs.default)().add(7, "day")
    },
    defaultValue: {
      date: (0, import_dayjs.default)().startOf("day")
    }
  },
  decorators: [wideDecorator]
};
var Controlled = {
  render: function ControlledBandRender() {
    const [value, setValue] = (0, import_react.useState)(() => ({
      date: (0, import_dayjs.default)().startOf("day"),
      at: (0, import_dayjs.default)()
    }));
    return /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "100%", maxWidth: 960, minWidth: 480 } }, /* @__PURE__ */ import_react.default.createElement(
      import_PisellReservationScheduleBand.PisellReservationScheduleBand,
      {
        value,
        onChange: (next) => {
          setValue(next);
          console.log("onChange", {
            date: next.date.format("YYYY-MM-DD"),
            at: next.at.format("YYYY-MM-DD HH:mm")
          });
        },
        timeNavigatorProps: { showNowButton: true }
      }
    ), /* @__PURE__ */ import_react.default.createElement("p", { style: { marginTop: 12, fontSize: 12, color: "#666" } }, "date: ", value.date.format("YYYY-MM-DD"), " · at:", " ", value.at.format("HH:mm")));
  }
};
var InitialPastDay = {
  args: {
    defaultValue: {
      date: (0, import_dayjs.default)().subtract(1, "day").startOf("day"),
      at: (0, import_dayjs.default)().subtract(1, "day").hour(14).minute(30).second(0)
    },
    timeNavigatorProps: { showNowButton: true }
  },
  decorators: [wideDecorator]
};
var WithScheduleSlots = {
  render: () => /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "100%", maxWidth: 960, minWidth: 480 } }, /* @__PURE__ */ import_react.default.createElement(
    import_PisellReservationScheduleBand.PisellReservationScheduleBand,
    {
      scheduleStartSlot: /* @__PURE__ */ import_react.default.createElement("span", { style: { fontSize: 15, fontWeight: 600 } }, "Reservation"),
      scheduleEndSlot: /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 12 } }, /* @__PURE__ */ import_react.default.createElement("span", { style: { fontSize: 13, color: "#595959" } }, /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#52c41a", marginRight: 6 } }, "●"), "Current"), /* @__PURE__ */ import_react.default.createElement(
        "button",
        {
          type: "button",
          style: {
            background: "#1677ff",
            color: "#fff",
            border: "none",
            borderRadius: 8,
            padding: "6px 14px",
            fontSize: 14,
            cursor: "pointer"
          }
        },
        "+ 新建"
      )),
      timeNavigatorProps: { showNowButton: true }
    }
  ))
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Controlled,
  CustomTimeNavigator,
  Default,
  InitialPastDay,
  ScheduleMinMax,
  WithScheduleSlots
});
