@univerjs/sheets-numfmt-ui 0.10.3 → 0.10.4-nightly.202508220605
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 +1 -1
- package/lib/es/index.js +449 -459
- package/lib/index.js +449 -459
- package/lib/types/controllers/menu.d.ts +3 -3
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.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/ko-KR.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 +12 -12
- package/LICENSE +0 -176
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IAccessor } from '@univerjs/core';
|
|
2
2
|
import { IMenuSelectorItem, MenuItemType } from '@univerjs/ui';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
export declare const MENU_OPTIONS: Array<{
|
|
4
|
+
export declare const MENU_OPTIONS: (currencySymbol: string) => Array<{
|
|
5
5
|
label: string;
|
|
6
6
|
pattern: string | null;
|
|
7
|
-
} |
|
|
8
|
-
export declare const
|
|
7
|
+
} | "|">;
|
|
8
|
+
export declare const CurrencySymbolIconMenuItem: (accessor: IAccessor) => {
|
|
9
9
|
icon: Observable<string>;
|
|
10
10
|
id: string;
|
|
11
11
|
title: string;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets-numfmt"),require("@univerjs/sheets-ui"),require("@univerjs/sheets"),require("@univerjs/ui"),require("rxjs"),require("rxjs/operators"),require("react/jsx-runtime"),require("react"),require("@univerjs/design")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/sheets-numfmt","@univerjs/sheets-ui","@univerjs/sheets","@univerjs/ui","rxjs","rxjs/operators","react/jsx-runtime","react","@univerjs/design"],a):(C=typeof globalThis<"u"?globalThis:C||self,a(C.UniverSheetsNumfmtUi={},C.UniverCore,C.UniverEngineRender,C.UniverSheetsNumfmt,C.UniverSheetsUi,C.UniverSheets,C.UniverUi,C.rxjs,C.rxjs.operators,C.React,C.React,C.UniverDesign))})(this,function(C,a,k,d,D,g,_,x,W,l,y,E){"use strict";var at=Object.defineProperty;var st=(C,a,k)=>a in C?at(C,a,{enumerable:!0,configurable:!0,writable:!0,value:k}):C[a]=k;var G=(C,a,k)=>st(C,typeof a!="symbol"?a+"":a,k);const ne={};var de=Object.getOwnPropertyDescriptor,ve=(e,n,r,t)=>{for(var i=t>1?void 0:t?de(n,r):n,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},j=(e,n)=>(r,t)=>n(r,t,e);const K="SHEET_NUMFMT_ALERT";let Z=class extends a.Disposable{constructor(e,n,r,t,i,s,o){super(),this._context=e,this._hoverManagerService=n,this._cellAlertManagerService=r,this._localeService=t,this._zenZoneService=i,this._numfmtService=s,this._configService=o,this._init()}_init(){this._initCellAlertPopup(),this._initZenService()}_initCellAlertPopup(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(x.debounceTime(100)).subscribe(e=>{var n,r;if(e){const t=e.location,i=this._context.unit,s=i.getActiveSheet();if(!s)return;const o=t.unitId,u=t.subUnitId;let c;const v=s.getCell(t.row,t.col);if(v!=null&&v.s){const f=i.getStyles().get(v.s);f!=null&&f.n&&(c=f.n)}if(c||(c=this._numfmtService.getValue(o,u,t.row,t.col)),!c){this._hideAlert();return}if(a.isTextFormat(c.pattern)&&a.Tools.isDefine(v==null?void 0:v.v)&&a.isRealNum(v.v)){if((n=this._configService.getConfig(d.SHEETS_NUMFMT_PLUGIN_CONFIG_KEY))!=null&&n.disableTextFormatAlert)return;const f=this._cellAlertManagerService.currentAlert.get(K),m=(r=f==null?void 0:f.alert)==null?void 0:r.location;if(m&&m.row===t.row&&m.col===t.col&&m.subUnitId===t.subUnitId&&m.unitId===t.unitId)return;this._cellAlertManagerService.showAlert({type:D.CellAlertType.ERROR,title:this._localeService.t("info.error"),message:this._localeService.t("info.forceStringInfo"),location:t,width:200,height:74,key:K});return}}this._hideAlert()}))}_initZenService(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this._hideAlert()}))}_hideAlert(){this._cellAlertManagerService.removeAlert(K)}};Z=ve([j(1,a.Inject(D.HoverManagerService)),j(2,a.Inject(D.CellAlertManagerService)),j(3,a.Inject(a.LocaleService)),j(4,_.IZenZoneService),j(5,a.Inject(g.INumfmtService)),j(6,a.IConfigService)],Z);const Y={id:"sheet.operation.close.numfmt.panel",type:a.CommandType.OPERATION,handler:()=>!0},L={id:"sheet.operation.open.numfmt.panel",type:a.CommandType.OPERATION,handler:e=>(e.get(H).openPanel(),!0)};var pe=Object.getOwnPropertyDescriptor,fe=(e,n,r,t)=>{for(var i=t>1?void 0:t?pe(n,r):n,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},he=(e,n)=>(r,t)=>n(r,t,e);const z=y.createContext([]);let F=class{constructor(e){this._localStorageService=e}_getKey(e){return`userHabitController_${e}`}async addHabit(e,n){const r=this._getKey(e);return this._localStorageService.getItem(r).then(t=>{t||this._localStorageService.setItem(r,n)})}markHabit(e,n){const r=this._getKey(e);this._localStorageService.getItem(r).then(t=>{if(t){const i=t.findIndex(s=>s===n);i>-1&&t.splice(i,1),t.unshift(n),this._localStorageService.setItem(r,t)}})}async getHabit(e,n){const r=this._getKey(e),t=await this._localStorageService.getItem(r);if(n&&t){const i=t.map((s,o,u)=>{const c=u.length;return{value:s,priority:c-o}});return n.sort((s,o)=>{var v,f;const u=((v=i.find(m=>m.value===s))==null?void 0:v.priority)||-1;return(((f=i.find(m=>m.value===o))==null?void 0:f.priority)||-1)-u})}return t||[]}deleteHabit(e){this._localStorageService.removeItem(e)}};F=fe([he(0,a.Inject(a.ILocalStorageService))],F);const re="numfmtCurrency",ge=e=>{const n=_.useDependency(F),[r,t]=y.useState(d.currencySymbols);return y.useEffect(()=>{n.addHabit("numfmtCurrency",[]).then(()=>{n.getHabit(re,[...d.currencySymbols]).then(s=>{t(s),e&&e(s)})})},[]),{userHabitCurrency:r,mark:s=>{n.markHabit(re,s)}}},Se=()=>{const e=y.useRef([]),[n,r]=y.useState({});return y.useEffect(()=>{e.current.forEach(i=>{i()}),e.current=[]},[n]),i=>{e.current.push(i),r({})}},ye=e=>!!d.getCurrencyType(e)&&e.startsWith("_("),_e=e=>{const{defaultPattern:n,action:r,onChange:t}=e,[i,s]=y.useState(()=>d.getDecimalFromPattern(n||"",2)),o=y.useContext(z),[u,c]=y.useState(()=>d.getCurrencyType(n)||o[0]),v=y.useMemo(()=>o.map(b=>({label:b,value:b})),[]),m=_.useDependency(a.LocaleService).t;r.current=()=>d.setPatternDecimal(`_("${u}"* #,##0${i>0?".0":""}_)`,i);const h=b=>{c(b),t(d.setPatternDecimal(`_("${b}"* #,##0${i>0?".0":""}_)`,i))},S=b=>{const p=b||0;s(p),t(d.setPatternDecimal(`_("${u}"* #,##0${p>0?".0":""}_)`,p))};return l.jsxs("div",{children:[l.jsxs("div",{className:"univer-mt-4 univer-flex univer-justify-between",children:[l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:m("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"univer-mt-2 univer-w-32",children:l.jsx(E.InputNumber,{value:i,step:1,precision:0,max:20,min:0,onChange:S})})]}),l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:m("sheet.numfmt.currencyType")}),l.jsx("div",{className:"univer-mt-2 univer-w-36",children:l.jsx(E.Select,{options:v,value:u,onChange:h})})]})]}),l.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:m("sheet.numfmt.accountingDes")})]})},Ce=e=>!!d.getCurrencyType(e)&&!e.startsWith("_("),be=e=>{const r=_.useDependency(a.LocaleService).t,t=y.useContext(z),[i,s]=y.useState(()=>d.getCurrencyType(e.defaultPattern)||t[0]),[o,u]=y.useState(()=>d.getDecimalFromPattern(e.defaultPattern||"",2)),[c,v]=y.useState(()=>{var I;const p=d.getCurrencyFormatOptions(i);return((I=p.find(M=>a.isPatternEqualWithoutDecimal(M.value,e.defaultPattern)))==null?void 0:I.value)||p[0].value}),f=y.useMemo(()=>d.getCurrencyFormatOptions(i),[i]),m=y.useMemo(()=>t.map(p=>({label:p,value:p})),[t]);e.action.current=()=>d.setPatternDecimal(c,o);const h=p=>{if(p===void 0)return;s(p);const P=d.getCurrencyFormatOptions(p)[0].value;v(P),e.onChange(d.setPatternDecimal(P,o))},S=p=>{p!==void 0&&(v(p),e.onChange(d.setPatternDecimal(p,o)))},b=p=>{u(p||0),e.onChange(d.setPatternDecimal(c,p||0))};return l.jsxs("div",{children:[l.jsxs("div",{className:"univer-mt-4 univer-flex univer-justify-between",children:[l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:r("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"univer-mt-2 univer-w-32",children:l.jsx(E.InputNumber,{value:o,max:20,min:0,onChange:b})})]}),l.jsxs("div",{className:"option",children:[l.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:r("sheet.numfmt.currencyType")}),l.jsx("div",{className:"univer-mt-2 univer-w-36",children:l.jsx(E.Select,{value:i,options:m,onChange:h})})]})]}),l.jsx("div",{className:"label univer-mt-4",children:r("sheet.numfmt.negType")}),l.jsx("div",{className:"univer-mt-2",children:l.jsx(E.SelectList,{value:c,options:f,onChange:S})}),l.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:r("sheet.numfmt.currencyDes")})]})};var w=function(){return w=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w.apply(this,arguments)},Ie=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(e);i<t.length;i++)n.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(r[t[i]]=e[t[i]]);return r},ie=y.forwardRef(function(e,n){var r=e.icon,t=e.id,i=e.className,s=e.extend,o=Ie(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(t," ").concat(i||"").trim(),c=y.useRef("_".concat(Pe()));return ae(r,"".concat(t),{defIds:r.defIds,idSuffix:c.current},w({ref:n,className:u},o),s)});function ae(e,n,r,t,i){return y.createElement(e.tag,w(w({key:n},Te(e,r,i)),t),(Ee(e,r).children||[]).map(function(s,o){return ae(s,"".concat(n,"-").concat(e.tag,"-").concat(o),r,void 0,i)}))}function Te(e,n,r){var t=w({},e.attrs);r!=null&&r.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=r.colorChannel1),e.tag==="mask"&&t.id&&(t.id=t.id+n.idSuffix),Object.entries(t).forEach(function(s){var o=s[0],u=s[1];o==="mask"&&typeof u=="string"&&(t[o]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))});var i=n.defIds;return!i||i.length===0||(e.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+n.idSuffix),Object.entries(t).forEach(function(s){var o=s[0],u=s[1];typeof u=="string"&&(t[o]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(n.idSuffix,")")))})),t}function Ee(e,n){var r,t=n.defIds;return!t||t.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?w(w({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&t&&t.includes(i.attrs.id)?w(w({},i),{attrs:w(w({},i.attrs),{id:i.attrs.id+n.idSuffix})}):i})}):e}function Pe(){return Math.random().toString(36).substring(2,8)}ie.displayName="UniverIcon";var Me={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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"}}]},se=y.forwardRef(function(e,n){return y.createElement(ie,Object.assign({},e,{id:"check-mark-icon",ref:n,icon:Me}))});se.displayName="CheckMarkIcon";const X="customFormat",J="numfmt_custom_pattern";function De(e){const{defaultPattern:n,action:r,onChange:t}=e,i=_.useDependency(F),s=_.useDependency(a.ILocalStorageService),o=_.useDependency(a.LocaleService),[u,c]=y.useState(n);r.current=()=>(i.markHabit(X,u),s.getItem(J).then((S=[])=>{const b=[...new Set([u,...S||[]])].splice(0,10).filter(p=>!!p);s.setItem(J,b)}),u);const[v,f]=y.useState([]);y.useEffect(()=>{s.getItem(J).then(S=>{const b=[...d.CURRENCYFORMAT.map(p=>p.suffix("$")),...d.DATEFMTLISG.map(p=>p.suffix),...d.NUMBERFORMAT.map(p=>p.suffix)];b.push(...S||[]),i.addHabit(X,[]).finally(()=>{i.getHabit(X,b).then(p=>{f([...new Set(p)])})})})},[]);const m=S=>{c(S),t(S)},h=()=>{t(u)};return l.jsxs("div",{children:[l.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:o.t("sheet.numfmt.customFormat")}),l.jsx(E.Input,{placeholder:o.t("sheet.numfmt.customFormat"),onBlur:h,value:u,onChange:c,className:"univer-mt-2 univer-w-full"}),l.jsx("div",{className:E.clsx("univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2",E.borderClassName),children:v.map(S=>l.jsxs("div",{onClick:()=>m(S),className:"univer-flex univer-cursor-pointer univer-items-center univer-gap-1.5 univer-py-1.5 univer-text-sm",children:[l.jsx("div",{className:"univer-flex univer-w-4 univer-items-center univer-text-primary-600",children:u===S&&l.jsx(se,{})}),l.jsx("div",{children:S})]},S))}),l.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:o.t("sheet.numfmt.customFormatDes")})]})}const we=e=>{const n=a.numfmt.getFormatInfo(e);return d.getDateFormatOptions().map(r=>r.value).includes(e)||["date","datetime","time"].includes(n.type)};function Ne(e){const{onChange:n,defaultPattern:r}=e,t=y.useMemo(d.getDateFormatOptions,[]),i=_.useDependency(a.LocaleService),[s,o]=y.useState(()=>{if(r){const c=t.find(v=>v.value===r);if(c)return c.value}return t[0].value});e.action.current=()=>s;const u=c=>{c!==void 0&&(o(c),n(c))};return l.jsxs("div",{children:[l.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:i.t("sheet.numfmt.dateType")}),l.jsx("div",{className:"univer-mt-2",children:l.jsx(E.SelectList,{value:s,options:t,onChange:u})}),l.jsx("div",{className:"univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",children:i.t("sheet.numfmt.dateDes")})]})}const xe=e=>!e,Oe=e=>{const r=_.useDependency(a.LocaleService).t;return e.action.current=()=>"",l.jsx("div",{children:l.jsx("div",{className:"univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",children:r("sheet.numfmt.generalDes")})})},Ue=e=>d.getNumberFormatOptions().some(n=>a.isPatternEqualWithoutDecimal(n.value,e));function ke(e){const n=_.useDependency(a.LocaleService),r=y.useMemo(d.getNumberFormatOptions,[]),[t,i]=y.useState(()=>d.getDecimalFromPattern(e.defaultPattern||"",0)),[s,o]=y.useState(()=>{const m=r.find(h=>a.isPatternEqualWithoutDecimal(h.value,e.defaultPattern||""));return(m==null?void 0:m.value)||r[0].value}),u=y.useMemo(()=>d.setPatternDecimal(s,Number(t||0)),[s,t]),c=y.useMemo(()=>!d.isPatternHasDecimal(s),[s]),v=m=>{i(m||0),e.onChange(d.setPatternDecimal(s,Number(m||0)))},f=m=>{m!==void 0&&(i(d.getDecimalFromPattern(m,0)),o(m),e.onChange(m))};return e.action.current=()=>u,l.jsxs("div",{children:[l.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:n.t("sheet.numfmt.decimalLength")}),l.jsx("div",{className:"univer-mt-2",children:l.jsx(E.InputNumber,{disabled:c,value:t,max:20,min:0,onChange:v})}),l.jsxs("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:[" ",n.t("sheet.numfmt.negType")]}),l.jsx("div",{className:"univer-mt-2",children:l.jsx(E.SelectList,{onChange:f,options:r,value:s})}),l.jsx("div",{className:"univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.numfmt.thousandthPercentileDes")})]})}const je=e=>{const{defaultValue:n,defaultPattern:r,row:t,col:i}=e.value,s=_.useDependency(a.LocaleService),o=y.useRef(()=>""),u=s.t,c=Se(),v=y.useMemo(()=>[{label:"sheet.numfmt.general",component:Oe},{label:"sheet.numfmt.accounting",component:_e},{label:"sheet.numfmt.currency",component:be},{label:"sheet.numfmt.date",component:Ne},{label:"sheet.numfmt.thousandthPercentile",component:ke},{label:"sheet.numfmt.customFormat",component:De}].map(T=>({...T,label:u(T.label)})),[]),[f,m]=y.useState(I),[h,S]=y.useState(()=>`${t}_${i}`),{mark:b,userHabitCurrency:p}=ge(()=>S(`${t}_${i}_userCurrency'`)),P=y.useMemo(()=>{var T;return(T=v.find($=>$.label===f))==null?void 0:T.component},[f]);function I(){return[xe,ye,Ce,we,Ue].reduce(($,rt,it)=>$||(rt(r)?v[it].label:""),"")||v[0].label}const M=v.map(T=>({label:T.label,value:T.label})),O=T=>{m(T),c(()=>e.onChange({type:"change",value:o.current()||""}))},U=y.useCallback(T=>{e.onChange({type:"change",value:T})},[]),ee=()=>{const T=o.current()||"",$=d.getCurrencyType(T);$&&b($),e.onChange({type:"confirm",value:T})},R=()=>{e.onChange({type:"cancel",value:""})},te={onChange:U,defaultValue:n,defaultPattern:r,action:o};return y.useEffect(()=>{m(I()),S(`${t}_${i}`)},[t,i]),l.jsxs("div",{className:E.clsx("univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5",E.scrollbarClassName),children:[l.jsxs("div",{children:[l.jsx("div",{className:"univer-mt-3.5 univer-text-sm univer-text-gray-400",children:u("sheet.numfmt.numfmtType")}),l.jsx("div",{className:"univer-mt-2",children:l.jsx(E.Select,{className:"univer-w-full",value:f,options:M,onChange:O})}),l.jsx("div",{children:P&&l.jsx(z.Provider,{value:p,children:y.createElement(P,{...te,key:h})})})]}),l.jsxs("div",{className:"univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end",children:[l.jsx(E.Button,{onClick:R,className:"univer-mr-3",children:u("sheet.numfmt.cancel")}),l.jsx(E.Button,{variant:"primary",onClick:ee,children:u("sheet.numfmt.confirm")})]})]})};var $e=Object.getOwnPropertyDescriptor,Le=(e,n,r,t)=>{for(var i=t>1?void 0:t?$e(n,r):n,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},N=(e,n)=>(r,t)=>n(r,t,e);const oe="SHEET_NUMFMT_PANEL";let H=class extends a.Disposable{constructor(n,r,t,i,s,o,u,c,v,f,m){super();G(this,"_previewPattern","");G(this,"_sidebarDisposable",null);this._sheetInterceptorService=n,this._themeService=r,this._univerInstanceService=t,this._commandService=i,this._selectionManagerService=s,this._renderManagerService=o,this._numfmtService=u,this._componentManager=c,this._sidebarService=v,this._localeService=f,this._sheetsNumfmtCellContentController=m,this._initRealTimeRenderingInterceptor(),this._initPanel(),this._initCommands(),this._initCloseListener(),this._commandExecutedListener(),this._initNumfmtLocalChange()}_initNumfmtLocalChange(){this.disposeWithMe(x.merge(this._sheetsNumfmtCellContentController.locale$,this._localeService.currentLocale$).subscribe(()=>{this._forceUpdate()}))}openPanel(){var P;const n=this._sidebarService,r=this._selectionManagerService,t=this._commandService,i=this._univerInstanceService,s=this._numfmtService,o=this._localeService,c=(((P=r.getCurrentSelections())==null?void 0:P.map(I=>I.range))||[])[0];if(!c)return!1;const v=i.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),f=v.getActiveSheet();if(!f)return!1;const m=f.getCellRaw(c.startRow,c.startColumn),h=s.getValue(v.getUnitId(),f.getSheetId(),c.startRow,c.startColumn);let S="";h&&(S=h.pattern);const b=(m==null?void 0:m.t)===a.CellValueType.NUMBER?m.v:12345678,p={onChange:I=>{var M;if(I.type==="change")this._previewPattern=I.value,this._forceUpdate();else if(I.type==="confirm"){const O=((M=r.getCurrentSelections())==null?void 0:M.map(R=>R.range))||[],U={values:[]},ee=d.getPatternType(I.value);O.forEach(R=>{a.Range.foreach(R,(te,T)=>{U.values.push({row:te,col:T,pattern:I.value,type:ee})})}),t.executeCommand(d.SetNumfmtCommand.id,U),n.close()}else I.type==="cancel"&&n.close()},value:{defaultPattern:S,defaultValue:b,row:c.startRow,col:c.startColumn}};return this._sidebarDisposable=n.open({header:{title:o.t("sheet.numfmt.title")},children:{label:oe,...p},onClose:()=>{this._forceUpdate(),t.executeCommand(Y.id)}}),!0}_forceUpdate(n){var t;const r=this._renderManagerService.getRenderById(n!=null?n:this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET).getUnitId());r==null||r.with(D.SheetSkeletonManagerService).reCalculate(),(t=r==null?void 0:r.mainComponent)==null||t.makeDirty()}_initCommands(){[L,Y].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initPanel(){this.disposeWithMe(this._componentManager.register(oe,je))}_initRealTimeRenderingInterceptor(){const n=new x.Observable(t=>{this._commandService.onCommandExecuted(i=>{i.id===L.id&&t.next(!0),i.id===Y.id&&t.next(!1)})}),r=x.combineLatest([n,this._selectionManagerService.selectionMoveEnd$.pipe(W.map(t=>t?t.map(i=>i.range):[]))]);this.disposeWithMe(a.toDisposable(r.pipe(W.switchMap(([t,i])=>new x.Observable(s=>{const o=new a.DisposableCollection;return t&&i.length&&s.next({selectionRanges:i,disposableCollection:o}),()=>{o.dispose()}})),W.tap(()=>{this._previewPattern=null})).subscribe(({disposableCollection:t,selectionRanges:i})=>{var o,u;const s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);this.openPanel(),t.add(this._sheetInterceptorService.intercept(g.INTERCEPTOR_POINT.CELL_CONTENT,{priority:99,effect:a.InterceptorEffectEnum.Value|a.InterceptorEffectEnum.Style,handler:(c,v,f)=>{var b;const{row:m,col:h}=v,S=f(c)||{};if(i.find(p=>p.startColumn<=h&&p.endColumn>=h&&p.startRow<=m&&p.endRow>=m)){const p=v.worksheet.getCellRaw(m,h),P=p==null?void 0:p.v,I=p==null?void 0:p.t;if(P==null||I!==a.CellValueType.NUMBER||this._previewPattern===null)return S;const M=d.getPatternPreviewIgnoreGeneral(this._previewPattern,P,this._sheetsNumfmtCellContentController.locale);if(M.color){const O=(b=this._themeService.getColorFromTheme(`${M.color}.500`))!=null?b:M.color;return{...S,v:M.result,t:a.CellValueType.STRING,s:{cl:{rgb:O}}}}return{...S,v:M.result,t:a.CellValueType.STRING}}return S}})),(u=(o=this._renderManagerService.getRenderById(s.getUnitId()))==null?void 0:o.mainComponent)==null||u.makeDirty()})))}_commandExecutedListener(){const n=[g.RemoveNumfmtMutation.id,g.SetNumfmtMutation.id];this.disposeWithMe(new x.Observable(r=>{const t=this._commandService.onCommandExecuted(i=>{if(n.includes(i.id)){const s=i.params;r.next(s.unitId)}});return()=>t.dispose()}).pipe(W.debounceTime(16)).subscribe(r=>this._forceUpdate(r)))}_initCloseListener(){this._univerInstanceService.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{var r;n||((r=this._sidebarDisposable)==null||r.dispose(),this._sidebarDisposable=null)})}};H=Le([N(0,a.Inject(g.SheetInterceptorService)),N(1,a.Inject(a.ThemeService)),N(2,a.IUniverInstanceService),N(3,a.ICommandService),N(4,a.Inject(g.SheetsSelectionsService)),N(5,k.IRenderManagerService),N(6,g.INumfmtService),N(7,a.Inject(_.ComponentManager)),N(8,_.ISidebarService),N(9,a.Inject(a.LocaleService)),N(10,a.Inject(d.SheetsNumfmtCellContentController))],H);var Fe=Object.getOwnPropertyDescriptor,He=(e,n,r,t)=>{for(var i=t>1?void 0:t?Fe(n,r):n,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},A=(e,n)=>(r,t)=>n(r,t,e);const Ae=()=>{let e=[];return{add:(i,s,o,u,c)=>e.push({unitId:i,subUnitId:s,row:o,col:u,value:c}),getEffects:()=>e,clean:()=>{e=[]}}};let V=class extends a.Disposable{constructor(n,r,t,i,s){super();G(this,"_collectEffectMutation",Ae());this._sheetInterceptorService=n,this._numfmtService=r,this._univerInstanceService=t,this._injector=i,this._editorBridgeService=s,this._initInterceptorEditorStart(),this._initInterceptorEditorEnd(),this._initInterceptorCommands()}_initInterceptorEditorStart(){this._editorBridgeService&&this.disposeWithMe(a.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(g.BEFORE_CELL_EDIT,{handler:(n,r,t)=>{const i=r.row,s=r.col,o=this._numfmtService.getValue(r.unitId,r.subUnitId,i,s);if(o)switch(d.getPatternType(o.pattern)){case"scientific":case"currency":case"grouped":case"number":{const c=r.worksheet.getCellRaw(i,s);return t&&t(c)}case"percent":case"date":case"time":case"datetime":default:return t&&t(n)}return t(n)}})))}_initInterceptorEditorEnd(){this.disposeWithMe(a.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(g.AFTER_CELL_EDIT,{handler:(n,r,t)=>{var c,v,f;this._collectEffectMutation.clean();const i=this._numfmtService.getValue(r.unitId,r.subUnitId,r.row,r.col);if(!(n!=null&&n.v)&&!(n!=null&&n.p)||a.isTextFormat(i==null?void 0:i.pattern)||n.t===a.CellValueType.FORCE_STRING)return t(n);const s=(c=n.p)==null?void 0:c.body,o=(f=(v=n==null?void 0:n.p)==null?void 0:v.body)!=null&&f.dataStream?n.p.body.dataStream.replace(/\r\n$/,""):String(n.v),u=a.numfmt.parseDate(o)||a.numfmt.parseTime(o)||a.numfmt.parseNumber(o);if(s)if(Re(s)){const{dataStream:m}=s,h=m.replace(/\r\n$/,""),S=Number(h);if(Number.isNaN(S)&&!u)return t(n)}else return t(n);if(u){if(!u.z&&a.willLoseNumericPrecision(o))return t({...n,p:void 0,v:o,t:a.CellValueType.FORCE_STRING});u.z&&this._collectEffectMutation.add(r.unitId,r.subUnitId,r.row,r.col,{pattern:u.z});const m=Number(u.v);return t({...n,p:void 0,v:m,t:a.CellValueType.NUMBER})}return t(n)}})))}_initInterceptorCommands(){const n=this;this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations(r){var t;switch(r.id){case g.SetRangeValuesCommand.id:{const i=n._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),s=i.getUnitId(),o=(t=i.getActiveSheet())==null?void 0:t.getSheetId();if(!o)return{redos:[],undos:[]};const u=n._collectEffectMutation.getEffects();if(n._collectEffectMutation.clean(),!u.length)return{redos:[],undos:[]};const c=u.filter(h=>{var S;return!!((S=h.value)!=null&&S.pattern)}).map(h=>({row:h.row,col:h.col,pattern:h.value.pattern})),v=u.filter(h=>{var S;return!((S=h.value)!=null&&S.pattern)}).map(h=>({startRow:h.row,endColumn:h.col,startColumn:h.col,endRow:h.row})),f=[],m=[];if(c.length){const h={id:g.SetNumfmtMutation.id,params:g.transformCellsToRange(s,o,c)};f.push(h),m.push(...g.factorySetNumfmtUndoMutation(n._injector,h.params))}if(v.length){const h={id:g.RemoveNumfmtMutation.id,params:{unitId:s,subUnitId:o,ranges:v}};f.push(h),m.push(...g.factoryRemoveNumfmtUndoMutation(n._injector,h.params))}return{redos:f,undos:m.reverse()}}}return{redos:[],undos:[]}}}))}};V=He([A(0,a.Inject(g.SheetInterceptorService)),A(1,a.Inject(g.INumfmtService)),A(2,a.Inject(a.IUniverInstanceService)),A(3,a.Inject(a.Injector)),A(4,a.Optional(D.IEditorBridgeService))],V);function Re(e){const{textRuns:n=[],paragraphs:r=[],customRanges:t,customBlocks:i=[]}=e,s=["va"];return!(n.some(o=>!!(o.ts&&Object.keys(o.ts).some(c=>s.includes(c))))||r.some(o=>o.bullet)||r.length>=2||t!=null&&t.length||i.length>0)}const B=[{label:"sheet.numfmt.general",pattern:null},{label:"sheet.numfmt.text",pattern:a.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:""}],We=e=>({icon:new x.Observable(n=>{var s;const r=e.get(d.MenuCurrencyService);function t(o){var c;return(c={[d.countryCurrencyMap.US]:"DollarIcon",[d.countryCurrencyMap.RU]:"RoubleIcon",[d.countryCurrencyMap.CN]:"RmbIcon",[d.countryCurrencyMap.AT]:"EuroIcon"}[o])!=null?c:"DollarIcon"}const i=(s=d.countryCurrencyMap[r.getCurrencySymbol()])!=null?s:"$";return n.next(t(i)),r.currencySymbol$.subscribe(o=>{var c;const u=(c=d.countryCurrencyMap[o])!=null?c:"$";n.next(t(u))})}),id:d.SetCurrencyCommand.id,title:"sheet.numfmt.currency",tooltip:"sheet.numfmt.currency",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),Ve=e=>({icon:"AddDigitsIcon",id:d.AddDecimalCommand.id,title:"sheet.numfmt.addDecimal",tooltip:"sheet.numfmt.addDecimal",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),Be=e=>({icon:"ReduceDigitsIcon",id:d.SubtractDecimalCommand.id,title:"sheet.numfmt.subtractDecimal",tooltip:"sheet.numfmt.subtractDecimal",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),qe=e=>({icon:"PercentIcon",id:d.SetPercentCommand.id,title:"sheet.numfmt.percent",tooltip:"sheet.numfmt.percent",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),Ge=e=>{const n=e.get(a.IUniverInstanceService),r=e.get(a.ICommandService),t=e.get(a.LocaleService),i=e.get(g.SheetsSelectionsService),s=[g.RemoveNumfmtMutation.id,g.SetNumfmtMutation.id],o=D.deriveStateFromActiveSheet$(n,"",({workbook:u,worksheet:c})=>new x.Observable(v=>x.merge(i.selectionMoveEnd$,a.fromCallback(r.onCommandExecuted.bind(r)).pipe(x.filter(([f])=>s.includes(f.id)))).subscribe(()=>{var m,h;const f=i.getCurrentSelections();if(f&&f[0]){const S=f[0].range,b=S.startRow,p=S.startColumn,P=(h=u.getStyles().get((m=c.getCell(b,p))==null?void 0:m.s))==null?void 0:h.n,I=P==null?void 0:P.pattern;let M=t.t("sheet.numfmt.general");if(a.isDefaultFormat(I)){v.next(M);return}if(I){const O=B.filter(U=>typeof U=="object"&&U.pattern).find(U=>a.isPatternEqualWithoutDecimal(I,U.pattern));O&&typeof O=="object"&&O.pattern?M=t.t(O.label):M=t.t("sheet.numfmt.moreFmt")}v.next(M)}})));return{label:ce,id:L.id,tooltip:"sheet.numfmt.title",type:_.MenuItemType.SELECTOR,slot:!0,selections:[{label:{name:le,hoverable:!1,selectable:!1}}],value$:o,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSetCellStylePermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}},ce="sheet.numfmt.moreNumfmtType",le="sheet.numfmt.moreNumfmtType.options",Ke=e=>{const{value:n}=e,r=_.useDependency(a.LocaleService),t=n!=null?n:r.t("sheet.numfmt.general");return l.jsx("span",{className:"univer-text-sm",children:t})},Ze=()=>{const e=_.useDependency(a.ICommandService),n=_.useDependency(a.LocaleService),r=_.useDependency(_.ILayoutService),t=_.useDependency(d.SheetsNumfmtCellContentController),i=_.useDependency(g.SheetsSelectionsService),s=c=>{const v=i.getCurrentLastSelection();if(!v)return;const f=v.range,m=[];a.Range.foreach(f,(h,S)=>{c?m.push({row:h,col:S,pattern:c,type:d.getPatternType(c)}):m.push({row:h,col:S})}),e.executeCommand(d.SetNumfmtCommand.id,{values:m}),r.focus()},o=c=>{if(c===0)s(null);else if(c===B.length-1)e.executeCommand(L.id),r.focus();else{const v=B[c];v.pattern&&s(v.pattern)}},u=1220;return l.jsx("div",{className:"univer-grid univer-gap-1 univer-p-1.5",children:B.map((c,v)=>c==="|"?l.jsx(E.Separator,{},v):l.jsxs("div",{className:"univer-flex univer-h-7 univer-items-center univer-justify-between univer-gap-6 univer-rounded univer-px-2 univer-text-sm hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",onClick:()=>{o(v)},children:[l.jsx("span",{children:n.t(c.label)}),l.jsx("span",{className:"univer-text-xs univer-text-gray-500",children:c.pattern?d.getPatternPreview(c.pattern||"",u,t.locale).result.trim():""})]},v))})},Ye={[_.RibbonDataGroup.FORMULAS]:{[d.SetCurrencyCommand.id]:{order:0,menuItemFactory:We},[d.AddDecimalCommand.id]:{order:1,menuItemFactory:Ve},[d.SubtractDecimalCommand.id]:{order:2,menuItemFactory:Be},[d.SetPercentCommand.id]:{order:3,menuItemFactory:qe},[L.id]:{order:4,menuItemFactory:Ge}}};var ze=Object.getOwnPropertyDescriptor,Xe=(e,n,r,t)=>{for(var i=t>1?void 0:t?ze(n,r):n,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},ue=(e,n)=>(r,t)=>n(r,t,e);let q=class extends a.Disposable{constructor(e,n){super(),this._componentManager=e,this._menuManagerService=n,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(Ye),[[ce,Ke],[le,Ze]].forEach(([e,n])=>{this.disposeWithMe(this._componentManager.register(e,n))})}};q=Xe([ue(0,a.Inject(_.ComponentManager)),ue(1,_.IMenuManagerService)],q);var Je=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,et=(e,n,r)=>n in e?Je(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,tt=(e,n,r,t)=>{for(var i=t>1?void 0:t?Qe(n,r):n,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},Q=(e,n)=>(r,t)=>n(r,t,e),me=(e,n,r)=>et(e,typeof n!="symbol"?n+"":n,r);const nt="SHEET_NUMFMT_UI_PLUGIN";C.UniverSheetsNumfmtUIPlugin=class extends a.Plugin{constructor(n=ne,r,t,i){super(),this._config=n,this._injector=r,this._configService=t,this._renderManagerService=i;const{menu:s,...o}=a.merge({},ne,this._config);s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig("sheets-numfmt-ui.config",o)}onStarting(){a.registerDependencies(this._injector,[[H],[V],[F],[q]])}onRendered(){this._registerRenderModules(),a.touchDependencies(this._injector,[[H],[V],[q]])}_registerRenderModules(){[[Z]].forEach(r=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(a.UniverInstanceType.UNIVER_SHEET,r))})}},me(C.UniverSheetsNumfmtUIPlugin,"pluginName",nt),me(C.UniverSheetsNumfmtUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),C.UniverSheetsNumfmtUIPlugin=tt([a.DependentOn(D.UniverSheetsUIPlugin,d.UniverSheetsNumfmtPlugin),Q(1,a.Inject(a.Injector)),Q(2,a.IConfigService),Q(3,k.IRenderManagerService)],C.UniverSheetsNumfmtUIPlugin),Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(C,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets-numfmt"),require("@univerjs/sheets-ui"),require("@univerjs/sheets"),require("@univerjs/ui"),require("rxjs"),require("rxjs/operators"),require("react/jsx-runtime"),require("react"),require("@univerjs/design")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/sheets-numfmt","@univerjs/sheets-ui","@univerjs/sheets","@univerjs/ui","rxjs","rxjs/operators","react/jsx-runtime","react","@univerjs/design"],a):(C=typeof globalThis<"u"?globalThis:C||self,a(C.UniverSheetsNumfmtUi={},C.UniverCore,C.UniverEngineRender,C.UniverSheetsNumfmt,C.UniverSheetsUi,C.UniverSheets,C.UniverUi,C.rxjs,C.rxjs.operators,C.React,C.React,C.UniverDesign))})(this,(function(C,a,$,v,D,g,_,x,B,c,S,E){"use strict";var at=Object.defineProperty;var st=(C,a,$)=>a in C?at(C,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):C[a]=$;var G=(C,a,$)=>st(C,typeof a!="symbol"?a+"":a,$);const te={};var me=Object.getOwnPropertyDescriptor,ve=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},j=(e,t)=>(r,n)=>t(r,n,e);const K="SHEET_NUMFMT_ALERT";let Z=class extends a.Disposable{constructor(e,t,r,n,i,s,o){super(),this._context=e,this._hoverManagerService=t,this._cellAlertManagerService=r,this._localeService=n,this._zenZoneService=i,this._numfmtService=s,this._configService=o,this._init()}_init(){this._initCellAlertPopup(),this._initZenService()}_initCellAlertPopup(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(x.debounceTime(100)).subscribe(e=>{var t,r;if(e){const n=e.location,i=this._context.unit,s=i.getActiveSheet();if(!s)return;const o=n.unitId,l=n.subUnitId;let d;const u=s.getCell(n.row,n.col);if(u!=null&&u.s){const f=i.getStyles().get(u.s);f!=null&&f.n&&(d=f.n)}if(d||(d=this._numfmtService.getValue(o,l,n.row,n.col)),!d){this._hideAlert();return}if(a.isTextFormat(d.pattern)&&a.Tools.isDefine(u==null?void 0:u.v)&&a.isRealNum(u.v)){if((t=this._configService.getConfig(v.SHEETS_NUMFMT_PLUGIN_CONFIG_KEY))!=null&&t.disableTextFormatAlert)return;const f=this._cellAlertManagerService.currentAlert.get(K),m=(r=f==null?void 0:f.alert)==null?void 0:r.location;if(m&&m.row===n.row&&m.col===n.col&&m.subUnitId===n.subUnitId&&m.unitId===n.unitId)return;this._cellAlertManagerService.showAlert({type:D.CellAlertType.ERROR,title:this._localeService.t("info.error"),message:this._localeService.t("info.forceStringInfo"),location:n,width:200,height:74,key:K});return}}this._hideAlert()}))}_initZenService(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this._hideAlert()}))}_hideAlert(){this._cellAlertManagerService.removeAlert(K)}};Z=ve([j(1,a.Inject(D.HoverManagerService)),j(2,a.Inject(D.CellAlertManagerService)),j(3,a.Inject(a.LocaleService)),j(4,_.IZenZoneService),j(5,a.Inject(g.INumfmtService)),j(6,a.IConfigService)],Z);const Y={id:"sheet.operation.close.numfmt.panel",type:a.CommandType.OPERATION,handler:()=>!0},F={id:"sheet.operation.open.numfmt.panel",type:a.CommandType.OPERATION,handler:e=>(e.get(A).openPanel(),!0)};var fe=Object.getOwnPropertyDescriptor,pe=(e,t,r,n)=>{for(var i=n>1?void 0:n?fe(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},he=(e,t)=>(r,n)=>t(r,n,e);const z=S.createContext([]);let H=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 i=n.findIndex(s=>s===t);i>-1&&n.splice(i,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 i=n.map((s,o,l)=>{const d=l.length;return{value:s,priority:d-o}});return t.sort((s,o)=>{var u,f;const l=((u=i.find(m=>m.value===s))==null?void 0:u.priority)||-1;return(((f=i.find(m=>m.value===o))==null?void 0:f.priority)||-1)-l})}return n||[]}deleteHabit(e){this._localStorageService.removeItem(e)}};H=pe([he(0,a.Inject(a.ILocalStorageService))],H);const ne="numfmtCurrency",ge=e=>{const t=_.useDependency(H),[r,n]=S.useState(v.currencySymbols);return S.useEffect(()=>{t.addHabit("numfmtCurrency",[]).then(()=>{t.getHabit(ne,[...v.currencySymbols]).then(s=>{n(s),e&&e(s)})})},[]),{userHabitCurrency:r,mark:s=>{t.markHabit(ne,s)}}},Se=()=>{const e=S.useRef([]),[t,r]=S.useState({});return S.useEffect(()=>{e.current.forEach(i=>{i()}),e.current=[]},[t]),i=>{e.current.push(i),r({})}},ye=e=>!!v.getCurrencyType(e)&&e.startsWith("_("),_e=e=>{const{defaultPattern:t,action:r,onChange:n}=e,[i,s]=S.useState(()=>v.getDecimalFromPattern(t||"",2)),o=S.useContext(z),[l,d]=S.useState(()=>v.getCurrencyType(t)||o[0]),u=S.useMemo(()=>o.map(b=>({label:b,value:b})),[]),m=_.useDependency(a.LocaleService).t;r.current=()=>v.setPatternDecimal(`_("${l}"* #,##0${i>0?".0":""}_)`,i);const h=b=>{d(b),n(v.setPatternDecimal(`_("${b}"* #,##0${i>0?".0":""}_)`,i))},y=b=>{const p=b||0;s(p),n(v.setPatternDecimal(`_("${l}"* #,##0${p>0?".0":""}_)`,p))};return c.jsxs("div",{children:[c.jsxs("div",{className:"univer-mt-4 univer-flex univer-justify-between",children:[c.jsxs("div",{className:"option",children:[c.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:m("sheet.numfmt.decimalLength")}),c.jsx("div",{className:"univer-mt-2 univer-w-32",children:c.jsx(E.InputNumber,{value:i,step:1,precision:0,max:20,min:0,onChange:y})})]}),c.jsxs("div",{className:"option",children:[c.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:m("sheet.numfmt.currencyType")}),c.jsx("div",{className:"univer-mt-2 univer-w-36",children:c.jsx(E.Select,{options:u,value:l,onChange:h})})]})]}),c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:m("sheet.numfmt.accountingDes")})]})},Ce=e=>!!v.getCurrencyType(e)&&!e.startsWith("_("),be=e=>{const r=_.useDependency(a.LocaleService).t,n=S.useContext(z),[i,s]=S.useState(()=>v.getCurrencyType(e.defaultPattern)||n[0]),[o,l]=S.useState(()=>v.getDecimalFromPattern(e.defaultPattern||"",2)),[d,u]=S.useState(()=>{var I;const p=v.getCurrencyFormatOptions(i);return((I=p.find(M=>a.isPatternEqualWithoutDecimal(M.value,e.defaultPattern)))==null?void 0:I.value)||p[0].value}),f=S.useMemo(()=>v.getCurrencyFormatOptions(i),[i]),m=S.useMemo(()=>n.map(p=>({label:p,value:p})),[n]);e.action.current=()=>v.setPatternDecimal(d,o);const h=p=>{if(p===void 0)return;s(p);const P=v.getCurrencyFormatOptions(p)[0].value;u(P),e.onChange(v.setPatternDecimal(P,o))},y=p=>{p!==void 0&&(u(p),e.onChange(v.setPatternDecimal(p,o)))},b=p=>{l(p||0),e.onChange(v.setPatternDecimal(d,p||0))};return c.jsxs("div",{children:[c.jsxs("div",{className:"univer-mt-4 univer-flex univer-justify-between",children:[c.jsxs("div",{className:"option",children:[c.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:r("sheet.numfmt.decimalLength")}),c.jsx("div",{className:"univer-mt-2 univer-w-32",children:c.jsx(E.InputNumber,{value:o,max:20,min:0,onChange:b})})]}),c.jsxs("div",{className:"option",children:[c.jsx("div",{className:"univer-text-sm univer-text-gray-400",children:r("sheet.numfmt.currencyType")}),c.jsx("div",{className:"univer-mt-2 univer-w-36",children:c.jsx(E.Select,{value:i,options:m,onChange:h})})]})]}),c.jsx("div",{className:"label univer-mt-4",children:r("sheet.numfmt.negType")}),c.jsx("div",{className:"univer-mt-2",children:c.jsx(E.SelectList,{value:d,options:f,onChange:y})}),c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:r("sheet.numfmt.currencyDes")})]})};var w=function(){return w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},w.apply(this,arguments)},Ie=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 i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},re=S.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,o=Ie(e,["icon","id","className","extend"]),l="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),d=S.useRef("_".concat(Pe()));return ie(r,"".concat(n),{defIds:r.defIds,idSuffix:d.current},w({ref:t,className:l},o),s)});function ie(e,t,r,n,i){return S.createElement(e.tag,w(w({key:t},Te(e,r,i)),n),(Ee(e,r).children||[]).map(function(s,o){return ie(s,"".concat(t,"-").concat(e.tag,"-").concat(o),r,void 0,i)}))}function Te(e,t,r){var n=w({},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(s){var o=s[0],l=s[1];o==="mask"&&typeof l=="string"&&(n[o]=l.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var o=s[0],l=s[1];typeof l=="string"&&(n[o]=l.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Ee(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)?w(w({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.includes(i.attrs.id)?w(w({},i),{attrs:w(w({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function Pe(){return Math.random().toString(36).substring(2,8)}re.displayName="UniverIcon";var Me={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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"}}]},ae=S.forwardRef(function(e,t){return S.createElement(re,Object.assign({},e,{id:"check-mark-icon",ref:t,icon:Me}))});ae.displayName="CheckMarkIcon";const X="customFormat",J="numfmt_custom_pattern";function De(e){const{defaultPattern:t,action:r,onChange:n}=e,i=_.useDependency(H),s=_.useDependency(a.ILocalStorageService),o=_.useDependency(a.LocaleService),[l,d]=S.useState(t);r.current=()=>(i.markHabit(X,l),s.getItem(J).then((y=[])=>{const b=[...new Set([l,...y||[]])].splice(0,10).filter(p=>!!p);s.setItem(J,b)}),l);const[u,f]=S.useState([]);S.useEffect(()=>{s.getItem(J).then(y=>{const b=[...v.CURRENCYFORMAT.map(p=>p.suffix("$")),...v.DATEFMTLISG.map(p=>p.suffix),...v.NUMBERFORMAT.map(p=>p.suffix)];b.push(...y||[]),i.addHabit(X,[]).finally(()=>{i.getHabit(X,b).then(p=>{f([...new Set(p)])})})})},[]);const m=y=>{d(y),n(y)},h=()=>{n(l)};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:o.t("sheet.numfmt.customFormat")}),c.jsx(E.Input,{placeholder:o.t("sheet.numfmt.customFormat"),onBlur:h,value:l,onChange:d,className:"univer-mt-2 univer-w-full"}),c.jsx("div",{className:E.clsx("univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2",E.borderClassName),children:u.map(y=>c.jsxs("div",{onClick:()=>m(y),className:"univer-flex univer-cursor-pointer univer-items-center univer-gap-1.5 univer-py-1.5 univer-text-sm",children:[c.jsx("div",{className:"univer-flex univer-w-4 univer-items-center univer-text-primary-600",children:l===y&&c.jsx(ae,{})}),c.jsx("div",{children:y})]},y))}),c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:o.t("sheet.numfmt.customFormatDes")})]})}const we=e=>{const t=a.numfmt.getFormatInfo(e);return v.getDateFormatOptions().map(r=>r.value).includes(e)||["date","datetime","time"].includes(t.type)};function Ne(e){const{onChange:t,defaultPattern:r}=e,n=S.useMemo(v.getDateFormatOptions,[]),i=_.useDependency(a.LocaleService),[s,o]=S.useState(()=>{if(r){const d=n.find(u=>u.value===r);if(d)return d.value}return n[0].value});e.action.current=()=>s;const l=d=>{d!==void 0&&(o(d),t(d))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:i.t("sheet.numfmt.dateType")}),c.jsx("div",{className:"univer-mt-2",children:c.jsx(E.SelectList,{value:s,options:n,onChange:l})}),c.jsx("div",{className:"univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",children:i.t("sheet.numfmt.dateDes")})]})}const xe=e=>!e,Oe=e=>{const r=_.useDependency(a.LocaleService).t;return e.action.current=()=>"",c.jsx("div",{children:c.jsx("div",{className:"univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",children:r("sheet.numfmt.generalDes")})})},Ue=e=>v.getNumberFormatOptions().some(t=>a.isPatternEqualWithoutDecimal(t.value,e));function ke(e){const t=_.useDependency(a.LocaleService),r=S.useMemo(v.getNumberFormatOptions,[]),[n,i]=S.useState(()=>v.getDecimalFromPattern(e.defaultPattern||"",0)),[s,o]=S.useState(()=>{const m=r.find(h=>a.isPatternEqualWithoutDecimal(h.value,e.defaultPattern||""));return(m==null?void 0:m.value)||r[0].value}),l=S.useMemo(()=>v.setPatternDecimal(s,Number(n||0)),[s,n]),d=S.useMemo(()=>!v.isPatternHasDecimal(s),[s]),u=m=>{i(m||0),e.onChange(v.setPatternDecimal(s,Number(m||0)))},f=m=>{m!==void 0&&(i(v.getDecimalFromPattern(m,0)),o(m),e.onChange(m))};return e.action.current=()=>l,c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:t.t("sheet.numfmt.decimalLength")}),c.jsx("div",{className:"univer-mt-2",children:c.jsx(E.InputNumber,{disabled:d,value:n,max:20,min:0,onChange:u})}),c.jsxs("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-400",children:[" ",t.t("sheet.numfmt.negType")]}),c.jsx("div",{className:"univer-mt-2",children:c.jsx(E.SelectList,{onChange:f,options:r,value:s})}),c.jsx("div",{className:"univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",children:t.t("sheet.numfmt.thousandthPercentileDes")})]})}const $e=e=>{const{defaultValue:t,defaultPattern:r,row:n,col:i}=e.value,s=_.useDependency(a.LocaleService),o=S.useRef(()=>""),l=s.t,d=Se(),u=S.useMemo(()=>[{label:"sheet.numfmt.general",component:Oe},{label:"sheet.numfmt.accounting",component:_e},{label:"sheet.numfmt.currency",component:be},{label:"sheet.numfmt.date",component:Ne},{label:"sheet.numfmt.thousandthPercentile",component:ke},{label:"sheet.numfmt.customFormat",component:De}].map(T=>({...T,label:l(T.label)})),[]),[f,m]=S.useState(I),[h,y]=S.useState(()=>`${n}_${i}`),{mark:b,userHabitCurrency:p}=ge(()=>y(`${n}_${i}_userCurrency'`)),P=S.useMemo(()=>{var T;return(T=u.find(L=>L.label===f))==null?void 0:T.component},[f]);function I(){return[xe,ye,Ce,we,Ue].reduce((L,rt,it)=>L||(rt(r)?u[it].label:""),"")||u[0].label}const M=u.map(T=>({label:T.label,value:T.label})),O=T=>{m(T),d(()=>e.onChange({type:"change",value:o.current()||""}))},U=S.useCallback(T=>{e.onChange({type:"change",value:T})},[]),k=()=>{const T=o.current()||"",L=v.getCurrencyType(T);L&&b(L),e.onChange({type:"confirm",value:T})},W=()=>{e.onChange({type:"cancel",value:""})},ee={onChange:U,defaultValue:t,defaultPattern:r,action:o};return S.useEffect(()=>{m(I()),y(`${n}_${i}`)},[n,i]),c.jsxs("div",{className:E.clsx("univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5",E.scrollbarClassName),children:[c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3.5 univer-text-sm univer-text-gray-400",children:l("sheet.numfmt.numfmtType")}),c.jsx("div",{className:"univer-mt-2",children:c.jsx(E.Select,{className:"univer-w-full",value:f,options:M,onChange:O})}),c.jsx("div",{children:P&&c.jsx(z.Provider,{value:p,children:S.createElement(P,{...ee,key:h})})})]}),c.jsxs("div",{className:"univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end",children:[c.jsx(E.Button,{onClick:W,className:"univer-mr-3",children:l("sheet.numfmt.cancel")}),c.jsx(E.Button,{variant:"primary",onClick:k,children:l("sheet.numfmt.confirm")})]})]})};var je=Object.getOwnPropertyDescriptor,Le=(e,t,r,n)=>{for(var i=n>1?void 0:n?je(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},N=(e,t)=>(r,n)=>t(r,n,e);const se="SHEET_NUMFMT_PANEL";let A=class extends a.Disposable{constructor(t,r,n,i,s,o,l,d,u,f,m){super();G(this,"_previewPattern","");G(this,"_sidebarDisposable",null);this._sheetInterceptorService=t,this._themeService=r,this._univerInstanceService=n,this._commandService=i,this._selectionManagerService=s,this._renderManagerService=o,this._numfmtService=l,this._componentManager=d,this._sidebarService=u,this._localeService=f,this._sheetsNumfmtCellContentController=m,this._initRealTimeRenderingInterceptor(),this._initPanel(),this._initCommands(),this._initCloseListener(),this._commandExecutedListener(),this._initNumfmtLocalChange()}_initNumfmtLocalChange(){this.disposeWithMe(x.merge(this._sheetsNumfmtCellContentController.locale$,this._localeService.currentLocale$).subscribe(()=>{this._forceUpdate()}))}openPanel(){var P;const t=this._sidebarService,r=this._selectionManagerService,n=this._commandService,i=this._univerInstanceService,s=this._numfmtService,o=this._localeService,d=(((P=r.getCurrentSelections())==null?void 0:P.map(I=>I.range))||[])[0];if(!d)return!1;const u=i.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),f=u.getActiveSheet();if(!f)return!1;const m=f.getCellRaw(d.startRow,d.startColumn),h=s.getValue(u.getUnitId(),f.getSheetId(),d.startRow,d.startColumn);let y="";h&&(y=h.pattern);const b=(m==null?void 0:m.t)===a.CellValueType.NUMBER?m.v:12345678,p={onChange:I=>{var M;if(I.type==="change")this._previewPattern=I.value,this._forceUpdate();else if(I.type==="confirm"){const O=((M=r.getCurrentSelections())==null?void 0:M.map(W=>W.range))||[],U={values:[]},k=v.getPatternType(I.value);O.forEach(W=>{a.Range.foreach(W,(ee,T)=>{U.values.push({row:ee,col:T,pattern:I.value,type:k})})}),n.executeCommand(v.SetNumfmtCommand.id,U),t.close()}else I.type==="cancel"&&t.close()},value:{defaultPattern:y,defaultValue:b,row:d.startRow,col:d.startColumn}};return this._sidebarDisposable=t.open({header:{title:o.t("sheet.numfmt.title")},children:{label:se,...p},onClose:()=>{this._forceUpdate(),n.executeCommand(Y.id)}}),!0}_forceUpdate(t){var n;const r=this._renderManagerService.getRenderById(t!=null?t:this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET).getUnitId());r==null||r.with(D.SheetSkeletonManagerService).reCalculate(),(n=r==null?void 0:r.mainComponent)==null||n.makeDirty()}_initCommands(){[F,Y].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))})}_initPanel(){this.disposeWithMe(this._componentManager.register(se,$e))}_initRealTimeRenderingInterceptor(){const t=new x.Observable(n=>{this._commandService.onCommandExecuted(i=>{i.id===F.id&&n.next(!0),i.id===Y.id&&n.next(!1)})}),r=x.combineLatest([t,this._selectionManagerService.selectionMoveEnd$.pipe(B.map(n=>n?n.map(i=>i.range):[]))]);this.disposeWithMe(a.toDisposable(r.pipe(B.switchMap(([n,i])=>new x.Observable(s=>{const o=new a.DisposableCollection;return n&&i.length&&s.next({selectionRanges:i,disposableCollection:o}),()=>{o.dispose()}})),B.tap(()=>{this._previewPattern=null})).subscribe(({disposableCollection:n,selectionRanges:i})=>{var o,l;const s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);this.openPanel(),n.add(this._sheetInterceptorService.intercept(g.INTERCEPTOR_POINT.CELL_CONTENT,{priority:99,effect:a.InterceptorEffectEnum.Value|a.InterceptorEffectEnum.Style,handler:(d,u,f)=>{var b;const{row:m,col:h}=u,y=f(d)||{};if(i.find(p=>p.startColumn<=h&&p.endColumn>=h&&p.startRow<=m&&p.endRow>=m)){const p=u.worksheet.getCellRaw(m,h),P=p==null?void 0:p.v,I=p==null?void 0:p.t;if(P==null||I!==a.CellValueType.NUMBER||this._previewPattern===null)return y;const M=v.getPatternPreviewIgnoreGeneral(this._previewPattern,P,this._sheetsNumfmtCellContentController.locale);if(M.color){const O=(b=this._themeService.getColorFromTheme(`${M.color}.500`))!=null?b:M.color;return{...y,v:M.result,t:a.CellValueType.STRING,s:{cl:{rgb:O}}}}return{...y,v:M.result,t:a.CellValueType.STRING}}return y}})),(l=(o=this._renderManagerService.getRenderById(s.getUnitId()))==null?void 0:o.mainComponent)==null||l.makeDirty()})))}_commandExecutedListener(){const t=[g.RemoveNumfmtMutation.id,g.SetNumfmtMutation.id];this.disposeWithMe(new x.Observable(r=>{const n=this._commandService.onCommandExecuted(i=>{if(t.includes(i.id)){const s=i.params;r.next(s.unitId)}});return()=>n.dispose()}).pipe(B.debounceTime(16)).subscribe(r=>this._forceUpdate(r)))}_initCloseListener(){this._univerInstanceService.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SHEET).subscribe(t=>{var r;t||((r=this._sidebarDisposable)==null||r.dispose(),this._sidebarDisposable=null)})}};A=Le([N(0,a.Inject(g.SheetInterceptorService)),N(1,a.Inject(a.ThemeService)),N(2,a.IUniverInstanceService),N(3,a.ICommandService),N(4,a.Inject(g.SheetsSelectionsService)),N(5,$.IRenderManagerService),N(6,g.INumfmtService),N(7,a.Inject(_.ComponentManager)),N(8,_.ISidebarService),N(9,a.Inject(a.LocaleService)),N(10,a.Inject(v.SheetsNumfmtCellContentController))],A);var Fe=Object.getOwnPropertyDescriptor,He=(e,t,r,n)=>{for(var i=n>1?void 0:n?Fe(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},R=(e,t)=>(r,n)=>t(r,n,e);const Ae=()=>{let e=[];return{add:(i,s,o,l,d)=>e.push({unitId:i,subUnitId:s,row:o,col:l,value:d}),getEffects:()=>e,clean:()=>{e=[]}}};let V=class extends a.Disposable{constructor(t,r,n,i,s){super();G(this,"_collectEffectMutation",Ae());this._sheetInterceptorService=t,this._numfmtService=r,this._univerInstanceService=n,this._injector=i,this._editorBridgeService=s,this._initInterceptorEditorStart(),this._initInterceptorEditorEnd(),this._initInterceptorCommands()}_initInterceptorEditorStart(){this._editorBridgeService&&this.disposeWithMe(a.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(g.BEFORE_CELL_EDIT,{handler:(t,r,n)=>{const i=r.row,s=r.col,o=this._numfmtService.getValue(r.unitId,r.subUnitId,i,s);if(o)switch(v.getPatternType(o.pattern)){case"scientific":case"currency":case"grouped":case"number":{const d=r.worksheet.getCellRaw(i,s);return n&&n(d)}case"percent":case"date":case"time":case"datetime":default:return n&&n(t)}return n(t)}})))}_initInterceptorEditorEnd(){this.disposeWithMe(a.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(g.AFTER_CELL_EDIT,{handler:(t,r,n)=>{var d,u,f;this._collectEffectMutation.clean();const i=this._numfmtService.getValue(r.unitId,r.subUnitId,r.row,r.col);if(!(t!=null&&t.v)&&!(t!=null&&t.p)||a.isTextFormat(i==null?void 0:i.pattern)||t.t===a.CellValueType.FORCE_STRING)return n(t);const s=(d=t.p)==null?void 0:d.body,o=(f=(u=t==null?void 0:t.p)==null?void 0:u.body)!=null&&f.dataStream?t.p.body.dataStream.replace(/\r\n$/,""):String(t.v),l=v.getNumfmtParseValueFilter(o);if(s)if(Re(s)){const{dataStream:m}=s,h=m.replace(/\r\n$/,""),y=Number(h);if(Number.isNaN(y)&&!l)return n(t)}else return n(t);if(l){if(!l.z&&a.willLoseNumericPrecision(o))return n({...t,p:void 0,v:o,t:a.CellValueType.FORCE_STRING});l.z&&this._collectEffectMutation.add(r.unitId,r.subUnitId,r.row,r.col,{pattern:l.z});const m=Number(l.v);return n({...t,p:void 0,v:m,t:a.CellValueType.NUMBER})}return n(t)}})))}_initInterceptorCommands(){const t=this;this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations(r){var n;switch(r.id){case g.SetRangeValuesCommand.id:{const i=t._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),s=i.getUnitId(),o=(n=i.getActiveSheet())==null?void 0:n.getSheetId();if(!o)return{redos:[],undos:[]};const l=t._collectEffectMutation.getEffects();if(t._collectEffectMutation.clean(),!l.length)return{redos:[],undos:[]};const d=l.filter(h=>{var y;return!!((y=h.value)!=null&&y.pattern)}).map(h=>({row:h.row,col:h.col,pattern:h.value.pattern})),u=l.filter(h=>{var y;return!((y=h.value)!=null&&y.pattern)}).map(h=>({startRow:h.row,endColumn:h.col,startColumn:h.col,endRow:h.row})),f=[],m=[];if(d.length){const h={id:g.SetNumfmtMutation.id,params:g.transformCellsToRange(s,o,d)};f.push(h),m.push(...g.factorySetNumfmtUndoMutation(t._injector,h.params))}if(u.length){const h={id:g.RemoveNumfmtMutation.id,params:{unitId:s,subUnitId:o,ranges:u}};f.push(h),m.push(...g.factoryRemoveNumfmtUndoMutation(t._injector,h.params))}return{redos:f,undos:m.reverse()}}}return{redos:[],undos:[]}}}))}};V=He([R(0,a.Inject(g.SheetInterceptorService)),R(1,a.Inject(g.INumfmtService)),R(2,a.Inject(a.IUniverInstanceService)),R(3,a.Inject(a.Injector)),R(4,a.Optional(D.IEditorBridgeService))],V);function Re(e){const{textRuns:t=[],paragraphs:r=[],customRanges:n,customBlocks:i=[]}=e,s=["va"];return!(t.some(o=>!!(o.ts&&Object.keys(o.ts).some(d=>s.includes(d))))||r.some(o=>o.bullet)||r.length>=2||n!=null&&n.length||i.length>0)}const oe=e=>[{label:"sheet.numfmt.general",pattern:null},{label:"sheet.numfmt.text",pattern:a.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:`"${e}" #,##0.00_);[Red]("${e}"#,##0.00)`},{label:"sheet.numfmt.financialValue",pattern:"#,##0.00;[Red]#,##0.00"},{label:"sheet.numfmt.currency",pattern:`"${e}"#,##0.00_);[Red]("${e}"#,##0.00)`},{label:"sheet.numfmt.roundingCurrency",pattern:`"${e}"#,##0;[Red]"${e}"#,##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:""}],We=e=>({icon:new x.Observable(t=>{const r=e.get(a.LocaleService);return t.next(v.getCurrencySymbolIconByLocale(r.getCurrentLocale()).icon),r.localeChanged$.subscribe(()=>{t.next(v.getCurrencySymbolIconByLocale(r.getCurrentLocale()).icon)})}),id:v.SetCurrencyCommand.id,title:"sheet.numfmt.currency",tooltip:"sheet.numfmt.currency",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),Be=e=>({icon:"AddDigitsIcon",id:v.AddDecimalCommand.id,title:"sheet.numfmt.addDecimal",tooltip:"sheet.numfmt.addDecimal",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),Ve=e=>({icon:"ReduceDigitsIcon",id:v.SubtractDecimalCommand.id,title:"sheet.numfmt.subtractDecimal",tooltip:"sheet.numfmt.subtractDecimal",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),qe=e=>({icon:"PercentIcon",id:v.SetPercentCommand.id,title:"sheet.numfmt.percent",tooltip:"sheet.numfmt.percent",type:_.MenuItemType.BUTTON,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetEditPermission,g.WorksheetSetCellStylePermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}),Ge=e=>{const t=e.get(a.IUniverInstanceService),r=e.get(a.ICommandService),n=e.get(a.LocaleService),i=e.get(g.SheetsSelectionsService),s=[g.RemoveNumfmtMutation.id,g.SetNumfmtMutation.id],o=D.deriveStateFromActiveSheet$(t,"",({workbook:l,worksheet:d})=>new x.Observable(u=>x.merge(i.selectionMoveEnd$,a.fromCallback(r.onCommandExecuted.bind(r)).pipe(x.filter(([f])=>s.includes(f.id)))).subscribe(()=>{var m,h;const f=i.getCurrentSelections();if(f&&f[0]){const y=f[0].range,b=y.startRow,p=y.startColumn,P=(h=l.getStyles().get((m=d.getCell(b,p))==null?void 0:m.s))==null?void 0:h.n,I=P==null?void 0:P.pattern,M=v.getCurrencySymbolByLocale(n.getCurrentLocale());let O=n.t("sheet.numfmt.general");if(a.isDefaultFormat(I)){u.next(O);return}if(I){const U=oe(M).filter(k=>typeof k=="object"&&k.pattern).find(k=>a.isPatternEqualWithoutDecimal(I,k.pattern));U&&typeof U=="object"&&U.pattern?O=n.t(U.label):O=n.t("sheet.numfmt.moreFmt")}u.next(O)}})));return{label:ce,id:F.id,tooltip:"sheet.numfmt.title",type:_.MenuItemType.SELECTOR,slot:!0,selections:[{label:{name:le,hoverable:!1,selectable:!1}}],value$:o,hidden$:_.getMenuHiddenObservable(e,a.UniverInstanceType.UNIVER_SHEET),disabled$:D.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSetCellStylePermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}},ce="sheet.numfmt.moreNumfmtType",le="sheet.numfmt.moreNumfmtType.options",Ke=e=>{const{value:t}=e,r=_.useDependency(a.LocaleService),n=t!=null?t:r.t("sheet.numfmt.general");return c.jsx("span",{className:"univer-text-sm",children:n})},Ze=()=>{const e=_.useDependency(a.ICommandService),t=_.useDependency(a.LocaleService),r=_.useDependency(_.ILayoutService),n=_.useDependency(v.SheetsNumfmtCellContentController),i=_.useDependency(g.SheetsSelectionsService),s=u=>{const f=i.getCurrentLastSelection();if(!f)return;const m=f.range,h=[];a.Range.foreach(m,(y,b)=>{u?h.push({row:y,col:b,pattern:u,type:v.getPatternType(u)}):h.push({row:y,col:b})}),e.executeCommand(v.SetNumfmtCommand.id,{values:h}),r.focus()},o=S.useMemo(()=>{const u=v.localeCurrencySymbolMap.get(t.getCurrentLocale());return oe(u)},[t]),l=u=>{if(u===0)s(null);else if(u===o.length-1)e.executeCommand(F.id),r.focus();else{const f=o[u];f.pattern&&s(f.pattern)}},d=1220;return c.jsx("div",{className:"univer-grid univer-gap-1 univer-p-1.5",children:o.map((u,f)=>u==="|"?c.jsx(E.Separator,{},f):c.jsxs("div",{className:"univer-flex univer-h-7 univer-items-center univer-justify-between univer-gap-6 univer-rounded univer-px-2 univer-text-sm hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",onClick:()=>{l(f)},children:[c.jsx("span",{children:t.t(u.label)}),c.jsx("span",{className:"univer-text-xs univer-text-gray-500",children:u.pattern?v.getPatternPreview(u.pattern||"",d,n.locale).result.trim():""})]},f))})},Ye={[_.RibbonDataGroup.FORMULAS]:{[v.SetCurrencyCommand.id]:{order:0,menuItemFactory:We},[v.AddDecimalCommand.id]:{order:1,menuItemFactory:Be},[v.SubtractDecimalCommand.id]:{order:2,menuItemFactory:Ve},[v.SetPercentCommand.id]:{order:3,menuItemFactory:qe},[F.id]:{order:4,menuItemFactory:Ge}}};var ze=Object.getOwnPropertyDescriptor,Xe=(e,t,r,n)=>{for(var i=n>1?void 0:n?ze(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},ue=(e,t)=>(r,n)=>t(r,n,e);let q=class extends a.Disposable{constructor(e,t){super(),this._componentManager=e,this._menuManagerService=t,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(Ye),[[ce,Ke],[le,Ze]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};q=Xe([ue(0,a.Inject(_.ComponentManager)),ue(1,_.IMenuManagerService)],q);var Je=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,et=(e,t,r)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tt=(e,t,r,n)=>{for(var i=n>1?void 0:n?Qe(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i},Q=(e,t)=>(r,n)=>t(r,n,e),de=(e,t,r)=>et(e,typeof t!="symbol"?t+"":t,r);const nt="SHEET_NUMFMT_UI_PLUGIN";C.UniverSheetsNumfmtUIPlugin=class extends a.Plugin{constructor(t=te,r,n,i){super(),this._config=t,this._injector=r,this._configService=n,this._renderManagerService=i;const{menu:s,...o}=a.merge({},te,this._config);s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig("sheets-numfmt-ui.config",o)}onStarting(){a.registerDependencies(this._injector,[[A],[V],[H],[q]])}onRendered(){this._registerRenderModules(),a.touchDependencies(this._injector,[[A],[V],[q]])}_registerRenderModules(){[[Z]].forEach(r=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(a.UniverInstanceType.UNIVER_SHEET,r))})}},de(C.UniverSheetsNumfmtUIPlugin,"pluginName",nt),de(C.UniverSheetsNumfmtUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),C.UniverSheetsNumfmtUIPlugin=tt([a.DependentOn(D.UniverSheetsUIPlugin,v.UniverSheetsNumfmtPlugin),Q(1,a.Inject(a.Injector)),Q(2,a.IConfigService),Q(3,$.IRenderManagerService)],C.UniverSheetsNumfmtUIPlugin),Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiCaES=a())})(this,function(){"use strict";return{sheet:{numfmt:{title:"Format de nombre",numfmtType:"Tipus de format",cancel:"Cancel·lar",confirm:"Confirmar",general:"General",accounting:"Comptabilitat",text:"Text",number:"Nombre",percent:"Percentatge",scientific:"Científic",currency:"Moneda",date:"Data",time:"Hora",thousandthPercentile:"Separador de milers",preview:"Previsualització",dateTime:"Data i hora",decimalLength:"Decimals",currencyType:"Símbol de moneda",moreFmt:"Formats",financialValue:"Valor financer",roundingCurrency:"Arrodonir la moneda",timeDuration:"Durada",currencyDes:"El format de moneda s'utilitza per representar valors monetaris generals. El format de comptabilitat alinea una columna de valors amb els punts decimals.",accountingDes:"El format de nombre de comptabilitat alinea una columna de valors amb símbols de moneda i punts decimals.",dateType:"Tipus de data",dateDes:"El format de data presenta valors de sèries de data i hora com a valors de data.",negType:"Tipus de nombre negatiu",generalDes:"El format regular no conté cap format de nombre específic.",thousandthPercentileDes:"El format de separador de milers s'utilitza per a la representació de nombres ordinaris. Els formats monetaris i de comptabilitat proporcionen un format especialitzat per a càlculs de valors monetaris.",addDecimal:"Augmentar decimals",subtractDecimal:"Disminuir decimals",customFormat:"Format personalitzat",customFormatDes:"Genera formats de nombre personalitzats basats en els existents."}}}});
|
|
1
|
+
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiCaES=a())})(this,(function(){"use strict";return{sheet:{numfmt:{title:"Format de nombre",numfmtType:"Tipus de format",cancel:"Cancel·lar",confirm:"Confirmar",general:"General",accounting:"Comptabilitat",text:"Text",number:"Nombre",percent:"Percentatge",scientific:"Científic",currency:"Moneda",date:"Data",time:"Hora",thousandthPercentile:"Separador de milers",preview:"Previsualització",dateTime:"Data i hora",decimalLength:"Decimals",currencyType:"Símbol de moneda",moreFmt:"Formats",financialValue:"Valor financer",roundingCurrency:"Arrodonir la moneda",timeDuration:"Durada",currencyDes:"El format de moneda s'utilitza per representar valors monetaris generals. El format de comptabilitat alinea una columna de valors amb els punts decimals.",accountingDes:"El format de nombre de comptabilitat alinea una columna de valors amb símbols de moneda i punts decimals.",dateType:"Tipus de data",dateDes:"El format de data presenta valors de sèries de data i hora com a valors de data.",negType:"Tipus de nombre negatiu",generalDes:"El format regular no conté cap format de nombre específic.",thousandthPercentileDes:"El format de separador de milers s'utilitza per a la representació de nombres ordinaris. Els formats monetaris i de comptabilitat proporcionen un format especialitzat per a càlculs de valors monetaris.",addDecimal:"Augmentar decimals",subtractDecimal:"Disminuir decimals",customFormat:"Format personalitzat",customFormatDes:"Genera formats de nombre personalitzats basats en els existents."}}}}));
|
package/lib/umd/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiEnUS=n())})(this,function(){"use strict";return{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."}}}});
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiEnUS=n())})(this,(function(){"use strict";return{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."}}}}));
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiEsES=o())})(this,function(){"use strict";return{sheet:{numfmt:{title:"Formato de número",numfmtType:"Tipos de formato",cancel:"Cancelar",confirm:"Confirmar",general:"General",accounting:"Contabilidad",text:"Texto",number:"Número",percent:"Porcentaje",scientific:"Científico",currency:"Moneda",date:"Fecha",time:"Hora",thousandthPercentile:"Separador de miles",preview:"Vista previa",dateTime:"Fecha y hora",decimalLength:"Decimales",currencyType:"Símbolo de moneda",moreFmt:"Formatos",financialValue:"Valor financiero",roundingCurrency:"Redondear la moneda",timeDuration:"Duración",currencyDes:"El formato de moneda se utiliza para representar valores monetarios generales. El formato de contabilidad alinea una columna de valores con los puntos decimales.",accountingDes:"El formato de número de contabilidad alinea una columna de valores con símbolos de moneda y puntos decimales.",dateType:"Tipo de fecha",dateDes:"El formato de fecha presenta valores de series de fecha y hora como valores de fecha.",negType:"Tipo de número negativo",generalDes:"El formato regular no contiene ningún formato de número específico.",thousandthPercentileDes:"El formato de separador de miles se utiliza para la representación de números ordinarios. Los formatos monetarios y de contabilidad proporcionan un formato especializado para cálculos de valores monetarios.",addDecimal:"Aumentar decimales",subtractDecimal:"Disminuir decimales",customFormat:"Formato personalizado",customFormatDes:"Generar formatos de número personalizados basados en los existentes."}}}});
|
|
1
|
+
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiEsES=o())})(this,(function(){"use strict";return{sheet:{numfmt:{title:"Formato de número",numfmtType:"Tipos de formato",cancel:"Cancelar",confirm:"Confirmar",general:"General",accounting:"Contabilidad",text:"Texto",number:"Número",percent:"Porcentaje",scientific:"Científico",currency:"Moneda",date:"Fecha",time:"Hora",thousandthPercentile:"Separador de miles",preview:"Vista previa",dateTime:"Fecha y hora",decimalLength:"Decimales",currencyType:"Símbolo de moneda",moreFmt:"Formatos",financialValue:"Valor financiero",roundingCurrency:"Redondear la moneda",timeDuration:"Duración",currencyDes:"El formato de moneda se utiliza para representar valores monetarios generales. El formato de contabilidad alinea una columna de valores con los puntos decimales.",accountingDes:"El formato de número de contabilidad alinea una columna de valores con símbolos de moneda y puntos decimales.",dateType:"Tipo de fecha",dateDes:"El formato de fecha presenta valores de series de fecha y hora como valores de fecha.",negType:"Tipo de número negativo",generalDes:"El formato regular no contiene ningún formato de número específico.",thousandthPercentileDes:"El formato de separador de miles se utiliza para la representación de números ordinarios. Los formatos monetarios y de contabilidad proporcionan un formato especializado para cálculos de valores monetarios.",addDecimal:"Aumentar decimales",subtractDecimal:"Disminuir decimales",customFormat:"Formato personalizado",customFormatDes:"Generar formatos de número personalizados basados en los existentes."}}}}));
|
package/lib/umd/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiFaIR=t())})(this,function(){"use strict";return{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:"ایجاد قالببندیهای عددی سفارشی بر اساس قالببندیهای موجود."}}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiFaIR=t())})(this,(function(){"use strict";return{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:"ایجاد قالببندیهای عددی سفارشی بر اساس قالببندیهای موجود."}}}}));
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiFrFR=t())})(this,function(){"use strict";return{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."}}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiFrFR=t())})(this,(function(){"use strict";return{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."}}}}));
|
package/lib/umd/locale/ko-KR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiKoKR=t())})(this,function(){"use strict";return{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:"기존 서식을 기반으로 사용자 지정 숫자 서식을 만듭니다."}}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiKoKR=t())})(this,(function(){"use strict";return{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:"기존 서식을 기반으로 사용자 지정 숫자 서식을 만듭니다."}}}}));
|
package/lib/umd/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiRuRU=t())})(this,function(){"use strict";return{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."}}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiRuRU=t())})(this,(function(){"use strict";return{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."}}}}));
|
package/lib/umd/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis<"u"?globalThis:n||self,n.UniverSheetsNumfmtUiViVN=t())})(this,function(){"use strict";return{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."}}}});
|
|
1
|
+
(function(n,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis<"u"?globalThis:n||self,n.UniverSheetsNumfmtUiViVN=t())})(this,(function(){"use strict";return{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."}}}}));
|
package/lib/umd/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiZhCN=t())})(this,function(){"use strict";return{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:"根据现有格式生成自定义数字格式。"}}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiZhCN=t())})(this,(function(){"use strict";return{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:"根据现有格式生成自定义数字格式。"}}}}));
|
package/lib/umd/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiZhTW=t())})(this,function(){"use strict";return{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."}}}});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsNumfmtUiZhTW=t())})(this,(function(){"use strict";return{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."}}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-numfmt-ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4-nightly.202508220605",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UniverSheet numfmt plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@univerjs/icons": "^0.4.6",
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/
|
|
61
|
-
"@univerjs/
|
|
62
|
-
"@univerjs/
|
|
63
|
-
"@univerjs/
|
|
64
|
-
"@univerjs/sheets-ui": "0.10.
|
|
58
|
+
"@univerjs/core": "0.10.4-nightly.202508220605",
|
|
59
|
+
"@univerjs/engine-render": "0.10.4-nightly.202508220605",
|
|
60
|
+
"@univerjs/sheets": "0.10.4-nightly.202508220605",
|
|
61
|
+
"@univerjs/sheets-numfmt": "0.10.4-nightly.202508220605",
|
|
62
|
+
"@univerjs/ui": "0.10.4-nightly.202508220605",
|
|
63
|
+
"@univerjs/design": "0.10.4-nightly.202508220605",
|
|
64
|
+
"@univerjs/sheets-ui": "0.10.4-nightly.202508220605"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"postcss": "^8.5.6",
|
|
68
68
|
"react": "18.3.1",
|
|
69
69
|
"rxjs": "^7.8.2",
|
|
70
70
|
"tailwindcss": "3.4.17",
|
|
71
|
-
"typescript": "^5.
|
|
72
|
-
"vite": "^7.
|
|
71
|
+
"typescript": "^5.9.2",
|
|
72
|
+
"vite": "^7.1.3",
|
|
73
73
|
"vitest": "^3.2.4",
|
|
74
|
-
"@univerjs-infra/shared": "0.10.
|
|
75
|
-
"@univerjs/engine-formula": "0.10.
|
|
74
|
+
"@univerjs-infra/shared": "0.10.4",
|
|
75
|
+
"@univerjs/engine-formula": "0.10.4-nightly.202508220605"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"test": "vitest run",
|
package/LICENSE
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|