"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("@aplus-frontend/antdv"),S=require("lodash-unified");require("../../hooks/index.js");require("../../render/index.js");const q=require("../hooks/use-default-placeholder.js"),x=require("../hooks/use-read-mode-render.js"),l=require("./helper.js"),g=require("../../hooks/useControllableValue.js"),P=require("../../render/render.js"),R=e.defineComponent({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(r,{expose:u,emit:d}){const o=r,{renderer:s}=x.useReadModeRender(o,e.computed(()=>l.formatSecond(Number(t.value)))),i=e.computed(()=>S.omit(o,["value","onUpdate:value","min","placeholder","mode"])),c=d,n=e.shallowRef(),{value:t,updateValue:p}=g.useControllableValue(o,c),f=e.useSlots(),m=q.useDefaultPlaceholder("Second",o);function v(){n.value?.focus()}function y(){n.value?.blur()}return u({focus:v,blur:y}),(h,_)=>r.mode==="read"?(e.openBlock(),e.createBlock(e.unref(P.default),{key:0,renderer:e.unref(s)},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(l.formatSecond)(Number(e.unref(t)))),1)]),_:1},8,["renderer"])):(e.openBlock(),e.createBlock(e.unref(b.InputNumber),e.mergeProps({key:1,min:0,style:{width:"100%"},placeholder:e.unref(m),value:e.unref(t)},i.value,{"onUpdate:value":e.unref(p)}),e.createSlots({_:2},[e.renderList(f,(k,a)=>({name:a,fn:e.withCtx(B=>[e.renderSlot(h.$slots,a,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1040,["placeholder","value","onUpdate:value"]))}});exports.default=R;
