@univerjs/sheets-numfmt 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +389 -319
- package/lib/index.css +1 -1
- package/lib/types/base/const/CURRENCY-SYMBOLS.d.ts +30 -0
- package/lib/types/base/types/index.d.ts +0 -1
- package/lib/types/commands/commands/add-decimal.command.d.ts +0 -1
- package/lib/types/commands/commands/set-currency.command.d.ts +0 -1
- package/lib/types/commands/commands/set-numfmt.command.d.ts +0 -1
- package/lib/types/commands/commands/set-percent.command.d.ts +0 -1
- package/lib/types/commands/commands/subtract-decimal.command.d.ts +0 -1
- package/lib/types/commands/operations/close.numfmt.panel.operation.d.ts +0 -1
- package/lib/types/commands/operations/open.numfmt.panel.operation.d.ts +0 -1
- package/lib/types/components/accounting/index.d.ts +0 -1
- package/lib/types/components/currency/index.d.ts +0 -1
- package/lib/types/components/custom-format/index.d.ts +0 -1
- package/lib/types/components/date/index.d.ts +0 -1
- package/lib/types/components/general/index.d.ts +0 -1
- package/lib/types/components/index.d.ts +0 -1
- package/lib/types/components/more-numfmt-type/MoreNumfmtType.d.ts +0 -1
- package/lib/types/components/stories/Panel.stories.d.ts +0 -1
- package/lib/types/components/thousandth-percentile/index.d.ts +0 -1
- package/lib/types/controllers/__tests__/test.util.d.ts +0 -1
- package/lib/types/controllers/numfmt.cell-content.controller.d.ts +0 -1
- package/lib/types/controllers/numfmt.controller.d.ts +0 -1
- package/lib/types/controllers/numfmt.editor.controller.d.ts +0 -1
- package/lib/types/controllers/numfmt.i18n.controller.d.ts +0 -1
- package/lib/types/controllers/numfmt.menu.controller.d.ts +8 -1
- package/lib/types/controllers/user-habit.controller.d.ts +0 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/types/locale/ru-RU.d.ts +0 -1
- package/lib/types/locale/vi-VN.d.ts +0 -1
- package/lib/types/locale/zh-TW.d.ts +0 -1
- package/lib/types/menu/menu.d.ts +1 -2
- package/lib/types/numfmt-plugin.d.ts +0 -1
- package/lib/types/utils/mutation.d.ts +0 -1
- package/lib/types/utils/pattern.d.ts +0 -1
- package/lib/umd/index.js +2 -2
- package/package.json +19 -19
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.numfmt-panel{overflow-y:auto;display:flex;flex-direction:column;justify-content:space-between;height:100%}.numfmt-panel .group-title{font-size:16px;color:rgba(var(--color-black))}.numfmt-panel .label{font-size:15px;color:rgba(var(--grey-400))}.numfmt-panel .describe{font-size:13px;line-height:20px;color:rgba(var(--grey-600))}.numfmt-panel .preview{height:36px;padding:0 16px;font-size:14px;line-height:36px;color:var(--color-black);border:1px solid rgb(var(--grey-200));border-radius:4px}.numfmt-panel .btn-list{display:flex;justify-content:flex-end}.numfmt-panel .m-r-12{margin-right:12px}.numfmt-panel .m-t-16{margin-top:16px}.numfmt-panel .m-t-14{margin-top:14px}.numfmt-panel .m-t-8{margin-top:8px}.numfmt-panel .m-b-20{margin-bottom:20px}.options{display:flex;justify-content:space-between}.options .w-140{width:140px}.options .w-120{width:120px}.univer-custom-format-title{margin-top:16px}.univer-custom-format-input{margin-top:8px;width:100%}.univer-custom-format-history-list{margin-top:8px;padding:8px;border-radius:8px;border:1px solid var(---Grey-200, #e5e5e5);max-height:400px;overflow:scroll}.univer-custom-format-history-list-item{padding:6px 0;display:flex;gap:6px;align-items:center;cursor:pointer}.univer-custom-format-history-list-item-icon-wrap{width:16px;display:flex;align-items:center;color:#274fee}.univer-custom-format-des{margin-top:8px;color:var(---Grey-600, #7a7a7a);font-size:12px;font-style:normal;font-weight:400;line-height:16px}
|
|
1
|
+
.more-numfmt-type{display:flex;flex-shrink:0;padding:0 4px;font-size:13px;color:var(--black)}.more-numfmt-type .icon{display:flex;align-items:center;height:auto;padding-left:8px;color:rgb(var(--grey-400))}.more-numfmt-type-options .line{width:100%;height:1px;background-color:rgb(var(--grey-200))}.more-numfmt-type-options .m-t-4{margin-top:4px}.more-numfmt-type-options .option-item{display:flex;align-items:center;justify-content:space-between;height:28px;padding:0 8px;font-size:13px}.more-numfmt-type-options .option-item:hover{background-color:rgb(var(--grey-100));border-radius:var(--border-radius-base)}.more-numfmt-type-options .m-l-26{margin-left:26px}.numfmt-panel{overflow-y:auto;display:flex;flex-direction:column;justify-content:space-between;height:100%}.numfmt-panel .group-title{font-size:16px;color:rgba(var(--color-black))}.numfmt-panel .label{font-size:15px;color:rgba(var(--grey-400))}.numfmt-panel .describe{font-size:13px;line-height:20px;color:rgba(var(--grey-600))}.numfmt-panel .preview{height:36px;padding:0 16px;font-size:14px;line-height:36px;color:var(--color-black);border:1px solid rgb(var(--grey-200));border-radius:4px}.numfmt-panel .btn-list{display:flex;justify-content:flex-end}.numfmt-panel .m-r-12{margin-right:12px}.numfmt-panel .m-t-16{margin-top:16px}.numfmt-panel .m-t-14{margin-top:14px}.numfmt-panel .m-t-8{margin-top:8px}.numfmt-panel .m-b-20{margin-bottom:20px}.options{display:flex;justify-content:space-between}.options .w-140{width:140px}.options .w-120{width:120px}.univer-custom-format-title{margin-top:16px}.univer-custom-format-input{margin-top:8px;width:100%}.univer-custom-format-history-list{margin-top:8px;padding:8px;border-radius:8px;border:1px solid var(---Grey-200, #e5e5e5);max-height:400px;overflow:scroll}.univer-custom-format-history-list-item{padding:6px 0;display:flex;gap:6px;align-items:center;cursor:pointer}.univer-custom-format-history-list-item-icon-wrap{width:16px;display:flex;align-items:center;color:#274fee}.univer-custom-format-des{margin-top:8px;color:var(---Grey-600, #7a7a7a);font-size:12px;font-style:normal;font-weight:400;line-height:16px}
|
|
@@ -14,3 +14,33 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare const currencySymbols: string[];
|
|
17
|
+
export declare const countryCurrencyMap: {
|
|
18
|
+
US: string;
|
|
19
|
+
CA: string;
|
|
20
|
+
GB: string;
|
|
21
|
+
JP: string;
|
|
22
|
+
IN: string;
|
|
23
|
+
AU: string;
|
|
24
|
+
CN: string;
|
|
25
|
+
KR: string;
|
|
26
|
+
RU: string;
|
|
27
|
+
AT: string;
|
|
28
|
+
BE: string;
|
|
29
|
+
CY: string;
|
|
30
|
+
EE: string;
|
|
31
|
+
FI: string;
|
|
32
|
+
FR: string;
|
|
33
|
+
DE: string;
|
|
34
|
+
GR: string;
|
|
35
|
+
IE: string;
|
|
36
|
+
IT: string;
|
|
37
|
+
LV: string;
|
|
38
|
+
LT: string;
|
|
39
|
+
LU: string;
|
|
40
|
+
MT: string;
|
|
41
|
+
NL: string;
|
|
42
|
+
PT: string;
|
|
43
|
+
SK: string;
|
|
44
|
+
SI: string;
|
|
45
|
+
ES: string;
|
|
46
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Disposable, ICommandService, IUniverInstanceService, LocaleService, ThemeService } from '@univerjs/core';
|
|
2
2
|
import { INumfmtService, SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
-
|
|
4
3
|
export declare class SheetsNumfmtCellContentController extends Disposable {
|
|
5
4
|
private readonly _instanceService;
|
|
6
5
|
private _sheetInterceptorService;
|
|
@@ -3,7 +3,6 @@ import { IRenderManagerService } from '@univerjs/engine-render';
|
|
|
3
3
|
import { INumfmtService, SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
4
|
import { ComponentManager, ISidebarService } from '@univerjs/ui';
|
|
5
5
|
import { INumfmtController } from './type';
|
|
6
|
-
|
|
7
6
|
export declare class NumfmtController extends Disposable implements INumfmtController {
|
|
8
7
|
private _sheetInterceptorService;
|
|
9
8
|
private _themeService;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { INumfmtService, SheetInterceptorService } from '@univerjs/sheets';
|
|
3
3
|
import { IEditorBridgeService } from '@univerjs/sheets-ui';
|
|
4
|
-
|
|
5
4
|
export declare class NumfmtEditorController extends Disposable {
|
|
6
5
|
private _sheetInterceptorService;
|
|
7
6
|
private _numfmtService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Disposable, Injector } from '@univerjs/core';
|
|
2
2
|
import { MenuConfig, ComponentManager, IMenuService } from '@univerjs/ui';
|
|
3
|
-
|
|
3
|
+
import { countryCurrencyMap } from '../base/const/CURRENCY-SYMBOLS';
|
|
4
4
|
export interface IUniverSheetsNumfmtConfig {
|
|
5
5
|
menu: MenuConfig;
|
|
6
6
|
}
|
|
@@ -10,6 +10,13 @@ export declare class NumfmtMenuController extends Disposable {
|
|
|
10
10
|
private _injector;
|
|
11
11
|
private _componentManager;
|
|
12
12
|
private _menuService;
|
|
13
|
+
private _currencySymbol$;
|
|
14
|
+
readonly currencySymbol$: import('rxjs').Observable<"AT" | "US" | "CA" | "GB" | "JP" | "IN" | "AU" | "CN" | "KR" | "RU" | "BE" | "CY" | "EE" | "FI" | "FR" | "DE" | "GR" | "IE" | "IT" | "LV" | "LT" | "LU" | "MT" | "NL" | "PT" | "SK" | "SI" | "ES">;
|
|
13
15
|
constructor(_config: Partial<IUniverSheetsNumfmtConfig>, _injector: Injector, _componentManager: ComponentManager, _menuService: IMenuService);
|
|
14
16
|
private _initMenu;
|
|
17
|
+
/**
|
|
18
|
+
* Set the currency symbol by setting the country code.
|
|
19
|
+
*/
|
|
20
|
+
setCurrencySymbolByCountryCode(symbol: keyof typeof countryCurrencyMap): void;
|
|
21
|
+
getCurrencySymbol(): "AT" | "US" | "CA" | "GB" | "JP" | "IN" | "AU" | "CN" | "KR" | "RU" | "BE" | "CY" | "EE" | "FI" | "FR" | "DE" | "GR" | "IE" | "IT" | "LV" | "LT" | "LU" | "MT" | "NL" | "PT" | "SK" | "SI" | "ES";
|
|
15
22
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { UniverSheetsNumfmtPlugin } from './numfmt-plugin';
|
|
17
17
|
export { getPatternPreview } from './utils/pattern';
|
|
18
|
+
export { NumfmtMenuController } from './controllers/numfmt.menu.controller';
|
|
19
|
+
export { countryCurrencyMap } from './base/const/CURRENCY-SYMBOLS';
|
|
18
20
|
export { AddDecimalCommand } from './commands/commands/add-decimal.command';
|
|
19
21
|
export { SetCurrencyCommand } from './commands/commands/set-currency.command';
|
|
20
22
|
export { type ISetNumfmtCommandParams, SetNumfmtCommand } from './commands/commands/set-numfmt.command';
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IMenuSelectorItem, MenuGroup, MenuItemType, MenuPosition } from '@univerjs/ui';
|
|
2
2
|
import { IAccessor } from '@univerjs/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
|
|
5
4
|
export declare const CurrencyMenuItem: (accessor: IAccessor) => {
|
|
6
|
-
icon: string
|
|
5
|
+
icon: Observable<string>;
|
|
7
6
|
id: string;
|
|
8
7
|
title: string;
|
|
9
8
|
tooltip: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
import { IUniverSheetsNumfmtConfig } from './controllers/numfmt.menu.controller';
|
|
3
|
-
|
|
4
3
|
export declare class UniverSheetsNumfmtPlugin extends Plugin {
|
|
5
4
|
private readonly _config;
|
|
6
5
|
readonly _injector: Injector;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LocaleType } from '@univerjs/core';
|
|
2
2
|
import { FormatType } from '@univerjs/sheets';
|
|
3
|
-
|
|
4
3
|
export declare const getPatternType: (pattern: string) => FormatType;
|
|
5
4
|
export declare const getPatternPreview: (pattern: string, value: number, _locale?: LocaleType) => {
|
|
6
5
|
result: any;
|