import { defineComponent as R, computed as l, shallowRef as P, useSlots as _, openBlock as u, createBlock as d, unref as e, withCtx as s, createElementVNode as k, toDisplayString as C, mergeProps as I, createSlots as M, renderList as N, renderSlot as U, normalizeProps as V, guardReactiveProps as w } from "vue";
import { InputNumber as z } from "@aplus-frontend/antdv";
import { omit as A } from "lodash-unified";
import "../../hooks/index.mjs";
import "../../render/index.mjs";
import { useDefaultPlaceholder as D } from "../hooks/use-default-placeholder.mjs";
import { useReadModeRender as E } from "../hooks/use-read-mode-render.mjs";
import { formatSecond as p } from "./helper.mjs";
import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
import O from "../../render/render.mjs";
const Y = /* @__PURE__ */ R({
  name: "ApFieldSecond",
  __name: "index",
  props: {
    mode: {},
    class: {},
    style: {},
    emptyText: { default: "--" },
    customReadMode: {},
    size: {},
    bordered: { type: Boolean, default: !0 },
    placeholder: {},
    name: {},
    id: {},
    type: {},
    addonBefore: {},
    addonAfter: {},
    prefix: {},
    suffix: {},
    "onUpdate:value": {},
    valueModifiers: {},
    status: {},
    variant: {},
    changeOnWheel: { type: Boolean, default: void 0 },
    changeOnBlur: { type: Boolean, default: void 0 },
    stringMode: { type: Boolean },
    defaultValue: {},
    value: {},
    prefixCls: {},
    min: { default: -1 / 0 },
    max: { default: 1 / 0 },
    step: { default: 1 },
    tabindex: {},
    controls: { type: Boolean, default: !0 },
    readonly: { type: Boolean },
    disabled: { type: Boolean, default: void 0 },
    autofocus: { type: Boolean },
    keyboard: { type: Boolean, default: !0 },
    parser: {},
    formatter: {},
    precision: {},
    decimalSeparator: {},
    onInput: {},
    onChange: {},
    onPressEnter: {},
    onStep: {},
    onBlur: {},
    onFocus: {}
  },
  emits: ["update:value"],
  setup(a, { expose: i, emit: m }) {
    const o = a, { renderer: f } = E(
      o,
      l(() => p(Number(t.value)))
    ), c = l(
      () => A(o, ["value", "onUpdate:value", "min", "placeholder", "mode"])
    ), v = m, r = P(), { value: t, updateValue: y } = F(
      o,
      v
    ), h = _(), B = D("Second", o);
    function b() {
      r.value?.focus();
    }
    function x() {
      r.value?.blur();
    }
    return i({ focus: b, blur: x }), (S, L) => a.mode === "read" ? (u(), d(e(O), {
      key: 0,
      renderer: e(f)
    }, {
      default: s(() => [
        k("span", null, C(e(p)(Number(e(t)))), 1)
      ]),
      _: 1
    }, 8, ["renderer"])) : (u(), d(e(z), I({
      key: 1,
      min: 0,
      style: { width: "100%" },
      placeholder: e(B),
      value: e(t)
    }, c.value, { "onUpdate:value": e(y) }), M({ _: 2 }, [
      N(h, (T, n) => ({
        name: n,
        fn: s((g) => [
          U(S.$slots, n, V(w(g || {})))
        ])
      }))
    ]), 1040, ["placeholder", "value", "onUpdate:value"]));
  }
});
export {
  Y as default
};
