@univerjs/sheets-numfmt-ui 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +144 -141
- package/lib/es/locale/en-US.js +2 -1
- package/lib/es/locale/fa-IR.js +2 -1
- package/lib/es/locale/fr-FR.js +2 -1
- package/lib/es/locale/ru-RU.js +2 -1
- package/lib/es/locale/vi-VN.js +2 -1
- package/lib/es/locale/zh-CN.js +2 -1
- package/lib/es/locale/zh-TW.js +2 -1
- package/lib/index.js +1100 -0
- package/lib/locale/en-US.js +42 -0
- package/lib/locale/fa-IR.js +42 -0
- package/lib/locale/fr-FR.js +42 -0
- package/lib/locale/ru-RU.js +42 -0
- package/lib/locale/vi-VN.js +42 -0
- package/lib/locale/zh-CN.js +42 -0
- package/lib/locale/zh-TW.js +42 -0
- package/lib/types/locale/zh-CN.d.ts +2 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +13 -13
package/lib/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var pe=Object.defineProperty;var ve=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var A=(e,t,r)=>ve(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@univerjs/core"),oe=require("@univerjs/engine-render"),m=require("@univerjs/sheets-numfmt"),M=require("@univerjs/sheets-ui"),b=require("@univerjs/ui"),ge=require("@univerjs/engine-formula"),G=require("@univerjs/engine-numfmt"),S=require("@univerjs/sheets"),D=require("rxjs"),W=require("rxjs/operators"),l=require("react/jsx-runtime"),y=require("react"),T=require("@univerjs/design"),ne={};var Se=Object.getOwnPropertyDescriptor,ye=(e,t,r,n)=>{for(var s=n>1?void 0:n?Se(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},U=(e,t)=>(r,n)=>t(r,n,e);const Z="SHEET_NUMFMT_ALERT";let ee=class extends c.Disposable{constructor(e,t,r,n,s,i,o,u){super(),this._context=e,this._hoverManagerService=t,this._cellAlertManagerService=r,this._localeService=n,this._formulaDataModel=s,this._zenZoneService=i,this._numfmtService=o,this._configService=u,this._init()}_init(){this._initCellAlertPopup(),this._initZenService()}_initCellAlertPopup(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(D.debounceTime(100)).subscribe(e=>{var t,r;if(e){const n=e.location,s=this._context.unit,i=s.getActiveSheet();if(!i)return;const o=n.unitId,u=n.subUnitId;let a;const h=i.getCell(n.row,n.col);if(h!=null&&h.s){const f=s.getStyles().get(h.s);f!=null&&f.n&&(a=f.n)}if(a||(a=this._numfmtService.getValue(o,u,n.row,n.col)),!a){this._hideAlert();return}if(G.isTextFormat(a.pattern)&&(h!=null&&h.v)&&c.isRealNum(h.v)){if((t=this._configService.getConfig(m.SHEETS_NUMFMT_PLUGIN_CONFIG_KEY))!=null&&t.disableTextFormatAlert)return;const f=this._cellAlertManagerService.currentAlert.get(Z),d=(r=f==null?void 0:f.alert)==null?void 0:r.location;if(d&&d.row===n.row&&d.col===n.col&&d.subUnitId===n.subUnitId&&d.unitId===n.unitId)return;this._cellAlertManagerService.showAlert({type:M.CellAlertType.WARNING,title:this._localeService.t("info.error"),message:this._localeService.t("info.forceStringInfo"),location:n,width:200,height:74,key:Z});return}}this._hideAlert()}))}_initZenService(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this._hideAlert()}))}_hideAlert(){this._cellAlertManagerService.removeAlert(Z)}};ee=ye([U(1,c.Inject(M.HoverManagerService)),U(2,c.Inject(M.CellAlertManagerService)),U(3,c.Inject(c.LocaleService)),U(4,c.Inject(ge.FormulaDataModel)),U(5,b.IZenZoneService),U(6,c.Inject(S.INumfmtService)),U(7,c.IConfigService)],ee);const z={id:"sheet.operation.close.numfmt.panel",type:c.CommandType.OPERATION,handler:()=>!0},L={id:"sheet.operation.open.numfmt.panel",type:c.CommandType.OPERATION,handler:e=>(e.get(H).openPanel(),!0)};var _e=Object.getOwnPropertyDescriptor,be=(e,t,r,n)=>{for(var s=n>1?void 0:n?_e(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Ce=(e,t)=>(r,n)=>t(r,n,e);const te=y.createContext([]);let $=class{constructor(e){this._localStorageService=e}_getKey(e){return`userHabitController_${e}`}async addHabit(e,t){const r=this._getKey(e);return this._localStorageService.getItem(r).then(n=>{n||this._localStorageService.setItem(r,t)})}markHabit(e,t){const r=this._getKey(e);this._localStorageService.getItem(r).then(n=>{if(n){const s=n.findIndex(i=>i===t);s>-1&&n.splice(s,1),n.unshift(t),this._localStorageService.setItem(r,n)}})}async getHabit(e,t){const r=this._getKey(e),n=await this._localStorageService.getItem(r);if(t&&n){const s=n.map((i,o,u)=>{const a=u.length;return{value:i,priority:a-o}});return t.sort((i,o)=>{var h,f;const u=((h=s.find(d=>d.value===i))==null?void 0:h.priority)||-1;return(((f=s.find(d=>d.value===o))==null?void 0:f.priority)||-1)-u})}return n||[]}deleteHabit(e){this._localStorageService.removeItem(e)}};$=be([Ce(0,c.Inject(c.ILocalStorageService))],$);const re="numfmtCurrency",Ie=e=>{const t=b.useDependency($),[r,n]=y.useState(m.currencySymbols);return y.useEffect(()=>{t.addHabit("numfmtCurrency",[]).then(()=>{t.getHabit(re,[...m.currencySymbols]).then(i=>{n(i),e&&e(i)})})},[]),{userHabitCurrency:r,mark:i=>{t.markHabit(re,i)}}},Ne=()=>{const e=y.useRef([]),[t,r]=y.useState({});return y.useEffect(()=>{e.current.forEach(s=>{s()}),e.current=[]},[t]),s=>{e.current.push(s),r({})}},Te=e=>!!m.getCurrencyType(e)&&e.startsWith("_("),Ee=e=>{const{defaultPattern:t,action:r,onChange:n}=e,[s,i]=y.useState(()=>m.getDecimalFromPattern(t||"",2)),o=y.useContext(te),[u,a]=y.useState(()=>m.getCurrencyType(t)||o[0]),h=y.useMemo(()=>o.map(_=>({label:_,value:_})),[]),d=b.useDependency(c.LocaleService).t;r.current=()=>m.setPatternDecimal(`_("${u}"* #,##0${s>0?".0":""}_)`,s);const p=_=>{a(_),n(m.setPatternDecimal(`_("${_}"* #,##0${s>0?".0":""}_)`,s))},g=_=>{const v=_||0;i(v),n(m.setPatternDecimal(`_("${u}"* #,##0${v>0?".0":""}_)`,v))};return l.jsxs("div",{children:[l.jsxs("div",{className:"m-t-16 options",children:[l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:d("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"m-t-8 w-120",children:l.jsx(T.InputNumber,{value:s,max:20,min:0,onChange:g})})]}),l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:d("sheet.numfmt.currencyType")}),l.jsx("div",{className:"m-t-8 w-140",children:l.jsx(T.Select,{onChange:p,options:h,value:u})})]})]}),l.jsx("div",{className:"describe m-t-14",children:d("sheet.numfmt.accountingDes")})]})},Pe=e=>!!m.getCurrencyType(e)&&!e.startsWith("_("),Me=e=>{const r=b.useDependency(c.LocaleService).t,n=y.useContext(te),[s,i]=y.useState(()=>m.getCurrencyType(e.defaultPattern)||n[0]),[o,u]=y.useState(()=>m.getDecimalFromPattern(e.defaultPattern||"",2)),[a,h]=y.useState(()=>{var C;const v=m.getCurrencyFormatOptions(s);return((C=v.find(E=>m.isPatternEqualWithoutDecimal(E.value,e.defaultPattern)))==null?void 0:C.value)||v[0].value}),f=y.useMemo(()=>m.getCurrencyFormatOptions(s),[s]),d=y.useMemo(()=>n.map(v=>({label:v,value:v})),[n]);e.action.current=()=>m.setPatternDecimal(a,o);const p=v=>{if(v===void 0)return;i(v);const N=m.getCurrencyFormatOptions(v)[0].value;h(N),e.onChange(m.setPatternDecimal(N,o))},g=v=>{v!==void 0&&(h(v),e.onChange(m.setPatternDecimal(v,o)))},_=v=>{u(v||0),e.onChange(m.setPatternDecimal(a,v||0))};return l.jsxs("div",{children:[l.jsxs("div",{className:"m-t-16 options",children:[l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:r("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"m-t-8 w-120",children:l.jsx(T.InputNumber,{value:o,max:20,min:0,onChange:_})})]}),l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:r("sheet.numfmt.currencyType")}),l.jsx("div",{className:"m-t-8 w-140",children:l.jsx(T.Select,{onChange:p,options:d,value:s})})]})]}),l.jsx("div",{className:"m-t-16 label",children:r("sheet.numfmt.negType")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.SelectList,{onChange:g,options:f,value:a})}),l.jsx("div",{className:"describe m-t-14",children:r("sheet.numfmt.currencyDes")})]})};var P=function(){return P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},P.apply(this,arguments)},xe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r},ce=y.forwardRef(function(e,t){var r=e.icon,n=e.id,s=e.className,i=e.extend,o=xe(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(n," ").concat(s||"").trim(),a=y.useRef("_".concat(Re()));return ae(r,"".concat(n),{defIds:r.defIds,idSuffix:a.current},P({ref:t,className:u},o),i)});function ae(e,t,r,n,s){return y.createElement(e.tag,P(P({key:t},je(e,r,s)),n),(De(e,r).children||[]).map(function(i,o){return ae(i,"".concat(t,"-").concat(e.tag,"-").concat(o),r,void 0,s)}))}function je(e,t,r){var n=P({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(i){var o=i[0],u=i[1];o==="mask"&&typeof u=="string"&&(n[o]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var s=t.defIds;return!s||s.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(i){var o=i[0],u=i[1];typeof u=="string"&&(n[o]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?P(P({},e),{children:e.children.map(function(s){return typeof s.attrs.id=="string"&&n&&n.indexOf(s.attrs.id)>-1?P(P({},s),{attrs:P(P({},s.attrs),{id:s.attrs.id+t.idSuffix})}):s})}):e}function Re(){return Math.random().toString(36).substring(2,8)}ce.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},le=y.forwardRef(function(e,t){return y.createElement(ce,Object.assign({},e,{id:"check-mark-single",ref:t,icon:Ue}))});le.displayName="CheckMarkSingle";const Oe="univer-custom-format-title",we="univer-custom-format-input",ke="univer-custom-format-history-list",Fe="univer-custom-format-history-list-item",Le="univer-custom-format-history-list-item-icon-wrap",$e="univer-custom-format-des",O={customFormatTitle:Oe,customFormatInput:we,customFormatHistoryList:ke,customFormatHistoryListItem:Fe,customFormatHistoryListItemIconWrap:Le,customFormatDes:$e},X="customFormat",J="numfmt_custom_pattern";function He(e){const{defaultPattern:t,action:r,onChange:n}=e,s=b.useDependency($),i=b.useDependency(c.ILocalStorageService),o=b.useDependency(c.LocaleService),[u,a]=y.useState(t);r.current=()=>(s.markHabit(X,u),i.getItem(J).then((g=[])=>{const _=[...new Set([u,...g||[]])].splice(0,10).filter(v=>!!v);i.setItem(J,_)}),u);const[h,f]=y.useState([]);y.useEffect(()=>{i.getItem(J).then(g=>{const _=[...m.CURRENCYFORMAT.map(v=>v.suffix("$")),...m.DATEFMTLISG.map(v=>v.suffix),...m.NUMBERFORMAT.map(v=>v.suffix)];_.push(...g||[]),s.addHabit(X,[]).finally(()=>{s.getHabit(X,_).then(v=>{f([...new Set(v)])})})})},[]);const d=g=>{a(g),n(g)},p=()=>{n(u)};return l.jsxs("div",{className:O.customFormat,children:[l.jsx("div",{className:O.customFormatTitle,children:o.t("sheet.numfmt.customFormat")}),l.jsx(T.Input,{placeholder:o.t("sheet.numfmt.customFormat"),onBlur:p,value:u,onChange:a,className:O.customFormatInput}),l.jsx("div",{className:O.customFormatHistoryList,children:h.map(g=>l.jsxs("div",{onClick:()=>d(g),className:O.customFormatHistoryListItem,children:[l.jsx("div",{className:O.customFormatHistoryListItemIconWrap,children:u===g&&l.jsx(le,{})}),l.jsx("div",{children:g})]},g))}),l.jsx("div",{className:O.customFormatDes,children:o.t("sheet.numfmt.customFormatDes")})]})}const Ae=e=>{const t=c.numfmt.getInfo(e);return m.getDateFormatOptions().map(r=>r.value).includes(e)||["date","datetime","time"].includes(t.type)},We=e=>{const t=y.useMemo(m.getDateFormatOptions,[]),n=b.useDependency(c.LocaleService).t,[s,i]=y.useState(()=>{if(e.defaultPattern){const u=t.find(a=>a.value===e.defaultPattern);if(u)return u.value}return t[0].value});e.action.current=()=>s;const o=u=>{u!==void 0&&(i(u),e.onChange(u))};return l.jsxs("div",{children:[l.jsx("div",{className:"m-t-16 label",children:n("sheet.numfmt.dateType")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.SelectList,{value:s,options:t,onChange:o})}),l.jsx("div",{className:"describe m-t-14",children:n("sheet.numfmt.dateDes")})]})},Ve=e=>!e,Be=e=>{const r=b.useDependency(c.LocaleService).t;return e.action.current=()=>"",l.jsx("div",{children:l.jsx("div",{className:"describe m-t-14",children:r("sheet.numfmt.generalDes")})})},qe=e=>m.getNumberFormatOptions().some(t=>m.isPatternEqualWithoutDecimal(t.value,e)),Ge=e=>{const t=b.useDependency(c.LocaleService),r=y.useMemo(m.getNumberFormatOptions,[]),[n,s]=y.useState(()=>m.getDecimalFromPattern(e.defaultPattern||"",0)),[i,o]=y.useState(()=>{const d=r.find(p=>m.isPatternEqualWithoutDecimal(p.value,e.defaultPattern||""));return(d==null?void 0:d.value)||r[0].value}),u=y.useMemo(()=>m.setPatternDecimal(i,Number(n||0)),[i,n]),a=y.useMemo(()=>!m.isPatternHasDecimal(i),[i]),h=d=>{s(d||0),e.onChange(m.setPatternDecimal(i,Number(d||0)))},f=d=>{d!==void 0&&(s(m.getDecimalFromPattern(d,0)),o(d),e.onChange(d))};return e.action.current=()=>u,l.jsxs("div",{children:[l.jsx("div",{className:"m-t-16 label",children:t.t("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.InputNumber,{disabled:a,value:n,max:20,min:0,onChange:h})}),l.jsxs("div",{className:"m-t-16 label",children:[" ",t.t("sheet.numfmt.negType")]}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.SelectList,{onChange:f,options:r,value:i})}),l.jsx("div",{className:"describe m-t-14",children:t.t("sheet.numfmt.thousandthPercentileDes")})]})},Ke=e=>{const{defaultValue:t,defaultPattern:r,row:n,col:s}=e.value,i=b.useDependency(c.LocaleService),o=y.useRef(()=>""),u=i.t,a=Ne(),h=y.useMemo(()=>[{label:"sheet.numfmt.general",component:Be},{label:"sheet.numfmt.accounting",component:Ee},{label:"sheet.numfmt.currency",component:Me},{label:"sheet.numfmt.date",component:We},{label:"sheet.numfmt.thousandthPercentile",component:Ge},{label:"sheet.numfmt.customFormat",component:He}].map(I=>({...I,label:u(I.label)})),[]),[f,d]=y.useState(C),[p,g]=y.useState(()=>`${n}_${s}`),{mark:_,userHabitCurrency:v}=Ie(()=>g(`${n}_${s}_userCurrency'`)),N=y.useMemo(()=>{var I;return(I=h.find(w=>w.label===f))==null?void 0:I.component},[f]);function C(){return[Ve,Te,Pe,Ae,qe].reduce((w,he,fe)=>w||(he(r)?h[fe].label:""),"")||h[0].label}const E=h.map(I=>({label:I.label,value:I.label})),j=I=>{d(I),a(()=>e.onChange({type:"change",value:o.current()||""}))},R=I=>{e.onChange({type:"change",value:I})},K=()=>{const I=o.current()||"",w=m.getCurrencyType(I);w&&_(w),e.onChange({type:"confirm",value:I})},k=()=>{e.onChange({type:"cancel",value:""})},Y={onChange:R,defaultValue:t,defaultPattern:r,action:o};return y.useEffect(()=>{d(C()),g(`${n}_${s}`)},[n,s]),l.jsxs("div",{className:"numfmt-panel p-b-20",children:[l.jsxs("div",{children:[l.jsx("div",{className:"label m-t-14",children:u("sheet.numfmt.numfmtType")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.Select,{onChange:j,options:E,value:f,style:{width:"100%"}})}),l.jsx("div",{children:N&&l.jsx(te.Provider,{value:v,children:y.createElement(N,{...Y,key:p})})})]}),l.jsxs("div",{className:"btn-list m-t-14 m-b-20",children:[l.jsx(T.Button,{size:"small",onClick:k,className:"m-r-12",children:u("sheet.numfmt.cancel")}),l.jsx(T.Button,{type:"primary",size:"small",onClick:K,children:u("sheet.numfmt.confirm")})]})]})};var Ye=Object.getOwnPropertyDescriptor,Ze=(e,t,r,n)=>{for(var s=n>1?void 0:n?Ye(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},x=(e,t)=>(r,n)=>t(r,n,e);const se="SHEET_NUMFMT_PANEL";let H=class extends c.Disposable{constructor(t,r,n,s,i,o,u,a,h,f,d){super();A(this,"_previewPattern","");A(this,"_sidebarDisposable",null);this._sheetInterceptorService=t,this._themeService=r,this._univerInstanceService=n,this._commandService=s,this._selectionManagerService=i,this._renderManagerService=o,this._numfmtService=u,this._componentManager=a,this._sidebarService=h,this._localeService=f,this._sheetsNumfmtCellContentController=d,this._initRealTimeRenderingInterceptor(),this._initPanel(),this._initCommands(),this._initCloseListener(),this._commandExecutedListener(),this._initNumfmtLocalChange()}_initNumfmtLocalChange(){this.disposeWithMe(D.merge(this._sheetsNumfmtCellContentController.local$,this._localeService.currentLocale$).subscribe(()=>{this._forceUpdate()}))}openPanel(){var N;const t=this._sidebarService,r=this._selectionManagerService,n=this._commandService,s=this._univerInstanceService,i=this._numfmtService,o=this._localeService,a=(((N=r.getCurrentSelections())==null?void 0:N.map(C=>C.range))||[])[0];if(!a)return!1;const h=s.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET),f=h.getActiveSheet();if(!f)return!1;const d=f.getCellRaw(a.startRow,a.startColumn),p=i.getValue(h.getUnitId(),f.getSheetId(),a.startRow,a.startColumn);let g="";p&&(g=p.pattern);const _=(d==null?void 0:d.t)===c.CellValueType.NUMBER?d.v:12345678,v={onChange:C=>{var E;if(C.type==="change")this._previewPattern=C.value,this._forceUpdate();else if(C.type==="confirm"){const j=((E=r.getCurrentSelections())==null?void 0:E.map(k=>k.range))||[],R={values:[]},K=m.getPatternType(C.value);j.forEach(k=>{c.Range.foreach(k,(Y,I)=>{R.values.push({row:Y,col:I,pattern:C.value,type:K})})}),n.executeCommand(m.SetNumfmtCommand.id,R),t.close()}else C.type==="cancel"&&t.close()},value:{defaultPattern:g,defaultValue:_,row:a.startRow,col:a.startColumn}};return this._sidebarDisposable=t.open({header:{title:o.t("sheet.numfmt.title")},children:{label:se,...v},onClose:()=>{this._forceUpdate(),n.executeCommand(z.id)}}),!0}_forceUpdate(t){var n;const r=this._renderManagerService.getRenderById(t!=null?t:this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getUnitId());r==null||r.with(M.SheetSkeletonManagerService).reCalculate(),(n=r==null?void 0:r.mainComponent)==null||n.makeDirty()}_initCommands(){[L,z].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))})}_initPanel(){this._componentManager.register(se,Ke)}_initRealTimeRenderingInterceptor(){const t=new D.Observable(n=>{this._commandService.onCommandExecuted(s=>{s.id===L.id&&n.next(!0),s.id===z.id&&n.next(!1)})}),r=D.combineLatest([t,this._selectionManagerService.selectionMoveEnd$.pipe(W.map(n=>n?n.map(s=>s.range):[]))]);this.disposeWithMe(c.toDisposable(r.pipe(W.switchMap(([n,s])=>new D.Observable(i=>{const o=new c.DisposableCollection;return n&&s.length&&i.next({selectionRanges:s,disposableCollection:o}),()=>{o.dispose()}})),W.tap(()=>{this._previewPattern=null})).subscribe(({disposableCollection:n,selectionRanges:s})=>{var o,u;const i=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);this.openPanel(),n.add(this._sheetInterceptorService.intercept(S.INTERCEPTOR_POINT.CELL_CONTENT,{priority:99,effect:c.InterceptorEffectEnum.Value|c.InterceptorEffectEnum.Style,handler:(a,h,f)=>{const{row:d,col:p}=h,g=f(a)||{};if(s.find(_=>_.startColumn<=p&&_.endColumn>=p&&_.startRow<=d&&_.endRow>=d)){const _=h.worksheet.getCellRaw(d,p),v=_==null?void 0:_.v,N=_==null?void 0:_.t;if(v==null||N!==c.CellValueType.NUMBER||this._previewPattern===null)return g;const C=m.getPatternPreviewIgnoreGeneral(this._previewPattern,v,this._sheetsNumfmtCellContentController.local);if(C.color){const j=this._themeService.getCurrentTheme()[`${C.color}500`];return{...g,v:C.result,t:c.CellValueType.STRING,s:{cl:{rgb:j}}}}return{...g,v:C.result,t:c.CellValueType.STRING}}return g}})),(u=(o=this._renderManagerService.getRenderById(i.getUnitId()))==null?void 0:o.mainComponent)==null||u.makeDirty()})))}_commandExecutedListener(){const t=[S.RemoveNumfmtMutation.id,S.SetNumfmtMutation.id];this.disposeWithMe(new D.Observable(r=>{const n=this._commandService.onCommandExecuted(s=>{if(t.includes(s.id)){const i=s.params;r.next(i.unitId)}});return()=>n.dispose()}).pipe(W.debounceTime(16)).subscribe(r=>this._forceUpdate(r)))}_initCloseListener(){this._univerInstanceService.getCurrentTypeOfUnit$(c.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{var r;t||((r=this._sidebarDisposable)==null||r.dispose(),this._sidebarDisposable=null)})}};H=Ze([x(0,c.Inject(S.SheetInterceptorService)),x(1,c.Inject(c.ThemeService)),x(2,c.IUniverInstanceService),x(3,c.ICommandService),x(4,c.Inject(S.SheetsSelectionsService)),x(5,oe.IRenderManagerService),x(6,S.INumfmtService),x(7,c.Inject(b.ComponentManager)),x(8,b.ISidebarService),x(9,c.Inject(c.LocaleService)),x(10,c.Inject(m.SheetsNumfmtCellContentController))],H);var ze=Object.getOwnPropertyDescriptor,Xe=(e,t,r,n)=>{for(var s=n>1?void 0:n?ze(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},F=(e,t)=>(r,n)=>t(r,n,e);const Je=()=>{let e=[];return{add:(s,i,o,u,a)=>e.push({unitId:s,subUnitId:i,row:o,col:u,value:a}),getEffects:()=>e,clean:()=>{e=[]}}};let B=class extends c.Disposable{constructor(t,r,n,s,i){super();A(this,"_collectEffectMutation",Je());this._sheetInterceptorService=t,this._numfmtService=r,this._univerInstanceService=n,this._injector=s,this._editorBridgeService=i,this._initInterceptorEditorStart(),this._initInterceptorEditorEnd(),this._initInterceptorCommands()}_initInterceptorEditorStart(){this._editorBridgeService&&this.disposeWithMe(c.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(S.BEFORE_CELL_EDIT,{handler:(t,r,n)=>{const s=r.row,i=r.col,o=this._numfmtService.getValue(r.unitId,r.subUnitId,s,i);if(o)switch(m.getPatternType(o.pattern)){case"scientific":case"currency":case"grouped":case"number":{const a=r.worksheet.getCellRaw(s,i);return n&&n(a)}case"percent":case"date":case"time":case"datetime":default:return n&&n(t)}return n(t)}})))}_initInterceptorEditorEnd(){this.disposeWithMe(c.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(S.AFTER_CELL_EDIT,{handler:(t,r,n)=>{var f,d,p,g;this._collectEffectMutation.clean();const s=this._numfmtService.getValue(r.unitId,r.subUnitId,r.row,r.col),i=(f=s&&m.getPatternType(s.pattern))!=null?f:"",o=()=>{s&&this._collectEffectMutation.add(r.unitId,r.subUnitId,r.row,r.col,null)};if(!(t!=null&&t.v)&&!(t!=null&&t.p)||G.isTextFormat(s==null?void 0:s.pattern)||t.t===c.CellValueType.FORCE_STRING)return n(t);const u=(d=t.p)==null?void 0:d.body,a=(g=(p=t==null?void 0:t.p)==null?void 0:p.body)!=null&&g.dataStream?t.p.body.dataStream.replace(/\r\n$/,""):String(t.v),h=c.numfmt.parseDate(a)||c.numfmt.parseTime(a)||c.numfmt.parseNumber(a);if(u)if(et(u)){const{dataStream:_}=u,v=_.replace(/\r\n$/,""),N=Number(v);if(Number.isNaN(N)&&!h)return n(t)}else return n(t);if(h){h.z&&this._collectEffectMutation.add(r.unitId,r.subUnitId,r.row,r.col,{pattern:h.z});const _=Number(h.v);return n({...t,p:void 0,v:_,t:c.CellValueType.NUMBER})}else(["date","time","datetime","percent"].includes(i)||!Qe(a))&&o();return n(t)}})))}_initInterceptorCommands(){const t=this;this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations(r){var n;switch(r.id){case S.SetRangeValuesCommand.id:{const s=t._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET),i=s.getUnitId(),o=(n=s.getActiveSheet())==null?void 0:n.getSheetId();if(!o)return{redos:[],undos:[]};const u=t._collectEffectMutation.getEffects();if(t._collectEffectMutation.clean(),!u.length)return{redos:[],undos:[]};const a=u.filter(p=>{var g;return!!((g=p.value)!=null&&g.pattern)}).map(p=>({row:p.row,col:p.col,pattern:p.value.pattern})),h=u.filter(p=>{var g;return!((g=p.value)!=null&&g.pattern)}).map(p=>({startRow:p.row,endColumn:p.col,startColumn:p.col,endRow:p.row})),f=[],d=[];if(a.length){const p={id:S.SetNumfmtMutation.id,params:S.transformCellsToRange(i,o,a)};f.push(p),d.push(...S.factorySetNumfmtUndoMutation(t._injector,p.params))}if(h.length){const p={id:S.RemoveNumfmtMutation.id,params:{unitId:i,subUnitId:o,ranges:h}};f.push(p),d.push(...S.factoryRemoveNumfmtUndoMutation(t._injector,p.params))}return{redos:f,undos:d.reverse()}}}return{redos:[],undos:[]}}}))}};B=Xe([F(0,c.Inject(S.SheetInterceptorService)),F(1,c.Inject(S.INumfmtService)),F(2,c.Inject(c.IUniverInstanceService)),F(3,c.Inject(c.Injector)),F(4,c.Optional(M.IEditorBridgeService))],B);function Qe(e){return/^-?\d+(\.\d+)?$/.test(e)}function et(e){const{textRuns:t=[],paragraphs:r=[],customRanges:n,customBlocks:s=[]}=e,i=["va"];return!(t.some(o=>!!(o.ts&&Object.keys(o.ts).some(a=>i.includes(a))))||r.some(o=>o.bullet)||r.length>=2||n!=null&&n.length||s.length>0)}const V=[{label:"sheet.numfmt.general",pattern:null},{label:"sheet.numfmt.text",pattern:G.DEFAULT_TEXT_FORMAT_EXCEL},"|",{label:"sheet.numfmt.number",pattern:"0"},"|",{label:"sheet.numfmt.accounting",pattern:'"¥" #,##0.00_);[Red]("¥"#,##0.00)'},{label:"sheet.numfmt.financialValue",pattern:"#,##0.00;[Red]#,##0.00"},{label:"sheet.numfmt.currency",pattern:'"¥"#,##0.00_);[Red]("¥"#,##0.00)'},{label:"sheet.numfmt.roundingCurrency",pattern:'"¥"#,##0;[Red]"¥"#,##0'},"|",{label:"sheet.numfmt.date",pattern:"yyyy-mm-dd;@"},{label:"sheet.numfmt.time",pattern:'am/pm h":"mm":"ss'},{label:"sheet.numfmt.dateTime",pattern:"yyyy-m-d am/pm h:mm"},{label:"sheet.numfmt.timeDuration",pattern:"h:mm:ss"},"|",{label:"sheet.numfmt.percent",pattern:"0.00%"},"|",{label:"sheet.numfmt.moreFmt",pattern:""}],tt=e=>({icon:new D.Observable(t=>{const r=e.get(m.MenuCurrencyService);function n(i){return{[m.countryCurrencyMap.US]:"DollarSingle",[m.countryCurrencyMap.RU]:"RoubleSingle",[m.countryCurrencyMap.CN]:"RmbSingle",[m.countryCurrencyMap.AT]:"EuroSingle"}[i]||"DollarSingle"}const s=m.countryCurrencyMap[r.getCurrencySymbol()]||"$";return t.next(n(s)),r.currencySymbol$.subscribe(i=>{const o=m.countryCurrencyMap[i]||"$";t.next(n(o))})}),id:m.SetCurrencyCommand.id,title:"sheet.numfmt.currency",tooltip:"sheet.numfmt.currency",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),nt=e=>({icon:"AddDigitsSingle",id:m.AddDecimalCommand.id,title:"sheet.numfmt.addDecimal",tooltip:"sheet.numfmt.addDecimal",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),rt=e=>({icon:"ReduceDigitsSingle",id:m.SubtractDecimalCommand.id,title:"sheet.numfmt.subtractDecimal",tooltip:"sheet.numfmt.subtractDecimal",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),st=e=>({icon:"PercentSingle",id:m.SetPercentCommand.id,title:"sheet.numfmt.percent",tooltip:"sheet.numfmt.percent",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),it=e=>{const t=e.get(c.IUniverInstanceService),r=e.get(c.ICommandService),n=e.get(c.LocaleService),s=e.get(S.SheetsSelectionsService),i=[S.RemoveNumfmtMutation.id,S.SetNumfmtMutation.id],o=M.deriveStateFromActiveSheet$(t,"",({workbook:u,worksheet:a})=>new D.Observable(h=>D.merge(s.selectionMoveEnd$,c.fromCallback(r.onCommandExecuted.bind(r)).pipe(D.filter(([f])=>i.includes(f.id)))).subscribe(()=>{var d,p;const f=s.getCurrentSelections();if(f&&f[0]){const g=f[0].range,_=g.startRow,v=g.startColumn,N=(p=u.getStyles().get((d=a.getCell(_,v))==null?void 0:d.s))==null?void 0:p.n,C=N==null?void 0:N.pattern;let E=n.t("sheet.numfmt.general");if(G.isDefaultFormat(C)){h.next(E);return}if(C){const j=V.filter(R=>typeof R=="object"&&R.pattern).find(R=>m.isPatternEqualWithoutDecimal(C,R.pattern));j&&typeof j=="object"&&j.pattern?E=n.t(j.label):E=n.t("sheet.numfmt.moreFmt")}h.next(E)}})));return{label:ue,id:L.id,tooltip:"sheet.numfmt.title",type:b.MenuItemType.SELECTOR,slot:!0,selections:[{label:{name:me,hoverable:!1,selectable:!1}}],value$:o,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetSetCellStylePermission,S.WorksheetEditPermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}},ue="sheet.numfmt.moreNumfmtType",me="sheet.numfmt.moreNumfmtType.options",ot=e=>{const{value:t}=e,r=b.useDependency(c.LocaleService),n=t!=null?t:r.t("sheet.numfmt.general");return l.jsx("span",{className:"univer-text-sm",children:n})},ct=()=>{const e=b.useDependency(c.ICommandService),t=b.useDependency(c.LocaleService),r=b.useDependency(b.ILayoutService),n=b.useDependency(m.SheetsNumfmtCellContentController),s=b.useDependency(S.SheetsSelectionsService),i=a=>{const h=s.getCurrentLastSelection();if(!h)return;const f=h.range,d=[];c.Range.foreach(f,(p,g)=>{a?d.push({row:p,col:g,pattern:a,type:m.getPatternType(a)}):d.push({row:p,col:g})}),e.executeCommand(m.SetNumfmtCommand.id,{values:d}),r.focus()},o=a=>{if(a===0)i(null);else if(a===V.length-1)e.executeCommand(L.id),r.focus();else{const h=V[a];h.pattern&&i(h.pattern)}},u=1220;return l.jsx("div",{className:"univer-grid univer-gap-1 univer-p-1.5",children:V.map((a,h)=>a==="|"?l.jsx(T.Separator,{},h):l.jsxs("div",{className:`
|
|
1
|
+
"use strict";var pe=Object.defineProperty;var ve=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var A=(e,t,r)=>ve(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@univerjs/core"),oe=require("@univerjs/engine-render"),m=require("@univerjs/sheets-numfmt"),M=require("@univerjs/sheets-ui"),ge=require("@univerjs/engine-formula"),G=require("@univerjs/engine-numfmt"),S=require("@univerjs/sheets"),b=require("@univerjs/ui"),D=require("rxjs"),W=require("rxjs/operators"),l=require("react/jsx-runtime"),y=require("react"),T=require("@univerjs/design"),ne={};var Se=Object.getOwnPropertyDescriptor,ye=(e,t,r,n)=>{for(var s=n>1?void 0:n?Se(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},U=(e,t)=>(r,n)=>t(r,n,e);const z="SHEET_NUMFMT_ALERT";let ee=class extends c.Disposable{constructor(e,t,r,n,s,i,o,u){super(),this._context=e,this._hoverManagerService=t,this._cellAlertManagerService=r,this._localeService=n,this._formulaDataModel=s,this._zenZoneService=i,this._numfmtService=o,this._configService=u,this._init()}_init(){this._initCellAlertPopup(),this._initZenService()}_initCellAlertPopup(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(D.debounceTime(100)).subscribe(e=>{var t,r;if(e){const n=e.location,s=this._context.unit,i=s.getActiveSheet();if(!i)return;const o=n.unitId,u=n.subUnitId;let a;const h=i.getCell(n.row,n.col);if(h!=null&&h.s){const f=s.getStyles().get(h.s);f!=null&&f.n&&(a=f.n)}if(a||(a=this._numfmtService.getValue(o,u,n.row,n.col)),!a){this._hideAlert();return}if(G.isTextFormat(a.pattern)&&(h!=null&&h.v)&&c.isRealNum(h.v)){if((t=this._configService.getConfig(m.SHEETS_NUMFMT_PLUGIN_CONFIG_KEY))!=null&&t.disableTextFormatAlert)return;const f=this._cellAlertManagerService.currentAlert.get(z),d=(r=f==null?void 0:f.alert)==null?void 0:r.location;if(d&&d.row===n.row&&d.col===n.col&&d.subUnitId===n.subUnitId&&d.unitId===n.unitId)return;this._cellAlertManagerService.showAlert({type:M.CellAlertType.WARNING,title:this._localeService.t("info.error"),message:this._localeService.t("info.forceStringInfo"),location:n,width:200,height:74,key:z});return}}this._hideAlert()}))}_initZenService(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this._hideAlert()}))}_hideAlert(){this._cellAlertManagerService.removeAlert(z)}};ee=ye([U(1,c.Inject(M.HoverManagerService)),U(2,c.Inject(M.CellAlertManagerService)),U(3,c.Inject(c.LocaleService)),U(4,c.Inject(ge.FormulaDataModel)),U(5,b.IZenZoneService),U(6,c.Inject(S.INumfmtService)),U(7,c.IConfigService)],ee);const Y={id:"sheet.operation.close.numfmt.panel",type:c.CommandType.OPERATION,handler:()=>!0},L={id:"sheet.operation.open.numfmt.panel",type:c.CommandType.OPERATION,handler:e=>(e.get(H).openPanel(),!0)};var _e=Object.getOwnPropertyDescriptor,be=(e,t,r,n)=>{for(var s=n>1?void 0:n?_e(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Ce=(e,t)=>(r,n)=>t(r,n,e);const te=y.createContext([]);let $=class{constructor(e){this._localStorageService=e}_getKey(e){return`userHabitController_${e}`}async addHabit(e,t){const r=this._getKey(e);return this._localStorageService.getItem(r).then(n=>{n||this._localStorageService.setItem(r,t)})}markHabit(e,t){const r=this._getKey(e);this._localStorageService.getItem(r).then(n=>{if(n){const s=n.findIndex(i=>i===t);s>-1&&n.splice(s,1),n.unshift(t),this._localStorageService.setItem(r,n)}})}async getHabit(e,t){const r=this._getKey(e),n=await this._localStorageService.getItem(r);if(t&&n){const s=n.map((i,o,u)=>{const a=u.length;return{value:i,priority:a-o}});return t.sort((i,o)=>{var h,f;const u=((h=s.find(d=>d.value===i))==null?void 0:h.priority)||-1;return(((f=s.find(d=>d.value===o))==null?void 0:f.priority)||-1)-u})}return n||[]}deleteHabit(e){this._localStorageService.removeItem(e)}};$=be([Ce(0,c.Inject(c.ILocalStorageService))],$);const re="numfmtCurrency",Ie=e=>{const t=b.useDependency($),[r,n]=y.useState(m.currencySymbols);return y.useEffect(()=>{t.addHabit("numfmtCurrency",[]).then(()=>{t.getHabit(re,[...m.currencySymbols]).then(i=>{n(i),e&&e(i)})})},[]),{userHabitCurrency:r,mark:i=>{t.markHabit(re,i)}}},Ne=()=>{const e=y.useRef([]),[t,r]=y.useState({});return y.useEffect(()=>{e.current.forEach(s=>{s()}),e.current=[]},[t]),s=>{e.current.push(s),r({})}},Te=e=>!!m.getCurrencyType(e)&&e.startsWith("_("),Ee=e=>{const{defaultPattern:t,action:r,onChange:n}=e,[s,i]=y.useState(()=>m.getDecimalFromPattern(t||"",2)),o=y.useContext(te),[u,a]=y.useState(()=>m.getCurrencyType(t)||o[0]),h=y.useMemo(()=>o.map(_=>({label:_,value:_})),[]),d=b.useDependency(c.LocaleService).t;r.current=()=>m.setPatternDecimal(`_("${u}"* #,##0${s>0?".0":""}_)`,s);const p=_=>{a(_),n(m.setPatternDecimal(`_("${_}"* #,##0${s>0?".0":""}_)`,s))},g=_=>{const v=_||0;i(v),n(m.setPatternDecimal(`_("${u}"* #,##0${v>0?".0":""}_)`,v))};return l.jsxs("div",{children:[l.jsxs("div",{className:"m-t-16 options",children:[l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:d("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"m-t-8 w-120",children:l.jsx(T.InputNumber,{value:s,max:20,min:0,onChange:g})})]}),l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:d("sheet.numfmt.currencyType")}),l.jsx("div",{className:"m-t-8 w-140",children:l.jsx(T.Select,{onChange:p,options:h,value:u})})]})]}),l.jsx("div",{className:"describe m-t-14",children:d("sheet.numfmt.accountingDes")})]})},Pe=e=>!!m.getCurrencyType(e)&&!e.startsWith("_("),Me=e=>{const r=b.useDependency(c.LocaleService).t,n=y.useContext(te),[s,i]=y.useState(()=>m.getCurrencyType(e.defaultPattern)||n[0]),[o,u]=y.useState(()=>m.getDecimalFromPattern(e.defaultPattern||"",2)),[a,h]=y.useState(()=>{var C;const v=m.getCurrencyFormatOptions(s);return((C=v.find(E=>m.isPatternEqualWithoutDecimal(E.value,e.defaultPattern)))==null?void 0:C.value)||v[0].value}),f=y.useMemo(()=>m.getCurrencyFormatOptions(s),[s]),d=y.useMemo(()=>n.map(v=>({label:v,value:v})),[n]);e.action.current=()=>m.setPatternDecimal(a,o);const p=v=>{if(v===void 0)return;i(v);const N=m.getCurrencyFormatOptions(v)[0].value;h(N),e.onChange(m.setPatternDecimal(N,o))},g=v=>{v!==void 0&&(h(v),e.onChange(m.setPatternDecimal(v,o)))},_=v=>{u(v||0),e.onChange(m.setPatternDecimal(a,v||0))};return l.jsxs("div",{children:[l.jsxs("div",{className:"m-t-16 options",children:[l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:r("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"m-t-8 w-120",children:l.jsx(T.InputNumber,{value:o,max:20,min:0,onChange:_})})]}),l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"label",children:r("sheet.numfmt.currencyType")}),l.jsx("div",{className:"m-t-8 w-140",children:l.jsx(T.Select,{onChange:p,options:d,value:s})})]})]}),l.jsx("div",{className:"m-t-16 label",children:r("sheet.numfmt.negType")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.SelectList,{onChange:g,options:f,value:a})}),l.jsx("div",{className:"describe m-t-14",children:r("sheet.numfmt.currencyDes")})]})};var P=function(){return P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},P.apply(this,arguments)},xe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r},ce=y.forwardRef(function(e,t){var r=e.icon,n=e.id,s=e.className,i=e.extend,o=xe(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(n," ").concat(s||"").trim(),a=y.useRef("_".concat(Re()));return ae(r,"".concat(n),{defIds:r.defIds,idSuffix:a.current},P({ref:t,className:u},o),i)});function ae(e,t,r,n,s){return y.createElement(e.tag,P(P({key:t},je(e,r,s)),n),(De(e,r).children||[]).map(function(i,o){return ae(i,"".concat(t,"-").concat(e.tag,"-").concat(o),r,void 0,s)}))}function je(e,t,r){var n=P({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(i){var o=i[0],u=i[1];o==="mask"&&typeof u=="string"&&(n[o]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var s=t.defIds;return!s||s.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(i){var o=i[0],u=i[1];typeof u=="string"&&(n[o]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?P(P({},e),{children:e.children.map(function(s){return typeof s.attrs.id=="string"&&n&&n.indexOf(s.attrs.id)>-1?P(P({},s),{attrs:P(P({},s.attrs),{id:s.attrs.id+t.idSuffix})}):s})}):e}function Re(){return Math.random().toString(36).substring(2,8)}ce.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},le=y.forwardRef(function(e,t){return y.createElement(ce,Object.assign({},e,{id:"check-mark-single",ref:t,icon:Ue}))});le.displayName="CheckMarkSingle";const Oe="univer-custom-format-title",we="univer-custom-format-input",ke="univer-custom-format-history-list",Fe="univer-custom-format-history-list-item",Le="univer-custom-format-history-list-item-icon-wrap",$e="univer-custom-format-des",O={customFormatTitle:Oe,customFormatInput:we,customFormatHistoryList:ke,customFormatHistoryListItem:Fe,customFormatHistoryListItemIconWrap:Le,customFormatDes:$e},X="customFormat",J="numfmt_custom_pattern";function He(e){const{defaultPattern:t,action:r,onChange:n}=e,s=b.useDependency($),i=b.useDependency(c.ILocalStorageService),o=b.useDependency(c.LocaleService),[u,a]=y.useState(t);r.current=()=>(s.markHabit(X,u),i.getItem(J).then((g=[])=>{const _=[...new Set([u,...g||[]])].splice(0,10).filter(v=>!!v);i.setItem(J,_)}),u);const[h,f]=y.useState([]);y.useEffect(()=>{i.getItem(J).then(g=>{const _=[...m.CURRENCYFORMAT.map(v=>v.suffix("$")),...m.DATEFMTLISG.map(v=>v.suffix),...m.NUMBERFORMAT.map(v=>v.suffix)];_.push(...g||[]),s.addHabit(X,[]).finally(()=>{s.getHabit(X,_).then(v=>{f([...new Set(v)])})})})},[]);const d=g=>{a(g),n(g)},p=()=>{n(u)};return l.jsxs("div",{className:O.customFormat,children:[l.jsx("div",{className:O.customFormatTitle,children:o.t("sheet.numfmt.customFormat")}),l.jsx(T.Input,{placeholder:o.t("sheet.numfmt.customFormat"),onBlur:p,value:u,onChange:a,className:O.customFormatInput}),l.jsx("div",{className:O.customFormatHistoryList,children:h.map(g=>l.jsxs("div",{onClick:()=>d(g),className:O.customFormatHistoryListItem,children:[l.jsx("div",{className:O.customFormatHistoryListItemIconWrap,children:u===g&&l.jsx(le,{})}),l.jsx("div",{children:g})]},g))}),l.jsx("div",{className:O.customFormatDes,children:o.t("sheet.numfmt.customFormatDes")})]})}const Ae=e=>{const t=c.numfmt.getInfo(e);return m.getDateFormatOptions().map(r=>r.value).includes(e)||["date","datetime","time"].includes(t.type)},We=e=>{const t=y.useMemo(m.getDateFormatOptions,[]),n=b.useDependency(c.LocaleService).t,[s,i]=y.useState(()=>{if(e.defaultPattern){const u=t.find(a=>a.value===e.defaultPattern);if(u)return u.value}return t[0].value});e.action.current=()=>s;const o=u=>{u!==void 0&&(i(u),e.onChange(u))};return l.jsxs("div",{children:[l.jsx("div",{className:"m-t-16 label",children:n("sheet.numfmt.dateType")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.SelectList,{value:s,options:t,onChange:o})}),l.jsx("div",{className:"describe m-t-14",children:n("sheet.numfmt.dateDes")})]})},Ve=e=>!e,Be=e=>{const r=b.useDependency(c.LocaleService).t;return e.action.current=()=>"",l.jsx("div",{children:l.jsx("div",{className:"describe m-t-14",children:r("sheet.numfmt.generalDes")})})},qe=e=>m.getNumberFormatOptions().some(t=>m.isPatternEqualWithoutDecimal(t.value,e)),Ge=e=>{const t=b.useDependency(c.LocaleService),r=y.useMemo(m.getNumberFormatOptions,[]),[n,s]=y.useState(()=>m.getDecimalFromPattern(e.defaultPattern||"",0)),[i,o]=y.useState(()=>{const d=r.find(p=>m.isPatternEqualWithoutDecimal(p.value,e.defaultPattern||""));return(d==null?void 0:d.value)||r[0].value}),u=y.useMemo(()=>m.setPatternDecimal(i,Number(n||0)),[i,n]),a=y.useMemo(()=>!m.isPatternHasDecimal(i),[i]),h=d=>{s(d||0),e.onChange(m.setPatternDecimal(i,Number(d||0)))},f=d=>{d!==void 0&&(s(m.getDecimalFromPattern(d,0)),o(d),e.onChange(d))};return e.action.current=()=>u,l.jsxs("div",{children:[l.jsx("div",{className:"m-t-16 label",children:t.t("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.InputNumber,{disabled:a,value:n,max:20,min:0,onChange:h})}),l.jsxs("div",{className:"m-t-16 label",children:[" ",t.t("sheet.numfmt.negType")]}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.SelectList,{onChange:f,options:r,value:i})}),l.jsx("div",{className:"describe m-t-14",children:t.t("sheet.numfmt.thousandthPercentileDes")})]})},Ke=e=>{const{defaultValue:t,defaultPattern:r,row:n,col:s}=e.value,i=b.useDependency(c.LocaleService),o=y.useRef(()=>""),u=i.t,a=Ne(),h=y.useMemo(()=>[{label:"sheet.numfmt.general",component:Be},{label:"sheet.numfmt.accounting",component:Ee},{label:"sheet.numfmt.currency",component:Me},{label:"sheet.numfmt.date",component:We},{label:"sheet.numfmt.thousandthPercentile",component:Ge},{label:"sheet.numfmt.customFormat",component:He}].map(I=>({...I,label:u(I.label)})),[]),[f,d]=y.useState(C),[p,g]=y.useState(()=>`${n}_${s}`),{mark:_,userHabitCurrency:v}=Ie(()=>g(`${n}_${s}_userCurrency'`)),N=y.useMemo(()=>{var I;return(I=h.find(w=>w.label===f))==null?void 0:I.component},[f]);function C(){return[Ve,Te,Pe,Ae,qe].reduce((w,he,fe)=>w||(he(r)?h[fe].label:""),"")||h[0].label}const E=h.map(I=>({label:I.label,value:I.label})),j=I=>{d(I),a(()=>e.onChange({type:"change",value:o.current()||""}))},R=I=>{e.onChange({type:"change",value:I})},K=()=>{const I=o.current()||"",w=m.getCurrencyType(I);w&&_(w),e.onChange({type:"confirm",value:I})},k=()=>{e.onChange({type:"cancel",value:""})},Z={onChange:R,defaultValue:t,defaultPattern:r,action:o};return y.useEffect(()=>{d(C()),g(`${n}_${s}`)},[n,s]),l.jsxs("div",{className:"numfmt-panel p-b-20",children:[l.jsxs("div",{children:[l.jsx("div",{className:"label m-t-14",children:u("sheet.numfmt.numfmtType")}),l.jsx("div",{className:"m-t-8",children:l.jsx(T.Select,{onChange:j,options:E,value:f,style:{width:"100%"}})}),l.jsx("div",{children:N&&l.jsx(te.Provider,{value:v,children:y.createElement(N,{...Z,key:p})})})]}),l.jsxs("div",{className:"btn-list m-t-14 m-b-20",children:[l.jsx(T.Button,{size:"small",onClick:k,className:"m-r-12",children:u("sheet.numfmt.cancel")}),l.jsx(T.Button,{type:"primary",size:"small",onClick:K,children:u("sheet.numfmt.confirm")})]})]})};var Ze=Object.getOwnPropertyDescriptor,ze=(e,t,r,n)=>{for(var s=n>1?void 0:n?Ze(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},x=(e,t)=>(r,n)=>t(r,n,e);const se="SHEET_NUMFMT_PANEL";let H=class extends c.Disposable{constructor(t,r,n,s,i,o,u,a,h,f,d){super();A(this,"_previewPattern","");A(this,"_sidebarDisposable",null);this._sheetInterceptorService=t,this._themeService=r,this._univerInstanceService=n,this._commandService=s,this._selectionManagerService=i,this._renderManagerService=o,this._numfmtService=u,this._componentManager=a,this._sidebarService=h,this._localeService=f,this._sheetsNumfmtCellContentController=d,this._initRealTimeRenderingInterceptor(),this._initPanel(),this._initCommands(),this._initCloseListener(),this._commandExecutedListener(),this._initNumfmtLocalChange()}_initNumfmtLocalChange(){this.disposeWithMe(D.merge(this._sheetsNumfmtCellContentController.local$,this._localeService.currentLocale$).subscribe(()=>{this._forceUpdate()}))}openPanel(){var N;const t=this._sidebarService,r=this._selectionManagerService,n=this._commandService,s=this._univerInstanceService,i=this._numfmtService,o=this._localeService,a=(((N=r.getCurrentSelections())==null?void 0:N.map(C=>C.range))||[])[0];if(!a)return!1;const h=s.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET),f=h.getActiveSheet();if(!f)return!1;const d=f.getCellRaw(a.startRow,a.startColumn),p=i.getValue(h.getUnitId(),f.getSheetId(),a.startRow,a.startColumn);let g="";p&&(g=p.pattern);const _=(d==null?void 0:d.t)===c.CellValueType.NUMBER?d.v:12345678,v={onChange:C=>{var E;if(C.type==="change")this._previewPattern=C.value,this._forceUpdate();else if(C.type==="confirm"){const j=((E=r.getCurrentSelections())==null?void 0:E.map(k=>k.range))||[],R={values:[]},K=m.getPatternType(C.value);j.forEach(k=>{c.Range.foreach(k,(Z,I)=>{R.values.push({row:Z,col:I,pattern:C.value,type:K})})}),n.executeCommand(m.SetNumfmtCommand.id,R),t.close()}else C.type==="cancel"&&t.close()},value:{defaultPattern:g,defaultValue:_,row:a.startRow,col:a.startColumn}};return this._sidebarDisposable=t.open({header:{title:o.t("sheet.numfmt.title")},children:{label:se,...v},onClose:()=>{this._forceUpdate(),n.executeCommand(Y.id)}}),!0}_forceUpdate(t){var n;const r=this._renderManagerService.getRenderById(t!=null?t:this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getUnitId());r==null||r.with(M.SheetSkeletonManagerService).reCalculate(),(n=r==null?void 0:r.mainComponent)==null||n.makeDirty()}_initCommands(){[L,Y].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))})}_initPanel(){this._componentManager.register(se,Ke)}_initRealTimeRenderingInterceptor(){const t=new D.Observable(n=>{this._commandService.onCommandExecuted(s=>{s.id===L.id&&n.next(!0),s.id===Y.id&&n.next(!1)})}),r=D.combineLatest([t,this._selectionManagerService.selectionMoveEnd$.pipe(W.map(n=>n?n.map(s=>s.range):[]))]);this.disposeWithMe(c.toDisposable(r.pipe(W.switchMap(([n,s])=>new D.Observable(i=>{const o=new c.DisposableCollection;return n&&s.length&&i.next({selectionRanges:s,disposableCollection:o}),()=>{o.dispose()}})),W.tap(()=>{this._previewPattern=null})).subscribe(({disposableCollection:n,selectionRanges:s})=>{var o,u;const i=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);this.openPanel(),n.add(this._sheetInterceptorService.intercept(S.INTERCEPTOR_POINT.CELL_CONTENT,{priority:99,effect:c.InterceptorEffectEnum.Value|c.InterceptorEffectEnum.Style,handler:(a,h,f)=>{const{row:d,col:p}=h,g=f(a)||{};if(s.find(_=>_.startColumn<=p&&_.endColumn>=p&&_.startRow<=d&&_.endRow>=d)){const _=h.worksheet.getCellRaw(d,p),v=_==null?void 0:_.v,N=_==null?void 0:_.t;if(v==null||N!==c.CellValueType.NUMBER||this._previewPattern===null)return g;const C=m.getPatternPreviewIgnoreGeneral(this._previewPattern,v,this._sheetsNumfmtCellContentController.local);if(C.color){const j=this._themeService.getCurrentTheme()[`${C.color}500`];return{...g,v:C.result,t:c.CellValueType.STRING,s:{cl:{rgb:j}}}}return{...g,v:C.result,t:c.CellValueType.STRING}}return g}})),(u=(o=this._renderManagerService.getRenderById(i.getUnitId()))==null?void 0:o.mainComponent)==null||u.makeDirty()})))}_commandExecutedListener(){const t=[S.RemoveNumfmtMutation.id,S.SetNumfmtMutation.id];this.disposeWithMe(new D.Observable(r=>{const n=this._commandService.onCommandExecuted(s=>{if(t.includes(s.id)){const i=s.params;r.next(i.unitId)}});return()=>n.dispose()}).pipe(W.debounceTime(16)).subscribe(r=>this._forceUpdate(r)))}_initCloseListener(){this._univerInstanceService.getCurrentTypeOfUnit$(c.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{var r;t||((r=this._sidebarDisposable)==null||r.dispose(),this._sidebarDisposable=null)})}};H=ze([x(0,c.Inject(S.SheetInterceptorService)),x(1,c.Inject(c.ThemeService)),x(2,c.IUniverInstanceService),x(3,c.ICommandService),x(4,c.Inject(S.SheetsSelectionsService)),x(5,oe.IRenderManagerService),x(6,S.INumfmtService),x(7,c.Inject(b.ComponentManager)),x(8,b.ISidebarService),x(9,c.Inject(c.LocaleService)),x(10,c.Inject(m.SheetsNumfmtCellContentController))],H);var Ye=Object.getOwnPropertyDescriptor,Xe=(e,t,r,n)=>{for(var s=n>1?void 0:n?Ye(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},F=(e,t)=>(r,n)=>t(r,n,e);const Je=()=>{let e=[];return{add:(s,i,o,u,a)=>e.push({unitId:s,subUnitId:i,row:o,col:u,value:a}),getEffects:()=>e,clean:()=>{e=[]}}};let B=class extends c.Disposable{constructor(t,r,n,s,i){super();A(this,"_collectEffectMutation",Je());this._sheetInterceptorService=t,this._numfmtService=r,this._univerInstanceService=n,this._injector=s,this._editorBridgeService=i,this._initInterceptorEditorStart(),this._initInterceptorEditorEnd(),this._initInterceptorCommands()}_initInterceptorEditorStart(){this._editorBridgeService&&this.disposeWithMe(c.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(S.BEFORE_CELL_EDIT,{handler:(t,r,n)=>{const s=r.row,i=r.col,o=this._numfmtService.getValue(r.unitId,r.subUnitId,s,i);if(o)switch(m.getPatternType(o.pattern)){case"scientific":case"currency":case"grouped":case"number":{const a=r.worksheet.getCellRaw(s,i);return n&&n(a)}case"percent":case"date":case"time":case"datetime":default:return n&&n(t)}return n(t)}})))}_initInterceptorEditorEnd(){this.disposeWithMe(c.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(S.AFTER_CELL_EDIT,{handler:(t,r,n)=>{var f,d,p,g;this._collectEffectMutation.clean();const s=this._numfmtService.getValue(r.unitId,r.subUnitId,r.row,r.col),i=(f=s&&m.getPatternType(s.pattern))!=null?f:"",o=()=>{s&&this._collectEffectMutation.add(r.unitId,r.subUnitId,r.row,r.col,null)};if(!(t!=null&&t.v)&&!(t!=null&&t.p)||G.isTextFormat(s==null?void 0:s.pattern)||t.t===c.CellValueType.FORCE_STRING)return n(t);const u=(d=t.p)==null?void 0:d.body,a=(g=(p=t==null?void 0:t.p)==null?void 0:p.body)!=null&&g.dataStream?t.p.body.dataStream.replace(/\r\n$/,""):String(t.v),h=c.numfmt.parseDate(a)||c.numfmt.parseTime(a)||c.numfmt.parseNumber(a);if(u)if(et(u)){const{dataStream:_}=u,v=_.replace(/\r\n$/,""),N=Number(v);if(Number.isNaN(N)&&!h)return n(t)}else return n(t);if(h){h.z&&this._collectEffectMutation.add(r.unitId,r.subUnitId,r.row,r.col,{pattern:h.z});const _=Number(h.v);return n({...t,p:void 0,v:_,t:c.CellValueType.NUMBER})}else(["date","time","datetime","percent"].includes(i)||!Qe(a))&&o();return n(t)}})))}_initInterceptorCommands(){const t=this;this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations(r){var n;switch(r.id){case S.SetRangeValuesCommand.id:{const s=t._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET),i=s.getUnitId(),o=(n=s.getActiveSheet())==null?void 0:n.getSheetId();if(!o)return{redos:[],undos:[]};const u=t._collectEffectMutation.getEffects();if(t._collectEffectMutation.clean(),!u.length)return{redos:[],undos:[]};const a=u.filter(p=>{var g;return!!((g=p.value)!=null&&g.pattern)}).map(p=>({row:p.row,col:p.col,pattern:p.value.pattern})),h=u.filter(p=>{var g;return!((g=p.value)!=null&&g.pattern)}).map(p=>({startRow:p.row,endColumn:p.col,startColumn:p.col,endRow:p.row})),f=[],d=[];if(a.length){const p={id:S.SetNumfmtMutation.id,params:S.transformCellsToRange(i,o,a)};f.push(p),d.push(...S.factorySetNumfmtUndoMutation(t._injector,p.params))}if(h.length){const p={id:S.RemoveNumfmtMutation.id,params:{unitId:i,subUnitId:o,ranges:h}};f.push(p),d.push(...S.factoryRemoveNumfmtUndoMutation(t._injector,p.params))}return{redos:f,undos:d.reverse()}}}return{redos:[],undos:[]}}}))}};B=Xe([F(0,c.Inject(S.SheetInterceptorService)),F(1,c.Inject(S.INumfmtService)),F(2,c.Inject(c.IUniverInstanceService)),F(3,c.Inject(c.Injector)),F(4,c.Optional(M.IEditorBridgeService))],B);function Qe(e){return/^-?\d+(\.\d+)?$/.test(e)}function et(e){const{textRuns:t=[],paragraphs:r=[],customRanges:n,customBlocks:s=[]}=e,i=["va"];return!(t.some(o=>!!(o.ts&&Object.keys(o.ts).some(a=>i.includes(a))))||r.some(o=>o.bullet)||r.length>=2||n!=null&&n.length||s.length>0)}const V=[{label:"sheet.numfmt.general",pattern:null},{label:"sheet.numfmt.text",pattern:G.DEFAULT_TEXT_FORMAT_EXCEL},"|",{label:"sheet.numfmt.number",pattern:"0"},{label:"sheet.numfmt.percent",pattern:"0.00%"},{label:"sheet.numfmt.scientific",pattern:"0.00E+00"},"|",{label:"sheet.numfmt.accounting",pattern:'"¥" #,##0.00_);[Red]("¥"#,##0.00)'},{label:"sheet.numfmt.financialValue",pattern:"#,##0.00;[Red]#,##0.00"},{label:"sheet.numfmt.currency",pattern:'"¥"#,##0.00_);[Red]("¥"#,##0.00)'},{label:"sheet.numfmt.roundingCurrency",pattern:'"¥"#,##0;[Red]"¥"#,##0'},"|",{label:"sheet.numfmt.date",pattern:"yyyy-mm-dd;@"},{label:"sheet.numfmt.time",pattern:'am/pm h":"mm":"ss'},{label:"sheet.numfmt.dateTime",pattern:"yyyy-m-d am/pm h:mm"},{label:"sheet.numfmt.timeDuration",pattern:"h:mm:ss"},"|",{label:"sheet.numfmt.moreFmt",pattern:""}],tt=e=>({icon:new D.Observable(t=>{const r=e.get(m.MenuCurrencyService);function n(i){return{[m.countryCurrencyMap.US]:"DollarSingle",[m.countryCurrencyMap.RU]:"RoubleSingle",[m.countryCurrencyMap.CN]:"RmbSingle",[m.countryCurrencyMap.AT]:"EuroSingle"}[i]||"DollarSingle"}const s=m.countryCurrencyMap[r.getCurrencySymbol()]||"$";return t.next(n(s)),r.currencySymbol$.subscribe(i=>{const o=m.countryCurrencyMap[i]||"$";t.next(n(o))})}),id:m.SetCurrencyCommand.id,title:"sheet.numfmt.currency",tooltip:"sheet.numfmt.currency",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),nt=e=>({icon:"AddDigitsSingle",id:m.AddDecimalCommand.id,title:"sheet.numfmt.addDecimal",tooltip:"sheet.numfmt.addDecimal",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),rt=e=>({icon:"ReduceDigitsSingle",id:m.SubtractDecimalCommand.id,title:"sheet.numfmt.subtractDecimal",tooltip:"sheet.numfmt.subtractDecimal",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),st=e=>({icon:"PercentSingle",id:m.SetPercentCommand.id,title:"sheet.numfmt.percent",tooltip:"sheet.numfmt.percent",type:b.MenuItemType.BUTTON,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetEditPermission,S.WorksheetSetCellStylePermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}),it=e=>{const t=e.get(c.IUniverInstanceService),r=e.get(c.ICommandService),n=e.get(c.LocaleService),s=e.get(S.SheetsSelectionsService),i=[S.RemoveNumfmtMutation.id,S.SetNumfmtMutation.id],o=M.deriveStateFromActiveSheet$(t,"",({workbook:u,worksheet:a})=>new D.Observable(h=>D.merge(s.selectionMoveEnd$,c.fromCallback(r.onCommandExecuted.bind(r)).pipe(D.filter(([f])=>i.includes(f.id)))).subscribe(()=>{var d,p;const f=s.getCurrentSelections();if(f&&f[0]){const g=f[0].range,_=g.startRow,v=g.startColumn,N=(p=u.getStyles().get((d=a.getCell(_,v))==null?void 0:d.s))==null?void 0:p.n,C=N==null?void 0:N.pattern;let E=n.t("sheet.numfmt.general");if(G.isDefaultFormat(C)){h.next(E);return}if(C){const j=V.filter(R=>typeof R=="object"&&R.pattern).find(R=>m.isPatternEqualWithoutDecimal(C,R.pattern));j&&typeof j=="object"&&j.pattern?E=n.t(j.label):E=n.t("sheet.numfmt.moreFmt")}h.next(E)}})));return{label:ue,id:L.id,tooltip:"sheet.numfmt.title",type:b.MenuItemType.SELECTOR,slot:!0,selections:[{label:{name:me,hoverable:!1,selectable:!1}}],value$:o,hidden$:b.getMenuHiddenObservable(e,c.UniverInstanceType.UNIVER_SHEET),disabled$:M.getCurrentRangeDisable$(e,{workbookTypes:[S.WorkbookEditablePermission],worksheetTypes:[S.WorksheetSetCellStylePermission,S.WorksheetEditPermission],rangeTypes:[S.RangeProtectionPermissionEditPoint]})}},ue="sheet.numfmt.moreNumfmtType",me="sheet.numfmt.moreNumfmtType.options",ot=e=>{const{value:t}=e,r=b.useDependency(c.LocaleService),n=t!=null?t:r.t("sheet.numfmt.general");return l.jsx("span",{className:"univer-text-sm",children:n})},ct=()=>{const e=b.useDependency(c.ICommandService),t=b.useDependency(c.LocaleService),r=b.useDependency(b.ILayoutService),n=b.useDependency(m.SheetsNumfmtCellContentController),s=b.useDependency(S.SheetsSelectionsService),i=a=>{const h=s.getCurrentLastSelection();if(!h)return;const f=h.range,d=[];c.Range.foreach(f,(p,g)=>{a?d.push({row:p,col:g,pattern:a,type:m.getPatternType(a)}):d.push({row:p,col:g})}),e.executeCommand(m.SetNumfmtCommand.id,{values:d}),r.focus()},o=a=>{if(a===0)i(null);else if(a===V.length-1)e.executeCommand(L.id),r.focus();else{const h=V[a];h.pattern&&i(h.pattern)}},u=1220;return l.jsx("div",{className:"univer-grid univer-gap-1 univer-p-1.5",children:V.map((a,h)=>a==="|"?l.jsx(T.Separator,{},h):l.jsxs("div",{className:`
|
|
2
2
|
univer-flex univer-h-7 univer-items-center univer-justify-between univer-gap-6 univer-rounded
|
|
3
3
|
univer-px-2 univer-text-[13px]
|
|
4
4
|
hover:univer-bg-gray-100
|
|
5
|
-
`,onClick:()=>{o(h)},children:[l.jsx("span",{children:t.t(a.label)}),l.jsx("span",{className:"univer-text-xs univer-text-gray-500",children:a.pattern?m.getPatternPreview(a.pattern||"",u,n.local).result.trim():""})]},h))})},at={[b.RibbonStartGroup.FORMULAS_INSERT]:{[m.SetCurrencyCommand.id]:{order:4,menuItemFactory:tt},[m.AddDecimalCommand.id]:{order:5,menuItemFactory:nt},[m.SubtractDecimalCommand.id]:{order:6,menuItemFactory:rt},[m.SetPercentCommand.id]:{order:7,menuItemFactory:st},[L.id]:{order:8,menuItemFactory:it}}};var lt=Object.getOwnPropertyDescriptor,ut=(e,t,r,n)=>{for(var s=n>1?void 0:n?lt(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ie=(e,t)=>(r,n)=>t(r,n,e);let q=class extends c.Disposable{constructor(e,t){super(),this._componentManager=e,this._menuManagerService=t,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(at),this.disposeWithMe(this._componentManager.register(ue,ot)),this.disposeWithMe(this._componentManager.register(me,ct))}};q=ut([ie(0,c.Inject(b.ComponentManager)),ie(1,b.IMenuManagerService)],q);var mt=Object.defineProperty,dt=Object.getOwnPropertyDescriptor,ht=(e,t,r)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ft=(e,t,r,n)=>{for(var s=n>1?void 0:n?dt(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Q=(e,t)=>(r,n)=>t(r,n,e),de=(e,t,r)=>ht(e,typeof t!="symbol"?t+"":t,r);const pt="SHEET_NUMFMT_UI_PLUGIN";exports.UniverSheetsNumfmtUIPlugin=class extends c.Plugin{constructor(t=ne,r,n,s){super(),this._config=t,this._injector=r,this._configService=n,this._renderManagerService=s;const{menu:i,...o}=c.merge({},ne,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(
|
|
5
|
+
`,onClick:()=>{o(h)},children:[l.jsx("span",{children:t.t(a.label)}),l.jsx("span",{className:"univer-text-xs univer-text-gray-500",children:a.pattern?m.getPatternPreview(a.pattern||"",u,n.local).result.trim():""})]},h))})},at={[b.RibbonStartGroup.FORMULAS_INSERT]:{[m.SetCurrencyCommand.id]:{order:4,menuItemFactory:tt},[m.AddDecimalCommand.id]:{order:5,menuItemFactory:nt},[m.SubtractDecimalCommand.id]:{order:6,menuItemFactory:rt},[m.SetPercentCommand.id]:{order:7,menuItemFactory:st},[L.id]:{order:8,menuItemFactory:it}}};var lt=Object.getOwnPropertyDescriptor,ut=(e,t,r,n)=>{for(var s=n>1?void 0:n?lt(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ie=(e,t)=>(r,n)=>t(r,n,e);let q=class extends c.Disposable{constructor(e,t){super(),this._componentManager=e,this._menuManagerService=t,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(at),this.disposeWithMe(this._componentManager.register(ue,ot)),this.disposeWithMe(this._componentManager.register(me,ct))}};q=ut([ie(0,c.Inject(b.ComponentManager)),ie(1,b.IMenuManagerService)],q);var mt=Object.defineProperty,dt=Object.getOwnPropertyDescriptor,ht=(e,t,r)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ft=(e,t,r,n)=>{for(var s=n>1?void 0:n?dt(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Q=(e,t)=>(r,n)=>t(r,n,e),de=(e,t,r)=>ht(e,typeof t!="symbol"?t+"":t,r);const pt="SHEET_NUMFMT_UI_PLUGIN";exports.UniverSheetsNumfmtUIPlugin=class extends c.Plugin{constructor(t=ne,r,n,s){super(),this._config=t,this._injector=r,this._configService=n,this._renderManagerService=s;const{menu:i,...o}=c.merge({},ne,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig("sheets-numfmt-ui.config",o)}onStarting(){c.registerDependencies(this._injector,[[H],[B],[$],[q]])}onRendered(){this._registerRenderModules(),c.touchDependencies(this._injector,[[H],[B],[q]])}_registerRenderModules(){[[ee]].forEach(r=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(c.UniverInstanceType.UNIVER_SHEET,r))})}};de(exports.UniverSheetsNumfmtUIPlugin,"pluginName",pt);de(exports.UniverSheetsNumfmtUIPlugin,"type",c.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsNumfmtUIPlugin=ft([c.DependentOn(M.UniverSheetsUIPlugin,m.UniverSheetsNumfmtPlugin),Q(1,c.Inject(c.Injector)),Q(2,c.IConfigService),Q(3,oe.IRenderManagerService)],exports.UniverSheetsNumfmtUIPlugin);
|
package/lib/cjs/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={sheet:{numfmt:{
|
|
1
|
+
"use strict";const e={sheet:{numfmt:{title:"Number format",numfmtType:"Format types",cancel:"Cancel",confirm:"Confirm",general:"General",accounting:"Accounting",text:"Text",number:"Number",percent:"Percentage",scientific:"Scientific",currency:"Currency",date:"Date",time:"Time",thousandthPercentile:"Thousands separator",preview:"Preview",dateTime:"Date and time",decimalLength:"Decimal places",currencyType:"Currency Symbol",moreFmt:"Formats",financialValue:"Financial value",roundingCurrency:"Rounding up the currency",timeDuration:"Duration Time",currencyDes:"The currency format is used to represent general currency values. The accounting format aligns a column of values with decimal points",accountingDes:"The accounting number format aligns a column of values with currency symbols and decimal points",dateType:"Date Type",dateDes:"The date format presents date and time series values as date values.",negType:"A negative number type",generalDes:"The regular format does not contain any specific number format.",thousandthPercentileDes:"The percentile format is used for the representation of ordinary numbers. Monetary and accounting formats provide a specialized format for monetary value calculations.",addDecimal:"Increase decimal places",subtractDecimal:"Decreasing decimal places",customFormat:"Custom Format",customFormatDes:"Generate custom number formats based on existing formats."}}};module.exports=e;
|
package/lib/cjs/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={sheet:{numfmt:{
|
|
1
|
+
"use strict";const e={sheet:{numfmt:{title:"قالببندی عدد",numfmtType:"انواع قالببندی",cancel:"انصراف",confirm:"تایید",general:"عمومی",accounting:"حسابداری",text:"متن",number:"عدد",percent:"درصد",scientific:"علمی",currency:"ارز",date:"تاریخ",time:"زمان",thousandthPercentile:"جداساز هزارتایی",preview:"پیشنمایش",dateTime:"تاریخ و زمان",decimalLength:"اعشار",currencyType:"نماد ارز",moreFmt:"قالبها",financialValue:"مقدار مالی",roundingCurrency:"گرد کردن ارز",timeDuration:"مدت زمان",currencyDes:"قالببندی ارز برای نمایش مقادیر عمومی ارز استفاده میشود. قالببندی حسابداری ستونی از مقادیر را با اعشار تراز میکند.",accountingDes:"قالببندی عددی حسابداری ستونی از مقادیر را با نمادهای ارز و اعشار تراز میکند.",dateType:"نوع تاریخ",dateDes:"قالببندی تاریخ مقادیر سری تاریخ و زمان را به عنوان مقادیر تاریخ ارائه میدهد.",negType:"نوع عدد منفی",generalDes:"قالببندی معمولی حاوی هیچ قالببندی عدد خاصی نیست.",thousandthPercentileDes:"قالببندی درصدی برای نمایش اعداد معمولی استفاده میشود. قالببندیهای پولی و حسابداری قالب تخصصی برای محاسبات مقدار پولی ارائه میدهند.",addDecimal:"افزایش اعشار",subtractDecimal:"کاهش اعشار",customFormat:"قالببندی سفارشی",customFormatDes:"ایجاد قالببندیهای عددی سفارشی بر اساس قالببندیهای موجود."}}};module.exports=e;
|
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={sheet:{numfmt:{
|
|
1
|
+
"use strict";const e={sheet:{numfmt:{title:"Format de nombre",numfmtType:"Types de format",cancel:"Annuler",confirm:"Confirmer",general:"Général",accounting:"Comptabilité",text:"Texte",number:"Nombre",percent:"Pourcentage",scientific:"Scientifique",currency:"Devise",date:"Date",time:"Heure",thousandthPercentile:"Séparateur de milliers",preview:"Aperçu",dateTime:"Date et heure",decimalLength:"Nombre de décimales",currencyType:"Symbole de devise",moreFmt:"Formats",financialValue:"Valeur financière",roundingCurrency:"Arrondir la devise",timeDuration:"Durée",currencyDes:"Le format de devise est utilisé pour représenter des valeurs monétaires générales. Le format de comptabilité aligne une colonne de valeurs avec des points décimaux",accountingDes:"Le format de nombre de comptabilité aligne une colonne de valeurs avec des symboles de devise et des points décimaux",dateType:"Type de date",dateDes:"Le format de date présente les valeurs de la série date et heure sous forme de valeurs de date.",negType:"Type de nombre négatif",generalDes:"Le format général ne contient aucun format de nombre spécifique.",thousandthPercentileDes:"Le format de percentile est utilisé pour la représentation des nombres ordinaires. Les formats monétaires et comptables fournissent un format spécialisé pour les calculs de valeurs monétaires.",addDecimal:"Augmenter les décimales",subtractDecimal:"Diminuer les décimales",customFormat:"Format personnalisé",customFormatDes:"Générer des formats de nombre personnalisés basés sur des formats existants."}}};module.exports=e;
|
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={sheet:{numfmt:{
|
|
1
|
+
"use strict";const e={sheet:{numfmt:{title:"Формат числа",numfmtType:"Типы форматов",cancel:"Отмена",confirm:"Подтвердить",general:"Общий",accounting:"Бухгалтерский",text:"Текст",number:"Число",percent:"Процент",scientific:"Экспоненциальный",currency:"Валюта",date:"Дата",time:"Время",thousandthPercentile:"Разделитель тысяч",preview:"Предпросмотр",dateTime:"Дата и время",decimalLength:"Десятичные знаки",currencyType:"Символ валюты",moreFmt:"Другие форматы",financialValue:"Финансовое значение",roundingCurrency:"Округление валюты",timeDuration:"Продолжительность времени",currencyDes:"Формат валюты используется для представления общих значений валюты. Формат бухгалтерского учета выравнивает столбец значений по десятичным точкам.",accountingDes:"Формат бухгалтерских чисел выравнивает столбец значений по символам валюты и десятичным точкам.",dateType:"Тип даты",dateDes:"Формат даты представляет значения времени и даты как значения даты.",negType:"Тип отрицательного числа",generalDes:"Обычный формат не содержит никакого специфического формата числа.",thousandthPercentileDes:"Формат процента используется для представления обычных чисел. Монетарные и бухгалтерские форматы предоставляют специальный формат для вычислений монетарных значений.",addDecimal:"Увеличить количество десятичных знаков",subtractDecimal:"Уменьшить количество десятичных знаков",customFormat:"Custom Format",customFormatDes:"Generate custom number formats based on existing formats."}}};module.exports=e;
|
package/lib/cjs/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n={sheet:{numfmt:{
|
|
1
|
+
"use strict";const n={sheet:{numfmt:{title:"Định dạng số",numfmtType:"Loại định dạng",cancel:"Hủy bỏ",confirm:"Xác nhận",general:"Chung",accounting:"Kế toán",text:"Văn bản",number:"Số",percent:"Phần trăm",scientific:"Chính xác",currency:"Tiền tệ",date:"Ngày",time:"Thời gian",thousandthPercentile:"Phân vị phần nghìn",preview:"Xem trước",dateTime:"Ngày giờ",decimalLength:"Số chữ số thập phân",currencyType:"Loại tiền tệ",moreFmt:"Nhiều định dạng hơn",financialValue:"Giá trị tài chính",roundingCurrency:"Tiền tệ làm tròn",timeDuration:"Thời lượng",currencyDes:"Định dạng tiền tệ được sử dụng để biểu thị các giá trị tiền tệ thông thường. Định dạng kế toán có thể căn chỉnh các giá trị trong một cột với dấu thập phân.",accountingDes:"Định dạng số kế toán có thể căn chỉnh các ký hiệu tiền tệ và dấu thập phân trong một cột các giá trị.",dateType:"Loại ngày",dateDes:"Định dạng ngày biểu thị các giá trị chuỗi ngày và thời gian dưới dạng giá trị ngày.",negType:"Loại số âm",generalDes:"Định dạng chung không chứa bất kỳ định dạng số cụ thể nào.",thousandthPercentileDes:"Định dạng phân vị phần nghìn được sử dụng để biểu thị các số thông thường. Các định dạng tiền tệ và kế toán cung cấp các định dạng chuyên dụng để tính toán giá trị tiền tệ.",addDecimal:"Thêm chữ số thập phân",subtractDecimal:"Giảm chữ số thập phân",customFormat:"Custom Format",customFormatDes:"Generate custom number formats based on existing formats."}}};module.exports=n;
|
package/lib/cjs/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={sheet:{numfmt:{
|
|
1
|
+
"use strict";const e={sheet:{numfmt:{title:"数字格式",numfmtType:"格式类型",cancel:"取消",confirm:"确认",general:"常规",accounting:"会计",text:"文本",number:"数值",percent:"百分比",scientific:"科学记数",currency:"货币",date:"日期",time:"时间",thousandthPercentile:"千分位符",preview:"示例",dateTime:"日期时间",decimalLength:"小数位数",currencyType:"货币类型",moreFmt:"更多格式",financialValue:"财务数值",roundingCurrency:"货币取整",timeDuration:"持续时间",currencyDes:"货币格式用于表示一般货币数值。会计格式可以对一列数值进行小数点对齐",accountingDes:"会计数字格式可对一列数值进行货币符号和小数点对齐",dateType:"日期类型",dateDes:"日期格式将日期和时间系列数值品示为日期值。",negType:"负数类型",generalDes:"常规格式不包含任何特定的数字格式。",thousandthPercentileDes:"千分位符格式用于一般数字的表示。货币和会计格式则提供货币值计算的专用格式。",addDecimal:"增加小数位",subtractDecimal:"减少小数位",customFormat:"自定义格式",customFormatDes:"根据现有格式生成自定义数字格式。"}}};module.exports=e;
|
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={sheet:{numfmt:{
|
|
1
|
+
"use strict";const e={sheet:{numfmt:{title:"數字格式",numfmtType:"格式類型",cancel:"取消",confirm:"確認",general:"常規",accounting:"會計",text:"文字",number:"數值",percent:"百分比",scientific:"工程型",currency:"貨幣",date:"日期",time:"時間",thousandthPercentile:"千分位符",preview:"範例",dateTime:"日期時間",decimalLength:"小數位數",currencyType:"貨幣類型",moreFmt:"更多格式",financialValue:"財務數值",roundingCurrency:"貨幣取整",timeDuration:"持續時間",currencyDes:"貨幣格式用來表示一般貨幣數值。會計格式可以對一列數值進行小數點對齊",accountingDes:"會計數字格式可對一列數值進行貨幣符號和小數點對齊",dateType:"日期類型",dateDes:"日期格式將日期和時間系列數值品顯示為日期值。",negType:"負數型別",generalDes:"常規格式不包含任何特定的數字格式。",thousandthPercentileDes:"千分位符號格式用於一般數字的表示。貨幣和會計格式則提供貨幣值計算的專用格式。",addDecimal:"增加小數位",subtractDecimal:"減少小數位",customFormat:"Custom Format",customFormatDes:"Generate custom number formats based on existing formats."}}};module.exports=e;
|