@univerjs/sheets-numfmt-ui 0.4.0-nightly.202410290723

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.
Files changed (42) hide show
  1. package/README.md +58 -0
  2. package/lib/cjs/index.js +9 -0
  3. package/lib/es/index.js +1008 -0
  4. package/lib/index.css +1 -0
  5. package/lib/locale/en-US.json +38 -0
  6. package/lib/locale/fa-IR.json +38 -0
  7. package/lib/locale/ru-RU.json +38 -0
  8. package/lib/locale/vi-VN.json +38 -0
  9. package/lib/locale/zh-CN.json +38 -0
  10. package/lib/locale/zh-TW.json +38 -0
  11. package/lib/types/controllers/__tests__/cell-content.controller.spec.d.ts +16 -0
  12. package/lib/types/controllers/__tests__/editor.controller.spec.d.ts +16 -0
  13. package/lib/types/controllers/__tests__/test.util.d.ts +15 -0
  14. package/lib/types/controllers/config.schema.d.ts +7 -0
  15. package/lib/types/controllers/menu.d.ts +44 -0
  16. package/lib/types/controllers/menu.schema.d.ts +2 -0
  17. package/lib/types/controllers/numfmt.controller.d.ts +32 -0
  18. package/lib/types/controllers/numfmt.editor.controller.d.ts +20 -0
  19. package/lib/types/controllers/numfmt.menu.controller.d.ts +8 -0
  20. package/lib/types/controllers/user-habit.controller.d.ts +19 -0
  21. package/lib/types/index.d.ts +16 -0
  22. package/lib/types/locale/en-US.d.ts +3 -0
  23. package/lib/types/locale/fa-IR.d.ts +3 -0
  24. package/lib/types/locale/ru-RU.d.ts +3 -0
  25. package/lib/types/locale/vi-VN.d.ts +3 -0
  26. package/lib/types/locale/zh-CN.d.ts +54 -0
  27. package/lib/types/locale/zh-TW.d.ts +3 -0
  28. package/lib/types/plugin.d.ts +13 -0
  29. package/lib/types/views/components/accounting/index.d.ts +4 -0
  30. package/lib/types/views/components/currency/index.d.ts +4 -0
  31. package/lib/types/views/components/custom-format/index.d.ts +3 -0
  32. package/lib/types/views/components/date/index.d.ts +4 -0
  33. package/lib/types/views/components/general/index.d.ts +4 -0
  34. package/lib/types/views/components/index.d.ts +14 -0
  35. package/lib/types/views/components/interface.d.ts +7 -0
  36. package/lib/types/views/components/more-numfmt-type/MoreNumfmtType.d.ts +7 -0
  37. package/lib/types/views/components/stories/Panel.stories.d.ts +5 -0
  38. package/lib/types/views/components/thousandth-percentile/index.d.ts +4 -0
  39. package/lib/types/views/hooks/useCurrencyOptions.d.ts +19 -0
  40. package/lib/types/views/hooks/useNextTick.d.ts +16 -0
  41. package/lib/umd/index.js +9 -0
  42. package/package.json +96 -0
package/lib/index.css ADDED
@@ -0,0 +1 @@
1
+ .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}.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}.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}
@@ -0,0 +1,38 @@
1
+ {
2
+ "sheet": {
3
+ "numfmt": {
4
+ "percent": "Percentage",
5
+ "title": "Number format",
6
+ "numfmtType": "Format types",
7
+ "cancel": "Cancel",
8
+ "confirm": "Confirm",
9
+ "general": "General",
10
+ "accounting": "Accounting",
11
+ "text": "Text",
12
+ "number": "Number",
13
+ "currency": "Currency",
14
+ "date": "Date",
15
+ "time": "Time",
16
+ "thousandthPercentile": "Thousands separator",
17
+ "preview": "Preview",
18
+ "dateTime": "Date and time",
19
+ "decimalLength": "Decimal places",
20
+ "currencyType": "Currency Symbol",
21
+ "moreFmt": "Formats",
22
+ "financialValue": "Financial value",
23
+ "roundingCurrency": "Rounding up the currency",
24
+ "timeDuration": "Duration Time",
25
+ "currencyDes": "The currency format is used to represent general currency values. The accounting format aligns a column of values with decimal points",
26
+ "accountingDes": "The accounting number format aligns a column of values with currency symbols and decimal points",
27
+ "dateType": "Date Type",
28
+ "dateDes": "The date format presents date and time series values as date values.",
29
+ "negType": "A negative number type",
30
+ "generalDes": "The regular format does not contain any specific number format.",
31
+ "thousandthPercentileDes": "The percentile format is used for the representation of ordinary numbers. Monetary and accounting formats provide a specialized format for monetary value calculations.",
32
+ "addDecimal": "Increase decimal places",
33
+ "subtractDecimal": "Decreasing decimal places",
34
+ "customFormat": "Custom Format",
35
+ "customFormatDes": "Generate custom number formats based on existing formats."
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "sheet": {
3
+ "numfmt": {
4
+ "percent": "درصد",
5
+ "title": "قالب‌بندی عدد",
6
+ "numfmtType": "انواع قالب‌بندی",
7
+ "cancel": "انصراف",
8
+ "confirm": "تایید",
9
+ "general": "عمومی",
10
+ "accounting": "حسابداری",
11
+ "text": "متن",
12
+ "number": "عدد",
13
+ "currency": "ارز",
14
+ "date": "تاریخ",
15
+ "time": "زمان",
16
+ "thousandthPercentile": "جداساز هزارتایی",
17
+ "preview": "پیش‌نمایش",
18
+ "dateTime": "تاریخ و زمان",
19
+ "decimalLength": "اعشار",
20
+ "currencyType": "نماد ارز",
21
+ "moreFmt": "قالب‌ها",
22
+ "financialValue": "مقدار مالی",
23
+ "roundingCurrency": "گرد کردن ارز",
24
+ "timeDuration": "مدت زمان",
25
+ "currencyDes": "قالب‌بندی ارز برای نمایش مقادیر عمومی ارز استفاده می‌شود. قالب‌بندی حسابداری ستونی از مقادیر را با اعشار تراز می‌کند.",
26
+ "accountingDes": "قالب‌بندی عددی حسابداری ستونی از مقادیر را با نمادهای ارز و اعشار تراز می‌کند.",
27
+ "dateType": "نوع تاریخ",
28
+ "dateDes": "قالب‌بندی تاریخ مقادیر سری تاریخ و زمان را به عنوان مقادیر تاریخ ارائه می‌دهد.",
29
+ "negType": "نوع عدد منفی",
30
+ "generalDes": "قالب‌بندی معمولی حاوی هیچ قالب‌بندی عدد خاصی نیست.",
31
+ "thousandthPercentileDes": "قالب‌بندی درصدی برای نمایش اعداد معمولی استفاده می‌شود. قالب‌بندی‌های پولی و حسابداری قالب تخصصی برای محاسبات مقدار پولی ارائه می‌دهند.",
32
+ "addDecimal": "افزایش اعشار",
33
+ "subtractDecimal": "کاهش اعشار",
34
+ "customFormat": "قالب‌بندی سفارشی",
35
+ "customFormatDes": "ایجاد قالب‌بندی‌های عددی سفارشی بر اساس قالب‌بندی‌های موجود."
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "sheet": {
3
+ "numfmt": {
4
+ "percent": "Процент",
5
+ "title": "Формат числа",
6
+ "numfmtType": "Типы форматов",
7
+ "cancel": "Отмена",
8
+ "confirm": "Подтвердить",
9
+ "general": "Общий",
10
+ "accounting": "Бухгалтерский",
11
+ "text": "Текст",
12
+ "number": "Число",
13
+ "currency": "Валюта",
14
+ "date": "Дата",
15
+ "time": "Время",
16
+ "thousandthPercentile": "Разделитель тысяч",
17
+ "preview": "Предпросмотр",
18
+ "dateTime": "Дата и время",
19
+ "decimalLength": "Десятичные знаки",
20
+ "currencyType": "Символ валюты",
21
+ "moreFmt": "Другие форматы",
22
+ "financialValue": "Финансовое значение",
23
+ "roundingCurrency": "Округление валюты",
24
+ "timeDuration": "Продолжительность времени",
25
+ "currencyDes": "Формат валюты используется для представления общих значений валюты. Формат бухгалтерского учета выравнивает столбец значений по десятичным точкам.",
26
+ "accountingDes": "Формат бухгалтерских чисел выравнивает столбец значений по символам валюты и десятичным точкам.",
27
+ "dateType": "Тип даты",
28
+ "dateDes": "Формат даты представляет значения времени и даты как значения даты.",
29
+ "negType": "Тип отрицательного числа",
30
+ "generalDes": "Обычный формат не содержит никакого специфического формата числа.",
31
+ "thousandthPercentileDes": "Формат процента используется для представления обычных чисел. Монетарные и бухгалтерские форматы предоставляют специальный формат для вычислений монетарных значений.",
32
+ "addDecimal": "Увеличить количество десятичных знаков",
33
+ "subtractDecimal": "Уменьшить количество десятичных знаков",
34
+ "customFormat": "Custom Format",
35
+ "customFormatDes": "Generate custom number formats based on existing formats."
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "sheet": {
3
+ "numfmt": {
4
+ "percent": "Phần trăm",
5
+ "title": "Định dạng số",
6
+ "numfmtType": "Loại định dạng",
7
+ "cancel": "Hủy bỏ",
8
+ "confirm": "Xác nhận",
9
+ "general": "Chung",
10
+ "accounting": "Kế toán",
11
+ "text": "Văn bản",
12
+ "number": "Số",
13
+ "currency": "Tiền tệ",
14
+ "date": "Ngày",
15
+ "time": "Thời gian",
16
+ "thousandthPercentile": "Phân vị phần nghìn",
17
+ "preview": "Xem trước",
18
+ "dateTime": "Ngày giờ",
19
+ "decimalLength": "Số chữ số thập phân",
20
+ "currencyType": "Loại tiền tệ",
21
+ "moreFmt": "Nhiều định dạng hơn",
22
+ "financialValue": "Giá trị tài chính",
23
+ "roundingCurrency": "Tiền tệ làm tròn",
24
+ "timeDuration": "Thời lượng",
25
+ "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.",
26
+ "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ị.",
27
+ "dateType": "Loại ngày",
28
+ "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.",
29
+ "negType": "Loại số âm",
30
+ "generalDes": "Định dạng chung không chứa bất kỳ định dạng số cụ thể nào.",
31
+ "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ệ.",
32
+ "addDecimal": "Thêm chữ số thập phân",
33
+ "subtractDecimal": "Giảm chữ số thập phân",
34
+ "customFormat": "Custom Format",
35
+ "customFormatDes": "Generate custom number formats based on existing formats."
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "sheet": {
3
+ "numfmt": {
4
+ "percent": "百分比",
5
+ "title": "数字格式",
6
+ "numfmtType": "格式类型",
7
+ "cancel": "取消",
8
+ "confirm": "确认",
9
+ "general": "常规",
10
+ "accounting": "会计",
11
+ "text": "文本",
12
+ "number": "数值",
13
+ "currency": "货币",
14
+ "date": "日期",
15
+ "time": "时间",
16
+ "thousandthPercentile": "千分位符",
17
+ "preview": "示例",
18
+ "dateTime": "日期时间",
19
+ "decimalLength": "小数位数",
20
+ "currencyType": "货币类型",
21
+ "moreFmt": "更多格式",
22
+ "financialValue": "财务数值",
23
+ "roundingCurrency": "货币取整",
24
+ "timeDuration": "持续时间",
25
+ "currencyDes": "货币格式用于表示一般货币数值。会计格式可以对一列数值进行小数点对齐",
26
+ "accountingDes": "会计数字格式可对一列数值进行货币符号和小数点对齐",
27
+ "dateType": "日期类型",
28
+ "dateDes": "日期格式将日期和时间系列数值品示为日期值。",
29
+ "negType": "负数类型",
30
+ "generalDes": "常规格式不包含任何特定的数字格式。",
31
+ "thousandthPercentileDes": "千分位符格式用于一般数字的表示。货币和会计格式则提供货币值计算的专用格式。",
32
+ "addDecimal": "增加小数位",
33
+ "subtractDecimal": "减少小数位",
34
+ "customFormat": "自定义格式",
35
+ "customFormatDes": "根据现有格式生成自定义数字格式。"
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "sheet": {
3
+ "numfmt": {
4
+ "percent": "百分比",
5
+ "title": "數字格式",
6
+ "numfmtType": "格式類型",
7
+ "cancel": "取消",
8
+ "confirm": "確認",
9
+ "general": "常規",
10
+ "accounting": "會計",
11
+ "text": "文字",
12
+ "number": "數值",
13
+ "currency": "貨幣",
14
+ "date": "日期",
15
+ "time": "時間",
16
+ "thousandthPercentile": "千分位符",
17
+ "preview": "範例",
18
+ "dateTime": "日期時間",
19
+ "decimalLength": "小數位數",
20
+ "currencyType": "貨幣類型",
21
+ "moreFmt": "更多格式",
22
+ "financialValue": "財務數值",
23
+ "roundingCurrency": "貨幣取整",
24
+ "timeDuration": "持續時間",
25
+ "currencyDes": "貨幣格式用來表示一般貨幣數值。會計格式可以對一列數值進行小數點對齊",
26
+ "accountingDes": "會計數字格式可對一列數值進行貨幣符號和小數點對齊",
27
+ "dateType": "日期類型",
28
+ "dateDes": "日期格式將日期和時間系列數值品顯示為日期值。",
29
+ "negType": "負數型別",
30
+ "generalDes": "常規格式不包含任何特定的數字格式。",
31
+ "thousandthPercentileDes": "千分位符號格式用於一般數字的表示。貨幣和會計格式則提供貨幣值計算的專用格式。",
32
+ "addDecimal": "增加小數位",
33
+ "subtractDecimal": "減少小數位",
34
+ "customFormat": "Custom Format",
35
+ "customFormatDes": "Generate custom number formats based on existing formats."
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Dependency, Univer } from '@univerjs/core';
2
+ export declare const createTestBed: (dependencies?: Dependency[]) => {
3
+ univer: Univer;
4
+ get: {
5
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
6
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
7
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
8
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
9
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
10
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
11
+ };
12
+ sheet: import('@univerjs/core').Workbook;
13
+ unitId: string;
14
+ subUnitId: string;
15
+ };
@@ -0,0 +1,7 @@
1
+ import { MenuConfig } from '@univerjs/ui';
2
+ export declare const PLUGIN_CONFIG_KEY = "sheets-numfmt.config";
3
+ export declare const configSymbol: unique symbol;
4
+ export interface IUniverSheetsNumfmtUIConfig {
5
+ menu?: MenuConfig;
6
+ }
7
+ export declare const defaultPluginConfig: IUniverSheetsNumfmtUIConfig;
@@ -0,0 +1,44 @@
1
+ import { IAccessor } from '@univerjs/core';
2
+ import { IMenuSelectorItem, MenuItemType } from '@univerjs/ui';
3
+ import { Observable } from 'rxjs';
4
+ export declare const MENU_OPTIONS: Array<{
5
+ label: string;
6
+ pattern: string | null;
7
+ } | '|'>;
8
+ export declare const CurrencyMenuItem: (accessor: IAccessor) => {
9
+ icon: Observable<string>;
10
+ id: string;
11
+ title: string;
12
+ tooltip: string;
13
+ type: MenuItemType;
14
+ hidden$: Observable<boolean>;
15
+ disabled$: Observable<boolean>;
16
+ };
17
+ export declare const AddDecimalMenuItem: (accessor: IAccessor) => {
18
+ icon: string;
19
+ id: string;
20
+ title: string;
21
+ tooltip: string;
22
+ type: MenuItemType;
23
+ hidden$: Observable<boolean>;
24
+ disabled$: Observable<boolean>;
25
+ };
26
+ export declare const SubtractDecimalMenuItem: (accessor: IAccessor) => {
27
+ icon: string;
28
+ id: string;
29
+ title: string;
30
+ tooltip: string;
31
+ type: MenuItemType;
32
+ hidden$: Observable<boolean>;
33
+ disabled$: Observable<boolean>;
34
+ };
35
+ export declare const PercentMenuItem: (accessor: IAccessor) => {
36
+ icon: string;
37
+ id: string;
38
+ title: string;
39
+ tooltip: string;
40
+ type: MenuItemType;
41
+ hidden$: Observable<boolean>;
42
+ disabled$: Observable<boolean>;
43
+ };
44
+ export declare const FactoryOtherMenuItem: (accessor: IAccessor) => IMenuSelectorItem;
@@ -0,0 +1,2 @@
1
+ import { MenuSchemaType } from '@univerjs/ui';
2
+ export declare const menuSchema: MenuSchemaType;
@@ -0,0 +1,32 @@
1
+ import { Disposable, ICommandService, IUniverInstanceService, LocaleService, ThemeService } from '@univerjs/core';
2
+ import { IRenderManagerService } from '@univerjs/engine-render';
3
+ import { INumfmtService, SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
4
+ import { ComponentManager, ISidebarService } from '@univerjs/ui';
5
+ export declare class SheetNumfmtUIController extends Disposable {
6
+ private _sheetInterceptorService;
7
+ private _themeService;
8
+ private _univerInstanceService;
9
+ private _commandService;
10
+ private _selectionManagerService;
11
+ private _renderManagerService;
12
+ private _numfmtService;
13
+ private _componentManager;
14
+ private _sidebarService;
15
+ private _localeService;
16
+ /**
17
+ * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
18
+ * @private
19
+ * @type {(string | null)}
20
+ * @memberof NumfmtController
21
+ */
22
+ private _previewPattern;
23
+ constructor(_sheetInterceptorService: SheetInterceptorService, _themeService: ThemeService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _selectionManagerService: SheetsSelectionsService, _renderManagerService: IRenderManagerService, _numfmtService: INumfmtService, _componentManager: ComponentManager, _sidebarService: ISidebarService, _localeService: LocaleService);
24
+ openPanel(): boolean;
25
+ private _forceUpdate;
26
+ private _initCommands;
27
+ private _initPanel;
28
+ private _initRealTimeRenderingInterceptor;
29
+ private _commandExecutedListener;
30
+ private _sidebarDisposable;
31
+ private _initCloseListener;
32
+ }
@@ -0,0 +1,20 @@
1
+ import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
2
+ import { INumfmtService, SheetInterceptorService } from '@univerjs/sheets';
3
+ import { IEditorBridgeService } from '@univerjs/sheets-ui';
4
+ export declare class NumfmtEditorController extends Disposable {
5
+ private _sheetInterceptorService;
6
+ private _numfmtService;
7
+ private _univerInstanceService;
8
+ private _injector;
9
+ private _editorBridgeService?;
10
+ private _collectEffectMutation;
11
+ constructor(_sheetInterceptorService: SheetInterceptorService, _numfmtService: INumfmtService, _univerInstanceService: IUniverInstanceService, _injector: Injector, _editorBridgeService?: IEditorBridgeService | undefined);
12
+ private _initInterceptorEditorStart;
13
+ /**
14
+ * Process the values after edit
15
+ * @private
16
+ * @memberof NumfmtService
17
+ */
18
+ private _initInterceptorEditorEnd;
19
+ private _initInterceptorCommands;
20
+ }
@@ -0,0 +1,8 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { ComponentManager, IMenuManagerService } from '@univerjs/ui';
3
+ export declare class NumfmtMenuController extends Disposable {
4
+ private _componentManager;
5
+ private readonly _menuManagerService;
6
+ constructor(_componentManager: ComponentManager, _menuManagerService: IMenuManagerService);
7
+ private _initMenu;
8
+ }
@@ -0,0 +1,19 @@
1
+ import { ILocalStorageService } from '@univerjs/core';
2
+ type HabitValue = string | number;
3
+ interface IUserHabitController {
4
+ addHabit(habit: string, initValue: HabitValue[]): Promise<void>;
5
+ markHabit(habit: string, value: HabitValue): void;
6
+ deleteHabit(habit: string): void;
7
+ getHabit(habit: string, sortList?: HabitValue[]): Promise<HabitValue[]>;
8
+ }
9
+ export declare const UserHabitCurrencyContext: import('react').Context<string[]>;
10
+ export declare class UserHabitController implements IUserHabitController {
11
+ private _localStorageService;
12
+ constructor(_localStorageService: ILocalStorageService);
13
+ private _getKey;
14
+ addHabit<T = unknown[]>(habit: string, initValue: T): Promise<void>;
15
+ markHabit(habit: string, value: HabitValue): void;
16
+ getHabit(habit: string, sortList: HabitValue[]): Promise<HabitValue[]>;
17
+ deleteHabit(habit: string): void;
18
+ }
19
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { UniverSheetsNumfmtUIPlugin } from './plugin';
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ declare const locale: {
17
+ sheet: {
18
+ numfmt: {
19
+ percent: string;
20
+ title: string;
21
+ numfmtType: string;
22
+ cancel: string;
23
+ confirm: string;
24
+ general: string;
25
+ accounting: string;
26
+ text: string;
27
+ number: string;
28
+ currency: string;
29
+ date: string;
30
+ time: string;
31
+ thousandthPercentile: string;
32
+ preview: string;
33
+ dateTime: string;
34
+ decimalLength: string;
35
+ currencyType: string;
36
+ moreFmt: string;
37
+ financialValue: string;
38
+ roundingCurrency: string;
39
+ timeDuration: string;
40
+ currencyDes: string;
41
+ accountingDes: string;
42
+ dateType: string;
43
+ dateDes: string;
44
+ negType: string;
45
+ generalDes: string;
46
+ thousandthPercentileDes: string;
47
+ addDecimal: string;
48
+ subtractDecimal: string;
49
+ customFormat: string;
50
+ customFormatDes: string;
51
+ };
52
+ };
53
+ };
54
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,13 @@
1
+ import { IUniverSheetsNumfmtUIConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
+ export declare const SHEET_NUMFMT_UI_PLUGIN = "SHEET_NUMFMT_UI_PLUGIN";
4
+ export declare class UniverSheetsNumfmtUIPlugin extends Plugin {
5
+ private readonly _config;
6
+ readonly _injector: Injector;
7
+ private readonly _configService;
8
+ static pluginName: string;
9
+ static type: UniverInstanceType;
10
+ constructor(_config: Partial<IUniverSheetsNumfmtUIConfig> | undefined, _injector: Injector, _configService: IConfigService);
11
+ onStarting(): void;
12
+ onRendered(): void;
13
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IBusinessComponentProps } from '../interface';
3
+ export declare const isAccountingPanel: (pattern: string) => boolean;
4
+ export declare const AccountingPanel: FC<IBusinessComponentProps>;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IBusinessComponentProps } from '../interface';
3
+ export declare const isCurrencyPanel: (pattern: string) => boolean;
4
+ export declare const CurrencyPanel: FC<IBusinessComponentProps>;
@@ -0,0 +1,3 @@
1
+ import { IBusinessComponentProps } from '../interface';
2
+ import { default as React } from 'react';
3
+ export declare function CustomFormat(props: IBusinessComponentProps): React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IBusinessComponentProps } from '../interface';
3
+ export declare const isDatePanel: (pattern: string) => boolean;
4
+ export declare const DatePanel: FC<IBusinessComponentProps>;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IBusinessComponentProps } from '../interface';
3
+ export declare const isGeneralPanel: (pattern: string) => boolean;
4
+ export declare const GeneralPanel: FC<IBusinessComponentProps>;
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ export interface ISheetNumfmtPanelProps {
3
+ value: {
4
+ defaultValue: number;
5
+ defaultPattern: string;
6
+ row: number;
7
+ col: number;
8
+ };
9
+ onChange: (config: {
10
+ type: 'change' | 'cancel' | 'confirm';
11
+ value: string;
12
+ }) => void;
13
+ }
14
+ export declare const SheetNumfmtPanel: FC<ISheetNumfmtPanelProps>;
@@ -0,0 +1,7 @@
1
+ import { MutableRefObject } from 'react';
2
+ export interface IBusinessComponentProps {
3
+ onChange: (result: string) => void;
4
+ defaultValue: number;
5
+ defaultPattern: string;
6
+ action: MutableRefObject<() => string | null>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export declare const MORE_NUMFMT_TYPE_KEY = "sheet.numfmt.moreNumfmtType";
3
+ export declare const OPTIONS_KEY = "sheet.numfmt.moreNumfmtType.options";
4
+ export declare const MoreNumfmtType: (props: {
5
+ value?: string;
6
+ }) => React.JSX.Element;
7
+ export declare const Options: () => React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { ISheetNumfmtPanelProps } from '../index';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const Test: StoryObj<ISheetNumfmtPanelProps>;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IBusinessComponentProps } from '../interface';
3
+ export declare const isThousandthPercentilePanel: (pattern: string) => boolean;
4
+ export declare const ThousandthPercentilePanel: FC<IBusinessComponentProps>;