"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),d=require("@aplus-frontend/utils"),n=require("dayjs"),p=require("lodash-unified"),c=require("../hooks/use-date-timezone.js"),r=require("./constant.js"),m=o.defineComponent({name:"ApFieldDateRead",__name:"read",props:{mode:{},class:{},style:{},emptyText:{default:"--"},customReadMode:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean},autofocus:{type:Boolean},disabled:{type:Boolean},tabindex:{},open:{type:Boolean},defaultOpen:{type:Boolean},inputReadOnly:{type:Boolean},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array]},clearIcon:{type:[Object,String,Number,Boolean,null,Array]},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean},showTime:{type:[Boolean,Object]},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},showWeek:{type:Boolean},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean},variant:{},showNow:{type:Boolean},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean},showMinute:{type:Boolean},showSecond:{type:Boolean},use12Hours:{type:Boolean},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},onOk:{},format:{default:"Y-D"},shownFormat:{},formatBegins:{type:Boolean},timezone:{}},setup(a){const e=a,{currentTimezone:u}=c.useDateTimezone(e),s=o.computed(()=>r.ApFieldDatePresetFormats.indexOf(e.format)>-1),i=o.computed(()=>s.value?r.PRESET_FORMAT_MAP[e.format]:e.format),l=o.computed(()=>{if(p.isNil(e.value))return;let t=n(e.value);return e.timezone&&(t=n(d.getTimeFormatToZone(e.value,u.value))),t});return(t,y)=>o.toDisplayString(l.value?o.unref(n)(l.value).format(i.value):a.emptyText)}});exports.default=m;
