@univerjs/sheets-numfmt-ui 1.0.4 → 1.1.0
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 +62 -61
- package/lib/es/index.js +62 -61
- package/lib/index.js +62 -61
- package/lib/types/menu/numfmt-menu-util.d.ts +20 -0
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
package/lib/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const CloseNumfmtPanelOperator = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
|
-
//#region \0@oxc-project+runtime@0.
|
|
24
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
25
25
|
function _typeof(o) {
|
|
26
26
|
"@babel/helpers - typeof";
|
|
27
27
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -32,7 +32,7 @@ function _typeof(o) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
//#region \0@oxc-project+runtime@0.
|
|
35
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
36
36
|
function toPrimitive(t, r) {
|
|
37
37
|
if ("object" != _typeof(t) || !t) return t;
|
|
38
38
|
var e = t[Symbol.toPrimitive];
|
|
@@ -45,14 +45,14 @@ function toPrimitive(t, r) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region \0@oxc-project+runtime@0.
|
|
48
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
49
49
|
function toPropertyKey(t) {
|
|
50
50
|
var i = toPrimitive(t, "string");
|
|
51
51
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
//#endregion
|
|
55
|
-
//#region \0@oxc-project+runtime@0.
|
|
55
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
56
56
|
function _defineProperty(e, r, t) {
|
|
57
57
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
58
58
|
value: t,
|
|
@@ -63,7 +63,7 @@ function _defineProperty(e, r, t) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
//#endregion
|
|
66
|
-
//#region \0@oxc-project+runtime@0.
|
|
66
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
67
67
|
function __decorateParam(paramIndex, decorator) {
|
|
68
68
|
return function(target, key) {
|
|
69
69
|
decorator(target, key, paramIndex);
|
|
@@ -71,7 +71,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
|
-
//#region \0@oxc-project+runtime@0.
|
|
74
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
75
75
|
function __decorate(decorators, target, key, desc) {
|
|
76
76
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
77
77
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -429,15 +429,56 @@ function Options() {
|
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region src/menu/numfmt-menu-util.ts
|
|
434
|
+
const FORMAT_TYPE_LABELS = {
|
|
435
|
+
currency: "sheets-numfmt-ui.currency",
|
|
436
|
+
date: "sheets-numfmt-ui.date",
|
|
437
|
+
datetime: "sheets-numfmt-ui.dateTime",
|
|
438
|
+
general: "sheets-numfmt-ui.general",
|
|
439
|
+
grouped: "sheets-numfmt-ui.number",
|
|
440
|
+
number: "sheets-numfmt-ui.number",
|
|
441
|
+
percent: "sheets-numfmt-ui.percent",
|
|
442
|
+
scientific: "sheets-numfmt-ui.scientific",
|
|
443
|
+
text: "sheets-numfmt-ui.text",
|
|
444
|
+
time: "sheets-numfmt-ui.time"
|
|
445
|
+
};
|
|
446
|
+
function getNumberFormatLabelKey(pattern, currencySymbol) {
|
|
447
|
+
if (!pattern || (0, _univerjs_core.isDefaultFormat)(pattern)) return "sheets-numfmt-ui.general";
|
|
448
|
+
if ((0, _univerjs_core.isTextFormat)(pattern)) return "sheets-numfmt-ui.text";
|
|
449
|
+
const preset = MENU_OPTIONS(currencySymbol).find((option) => typeof option === "object" && option.pattern && (0, _univerjs_core.isPatternEqualWithoutDecimal)(pattern, option.pattern));
|
|
450
|
+
if (preset && typeof preset === "object") return preset.label;
|
|
451
|
+
return FORMAT_TYPE_LABELS[(0, _univerjs_sheets_numfmt.getPatternType)(pattern)] ?? "sheets-numfmt-ui.moreFmt";
|
|
452
|
+
}
|
|
453
|
+
function getCurrentNumfmtPattern$(accessor) {
|
|
454
|
+
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
455
|
+
const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
456
|
+
const selectionService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
|
|
457
|
+
const commandIds = [
|
|
458
|
+
_univerjs_sheets.RemoveNumfmtMutation.id,
|
|
459
|
+
_univerjs_sheets.SetNumfmtMutation.id,
|
|
460
|
+
_univerjs_sheets.SetRangeValuesMutation.id
|
|
461
|
+
];
|
|
462
|
+
return (0, _univerjs_sheets_ui.deriveStateFromActiveSheet$)(instanceService, void 0, ({ worksheet }) => (0, rxjs.merge)(selectionService.selectionChanged$, (0, _univerjs_core.fromCallback)(commandService.onCommandExecuted.bind(commandService)).pipe((0, rxjs.filter)(([command]) => commandIds.includes(command.id)))).pipe((0, rxjs.startWith)(null), (0, rxjs.map)(() => {
|
|
463
|
+
var _worksheet$getCellSty;
|
|
464
|
+
const selection = selectionService.getCurrentLastSelection();
|
|
465
|
+
if (!selection) return;
|
|
466
|
+
const cell = selection.primary ?? selection.range;
|
|
467
|
+
return (_worksheet$getCellSty = worksheet.getCellStyle(cell.startRow, cell.startColumn)) === null || _worksheet$getCellSty === void 0 || (_worksheet$getCellSty = _worksheet$getCellSty.n) === null || _worksheet$getCellSty === void 0 ? void 0 : _worksheet$getCellSty.pattern;
|
|
468
|
+
}))).pipe((0, rxjs.distinctUntilChanged)());
|
|
469
|
+
}
|
|
470
|
+
|
|
432
471
|
//#endregion
|
|
433
472
|
//#region src/menu/menu.ts
|
|
434
473
|
function CurrencySymbolIconMenuItem(accessor) {
|
|
474
|
+
const regionService = accessor.get(_univerjs_core.RegionService);
|
|
435
475
|
return {
|
|
436
|
-
icon:
|
|
476
|
+
icon: regionService.currentRegion$.pipe((0, rxjs.map)((region) => (0, _univerjs_sheets_numfmt.getCurrencySymbolIconByLocale)(region).icon)),
|
|
437
477
|
id: _univerjs_sheets_numfmt.SetCurrencyCommand.id,
|
|
438
478
|
title: "sheets-numfmt-ui.currency",
|
|
439
479
|
tooltip: "sheets-numfmt-ui.currency",
|
|
440
480
|
type: _univerjs_ui.MenuItemType.BUTTON,
|
|
481
|
+
activated$: (0, rxjs.combineLatest)([getCurrentNumfmtPattern$(accessor), regionService.currentRegion$]).pipe((0, rxjs.map)(([pattern, region]) => !!pattern && (0, _univerjs_sheets_numfmt.getPatternType)(pattern) === "currency" && (0, _univerjs_sheets_numfmt.getCurrencyType)(pattern) === (0, _univerjs_sheets_numfmt.getCurrencySymbolIconByLocale)(region).symbol), (0, rxjs.distinctUntilChanged)()),
|
|
441
482
|
hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
|
|
442
483
|
disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
|
|
443
484
|
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
@@ -483,6 +524,7 @@ function PercentMenuItem(accessor) {
|
|
|
483
524
|
title: "sheets-numfmt-ui.percent",
|
|
484
525
|
tooltip: "sheets-numfmt-ui.percent",
|
|
485
526
|
type: _univerjs_ui.MenuItemType.BUTTON,
|
|
527
|
+
activated$: getCurrentNumfmtPattern$(accessor).pipe((0, rxjs.map)((pattern) => !!pattern && (0, _univerjs_sheets_numfmt.getPatternType)(pattern) === "percent"), (0, rxjs.distinctUntilChanged)()),
|
|
486
528
|
hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
|
|
487
529
|
disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
|
|
488
530
|
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
@@ -492,35 +534,13 @@ function PercentMenuItem(accessor) {
|
|
|
492
534
|
};
|
|
493
535
|
}
|
|
494
536
|
function FactoryOtherMenuItem(accessor) {
|
|
495
|
-
const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
496
|
-
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
497
537
|
const localeService = accessor.get(_univerjs_core.LocaleService);
|
|
498
538
|
const regionService = accessor.get(_univerjs_core.RegionService);
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
var _workbook$getStyles$g, _worksheet$getCell;
|
|
505
|
-
const range = selections[0].range;
|
|
506
|
-
const row = range.startRow;
|
|
507
|
-
const col = range.startColumn;
|
|
508
|
-
const numfmtValue = (_workbook$getStyles$g = workbook.getStyles().get((_worksheet$getCell = worksheet.getCell(row, col)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.s)) === null || _workbook$getStyles$g === void 0 ? void 0 : _workbook$getStyles$g.n;
|
|
509
|
-
const pattern = numfmtValue === null || numfmtValue === void 0 ? void 0 : numfmtValue.pattern;
|
|
510
|
-
const currencySymbol = (0, _univerjs_sheets_numfmt.getCurrencySymbolByLocale)(regionService.getCurrentRegion());
|
|
511
|
-
let value = localeService.t("sheets-numfmt-ui.general");
|
|
512
|
-
if ((0, _univerjs_core.isDefaultFormat)(pattern)) {
|
|
513
|
-
subscribe.next(value);
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
if (pattern) {
|
|
517
|
-
const item = MENU_OPTIONS(currencySymbol).filter((item) => typeof item === "object" && item.pattern).find((item) => (0, _univerjs_core.isPatternEqualWithoutDecimal)(pattern, item.pattern));
|
|
518
|
-
if (item && typeof item === "object" && item.pattern) value = localeService.t(item.label);
|
|
519
|
-
else value = localeService.t("sheets-numfmt-ui.moreFmt");
|
|
520
|
-
}
|
|
521
|
-
subscribe.next(value);
|
|
522
|
-
}
|
|
523
|
-
})));
|
|
539
|
+
const value$ = (0, rxjs.combineLatest)([
|
|
540
|
+
getCurrentNumfmtPattern$(accessor),
|
|
541
|
+
regionService.currentRegion$,
|
|
542
|
+
localeService.currentLocale$
|
|
543
|
+
]).pipe((0, rxjs.map)(([pattern, region]) => localeService.t(getNumberFormatLabelKey(pattern, (0, _univerjs_sheets_numfmt.getCurrencySymbolByLocale)(region)))), (0, rxjs.distinctUntilChanged)());
|
|
524
544
|
return {
|
|
525
545
|
label: MORE_NUMFMT_TYPE_KEY,
|
|
526
546
|
id: OpenNumfmtPanelOperator.id,
|
|
@@ -592,7 +612,7 @@ const menuSchema = { [_univerjs_ui.RibbonStartGroup.NUMBER]: {
|
|
|
592
612
|
//#endregion
|
|
593
613
|
//#region package.json
|
|
594
614
|
var name = "@univerjs/sheets-numfmt-ui";
|
|
595
|
-
var version = "1.0
|
|
615
|
+
var version = "1.1.0";
|
|
596
616
|
|
|
597
617
|
//#endregion
|
|
598
618
|
//#region src/config/config.ts
|
|
@@ -675,31 +695,13 @@ function createMobileNumberFormatMenuConfig(currencySymbol) {
|
|
|
675
695
|
};
|
|
676
696
|
}
|
|
677
697
|
function FactoryMobileOtherMenuItem(accessor) {
|
|
678
|
-
const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
679
|
-
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
680
698
|
const localeService = accessor.get(_univerjs_core.LocaleService);
|
|
681
699
|
const regionService = accessor.get(_univerjs_core.RegionService);
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
if (!selection) return;
|
|
688
|
-
const { startRow, startColumn } = selection.range;
|
|
689
|
-
const numfmtValue = (_workbook$getStyles$g = workbook.getStyles().get((_worksheet$getCell = worksheet.getCell(startRow, startColumn)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.s)) === null || _workbook$getStyles$g === void 0 ? void 0 : _workbook$getStyles$g.n;
|
|
690
|
-
const pattern = numfmtValue === null || numfmtValue === void 0 ? void 0 : numfmtValue.pattern;
|
|
691
|
-
const currencySymbol = (0, _univerjs_sheets_numfmt.getCurrencySymbolByLocale)(regionService.getCurrentRegion());
|
|
692
|
-
let value = localeService.t("sheets-numfmt-ui.general");
|
|
693
|
-
if ((0, _univerjs_core.isDefaultFormat)(pattern)) {
|
|
694
|
-
subscribe.next(value);
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
if (pattern) {
|
|
698
|
-
const item = MENU_OPTIONS(currencySymbol).filter((option) => typeof option === "object" && option.pattern).find((option) => (0, _univerjs_core.isPatternEqualWithoutDecimal)(pattern, option.pattern));
|
|
699
|
-
value = item && typeof item === "object" && item.pattern ? localeService.t(item.label) : localeService.t("sheets-numfmt-ui.moreFmt");
|
|
700
|
-
}
|
|
701
|
-
subscribe.next(value);
|
|
702
|
-
})));
|
|
700
|
+
const value$ = (0, rxjs.combineLatest)([
|
|
701
|
+
getCurrentNumfmtPattern$(accessor),
|
|
702
|
+
regionService.currentRegion$,
|
|
703
|
+
localeService.currentLocale$
|
|
704
|
+
]).pipe((0, rxjs.map)(([pattern, region]) => localeService.t(getNumberFormatLabelKey(pattern, (0, _univerjs_sheets_numfmt.getCurrencySymbolByLocale)(region)))), (0, rxjs.distinctUntilChanged)());
|
|
703
705
|
return {
|
|
704
706
|
id: MOBILE_NUMFMT_MENU_ID,
|
|
705
707
|
title: "sheets-numfmt-ui.title",
|
|
@@ -743,7 +745,6 @@ function MobileCustomFormat(props) {
|
|
|
743
745
|
children: [
|
|
744
746
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
|
|
745
747
|
className: "univer-shrink-0",
|
|
746
|
-
size: "large",
|
|
747
748
|
"aria-label": title,
|
|
748
749
|
value: pattern,
|
|
749
750
|
placeholder: title,
|
|
@@ -2159,13 +2160,13 @@ UniverSheetsNumfmtUIPlugin = __decorate([
|
|
|
2159
2160
|
|
|
2160
2161
|
//#endregion
|
|
2161
2162
|
exports.SheetsNumfmtUIMenuSchema = menuSchema;
|
|
2162
|
-
Object.defineProperty(exports,
|
|
2163
|
+
Object.defineProperty(exports, "UniverSheetsNumfmtMobileUIPlugin", {
|
|
2163
2164
|
enumerable: true,
|
|
2164
2165
|
get: function () {
|
|
2165
2166
|
return UniverSheetsNumfmtMobileUIPlugin;
|
|
2166
2167
|
}
|
|
2167
2168
|
});
|
|
2168
|
-
Object.defineProperty(exports,
|
|
2169
|
+
Object.defineProperty(exports, "UniverSheetsNumfmtUIPlugin", {
|
|
2169
2170
|
enumerable: true,
|
|
2170
2171
|
get: function () {
|
|
2171
2172
|
return UniverSheetsNumfmtUIPlugin;
|
package/lib/es/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { AddDecimalCommand, CURRENCYFORMAT, NUMBERFORMAT, SHEETS_NUMFMT_PLUGIN_C
|
|
|
2
2
|
import { ComponentManager, ILayoutService, IMenuManagerService, ISidebarService, IconManager, MenuItemType, RibbonStartGroup, UniverMobileUIPlugin, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
3
3
|
import { CellValueType, CommandType, DEFAULT_TEXT_FORMAT_EXCEL, DependentOn, Disposable, DisposableCollection, ICommandService, IConfigService, ILocalStorageService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Optional, Plugin, Range, RegionService, ThemeService, Tools, UniverInstanceType, currencySymbols, excelSerialToDateTimeParts, fromCallback, getNumfmtParseValueFilter, isDefaultFormat, isPatternEqualWithoutDecimal, isRealNum, isTextFormat, merge, numfmt, registerDependencies, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
|
|
4
4
|
import { IRenderManagerService, UniverRenderEnginePlugin } from "@univerjs/engine-render";
|
|
5
|
-
import { AFTER_CELL_EDIT, BEFORE_CELL_EDIT, INTERCEPTOR_POINT, INumfmtService, RangeProtectionPermissionEditPoint, RemoveNumfmtMutation, SetNumfmtMutation, SetRangeValuesCommand, SheetInterceptorService, SheetsSelectionsService, TextToNumberCommand, UniverSheetsPlugin, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, getSheetCommandTarget, transformCellsToRange } from "@univerjs/sheets";
|
|
5
|
+
import { AFTER_CELL_EDIT, BEFORE_CELL_EDIT, INTERCEPTOR_POINT, INumfmtService, RangeProtectionPermissionEditPoint, RemoveNumfmtMutation, SetNumfmtMutation, SetRangeValuesCommand, SetRangeValuesMutation, SheetInterceptorService, SheetsSelectionsService, TextToNumberCommand, UniverSheetsPlugin, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, getSheetCommandTarget, transformCellsToRange } from "@univerjs/sheets";
|
|
6
6
|
import { CellAlertManagerService, CellAlertType, IEditorBridgeService, IRepeatLastActionService, RepeatLastActionPermission, SheetSkeletonManagerService, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, deriveStateFromActiveSheet$, getCurrentRangeDisable$ } from "@univerjs/sheets-ui";
|
|
7
|
-
import { Observable, combineLatest, filter, map, merge as merge$1 } from "rxjs";
|
|
7
|
+
import { Observable, combineLatest, distinctUntilChanged, filter, map, merge as merge$1, startWith } from "rxjs";
|
|
8
8
|
import { debounceTime, map as map$1, switchMap, tap } from "rxjs/operators";
|
|
9
9
|
import { Button, Input, InputNumber, MobileActionRowGroup, MobileSelect, Select, SelectList, Separator, borderClassName, clsx, scrollbarClassName } from "@univerjs/design";
|
|
10
10
|
import { createContext, createElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
@@ -20,7 +20,7 @@ const CloseNumfmtPanelOperator = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region \0@oxc-project+runtime@0.
|
|
23
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
24
24
|
function _typeof(o) {
|
|
25
25
|
"@babel/helpers - typeof";
|
|
26
26
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -31,7 +31,7 @@ function _typeof(o) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
35
35
|
function toPrimitive(t, r) {
|
|
36
36
|
if ("object" != _typeof(t) || !t) return t;
|
|
37
37
|
var e = t[Symbol.toPrimitive];
|
|
@@ -44,14 +44,14 @@ function toPrimitive(t, r) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
|
-
//#region \0@oxc-project+runtime@0.
|
|
47
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
48
48
|
function toPropertyKey(t) {
|
|
49
49
|
var i = toPrimitive(t, "string");
|
|
50
50
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region \0@oxc-project+runtime@0.
|
|
54
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
55
55
|
function _defineProperty(e, r, t) {
|
|
56
56
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
57
57
|
value: t,
|
|
@@ -62,7 +62,7 @@ function _defineProperty(e, r, t) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region \0@oxc-project+runtime@0.
|
|
65
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
66
66
|
function __decorateParam(paramIndex, decorator) {
|
|
67
67
|
return function(target, key) {
|
|
68
68
|
decorator(target, key, paramIndex);
|
|
@@ -70,7 +70,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region \0@oxc-project+runtime@0.
|
|
73
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
74
74
|
function __decorate(decorators, target, key, desc) {
|
|
75
75
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76
76
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -428,15 +428,56 @@ function Options() {
|
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/menu/numfmt-menu-util.ts
|
|
433
|
+
const FORMAT_TYPE_LABELS = {
|
|
434
|
+
currency: "sheets-numfmt-ui.currency",
|
|
435
|
+
date: "sheets-numfmt-ui.date",
|
|
436
|
+
datetime: "sheets-numfmt-ui.dateTime",
|
|
437
|
+
general: "sheets-numfmt-ui.general",
|
|
438
|
+
grouped: "sheets-numfmt-ui.number",
|
|
439
|
+
number: "sheets-numfmt-ui.number",
|
|
440
|
+
percent: "sheets-numfmt-ui.percent",
|
|
441
|
+
scientific: "sheets-numfmt-ui.scientific",
|
|
442
|
+
text: "sheets-numfmt-ui.text",
|
|
443
|
+
time: "sheets-numfmt-ui.time"
|
|
444
|
+
};
|
|
445
|
+
function getNumberFormatLabelKey(pattern, currencySymbol) {
|
|
446
|
+
if (!pattern || isDefaultFormat(pattern)) return "sheets-numfmt-ui.general";
|
|
447
|
+
if (isTextFormat(pattern)) return "sheets-numfmt-ui.text";
|
|
448
|
+
const preset = MENU_OPTIONS(currencySymbol).find((option) => typeof option === "object" && option.pattern && isPatternEqualWithoutDecimal(pattern, option.pattern));
|
|
449
|
+
if (preset && typeof preset === "object") return preset.label;
|
|
450
|
+
return FORMAT_TYPE_LABELS[getPatternType(pattern)] ?? "sheets-numfmt-ui.moreFmt";
|
|
451
|
+
}
|
|
452
|
+
function getCurrentNumfmtPattern$(accessor) {
|
|
453
|
+
const commandService = accessor.get(ICommandService);
|
|
454
|
+
const instanceService = accessor.get(IUniverInstanceService);
|
|
455
|
+
const selectionService = accessor.get(SheetsSelectionsService);
|
|
456
|
+
const commandIds = [
|
|
457
|
+
RemoveNumfmtMutation.id,
|
|
458
|
+
SetNumfmtMutation.id,
|
|
459
|
+
SetRangeValuesMutation.id
|
|
460
|
+
];
|
|
461
|
+
return deriveStateFromActiveSheet$(instanceService, void 0, ({ worksheet }) => merge$1(selectionService.selectionChanged$, fromCallback(commandService.onCommandExecuted.bind(commandService)).pipe(filter(([command]) => commandIds.includes(command.id)))).pipe(startWith(null), map(() => {
|
|
462
|
+
var _worksheet$getCellSty;
|
|
463
|
+
const selection = selectionService.getCurrentLastSelection();
|
|
464
|
+
if (!selection) return;
|
|
465
|
+
const cell = selection.primary ?? selection.range;
|
|
466
|
+
return (_worksheet$getCellSty = worksheet.getCellStyle(cell.startRow, cell.startColumn)) === null || _worksheet$getCellSty === void 0 || (_worksheet$getCellSty = _worksheet$getCellSty.n) === null || _worksheet$getCellSty === void 0 ? void 0 : _worksheet$getCellSty.pattern;
|
|
467
|
+
}))).pipe(distinctUntilChanged());
|
|
468
|
+
}
|
|
469
|
+
|
|
431
470
|
//#endregion
|
|
432
471
|
//#region src/menu/menu.ts
|
|
433
472
|
function CurrencySymbolIconMenuItem(accessor) {
|
|
473
|
+
const regionService = accessor.get(RegionService);
|
|
434
474
|
return {
|
|
435
|
-
icon:
|
|
475
|
+
icon: regionService.currentRegion$.pipe(map((region) => getCurrencySymbolIconByLocale(region).icon)),
|
|
436
476
|
id: SetCurrencyCommand.id,
|
|
437
477
|
title: "sheets-numfmt-ui.currency",
|
|
438
478
|
tooltip: "sheets-numfmt-ui.currency",
|
|
439
479
|
type: MenuItemType.BUTTON,
|
|
480
|
+
activated$: combineLatest([getCurrentNumfmtPattern$(accessor), regionService.currentRegion$]).pipe(map(([pattern, region]) => !!pattern && getPatternType(pattern) === "currency" && getCurrencyType(pattern) === getCurrencySymbolIconByLocale(region).symbol), distinctUntilChanged()),
|
|
440
481
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
441
482
|
disabled$: getCurrentRangeDisable$(accessor, {
|
|
442
483
|
workbookTypes: [WorkbookEditablePermission],
|
|
@@ -482,6 +523,7 @@ function PercentMenuItem(accessor) {
|
|
|
482
523
|
title: "sheets-numfmt-ui.percent",
|
|
483
524
|
tooltip: "sheets-numfmt-ui.percent",
|
|
484
525
|
type: MenuItemType.BUTTON,
|
|
526
|
+
activated$: getCurrentNumfmtPattern$(accessor).pipe(map((pattern) => !!pattern && getPatternType(pattern) === "percent"), distinctUntilChanged()),
|
|
485
527
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
486
528
|
disabled$: getCurrentRangeDisable$(accessor, {
|
|
487
529
|
workbookTypes: [WorkbookEditablePermission],
|
|
@@ -491,35 +533,13 @@ function PercentMenuItem(accessor) {
|
|
|
491
533
|
};
|
|
492
534
|
}
|
|
493
535
|
function FactoryOtherMenuItem(accessor) {
|
|
494
|
-
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
495
|
-
const commandService = accessor.get(ICommandService);
|
|
496
536
|
const localeService = accessor.get(LocaleService);
|
|
497
537
|
const regionService = accessor.get(RegionService);
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
var _workbook$getStyles$g, _worksheet$getCell;
|
|
504
|
-
const range = selections[0].range;
|
|
505
|
-
const row = range.startRow;
|
|
506
|
-
const col = range.startColumn;
|
|
507
|
-
const numfmtValue = (_workbook$getStyles$g = workbook.getStyles().get((_worksheet$getCell = worksheet.getCell(row, col)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.s)) === null || _workbook$getStyles$g === void 0 ? void 0 : _workbook$getStyles$g.n;
|
|
508
|
-
const pattern = numfmtValue === null || numfmtValue === void 0 ? void 0 : numfmtValue.pattern;
|
|
509
|
-
const currencySymbol = getCurrencySymbolByLocale(regionService.getCurrentRegion());
|
|
510
|
-
let value = localeService.t("sheets-numfmt-ui.general");
|
|
511
|
-
if (isDefaultFormat(pattern)) {
|
|
512
|
-
subscribe.next(value);
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
if (pattern) {
|
|
516
|
-
const item = MENU_OPTIONS(currencySymbol).filter((item) => typeof item === "object" && item.pattern).find((item) => isPatternEqualWithoutDecimal(pattern, item.pattern));
|
|
517
|
-
if (item && typeof item === "object" && item.pattern) value = localeService.t(item.label);
|
|
518
|
-
else value = localeService.t("sheets-numfmt-ui.moreFmt");
|
|
519
|
-
}
|
|
520
|
-
subscribe.next(value);
|
|
521
|
-
}
|
|
522
|
-
})));
|
|
538
|
+
const value$ = combineLatest([
|
|
539
|
+
getCurrentNumfmtPattern$(accessor),
|
|
540
|
+
regionService.currentRegion$,
|
|
541
|
+
localeService.currentLocale$
|
|
542
|
+
]).pipe(map(([pattern, region]) => localeService.t(getNumberFormatLabelKey(pattern, getCurrencySymbolByLocale(region)))), distinctUntilChanged());
|
|
523
543
|
return {
|
|
524
544
|
label: MORE_NUMFMT_TYPE_KEY,
|
|
525
545
|
id: OpenNumfmtPanelOperator.id,
|
|
@@ -591,7 +611,7 @@ const menuSchema = { [RibbonStartGroup.NUMBER]: {
|
|
|
591
611
|
//#endregion
|
|
592
612
|
//#region package.json
|
|
593
613
|
var name = "@univerjs/sheets-numfmt-ui";
|
|
594
|
-
var version = "1.0
|
|
614
|
+
var version = "1.1.0";
|
|
595
615
|
|
|
596
616
|
//#endregion
|
|
597
617
|
//#region src/config/config.ts
|
|
@@ -674,31 +694,13 @@ function createMobileNumberFormatMenuConfig(currencySymbol) {
|
|
|
674
694
|
};
|
|
675
695
|
}
|
|
676
696
|
function FactoryMobileOtherMenuItem(accessor) {
|
|
677
|
-
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
678
|
-
const commandService = accessor.get(ICommandService);
|
|
679
697
|
const localeService = accessor.get(LocaleService);
|
|
680
698
|
const regionService = accessor.get(RegionService);
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
if (!selection) return;
|
|
687
|
-
const { startRow, startColumn } = selection.range;
|
|
688
|
-
const numfmtValue = (_workbook$getStyles$g = workbook.getStyles().get((_worksheet$getCell = worksheet.getCell(startRow, startColumn)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.s)) === null || _workbook$getStyles$g === void 0 ? void 0 : _workbook$getStyles$g.n;
|
|
689
|
-
const pattern = numfmtValue === null || numfmtValue === void 0 ? void 0 : numfmtValue.pattern;
|
|
690
|
-
const currencySymbol = getCurrencySymbolByLocale(regionService.getCurrentRegion());
|
|
691
|
-
let value = localeService.t("sheets-numfmt-ui.general");
|
|
692
|
-
if (isDefaultFormat(pattern)) {
|
|
693
|
-
subscribe.next(value);
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
if (pattern) {
|
|
697
|
-
const item = MENU_OPTIONS(currencySymbol).filter((option) => typeof option === "object" && option.pattern).find((option) => isPatternEqualWithoutDecimal(pattern, option.pattern));
|
|
698
|
-
value = item && typeof item === "object" && item.pattern ? localeService.t(item.label) : localeService.t("sheets-numfmt-ui.moreFmt");
|
|
699
|
-
}
|
|
700
|
-
subscribe.next(value);
|
|
701
|
-
})));
|
|
699
|
+
const value$ = combineLatest([
|
|
700
|
+
getCurrentNumfmtPattern$(accessor),
|
|
701
|
+
regionService.currentRegion$,
|
|
702
|
+
localeService.currentLocale$
|
|
703
|
+
]).pipe(map(([pattern, region]) => localeService.t(getNumberFormatLabelKey(pattern, getCurrencySymbolByLocale(region)))), distinctUntilChanged());
|
|
702
704
|
return {
|
|
703
705
|
id: MOBILE_NUMFMT_MENU_ID,
|
|
704
706
|
title: "sheets-numfmt-ui.title",
|
|
@@ -742,7 +744,6 @@ function MobileCustomFormat(props) {
|
|
|
742
744
|
children: [
|
|
743
745
|
/* @__PURE__ */ jsx(Input, {
|
|
744
746
|
className: "univer-shrink-0",
|
|
745
|
-
size: "large",
|
|
746
747
|
"aria-label": title,
|
|
747
748
|
value: pattern,
|
|
748
749
|
placeholder: title,
|
package/lib/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { AddDecimalCommand, CURRENCYFORMAT, NUMBERFORMAT, SHEETS_NUMFMT_PLUGIN_C
|
|
|
2
2
|
import { ComponentManager, ILayoutService, IMenuManagerService, ISidebarService, IconManager, MenuItemType, RibbonStartGroup, UniverMobileUIPlugin, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
3
3
|
import { CellValueType, CommandType, DEFAULT_TEXT_FORMAT_EXCEL, DependentOn, Disposable, DisposableCollection, ICommandService, IConfigService, ILocalStorageService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Optional, Plugin, Range, RegionService, ThemeService, Tools, UniverInstanceType, currencySymbols, excelSerialToDateTimeParts, fromCallback, getNumfmtParseValueFilter, isDefaultFormat, isPatternEqualWithoutDecimal, isRealNum, isTextFormat, merge, numfmt, registerDependencies, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
|
|
4
4
|
import { IRenderManagerService, UniverRenderEnginePlugin } from "@univerjs/engine-render";
|
|
5
|
-
import { AFTER_CELL_EDIT, BEFORE_CELL_EDIT, INTERCEPTOR_POINT, INumfmtService, RangeProtectionPermissionEditPoint, RemoveNumfmtMutation, SetNumfmtMutation, SetRangeValuesCommand, SheetInterceptorService, SheetsSelectionsService, TextToNumberCommand, UniverSheetsPlugin, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, getSheetCommandTarget, transformCellsToRange } from "@univerjs/sheets";
|
|
5
|
+
import { AFTER_CELL_EDIT, BEFORE_CELL_EDIT, INTERCEPTOR_POINT, INumfmtService, RangeProtectionPermissionEditPoint, RemoveNumfmtMutation, SetNumfmtMutation, SetRangeValuesCommand, SetRangeValuesMutation, SheetInterceptorService, SheetsSelectionsService, TextToNumberCommand, UniverSheetsPlugin, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, getSheetCommandTarget, transformCellsToRange } from "@univerjs/sheets";
|
|
6
6
|
import { CellAlertManagerService, CellAlertType, IEditorBridgeService, IRepeatLastActionService, RepeatLastActionPermission, SheetSkeletonManagerService, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, deriveStateFromActiveSheet$, getCurrentRangeDisable$ } from "@univerjs/sheets-ui";
|
|
7
|
-
import { Observable, combineLatest, filter, map, merge as merge$1 } from "rxjs";
|
|
7
|
+
import { Observable, combineLatest, distinctUntilChanged, filter, map, merge as merge$1, startWith } from "rxjs";
|
|
8
8
|
import { debounceTime, map as map$1, switchMap, tap } from "rxjs/operators";
|
|
9
9
|
import { Button, Input, InputNumber, MobileActionRowGroup, MobileSelect, Select, SelectList, Separator, borderClassName, clsx, scrollbarClassName } from "@univerjs/design";
|
|
10
10
|
import { createContext, createElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
@@ -20,7 +20,7 @@ const CloseNumfmtPanelOperator = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region \0@oxc-project+runtime@0.
|
|
23
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
24
24
|
function _typeof(o) {
|
|
25
25
|
"@babel/helpers - typeof";
|
|
26
26
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -31,7 +31,7 @@ function _typeof(o) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
35
35
|
function toPrimitive(t, r) {
|
|
36
36
|
if ("object" != _typeof(t) || !t) return t;
|
|
37
37
|
var e = t[Symbol.toPrimitive];
|
|
@@ -44,14 +44,14 @@ function toPrimitive(t, r) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
|
-
//#region \0@oxc-project+runtime@0.
|
|
47
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
48
48
|
function toPropertyKey(t) {
|
|
49
49
|
var i = toPrimitive(t, "string");
|
|
50
50
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region \0@oxc-project+runtime@0.
|
|
54
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
55
55
|
function _defineProperty(e, r, t) {
|
|
56
56
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
57
57
|
value: t,
|
|
@@ -62,7 +62,7 @@ function _defineProperty(e, r, t) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region \0@oxc-project+runtime@0.
|
|
65
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
66
66
|
function __decorateParam(paramIndex, decorator) {
|
|
67
67
|
return function(target, key) {
|
|
68
68
|
decorator(target, key, paramIndex);
|
|
@@ -70,7 +70,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region \0@oxc-project+runtime@0.
|
|
73
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
74
74
|
function __decorate(decorators, target, key, desc) {
|
|
75
75
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76
76
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -428,15 +428,56 @@ function Options() {
|
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/menu/numfmt-menu-util.ts
|
|
433
|
+
const FORMAT_TYPE_LABELS = {
|
|
434
|
+
currency: "sheets-numfmt-ui.currency",
|
|
435
|
+
date: "sheets-numfmt-ui.date",
|
|
436
|
+
datetime: "sheets-numfmt-ui.dateTime",
|
|
437
|
+
general: "sheets-numfmt-ui.general",
|
|
438
|
+
grouped: "sheets-numfmt-ui.number",
|
|
439
|
+
number: "sheets-numfmt-ui.number",
|
|
440
|
+
percent: "sheets-numfmt-ui.percent",
|
|
441
|
+
scientific: "sheets-numfmt-ui.scientific",
|
|
442
|
+
text: "sheets-numfmt-ui.text",
|
|
443
|
+
time: "sheets-numfmt-ui.time"
|
|
444
|
+
};
|
|
445
|
+
function getNumberFormatLabelKey(pattern, currencySymbol) {
|
|
446
|
+
if (!pattern || isDefaultFormat(pattern)) return "sheets-numfmt-ui.general";
|
|
447
|
+
if (isTextFormat(pattern)) return "sheets-numfmt-ui.text";
|
|
448
|
+
const preset = MENU_OPTIONS(currencySymbol).find((option) => typeof option === "object" && option.pattern && isPatternEqualWithoutDecimal(pattern, option.pattern));
|
|
449
|
+
if (preset && typeof preset === "object") return preset.label;
|
|
450
|
+
return FORMAT_TYPE_LABELS[getPatternType(pattern)] ?? "sheets-numfmt-ui.moreFmt";
|
|
451
|
+
}
|
|
452
|
+
function getCurrentNumfmtPattern$(accessor) {
|
|
453
|
+
const commandService = accessor.get(ICommandService);
|
|
454
|
+
const instanceService = accessor.get(IUniverInstanceService);
|
|
455
|
+
const selectionService = accessor.get(SheetsSelectionsService);
|
|
456
|
+
const commandIds = [
|
|
457
|
+
RemoveNumfmtMutation.id,
|
|
458
|
+
SetNumfmtMutation.id,
|
|
459
|
+
SetRangeValuesMutation.id
|
|
460
|
+
];
|
|
461
|
+
return deriveStateFromActiveSheet$(instanceService, void 0, ({ worksheet }) => merge$1(selectionService.selectionChanged$, fromCallback(commandService.onCommandExecuted.bind(commandService)).pipe(filter(([command]) => commandIds.includes(command.id)))).pipe(startWith(null), map(() => {
|
|
462
|
+
var _worksheet$getCellSty;
|
|
463
|
+
const selection = selectionService.getCurrentLastSelection();
|
|
464
|
+
if (!selection) return;
|
|
465
|
+
const cell = selection.primary ?? selection.range;
|
|
466
|
+
return (_worksheet$getCellSty = worksheet.getCellStyle(cell.startRow, cell.startColumn)) === null || _worksheet$getCellSty === void 0 || (_worksheet$getCellSty = _worksheet$getCellSty.n) === null || _worksheet$getCellSty === void 0 ? void 0 : _worksheet$getCellSty.pattern;
|
|
467
|
+
}))).pipe(distinctUntilChanged());
|
|
468
|
+
}
|
|
469
|
+
|
|
431
470
|
//#endregion
|
|
432
471
|
//#region src/menu/menu.ts
|
|
433
472
|
function CurrencySymbolIconMenuItem(accessor) {
|
|
473
|
+
const regionService = accessor.get(RegionService);
|
|
434
474
|
return {
|
|
435
|
-
icon:
|
|
475
|
+
icon: regionService.currentRegion$.pipe(map((region) => getCurrencySymbolIconByLocale(region).icon)),
|
|
436
476
|
id: SetCurrencyCommand.id,
|
|
437
477
|
title: "sheets-numfmt-ui.currency",
|
|
438
478
|
tooltip: "sheets-numfmt-ui.currency",
|
|
439
479
|
type: MenuItemType.BUTTON,
|
|
480
|
+
activated$: combineLatest([getCurrentNumfmtPattern$(accessor), regionService.currentRegion$]).pipe(map(([pattern, region]) => !!pattern && getPatternType(pattern) === "currency" && getCurrencyType(pattern) === getCurrencySymbolIconByLocale(region).symbol), distinctUntilChanged()),
|
|
440
481
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
441
482
|
disabled$: getCurrentRangeDisable$(accessor, {
|
|
442
483
|
workbookTypes: [WorkbookEditablePermission],
|
|
@@ -482,6 +523,7 @@ function PercentMenuItem(accessor) {
|
|
|
482
523
|
title: "sheets-numfmt-ui.percent",
|
|
483
524
|
tooltip: "sheets-numfmt-ui.percent",
|
|
484
525
|
type: MenuItemType.BUTTON,
|
|
526
|
+
activated$: getCurrentNumfmtPattern$(accessor).pipe(map((pattern) => !!pattern && getPatternType(pattern) === "percent"), distinctUntilChanged()),
|
|
485
527
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
486
528
|
disabled$: getCurrentRangeDisable$(accessor, {
|
|
487
529
|
workbookTypes: [WorkbookEditablePermission],
|
|
@@ -491,35 +533,13 @@ function PercentMenuItem(accessor) {
|
|
|
491
533
|
};
|
|
492
534
|
}
|
|
493
535
|
function FactoryOtherMenuItem(accessor) {
|
|
494
|
-
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
495
|
-
const commandService = accessor.get(ICommandService);
|
|
496
536
|
const localeService = accessor.get(LocaleService);
|
|
497
537
|
const regionService = accessor.get(RegionService);
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
var _workbook$getStyles$g, _worksheet$getCell;
|
|
504
|
-
const range = selections[0].range;
|
|
505
|
-
const row = range.startRow;
|
|
506
|
-
const col = range.startColumn;
|
|
507
|
-
const numfmtValue = (_workbook$getStyles$g = workbook.getStyles().get((_worksheet$getCell = worksheet.getCell(row, col)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.s)) === null || _workbook$getStyles$g === void 0 ? void 0 : _workbook$getStyles$g.n;
|
|
508
|
-
const pattern = numfmtValue === null || numfmtValue === void 0 ? void 0 : numfmtValue.pattern;
|
|
509
|
-
const currencySymbol = getCurrencySymbolByLocale(regionService.getCurrentRegion());
|
|
510
|
-
let value = localeService.t("sheets-numfmt-ui.general");
|
|
511
|
-
if (isDefaultFormat(pattern)) {
|
|
512
|
-
subscribe.next(value);
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
if (pattern) {
|
|
516
|
-
const item = MENU_OPTIONS(currencySymbol).filter((item) => typeof item === "object" && item.pattern).find((item) => isPatternEqualWithoutDecimal(pattern, item.pattern));
|
|
517
|
-
if (item && typeof item === "object" && item.pattern) value = localeService.t(item.label);
|
|
518
|
-
else value = localeService.t("sheets-numfmt-ui.moreFmt");
|
|
519
|
-
}
|
|
520
|
-
subscribe.next(value);
|
|
521
|
-
}
|
|
522
|
-
})));
|
|
538
|
+
const value$ = combineLatest([
|
|
539
|
+
getCurrentNumfmtPattern$(accessor),
|
|
540
|
+
regionService.currentRegion$,
|
|
541
|
+
localeService.currentLocale$
|
|
542
|
+
]).pipe(map(([pattern, region]) => localeService.t(getNumberFormatLabelKey(pattern, getCurrencySymbolByLocale(region)))), distinctUntilChanged());
|
|
523
543
|
return {
|
|
524
544
|
label: MORE_NUMFMT_TYPE_KEY,
|
|
525
545
|
id: OpenNumfmtPanelOperator.id,
|
|
@@ -591,7 +611,7 @@ const menuSchema = { [RibbonStartGroup.NUMBER]: {
|
|
|
591
611
|
//#endregion
|
|
592
612
|
//#region package.json
|
|
593
613
|
var name = "@univerjs/sheets-numfmt-ui";
|
|
594
|
-
var version = "1.0
|
|
614
|
+
var version = "1.1.0";
|
|
595
615
|
|
|
596
616
|
//#endregion
|
|
597
617
|
//#region src/config/config.ts
|
|
@@ -674,31 +694,13 @@ function createMobileNumberFormatMenuConfig(currencySymbol) {
|
|
|
674
694
|
};
|
|
675
695
|
}
|
|
676
696
|
function FactoryMobileOtherMenuItem(accessor) {
|
|
677
|
-
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
678
|
-
const commandService = accessor.get(ICommandService);
|
|
679
697
|
const localeService = accessor.get(LocaleService);
|
|
680
698
|
const regionService = accessor.get(RegionService);
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
if (!selection) return;
|
|
687
|
-
const { startRow, startColumn } = selection.range;
|
|
688
|
-
const numfmtValue = (_workbook$getStyles$g = workbook.getStyles().get((_worksheet$getCell = worksheet.getCell(startRow, startColumn)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.s)) === null || _workbook$getStyles$g === void 0 ? void 0 : _workbook$getStyles$g.n;
|
|
689
|
-
const pattern = numfmtValue === null || numfmtValue === void 0 ? void 0 : numfmtValue.pattern;
|
|
690
|
-
const currencySymbol = getCurrencySymbolByLocale(regionService.getCurrentRegion());
|
|
691
|
-
let value = localeService.t("sheets-numfmt-ui.general");
|
|
692
|
-
if (isDefaultFormat(pattern)) {
|
|
693
|
-
subscribe.next(value);
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
if (pattern) {
|
|
697
|
-
const item = MENU_OPTIONS(currencySymbol).filter((option) => typeof option === "object" && option.pattern).find((option) => isPatternEqualWithoutDecimal(pattern, option.pattern));
|
|
698
|
-
value = item && typeof item === "object" && item.pattern ? localeService.t(item.label) : localeService.t("sheets-numfmt-ui.moreFmt");
|
|
699
|
-
}
|
|
700
|
-
subscribe.next(value);
|
|
701
|
-
})));
|
|
699
|
+
const value$ = combineLatest([
|
|
700
|
+
getCurrentNumfmtPattern$(accessor),
|
|
701
|
+
regionService.currentRegion$,
|
|
702
|
+
localeService.currentLocale$
|
|
703
|
+
]).pipe(map(([pattern, region]) => localeService.t(getNumberFormatLabelKey(pattern, getCurrencySymbolByLocale(region)))), distinctUntilChanged());
|
|
702
704
|
return {
|
|
703
705
|
id: MOBILE_NUMFMT_MENU_ID,
|
|
704
706
|
title: "sheets-numfmt-ui.title",
|
|
@@ -742,7 +744,6 @@ function MobileCustomFormat(props) {
|
|
|
742
744
|
children: [
|
|
743
745
|
/* @__PURE__ */ jsx(Input, {
|
|
744
746
|
className: "univer-shrink-0",
|
|
745
|
-
size: "large",
|
|
746
747
|
"aria-label": title,
|
|
747
748
|
value: pattern,
|
|
748
749
|
placeholder: title,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import type { IAccessor } from '@univerjs/core';
|
|
17
|
+
import type { Observable } from 'rxjs';
|
|
18
|
+
import type { LocaleKey } from '../locale/types';
|
|
19
|
+
export declare function getNumberFormatLabelKey(pattern: string | undefined, currencySymbol: string): LocaleKey;
|
|
20
|
+
export declare function getCurrentNumfmtPattern$(accessor: IAccessor): Observable<string | undefined>;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/sheets-numfmt"),require("@univerjs/ui"),require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("rxjs"),require("rxjs/operators"),require("@univerjs/design"),require("react"),require("react/jsx-runtime"),require("@univerjs/engine-formula")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/sheets-numfmt`,`@univerjs/ui`,`@univerjs/core`,`@univerjs/engine-render`,`@univerjs/sheets`,`@univerjs/sheets-ui`,`rxjs`,`rxjs/operators`,`@univerjs/design`,`react`,`react/jsx-runtime`,`@univerjs/engine-formula`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsNumfmtUi={},e.UniverSheetsNumfmt,e.UniverUi,e.UniverCore,e.UniverEngineRender,e.UniverSheets,e.UniverSheetsUi,e.rxjs,e.rxjs.operators,e.UniverDesign,e.React,e.React,e.UniverEngineFormula))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let p={id:`sheet.operation.close.numfmt.panel`,type:r.CommandType.OPERATION,handler:()=>!0};function m(e){"@babel/helpers - typeof";return m=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},m(e)}function h(e,t){if(m(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(m(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g(e){var t=h(e,`string`);return m(t)==`symbol`?t:t+``}function _(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){return function(n,r){t(n,r,e)}}function y(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let b=class extends r.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._sheetInterceptorService=e,this._themeService=t,this._univerInstanceService=n,this._commandService=r,this._selectionManagerService=i,this._renderManagerService=a,this._numfmtService=o,this._sidebarService=s,this._localeService=c,this._sheetsNumfmtCellContentController=l,_(this,`_previewPattern`,``),_(this,`_sidebarDisposable`,null),this._initRealTimeRenderingInterceptor(),this._initCommands(),this._initCloseListener(),this._commandExecutedListener(),this._initNumfmtLocalChange()}_initNumfmtLocalChange(){this.disposeWithMe((0,s.merge)(this._sheetsNumfmtCellContentController.locale$,this._localeService.currentLocale$).subscribe(()=>{this._forceUpdate()}))}openPanel(){var e;let n=this._sidebarService,i=this._selectionManagerService,a=this._commandService,o=this._univerInstanceService,s=this._numfmtService,c=this._localeService,l=(((e=i.getCurrentSelections())==null?void 0:e.map(e=>e.range))||[])[0];if(!l)return!1;let u=o.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET),d=u.getActiveSheet();if(!d)return!1;let f=d.getCellRaw(l.startRow,l.startColumn),m=s.getValue(u.getUnitId(),d.getSheetId(),l.startRow,l.startColumn),h=``;m&&(h=m.pattern);let g=(f==null?void 0:f.t)===r.CellValueType.NUMBER?f.v:12345678,_={onChange:e=>{if(e.type===`change`)this._previewPattern=e.value,this._forceUpdate();else if(e.type===`confirm`){var o;let s=((o=i.getCurrentSelections())==null?void 0:o.map(e=>e.range))||[],c={values:[]},l=(0,t.getPatternType)(e.value);s.forEach(t=>{r.Range.foreach(t,(t,n)=>{c.values.push({row:t,col:n,pattern:e.value,type:l})})}),a.executeCommand(t.SetNumfmtCommand.id,c),n.close()}else e.type===`cancel`&&n.close()},value:{defaultPattern:h,defaultValue:g,row:l.startRow,col:l.startColumn}};return this._sidebarDisposable=n.open({header:{title:c.t(`sheets-numfmt-ui.title`)},children:{label:`SHEET_NUMFMT_PANEL`,..._},onClose:()=>{this._forceUpdate(),a.executeCommand(p.id)}}),!0}_forceUpdate(e){var t,n;let i=e??((t=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getUnitId());if(!i)return;let a=this._renderManagerService.getRenderUnitById(i);a==null||a.with(o.SheetSkeletonManagerService).reCalculate(),a==null||(n=a.mainComponent)==null||n.makeDirty()}_initCommands(){[x,p].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initRealTimeRenderingInterceptor(){let e=new s.Observable(e=>{this._commandService.onCommandExecuted(t=>{t.id===x.id&&e.next(!0),t.id===p.id&&e.next(!1)})}),n=(0,s.combineLatest)([e,this._selectionManagerService.selectionMoveEnd$.pipe((0,c.map)(e=>e?e.map(e=>e.range):[]))]);this.disposeWithMe((0,r.toDisposable)(n.pipe((0,c.switchMap)(([e,t])=>new s.Observable(n=>{let i=new r.DisposableCollection;return e&&t.length&&n.next({selectionRanges:t,disposableCollection:i}),()=>{i.dispose()}})),(0,c.tap)(()=>{this._previewPattern=null})).subscribe(({disposableCollection:e,selectionRanges:n})=>{var i;let o=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET);this.openPanel(),e.add(this._sheetInterceptorService.intercept(a.INTERCEPTOR_POINT.CELL_CONTENT,{priority:99,effect:r.InterceptorEffectEnum.Value|r.InterceptorEffectEnum.Style,handler:(e,i,a)=>{let{row:o,col:s}=i,c=a(e)||{};if(n.find(e=>e.startColumn<=s&&e.endColumn>=s&&e.startRow<=o&&e.endRow>=o)){let e=i.worksheet.getCellRaw(o,s),n=e==null?void 0:e.v,a=e==null?void 0:e.t;if(n==null||a!==r.CellValueType.NUMBER||this._previewPattern===null)return c;let l=(0,t.getPatternPreviewIgnoreGeneral)(this._previewPattern,n,this._sheetsNumfmtCellContentController.locale);if(l.color){let e=this._themeService.getColorFromTheme(`${l.color}.500`)??l.color;return{...c,v:l.result,t:r.CellValueType.STRING,s:{cl:{rgb:e}}}}return{...c,v:l.result,t:r.CellValueType.STRING}}return c}})),(i=this._renderManagerService.getRenderUnitById(o.getUnitId()))==null||(i=i.mainComponent)==null||i.makeDirty()})))}_commandExecutedListener(){let e=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id];this.disposeWithMe(new s.Observable(t=>{let n=this._commandService.onCommandExecuted(n=>{if(e.includes(n.id)){let e=n.params;t.next(e.unitId)}});return()=>n.dispose()}).pipe((0,c.debounceTime)(16)).subscribe(e=>this._forceUpdate(e)))}_initCloseListener(){this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_SHEET).subscribe(e=>{if(!e){var t;(t=this._sidebarDisposable)==null||t.dispose(),this._sidebarDisposable=null}})}};b=y([v(0,(0,r.Inject)(a.SheetInterceptorService)),v(1,(0,r.Inject)(r.ThemeService)),v(2,r.IUniverInstanceService),v(3,r.ICommandService),v(4,(0,r.Inject)(a.SheetsSelectionsService)),v(5,i.IRenderManagerService),v(6,a.INumfmtService),v(7,n.ISidebarService),v(8,(0,r.Inject)(r.LocaleService)),v(9,(0,r.Inject)(t.SheetsNumfmtCellContentController))],b);let x={id:`sheet.operation.open.numfmt.panel`,type:r.CommandType.OPERATION,handler:e=>(e.get(b).openPanel(),!0)},S=e=>[{label:`sheets-numfmt-ui.general`,pattern:null},{label:`sheets-numfmt-ui.text`,pattern:r.DEFAULT_TEXT_FORMAT_EXCEL},`|`,{label:`sheets-numfmt-ui.number`,pattern:`0`},{label:`sheets-numfmt-ui.percent`,pattern:`0.00%`},{label:`sheets-numfmt-ui.scientific`,pattern:`0.00E+00`},`|`,{label:`sheets-numfmt-ui.accounting`,pattern:`"${e}" #,##0.00_);[Red]("${e}"#,##0.00)`},{label:`sheets-numfmt-ui.financialValue`,pattern:`#,##0.00;[Red]#,##0.00`},{label:`sheets-numfmt-ui.currency`,pattern:`"${e}"#,##0.00_);[Red]("${e}"#,##0.00)`},{label:`sheets-numfmt-ui.roundingCurrency`,pattern:`"${e}"#,##0;[Red]"${e}"#,##0`},`|`,{label:`sheets-numfmt-ui.date`,pattern:`yyyy-mm-dd;@`},{label:`sheets-numfmt-ui.time`,pattern:`am/pm h":"mm":"ss`},{label:`sheets-numfmt-ui.dateTime`,pattern:`yyyy-m-d am/pm h:mm`},{label:`sheets-numfmt-ui.timeDuration`,pattern:`[h]:mm:ss`},`|`,{label:`sheets-numfmt-ui.moreFmt`,pattern:``}],C=`sheets-numfmt-ui.moreNumfmtType`,w=`sheets-numfmt-ui.moreNumfmtType.options`;function ee(e){let{value:t}=e,i=(0,n.useDependency)(r.LocaleService),a=t??i.t(`sheets-numfmt-ui.general`);return(0,d.jsx)(`span`,{className:`univer-text-sm`,children:a})}function te(){let e=(0,n.useDependency)(r.ICommandService),i=(0,n.useDependency)(r.LocaleService),o=(0,n.useDependency)(r.RegionService),s=(0,n.useDependency)(n.ILayoutService),c=(0,n.useDependency)(t.SheetsNumfmtCellContentController),f=(0,n.useObservable)(i.direction$,i.getDirection()),p=(0,n.useObservable)(o.currentRegion$,o.getCurrentRegion()),m=(0,n.useDependency)(a.SheetsSelectionsService),h=n=>{let i=m.getCurrentLastSelection();if(!i)return;let a=i.range,o=[];r.Range.foreach(a,(e,r)=>{n?o.push({row:e,col:r,pattern:n,type:(0,t.getPatternType)(n)}):o.push({row:e,col:r})}),e.executeCommand(t.SetNumfmtCommand.id,{values:o}),s.focus()},g=(0,u.useMemo)(()=>{let e=(0,t.getCurrencySymbolByLocale)(p);return S(e)},[p]),_=t=>{if(t===0)h(null);else if(t===g.length-1)e.executeCommand(x.id),s.focus();else{let e=g[t];e.pattern&&h(e.pattern)}};return(0,d.jsx)(`div`,{dir:f,className:`univer-grid univer-gap-1 univer-p-1.5`,children:g.map((e,n)=>e===`|`?(0,d.jsx)(l.Separator,{},n):(0,d.jsxs)(`div`,{className:`univer-flex univer-h-7 univer-cursor-default 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:()=>_(n),children:[(0,d.jsx)(`span`,{children:i.t(e.label)}),(0,d.jsx)(`span`,{className:`univer-text-xs univer-text-gray-500 dark:!univer-text-gray-400`,children:e.pattern?(0,t.getPatternPreview)(e.pattern||``,1220,c.locale).result.trim():``})]},n))})}function ne(e){return{icon:e.get(r.RegionService).currentRegion$.pipe((0,s.map)(e=>(0,t.getCurrencySymbolIconByLocale)(e).icon)),id:t.SetCurrencyCommand.id,title:`sheets-numfmt-ui.currency`,tooltip:`sheets-numfmt-ui.currency`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function re(e){return{icon:`AddDigitsIcon`,id:t.AddDecimalCommand.id,title:`sheets-numfmt-ui.addDecimal`,tooltip:`sheets-numfmt-ui.addDecimal`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function ie(e){return{icon:`ReduceDigitsIcon`,id:t.SubtractDecimalCommand.id,title:`sheets-numfmt-ui.subtractDecimal`,tooltip:`sheets-numfmt-ui.subtractDecimal`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function ae(e){return{icon:`PercentIcon`,id:t.SetPercentCommand.id,title:`sheets-numfmt-ui.percent`,tooltip:`sheets-numfmt-ui.percent`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function oe(e){let i=e.get(r.IUniverInstanceService),c=e.get(r.ICommandService),l=e.get(r.LocaleService),u=e.get(r.RegionService),d=e.get(a.SheetsSelectionsService),f=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id],p=(0,o.deriveStateFromActiveSheet$)(i,``,({workbook:e,worksheet:n})=>new s.Observable(i=>(0,s.merge)(d.selectionMoveEnd$,u.currentRegion$,(0,r.fromCallback)(c.onCommandExecuted.bind(c)).pipe((0,s.filter)(([e])=>f.includes(e.id)))).subscribe(()=>{let a=d.getCurrentSelections();if(a&&a[0]){var o,s;let c=a[0].range,d=c.startRow,f=c.startColumn,p=(o=e.getStyles().get((s=n.getCell(d,f))==null?void 0:s.s))==null?void 0:o.n,m=p==null?void 0:p.pattern,h=(0,t.getCurrencySymbolByLocale)(u.getCurrentRegion()),g=l.t(`sheets-numfmt-ui.general`);if((0,r.isDefaultFormat)(m)){i.next(g);return}if(m){let e=S(h).filter(e=>typeof e==`object`&&e.pattern).find(e=>(0,r.isPatternEqualWithoutDecimal)(m,e.pattern));g=e&&typeof e==`object`&&e.pattern?l.t(e.label):l.t(`sheets-numfmt-ui.moreFmt`)}i.next(g)}})));return{label:C,id:x.id,tooltip:`sheets-numfmt-ui.title`,type:n.MenuItemType.SELECTOR,slot:!0,selections:[{label:{name:w,hoverable:!1,selectable:!1}}],value$:p,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetSetCellStylePermission,a.WorksheetEditPermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}let se={[n.RibbonStartGroup.NUMBER]:{[x.id]:{order:9,gridLayout:{row:1,column:1,columnSpan:4,width:160},menuItemFactory:oe},[t.SetPercentCommand.id]:{order:9.1,gridLayout:{row:2,column:1},menuItemFactory:ae},[t.SetCurrencyCommand.id]:{order:9.2,gridLayout:{row:2,column:2},menuItemFactory:ne},[t.AddDecimalCommand.id]:{order:9.3,gridLayout:{row:2,column:3},menuItemFactory:re},[t.SubtractDecimalCommand.id]:{order:9.4,gridLayout:{row:2,column:4},menuItemFactory:ie}}};var T=`@univerjs/sheets-numfmt-ui`,E=`1.0.4`;let D=`sheets-numfmt-ui.config`,O={},k={id:`sheet.command.mobile.numfmt.set`,type:r.CommandType.COMMAND,handler:async(e,n)=>{let i=e.get(a.SheetsSelectionsService).getCurrentSelections();if(!(i!=null&&i.length))return!1;let o=(n==null?void 0:n.value)||void 0,s=o?(0,t.getPatternType)(o):void 0,c=[];return i.forEach(e=>{r.Range.foreach(e.range,(e,t)=>c.push({row:e,col:t,pattern:o,type:s}))}),e.get(r.ICommandService).executeCommand(t.SetNumfmtCommand.id,{values:c})}},ce=`sheet.menu.mobile.numfmt`,le=`sheets-numfmt-ui.mobile.custom-format`;function ue(e){let n=S(e).slice(0,-1).map(e=>e===`|`?{divider:!0}:{label:e.label,value:e.pattern});return n.push({label:`sheets-numfmt-ui.customFormat`,custom:!0}),{kind:`number-format`,title:`sheets-numfmt-ui.title`,commandId:k.id,detailTitle:`sheets-numfmt-ui.moreFmt`,customTitle:`sheets-numfmt-ui.customFormat`,customComponent:le,quickOptions:[{label:`sheets-numfmt-ui.percent`,commandId:t.SetPercentCommand.id},{label:`sheets-numfmt-ui.currency`,commandId:t.SetCurrencyCommand.id},{label:`sheets-numfmt-ui.date`,commandId:k.id,value:`yyyy-mm-dd;@`},{label:`sheets-numfmt-ui.text`,commandId:k.id,value:r.DEFAULT_TEXT_FORMAT_EXCEL}],decimalOptions:[{label:`sheets-numfmt-ui.subtractDecimal`,commandId:t.SubtractDecimalCommand.id},{label:`sheets-numfmt-ui.addDecimal`,commandId:t.AddDecimalCommand.id}],detailOptions:n,customPatterns:[...new Set([...t.CURRENCYFORMAT.map(t=>t.suffix(e)),...t.NUMBERFORMAT.map(e=>e.suffix)])]}}function de(e){let i=e.get(r.IUniverInstanceService),c=e.get(r.ICommandService),l=e.get(r.LocaleService),u=e.get(r.RegionService),d=e.get(a.SheetsSelectionsService),f=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id],p=(0,o.deriveStateFromActiveSheet$)(i,``,({workbook:e,worksheet:n})=>new s.Observable(i=>(0,s.merge)(d.selectionMoveEnd$,u.currentRegion$,(0,r.fromCallback)(c.onCommandExecuted.bind(c)).pipe((0,s.filter)(([e])=>f.includes(e.id)))).subscribe(()=>{var a,o,s;let c=(a=d.getCurrentSelections())==null?void 0:a[0];if(!c)return;let{startRow:f,startColumn:p}=c.range,m=(o=e.getStyles().get((s=n.getCell(f,p))==null?void 0:s.s))==null?void 0:o.n,h=m==null?void 0:m.pattern,g=(0,t.getCurrencySymbolByLocale)(u.getCurrentRegion()),_=l.t(`sheets-numfmt-ui.general`);if((0,r.isDefaultFormat)(h)){i.next(_);return}if(h){let e=S(g).filter(e=>typeof e==`object`&&e.pattern).find(e=>(0,r.isPatternEqualWithoutDecimal)(h,e.pattern));_=e&&typeof e==`object`&&e.pattern?l.t(e.label):l.t(`sheets-numfmt-ui.moreFmt`)}i.next(_)})));return{id:ce,title:`sheets-numfmt-ui.title`,tooltip:`sheets-numfmt-ui.title`,type:n.MenuItemType.SELECTOR,selections:[],value$:p,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetSetCellStylePermission,a.WorksheetEditPermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]}),mobileNumberFormat:ue((0,t.getCurrencySymbolByLocale)(u.getCurrentRegion()))}}function fe(e){let{patterns:i,onConfirm:a}=e,o=(0,n.useDependency)(r.LocaleService),s=(0,n.useObservable)(o.currentLocale$,o.getCurrentLocale()),[c,f]=(0,u.useState)(``),p=o.t(`sheets-numfmt-ui.customFormat`),m=(0,u.useMemo)(()=>[...new Set([...i,...(0,t.getDateFormatOptions)(s).map(e=>e.value),...c?[c]:[]])].map(e=>({label:e,value:e})),[s,c,i]);return(0,d.jsxs)(`div`,{"data-u-comp":`mobile-custom-format`,className:`univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-gap-4`,children:[(0,d.jsx)(l.Input,{className:`univer-shrink-0`,size:`large`,"aria-label":p,value:c,placeholder:p,onChange:f}),(0,d.jsx)(l.MobileSelect,{className:`univer-w-full univer-shrink-0 [&>div]:univer-font-mono`,value:c||p,options:m,onChange:f}),(0,d.jsx)(`div`,{className:`univer-flex-1 univer-px-1 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200`,children:o.t(`sheets-numfmt-ui.customFormatDes`)}),(0,d.jsx)(l.MobileActionRowGroup,{className:`univer-shrink-0`,children:(0,d.jsx)(l.Button,{variant:`primary`,disabled:!c.trim(),onClick:()=>a(c.trim()),children:o.t(`sheets-numfmt-ui.confirm`)})})]})}let A=class extends r.Disposable{constructor(e){super(),this.disposeWithMe(e.register(le,fe))}};A=y([v(0,(0,r.Inject)(n.ComponentManager))],A);let j=class extends r.Disposable{constructor(e,t,n,r,i){super(),this._commandService=e,this._univerInstanceService=t,this._renderManagerService=n,this._localeService=r,this._sheetsNumfmtCellContentController=i,this.disposeWithMe(this._commandService.registerCommand(k)),this._initNumfmtLocalChange(),this._initCommandExecutedListener()}_initNumfmtLocalChange(){this.disposeWithMe((0,s.merge)(this._sheetsNumfmtCellContentController.locale$,this._localeService.currentLocale$).subscribe(()=>this._forceUpdate()))}_initCommandExecutedListener(){let e=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id];this.disposeWithMe(new s.Observable(t=>{let n=this._commandService.onCommandExecuted(n=>{if(e.includes(n.id)){let e=n.params;t.next(e.unitId)}});return()=>n.dispose()}).pipe((0,c.debounceTime)(16)).subscribe(e=>this._forceUpdate(e)))}_forceUpdate(e){var t,n;let i=e??((t=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getUnitId());if(!i)return;let a=this._renderManagerService.getRenderUnitById(i);a==null||a.with(o.SheetSkeletonManagerService).reCalculate(),a==null||(n=a.mainComponent)==null||n.makeDirty()}};j=y([v(0,r.ICommandService),v(1,r.IUniverInstanceService),v(2,i.IRenderManagerService),v(3,(0,r.Inject)(r.LocaleService)),v(4,(0,r.Inject)(t.SheetsNumfmtCellContentController))],j);let M=class extends r.Disposable{constructor(e,t,n,r,i,a,o,s){super(),this._context=e,this._selectionManagerService=t,this._cellAlertManagerService=n,this._localeService=r,this._numfmtService=i,this._configService=a,this._commandService=o,this._univerInstanceService=s,this._init()}_init(){this._initCellAlertPopup()}_initCellAlertPopup(){this.disposeWithMe(this._selectionManagerService.selectionChanged$.subscribe(e=>this._updateAlert(e))),this.disposeWithMe(this._context.unit.activeSheet$.subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections()))),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_SHEET).subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections())))}_isCurrentSheet(e){let t=this._selectionManagerService.currentSelectionParam;return!!(e&&(t==null?void 0:t.unitId)===this._context.unit.getUnitId()&&t.sheetId===e.getSheetId())}_updateAlert(e){var n,i;this._hideAlert();let s=this._context.unit,c=s.getActiveSheet();if(!this._isCurrentSheet(c)||(e==null?void 0:e.length)!==1||(n=this._configService.getConfig(t.SHEETS_NUMFMT_PLUGIN_CONFIG_KEY))!=null&&n.disableTextFormatAlert)return;let l=e[0],u=l.primary;if(!u)return;let d=u.actualRow,f=u.actualColumn,p=s.getUnitId(),m=c.getSheetId(),h=c.getCell(d,f),g;if(h!=null&&h.s){var _;g=(_=s.getStyles().get(h.s))==null?void 0:_.n}g||=this._numfmtService.getValue(p,m,d,f);let v=h==null?void 0:h.v,y=(0,r.isRealNum)(v)||typeof v==`string`&&typeof((i=(0,r.getNumfmtParseValueFilter)(v))==null?void 0:i.v)==`number`;if(!(0,r.isTextFormat)(g==null?void 0:g.pattern)||!r.Tools.isDefine(v)||!y)return;let b={...l.range};this._cellAlertManagerService.showAlert({type:o.CellAlertType.WARNING,title:this._localeService.t(`sheets-numfmt-ui.info.error`),message:this._localeService.t(`sheets-numfmt-ui.info.forceStringInfo`),location:{unitId:p,subUnitId:m,row:d,col:f},width:200,height:74,key:this._alertKey,menu:[{label:this._localeService.t(`sheets-numfmt-ui.info.convertToNumber`),onSelect:()=>{this._commandService.syncExecuteCommand(a.TextToNumberCommand.id,{unitId:p,subUnitId:m,ranges:[b]})&&this._hideAlert()}}]})}get _alertKey(){return`SHEET_NUMFMT_ALERT:${this._context.unit.getUnitId()}`}_hideAlert(){this._cellAlertManagerService.removeAlert(this._alertKey)}};M=y([v(1,(0,r.Inject)(a.SheetsSelectionsService)),v(2,(0,r.Inject)(o.CellAlertManagerService)),v(3,(0,r.Inject)(r.LocaleService)),v(4,(0,r.Inject)(a.INumfmtService)),v(5,r.IConfigService),v(6,r.ICommandService),v(7,r.IUniverInstanceService)],M);let N=class extends r.Disposable{constructor(e){super(),this._repeatLastActionService=e,this._initCommandRecording()}_initCommandRecording(){this._repeatLastActionService&&this.disposeWithMe(this._repeatLastActionService.registerRepeatableCommand(t.SetNumfmtCommand.id,(e,t)=>{if(!t)return;let{values:n}=t,r=n.find(e=>e.pattern);if(!r)return;let{pattern:i,type:a}=r,o=[],s=new Set;for(let t of e){let{startRow:e,startColumn:n,endRow:r,endColumn:c}=t;for(let t=e;t<=r;t++)for(let e=n;e<=c;e++){let n=`${t}-${e}`;s.has(n)||(s.add(n),o.push({row:t,col:e,pattern:i,type:a}))}}return{...t,values:o}},o.RepeatLastActionPermission.CellStyle))}};N=y([v(0,(0,r.Optional)(o.IRepeatLastActionService))],N);function pe(e){if(r.numfmt.getFormatDateInfo(e).isDuration)return`duration`;let t=r.numfmt.getFormatInfo(e).type;return t===`date`||t===`datetime`||t===`time`?t:null}function me(e,t){var n;let i=((n=r.numfmt.getLocale(t))==null?void 0:n.decimal)??`.`,a=e.lastIndexOf(i);if(a<0)return e;let o=e.indexOf(` `,a),s=o<0?e.length:o,c=s;for(;c>a+1&&e[c-1]===`0`;)c--;return e.slice(0,c)+e.slice(s)}function he(e,t){var n;let i=Math.round(Math.abs(e)*864e5),a=Math.floor(i/36e5),o=Math.floor(i/6e4)%60,s=Math.floor(i/1e3)%60,c=i%1e3,l=c?`${((n=r.numfmt.getLocale(t))==null?void 0:n.decimal)??`.`}${String(c).padStart(3,`0`).replace(/0+$/,``)}`:``;return`${e<0?`-`:``}${a}:${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}${l}`}function ge(e){let{serial:t,pattern:n,locale:i,dateSystem:a}=e,o=pe(n);if(!o||!Number.isFinite(t)||t<0&&o!==`duration`)return null;if(o===`duration`)return he(t,i);let s=(0,r.excelSerialToDateTimeParts)(t,{dateSystem:a});if(!s)return null;let c=Math.round(s.fractionalSecond*1e3)>0,l=r.numfmt.getDateTimeEditPattern(n,t);if(!l)return null;let u=r.numfmt.format(l,t,{locale:i,dateSystem:a,throws:!1});return c?me(u,i):u}function _e(e,t){var n;let i=((n=r.numfmt.getLocale(t))==null?void 0:n.decimal)??`.`,a=i===`.`?e:e.replace(i,`.`),o=/^\s*([+-])?(\d+):([0-5]?\d):([0-5]?\d)(\.\d{1,10})?\s*$/.exec(a);if(!o)return null;let s=o[1]===`-`?-1:1,c=Number(o[2]),l=Number(o[3]),u=Number(o[4]),d=Number(o[5]??0);return s*(c*3600+l*60+u+d)/86400}function ve(e){let{content:t,originalSerial:n,pattern:i,locale:a,dateSystem:o}=e,s=pe(i);if(!s||!Number.isFinite(n)||n<0&&s!==`duration`)return null;if(s===`duration`)return _e(t,a);if(s===`time`){let e=r.numfmt.parseTime(t,{locale:a,dateSystem:o});return e?Math.floor(n)+Number(e.v):null}let c=r.numfmt.parseDate(t,{locale:a,dateSystem:o});return!c||typeof c.v!=`number`?null:s===`date`?Math.floor(c.v)+(n-Math.floor(n)):c.v}let ye=()=>{let e=[];return{add:(t,n,r,i,a)=>e.push({unitId:t,subUnitId:n,row:r,col:i,value:a}),getEffects:()=>e,clean:()=>{e=[]}}},P=class extends r.Disposable{constructor(e,t,n,r,i,a){super(),this._sheetInterceptorService=e,this._numfmtService=t,this._univerInstanceService=n,this._injector=r,this._sheetsNumfmtCellContentController=i,this._editorBridgeService=a,_(this,`_collectEffectMutation`,ye()),this._initInterceptorEditorStart(),this._initInterceptorEditorEnd(),this._initInterceptorCommands()}_initInterceptorEditorStart(){this._editorBridgeService&&this.disposeWithMe((0,r.toDisposable)(this._sheetInterceptorService.writeCellInterceptor.intercept(a.BEFORE_CELL_EDIT,{handler:(e,n,i)=>{let a=n.row,o=n.col,s=this._numfmtService.getValue(n.unitId,n.subUnitId,a,o);if(s){let c=n.worksheet.getCellRaw(a,o);if(!(c!=null&&c.f)&&(c==null?void 0:c.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(c.v)){let e=ge({serial:Number(c.v),pattern:s.pattern,locale:this._sheetsNumfmtCellContentController.getLocale(n.workbook),dateSystem:n.workbook.getDateSystem()});if(e!=null)return i&&i({...c,v:e})}switch((0,t.getPatternType)(s.pattern)){case`scientific`:case`currency`:case`grouped`:case`number`:{let e={...n.worksheet.getCellRaw(a,o)};return(e==null?void 0:e.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(e.v)&&(e.v=(0,f.stripErrorMargin)(Number(e.v))),i&&i(e)}case`percent`:{let e={...n.worksheet.getCellRaw(a,o)};return(e==null?void 0:e.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(e.v)&&(e.v=`${(0,f.stripErrorMargin)(Number(e.v)*100)}%`,e.isPercentFormat=!0),i&&i(e)}default:return i&&i(e)}}return i(e)}})))}_initInterceptorEditorEnd(){this.disposeWithMe((0,r.toDisposable)(this._sheetInterceptorService.writeCellInterceptor.intercept(a.AFTER_CELL_EDIT,{handler:(e,n,i)=>{var a,o;if(!(e!=null&&e.v)&&!(e!=null&&e.p))return i(e);this._collectEffectMutation.clean();let s=this._numfmtService.getValue(n.unitId,n.subUnitId,n.row,n.col),c=n.worksheet.getCellRaw(n.row,n.col);if((0,r.isTextFormat)(s==null?void 0:s.pattern)||e.t===r.CellValueType.FORCE_STRING)return i(e);let l=(a=e.p)==null?void 0:a.body,u=e!=null&&(o=e.p)!=null&&(o=o.body)!=null&&o.dataStream?e.p.body.dataStream.replace(/\r\n$/,``):String(e.v),d=this._sheetsNumfmtCellContentController.getLocale(n.workbook),p=n.workbook.getDateSystem(),m=(0,r.getNumfmtParseValueFilter)(u,{locale:d,dateSystem:p});if(l){if(be(l)){let{dataStream:t}=l,n=t.replace(/\r\n$/,``),r=Number(n);if(Number.isNaN(r)&&!m)return i(e)}else return i(e)}if(s!=null&&s.pattern&&(c==null?void 0:c.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(c.v)){let t=ve({content:u,originalSerial:Number(c.v),pattern:s.pattern,locale:d,dateSystem:p});if(t!=null)return i({...e,p:void 0,v:(0,f.stripErrorMargin)(t,16),t:r.CellValueType.NUMBER})}if(m){if(!m.z&&!(s!=null&&s.pattern)&&(c==null?void 0:c.t)!==r.CellValueType.STRING&&(c==null?void 0:c.t)!==r.CellValueType.FORCE_STRING&&(0,r.willLoseNumericPrecision)(u))return i({...e,p:void 0,v:u,t:r.CellValueType.FORCE_STRING});m.z&&(!(s!=null&&s.pattern)||(0,t.getPatternType)(m.z)!==(0,t.getPatternType)(s.pattern))&&this._collectEffectMutation.add(n.unitId,n.subUnitId,n.row,n.col,{pattern:m.z});let a=(0,f.stripErrorMargin)(Number(m.v),16);return i({...e,p:void 0,v:a,t:r.CellValueType.NUMBER})}return i(e)}})))}_initInterceptorCommands(){let e=this;this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations(t){switch(t.id){case a.SetRangeValuesCommand.id:{let n=e._collectEffectMutation.getEffects();if(e._collectEffectMutation.clean(),!n.length)return{redos:[],undos:[]};let r=(0,a.getSheetCommandTarget)(e._univerInstanceService,t.params);if(!r)return{redos:[],undos:[]};let{unitId:i,subUnitId:o}=r,s=n.filter(e=>e.unitId===i&&e.subUnitId===o),c=s.filter(e=>{var t;return!!((t=e.value)!=null&&t.pattern)}).map(e=>({row:e.row,col:e.col,pattern:e.value.pattern})),l=s.filter(e=>{var t;return!((t=e.value)!=null&&t.pattern)}).map(e=>({startRow:e.row,endColumn:e.col,startColumn:e.col,endRow:e.row})),u=[],d=[];if(c.length){let t={id:a.SetNumfmtMutation.id,params:(0,a.transformCellsToRange)(i,o,c)};u.push(t),d.push(...(0,a.factorySetNumfmtUndoMutation)(e._injector,t.params))}if(l.length){let t={id:a.RemoveNumfmtMutation.id,params:{unitId:i,subUnitId:o,ranges:l}};u.push(t),d.push(...(0,a.factoryRemoveNumfmtUndoMutation)(e._injector,t.params))}return{redos:u,undos:d.reverse()}}}return{redos:[],undos:[]}}}))}dispose(){super.dispose(),this._collectEffectMutation.clean()}};P=y([v(0,(0,r.Inject)(a.SheetInterceptorService)),v(1,(0,r.Inject)(a.INumfmtService)),v(2,(0,r.Inject)(r.IUniverInstanceService)),v(3,(0,r.Inject)(r.Injector)),v(4,(0,r.Inject)(t.SheetsNumfmtCellContentController)),v(5,(0,r.Optional)(o.IEditorBridgeService))],P);function be(e){let{textRuns:t=[],paragraphs:n=[],customRanges:r,customBlocks:i=[]}=e,a=[`va`];return!(t.some(e=>!!(e.ts&&Object.keys(e.ts).some(e=>a.includes(e))))||n.some(e=>e.bullet)||n.length>=2||r!=null&&r.length||i.length>0)}let xe={[n.RibbonStartGroup.NUMBER]:{[ce]:{order:9,menuItemFactory:de}}},F=class extends r.Disposable{constructor(e){super(),e.mergeMenu(xe)}};F=y([v(0,n.IMenuManagerService)],F);let I=class extends r.Plugin{constructor(e=O,t,n,i){super(),this._config=e,this._injector=t,this._configService=n,this._renderManagerService=i;let{menu:a,...o}=(0,r.merge)({},O,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(D,o)}onStarting(){(0,r.registerDependencies)(this._injector,[[A],[j],[P],[F],[N]]),(0,r.touchDependencies)(this._injector,[[A],[j]])}onRendered(){[[M]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(r.UniverInstanceType.UNIVER_SHEET,e))}),(0,r.touchDependencies)(this._injector,[[P],[F],[N]])}};_(I,`pluginName`,`SHEET_NUMFMT_UI_PLUGIN`),_(I,`packageName`,T),_(I,`version`,E),_(I,`type`,r.UniverInstanceType.UNIVER_SHEET),I=y([(0,r.DependentOn)(i.UniverRenderEnginePlugin,a.UniverSheetsPlugin,t.UniverSheetsNumfmtPlugin,o.UniverSheetsMobileUIPlugin,n.UniverMobileUIPlugin),v(1,(0,r.Inject)(r.Injector)),v(2,r.IConfigService),v(3,i.IRenderManagerService)],I);function L({ref:e,...t}){let{preserveStrokeWidth:n,icon:r,id:i,className:a,extend:o,...s}=t,c=`univerjs-icon univerjs-icon-${i} ${a||``}`.trim(),l=`_${(0,u.useId)()}`,d=(0,u.useRef)(null);return(0,u.useImperativeHandle)(e,()=>d.current),(0,u.useLayoutEffect)(()=>{if(n&&d.current&&d.current.localName===r.tag)return we(d.current)},[n,r]),R(r,`${i}`,{defIds:r.defIds,idSuffix:l},{ref:d,className:c,...s},o)}function R(e,t,n,r,i){return(0,u.createElement)(e.tag,{key:t,...Se(e,n,i),...r},(Ce(e,n).children||[]).map((r,a)=>R(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function Se(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function Ce(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function we(e){let t=e.viewBox.baseVal,n=Math.max(t.width,t.height);if(!Number.isFinite(n)||n<=0||t.width<=0||t.height<=0)return()=>void 0;let r=16/n,i=Array.from(e.querySelectorAll(`circle, ellipse, line, path, polygon, polyline, rect, text, textPath, tspan, use`)).flatMap(e=>{let t=getComputedStyle(e),n=Number.parseFloat(t.strokeWidth);return t.stroke===`none`||Number.parseFloat(t.strokeOpacity)===0||t.vectorEffect===`non-scaling-stroke`||!Number.isFinite(n)||n<=0?[]:[{element:e,hadStyleAttribute:e.hasAttribute(`style`),originalStrokeWidth:n,strokeWidth:Te(e.style,`stroke-width`)}]}).map(e=>({appliedStrokeWidth:null,element:e.element,hadStyleAttribute:e.hadStyleAttribute,isReleased:!1,originalStrokeWidth:e.originalStrokeWidth,strokeWidth:e.strokeWidth}));if(i.length===0)return()=>void 0;let a=(e,n)=>{if(t.width<=0||t.height<=0||e<=0||n<=0)return;let a=Math.min(e/t.width,n/t.height);!Number.isFinite(a)||a<=0||i.forEach(e=>{if(e.isReleased)return;if(e.appliedStrokeWidth!==null&&(e.element.style.getPropertyValue(`stroke-width`)!==e.appliedStrokeWidth||e.element.style.getPropertyPriority(`stroke-width`)!==e.strokeWidth.priority)){e.appliedStrokeWidth=null,e.isReleased=!0;return}let t=e.originalStrokeWidth*r/a,n=`${Number(t.toFixed(12))}px`;e.element.style.setProperty(`stroke-width`,n,e.strokeWidth.priority),e.appliedStrokeWidth=n})},o=e.getBoundingClientRect();a(o.width,o.height);let s=typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{if(t.some(t=>t.target===e)){let t=e.getBoundingClientRect();a(t.width,t.height)}});return s==null||s.observe(e),()=>{s==null||s.disconnect(),i.forEach(e=>{e.appliedStrokeWidth!==null&&(Ee(e.element.style,`stroke-width`,e.appliedStrokeWidth,e.strokeWidth.priority,e.strokeWidth),!e.hadStyleAttribute&&e.element.style.length===0&&e.element.removeAttribute(`style`))})}}function Te(e,t){return{priority:e.getPropertyPriority(t),value:e.getPropertyValue(t)}}function Ee(e,t,n,r,i){e.getPropertyValue(t)===n&&e.getPropertyPriority(t)===r&&(i.value?e.setProperty(t,i.value,i.priority):e.removeProperty(t))}L.displayName=`UniverIcon`;let De={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:`M4.06641 3.49366C4.06641 2.27555 5.14145 1.3916 6.33307 1.3916C7.52469 1.3916 8.59974 2.27555 8.59974 3.49366V6.49777C8.59974 7.71586 7.52469 8.59982 6.33307 8.59982C5.14145 8.59982 4.06641 7.71586 4.06641 6.49777V3.49366ZM6.33307 2.5916C5.68376 2.5916 5.26641 3.05264 5.26641 3.49366V6.49777C5.26641 6.93878 5.68376 7.39982 6.33307 7.39982C6.98239 7.39982 7.39974 6.93878 7.39974 6.49777V3.49366C7.39974 3.05264 6.98239 2.5916 6.33307 2.5916Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.0664 3.49366C10.0664 2.27555 11.1415 1.3916 12.3331 1.3916C13.5247 1.3916 14.5997 2.27555 14.5997 3.49366V6.49777C14.5997 7.71586 13.5247 8.59982 12.3331 8.59982C11.1415 8.59982 10.0664 7.71586 10.0664 6.49777V3.49366ZM12.3331 2.5916C11.6838 2.5916 11.2664 3.05264 11.2664 3.49366V6.49777C11.2664 6.93878 11.6838 7.39982 12.3331 7.39982C12.9824 7.39982 13.3997 6.93878 13.3997 6.49777V3.49366C13.3997 3.05264 12.9824 2.5916 12.3331 2.5916Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.4242 9.5417C12.1899 9.30739 11.81 9.30739 11.5756 9.5417C11.3413 9.77602 11.3413 10.1559 11.5756 10.3902L12.5514 11.366H6.3334C6.00203 11.366 5.7334 11.6346 5.7334 11.966C5.7334 12.2973 6.00203 12.566 6.3334 12.566H12.5514L11.5756 13.5417C11.3413 13.776 11.3413 14.1559 11.5756 14.3902C11.81 14.6245 12.1899 14.6245 12.4242 14.3902L14.4159 12.3985C14.5294 12.2893 14.6001 12.1359 14.6001 11.966C14.6001 11.796 14.5294 11.6426 14.4159 11.5334L12.4242 9.5417Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 8.3002C1.3999 7.96882 1.66853 7.7002 1.9999 7.7002H2.33324C2.66461 7.7002 2.93324 7.96882 2.93324 8.3002C2.93324 8.63157 2.66461 8.9002 2.33324 8.9002H1.9999C1.66853 8.9002 1.3999 8.63157 1.3999 8.3002Z`}}]},z=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`add-digits-icon`,ref:t,icon:De}))});z.displayName=`AddDigitsIcon`;let Oe={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`}}]},B=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`check-mark-icon`,ref:t,icon:Oe}))});B.displayName=`CheckMarkIcon`;let ke={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:`M7.3999 2.8999V1.6C7.3999 1.26863 7.66853 1 7.9999 1C8.33127 1 8.5999 1.26863 8.5999 1.6V2.8999H10.2044C11.6655 2.8999 12.8499 4.08431 12.8499 5.54536C12.8499 5.87673 12.5813 6.14536 12.2499 6.14536C11.9185 6.14536 11.6499 5.87673 11.6499 5.54536C11.6499 4.74705 11.0028 4.0999 10.2044 4.0999H5.7384C4.97155 4.0999 4.3499 4.72155 4.3499 5.4884C4.3499 6.14439 4.80899 6.71087 5.45074 6.84677L10.7977 7.97906C11.994 8.23242 12.8499 9.28849 12.8499 10.5114C12.8499 11.941 11.691 13.0999 10.2614 13.0999H8.5999V14.4C8.5999 14.7314 8.33127 15 7.9999 15C7.66853 15 7.3999 14.7314 7.3999 14.4V13.0999H5.79536C4.33431 13.0999 3.1499 11.9155 3.1499 10.4544C3.1499 10.1231 3.41853 9.85445 3.7499 9.85445C4.08127 9.85445 4.3499 10.1231 4.3499 10.4544C4.3499 11.2527 4.99705 11.8999 5.79536 11.8999H10.2614C11.0283 11.8999 11.6499 11.2782 11.6499 10.5114C11.6499 9.85542 11.1908 9.28893 10.5491 9.15303L5.20214 8.02074C4.00575 7.76739 3.1499 6.71132 3.1499 5.4884C3.1499 4.05881 4.30881 2.8999 5.7384 2.8999H7.3999Z`}}]},V=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`dollar-icon`,ref:t,icon:ke}))});V.displayName=`DollarIcon`;let Ae={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:`M12.2058 3.459H11.2416V12.6604H9.6438V11.6962Q8.9091 12.844 7.4858 12.844Q5.8971 12.844 4.8456 11.6686Q3.7942 10.4932 3.7942 8.5739Q3.7942 6.5904 4.7814 5.4471Q5.7685 4.3038 7.4031 4.3038Q8.9183 4.3038 9.5887 5.3415V3.459H7.5041V2.1091H9.5887V1.2H11.2416V2.1091H12.2058V3.459ZM7.6143 11.4941Q8.5234 11.4941 9.0744 10.8008Q9.6254 10.1075 9.6254 8.7484Q9.6254 5.6629 7.5592 5.6629Q6.5491 5.6629 6.0211 6.4297Q5.493 7.1965 5.493 8.5923Q5.493 11.4941 7.6143 11.4941ZM11.2416 14.8H4.0421V13.4501H11.2416V14.8Z`}}]},H=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`dong-icon`,ref:t,icon:Ae}))});H.displayName=`DongIcon`;let je={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:`M5.84964 5.80918C6.71946 3.63548 8.84516 2.2 11.3295 2.2C11.8324 2.2 12.3198 2.26279 12.7846 2.38065C13.1058 2.46209 13.4322 2.26773 13.5137 1.94652C13.5951 1.62532 13.4008 1.2989 13.0795 1.21746C12.5191 1.07535 11.9327 1 11.3295 1C8.17278 1 5.49724 2.96009 4.57394 5.80918H3.06582C2.73445 5.80918 2.46582 6.07781 2.46582 6.40918C2.46582 6.74055 2.73445 7.00918 3.06582 7.00918H4.29808C4.25287 7.33297 4.22949 7.66376 4.22949 8C4.22949 8.33608 4.25284 8.6667 4.29801 8.99033H3.06582C2.73445 8.99033 2.46582 9.25896 2.46582 9.59033C2.46582 9.9217 2.73445 10.1903 3.06582 10.1903H4.57378C5.49693 13.0397 8.1726 15 11.3295 15C11.9336 15 12.5209 14.9244 13.0821 14.7819C13.4033 14.7003 13.5975 14.3738 13.5159 14.0527C13.4344 13.7315 13.1079 13.5373 12.7867 13.6188C12.3213 13.737 11.8332 13.8 11.3295 13.8C8.84497 13.8 6.71914 12.3643 5.84944 10.1903H11.4291C11.7605 10.1903 12.0291 9.9217 12.0291 9.59033C12.0291 9.25896 11.7605 8.99033 11.4291 8.99033H5.51225C5.45783 8.66834 5.42949 8.33748 5.42949 8C5.42949 7.66235 5.45786 7.33133 5.51233 7.00918H11.4291C11.7605 7.00918 12.0291 6.74055 12.0291 6.40918C12.0291 6.07781 11.7605 5.80918 11.4291 5.80918H5.84964Z`}}]},U=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`euro-icon`,ref:t,icon:je}))});U.displayName=`EuroIcon`;let 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:`M1.85059 4.06725C1.85059 2.84302 2.84302 1.85059 4.06725 1.85059C5.29148 1.85059 6.28392 2.84302 6.28392 4.06725C6.28392 5.29148 5.29148 6.28392 4.06725 6.28392C2.84302 6.28392 1.85059 5.29148 1.85059 4.06725ZM4.06725 2.95059C3.45053 2.95059 2.95059 3.45053 2.95059 4.06725C2.95059 4.68397 3.45053 5.18392 4.06725 5.18392C4.68397 5.18392 5.18392 4.68397 5.18392 4.06725C5.18392 3.45053 4.68397 2.95059 4.06725 2.95059Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.7168 11.933C9.7168 10.7087 10.7092 9.71631 11.9335 9.71631C13.1577 9.71631 14.1501 10.7087 14.1501 11.933C14.1501 13.1572 13.1577 14.1496 11.9335 14.1496C10.7092 14.1496 9.7168 13.1572 9.7168 11.933ZM11.9335 10.8163C11.3167 10.8163 10.8168 11.3163 10.8168 11.933C10.8168 12.5497 11.3167 13.0496 11.9335 13.0496C12.5502 13.0496 13.0501 12.5497 13.0501 11.933C13.0501 11.3163 12.5502 10.8163 11.9335 10.8163Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.5241 3.32407C13.7584 3.08975 13.7584 2.70986 13.5241 2.47554C13.2898 2.24123 12.9099 2.24123 12.6755 2.47554L2.47554 12.6755C2.24123 12.9099 2.24123 13.2898 2.47554 13.5241C2.70986 13.7584 3.08975 13.7584 3.32407 13.5241L13.5241 3.32407Z`}}]},W=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`percent-icon`,ref:t,icon:Me}))});W.displayName=`PercentIcon`;let Ne={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:`M6.33307 1.3916C5.14145 1.3916 4.06641 2.27555 4.06641 3.49366V6.49777C4.06641 7.71586 5.14145 8.59982 6.33307 8.59982C7.52469 8.59982 8.59974 7.71586 8.59974 6.49777V3.49366C8.59974 2.27555 7.52469 1.3916 6.33307 1.3916ZM5.26641 3.49366C5.26641 3.05264 5.68376 2.5916 6.33307 2.5916C6.98239 2.5916 7.39974 3.05264 7.39974 3.49366V6.49777C7.39974 6.93878 6.98239 7.39982 6.33307 7.39982C5.68376 7.39982 5.26641 6.93878 5.26641 6.49777V3.49366Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.90913 9.5417C8.14345 9.30739 8.52335 9.30739 8.75766 9.5417C8.99198 9.77602 8.99198 10.1559 8.75766 10.3902L7.78193 11.366H13.9999C14.3313 11.366 14.5999 11.6346 14.5999 11.966C14.5999 12.2973 14.3313 12.566 13.9999 12.566H7.78193L8.75766 13.5417C8.99198 13.776 8.99198 14.1559 8.75766 14.3902C8.52335 14.6245 8.14345 14.6245 7.90913 14.3902L5.91739 12.3985C5.80388 12.2893 5.73324 12.1359 5.73324 11.966C5.73324 11.796 5.80388 11.6426 5.91739 11.5334L7.90913 9.5417Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 8.3002C1.3999 7.96882 1.66853 7.7002 1.9999 7.7002H2.33324C2.66461 7.7002 2.93324 7.96882 2.93324 8.3002C2.93324 8.63157 2.66461 8.9002 2.33324 8.9002H1.9999C1.66853 8.9002 1.3999 8.63157 1.3999 8.3002Z`}}]},Pe=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`reduce-digits-icon`,ref:t,icon:Ne}))});Pe.displayName=`ReduceDigitsIcon`;let Fe={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:`M6.7937 8.6977Q6.7937 9.5729 6.7228 9.9277Q6.6045 10.8264 5.7057 11.3704Q4.8543 11.8908 3.577 12.0327H3.4115Q2.6783 12.0327 2.2052 11.3468Q1.7795 10.7555 1.7795 9.9277Q1.7795 9.5965 1.945 8.887Q2.1343 8.0828 2.3944 7.8226Q2.4417 7.7517 2.5127 7.7517Q2.6546 7.7517 2.6546 7.9172Q2.6546 7.9882 2.489 8.4139Q2.3235 8.8397 2.3235 9.0762Q2.3235 9.904 2.7256 10.2588Q3.1277 10.6136 3.9791 10.6136Q4.9016 10.6136 5.6111 10.1878Q6.4863 9.6911 6.4153 8.8397Q6.2261 8.1774 5.8713 6.4271Q5.4456 4.2038 5.1617 3.0449Q4.9489 2.6191 4.807 2.4536Q4.9489 2.1934 5.0198 1.8859Q5.1617 1.2 5.28 1.2Q5.351 1.2 5.4456 1.4602Q5.5638 1.744 5.6821 1.8623Q6.1078 2.217 6.1551 2.288Q6.1551 2.3353 6.1788 2.3826Q6.2261 2.6191 5.9186 3.2577Q6.2024 4.535 6.4863 6.4271Q6.6991 7.8463 6.7937 8.6977ZM11.3586 8.9816Q11.3823 9.6911 11.0748 10.3061Q10.8856 10.7082 10.0577 10.7082Q9.3009 10.7082 8.8751 9.9277Q8.5677 9.4073 8.4021 7.8226Q8.1656 5.8122 7.9054 4.0146Q7.7398 3.0922 7.6452 2.6428L7.7871 1.9332Q7.8581 1.4602 7.929 1.4602Q7.9763 1.4602 8 1.5784Q8.2365 2.2407 8.4257 3.8963Q8.7096 6.167 8.8042 6.6637Q9.0643 8.5795 9.2299 8.9106Q9.3245 9.1235 9.5729 9.3127Q9.8212 9.5019 10.0577 9.5019Q10.72 9.5019 10.791 9.1471Q10.7437 8.9816 10.4835 8.6268Q10.2706 8.2957 10.247 8.0355L10.3889 7.657Q10.4598 7.4442 10.5781 7.2077Q10.6017 7.184 10.6254 7.184Q10.8383 7.184 11.0275 7.6334Q11.335 8.272 11.3586 8.9816ZM14.2205 10.7318Q14.2205 12.2219 13.511 13.3099Q13.1325 13.8776 12.2574 14.6108Q11.9736 14.8 11.4532 14.8Q10.9329 14.8 9.3245 14.4689Q9.2536 14.4689 9.1471 14.3624Q9.0407 14.256 9.0407 14.2087Q9.0643 14.185 9.0643 14.185L9.088 14.1614Q9.703 14.1141 10.0577 14.1141Q10.72 14.0904 11.0038 13.9722Q13.1089 13.1917 13.7475 11.2995Q13.6765 11.1339 13.2035 10.3061Q12.825 9.6438 12.825 9.3363Q12.825 9.289 12.9197 9.1471Q12.9433 9.1235 13.0379 8.7923Q13.1089 8.5558 13.1798 8.5558Q13.4637 8.5558 13.8657 9.3363Q14.2205 10.0459 14.2205 10.377V10.7318ZM10.6017 12.1273Q10.6254 12.1983 10.4243 12.6122Q10.2233 13.0261 10.105 13.0261Q9.9631 13.0261 9.6793 12.7777Q9.3955 12.5294 9.3245 12.3638Q9.632 11.536 9.7976 11.465Q9.8685 11.465 10.1997 11.7607Q10.5308 12.0563 10.6017 12.1273ZM9.1353 12.4584Q9.159 12.6003 8.9579 12.967Q8.7569 13.3336 8.6386 13.3336Q8.4967 13.3336 8.201 13.097Q7.9054 12.8605 7.9054 12.7423Q7.8344 12.553 8.3075 11.8198Q8.6386 11.9617 9.1353 12.4584Z`}}]},Ie=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`rial-icon`,ref:t,icon:Fe}))});Ie.displayName=`RialIcon`;let Le={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:`M11.9445 1.55649C12.2184 1.744 12.2895 2.11755 12.1033 2.39085L9.24342 6.58659H12.8001C13.1315 6.58659 13.4001 6.85522 13.4001 7.18659C13.4001 7.51796 13.1315 7.78659 12.8001 7.78659H8.5999V9.91276H13.2221C13.5534 9.91276 13.8221 10.1814 13.8221 10.5128C13.8221 10.8441 13.5534 11.1128 13.2221 11.1128H8.5999V14.0877C8.5999 14.4191 8.33127 14.6877 7.9999 14.6877C7.66853 14.6877 7.3999 14.4191 7.3999 14.0877V11.1128H2.77773C2.44636 11.1128 2.17773 10.8441 2.17773 10.5128C2.17773 10.1814 2.44636 9.91276 2.77773 9.91276H7.3999V7.78659H3.2001C2.86873 7.78659 2.6001 7.51796 2.6001 7.18659C2.6001 6.85522 2.86873 6.58659 3.2001 6.58659H6.75736L3.89753 2.39085C3.71125 2.11755 3.78234 1.744 4.05631 1.55649C4.33029 1.36899 4.7034 1.43854 4.88968 1.71184L7.94595 6.19577C7.96752 6.22741 7.98564 6.2604 8.00039 6.29429C8.01514 6.2604 8.03326 6.22741 8.05483 6.19577L11.1111 1.71184C11.2974 1.43854 11.6705 1.36899 11.9445 1.55649Z`}}]},Re=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`rmb-icon`,ref:t,icon:Le}))});Re.displayName=`RmbIcon`;let ze={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:`M9.72502 1.02051H6.07803C4.97346 1.02051 4.07803 1.91594 4.07803 3.02051V7.57046H3.00039C2.66902 7.57046 2.40039 7.83909 2.40039 8.17046C2.40039 8.50183 2.66902 8.77046 3.00039 8.77046H4.07803V10.4854H3.00039C2.66902 10.4854 2.40039 10.754 2.40039 11.0854C2.40039 11.4167 2.66902 11.6854 3.00039 11.6854H4.07803V14.3795C4.07803 14.7108 4.34666 14.9795 4.67803 14.9795C5.0094 14.9795 5.27803 14.7108 5.27803 14.3795V11.6854H10.3637C10.695 11.6854 10.9637 11.4167 10.9637 11.0854C10.9637 10.754 10.695 10.4854 10.3637 10.4854H5.27803V8.77046H9.72503C11.8651 8.77046 13.6 7.03557 13.6 4.89548C13.6 2.75539 11.8651 1.02051 9.72502 1.02051ZM9.72503 7.57046H5.27803V3.12051C5.27803 2.62345 5.68097 2.22051 6.17803 2.22051H9.72502C11.2024 2.22051 12.4 3.41814 12.4 4.89548C12.4 6.37283 11.2024 7.57046 9.72503 7.57046Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Be=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`rouble-icon`,ref:t,icon:ze}))});Be.displayName=`RoubleIcon`;let Ve={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:`M8.5953 11.0279H7.1987Q5.9451 9.0475 5.6418 8.5953Q5.3384 8.1431 5.0035 7.8197Q4.6687 7.4963 4.3739 7.4104Q4.0791 7.3246 3.5926 7.3246H2.3104V11.0279H1.2V2.6367H4.9148Q5.6761 2.6367 6.1912 2.734Q6.7064 2.8313 7.0956 3.1433Q7.4848 3.4552 7.6938 3.9303Q7.9027 4.4054 7.9027 4.932Q7.9027 5.8822 7.3017 6.4603Q6.7007 7.0384 5.5502 7.1929V7.2158Q6.3916 7.5879 7.13 8.7441L8.5953 11.0279ZM2.3104 6.3286H4.6916Q5.4128 6.3286 5.8335 6.2056Q6.2542 6.0825 6.5061 5.7276Q6.7579 5.3727 6.7579 4.932Q6.7579 4.3596 6.3401 3.9589Q5.9222 3.5582 4.9606 3.5582H2.3104V6.3286ZM10.4842 5.7391Q11.0623 4.8175 12.2185 4.8175Q13.4148 4.8175 14.1074 5.6847Q14.8 6.5519 14.8 7.9428Q14.8 9.4253 14.033 10.2981Q13.266 11.171 12.1498 11.171Q11.171 11.171 10.5815 10.3926H10.5529V13.3633H9.5226V4.9549H10.4613V5.7391H10.4842ZM12.0811 10.3239Q12.8024 10.3239 13.2746 9.7258Q13.7468 9.1276 13.7468 7.9428Q13.7468 6.8266 13.2918 6.2256Q12.8367 5.6246 12.1269 5.6246Q11.3943 5.6246 10.9221 6.2943Q10.4498 6.964 10.4498 8.0286Q10.4498 9.1562 10.902 9.7401Q11.3542 10.3239 12.0811 10.3239Z`}}]},He=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`rupiah-icon`,ref:t,icon:Ve}))});He.displayName=`RupiahIcon`;let Ue={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.8 9.4486H12.955L11.8883 13.2829H10.5477L9.4811 9.4486H6.5189L5.4378 13.2829H4.0108L2.9874 9.4486H1.2V8.4685H2.7351L2.4541 7.409H1.2V6.436H2.1946L1.2 2.7171H2.6342L3.4919 6.436H6.1153L7.182 2.7171H8.8613L9.9135 6.436H12.4649L13.3802 2.7171H14.8L13.7622 6.436H14.8V7.409H13.5099L13.2144 8.4685H14.8V9.4486ZM8.645 6.436Q8.0757 4.3676 7.9892 4Q7.8667 4.6342 7.3261 6.436H8.645ZM12.2414 7.409H10.209L10.5045 8.4685H11.9748L12.2414 7.409ZM9.2144 8.4685L8.9189 7.409H7.0739L6.7856 8.4685H9.2144ZM5.8559 7.409H3.7297L3.9748 8.4685H5.5604L5.8559 7.409ZM11.7586 9.4486H10.7351Q11.0955 11.1063 11.1964 11.8054L11.7586 9.4486ZM5.2937 9.4486H4.1838Q4.573 11.1063 4.7027 11.8054Q4.955 10.7315 5.2937 9.4486Z`}}]},We=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`won-icon`,ref:t,icon:Ue}))});We.displayName=`WonIcon`;let Ge={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:`M10.092 14.8H1.3716V13.4548L7.6428 6.2652Q6.5389 6.3302 5.7596 6.3302H1.7334V4.9572H9.7858V6.0426L4.4516 12.2767Q4.2939 12.4715 3.6352 13.1858Q3.4775 13.3342 3.4218 13.4363Q4.3774 13.3528 5.5277 13.3528H10.092V14.8ZM14.6284 6.9888L13.376 8.0557V14.8H11.7247V9.4843L10.5094 10.4862V9.0205L11.7247 8.0186V1.2H13.376V6.5899L14.6284 5.5323V6.9888Z`}}]},G=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(L,Object.assign({},e,{id:`zloty-icon`,ref:t,icon:Ge}))});G.displayName=`ZlotyIcon`;let K=(0,u.createContext)([]),q=class{constructor(e){this._localStorageService=e}_getKey(e){return`userHabitController_${e}`}async addHabit(e,t){let n=this._getKey(e);return this._localStorageService.getItem(n).then(e=>{e||this._localStorageService.setItem(n,t)})}markHabit(e,t){let n=this._getKey(e);this._localStorageService.getItem(n).then(e=>{if(e){let r=e.findIndex(e=>e===t);r>-1&&e.splice(r,1),e.unshift(t),this._localStorageService.setItem(n,e)}})}async getHabit(e,t){let n=this._getKey(e),r=await this._localStorageService.getItem(n);if(t&&r){let e=r.map((e,t,n)=>({value:e,priority:n.length-t}));return t.sort((t,n)=>{var r,i;let a=((r=e.find(e=>e.value===t))==null?void 0:r.priority)||-1;return(((i=e.find(e=>e.value===n))==null?void 0:i.priority)||-1)-a})}return r||[]}deleteHabit(e){this._localStorageService.removeItem(e)}};q=y([v(0,(0,r.Inject)(r.ILocalStorageService))],q);let Ke=e=>!!(0,t.getCurrencyType)(e)&&e.startsWith(`_(`);function qe(e){let{defaultPattern:i,onActionChange:a,onChange:o}=e,[s,c]=(0,u.useState)(()=>(0,t.getDecimalFromPattern)(i||``,2)),f=(0,u.useContext)(K),[p,m]=(0,u.useState)(()=>(0,t.getCurrencyType)(i)||f[0]),h=(0,u.useMemo)(()=>f.map(e=>({label:e,value:e})),[]),g=(0,n.useDependency)(r.LocaleService);return(0,u.useLayoutEffect)(()=>{a(()=>(0,t.setPatternDecimal)(`_("${p}"* #,##0${s>0?`.0`:``}_)`,s))},[s,a,p]),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`univer-mt-4 univer-flex univer-justify-between`,children:[(0,d.jsxs)(`div`,{className:`option`,children:[(0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:g.t(`sheets-numfmt-ui.decimalLength`)}),(0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-32`,children:(0,d.jsx)(l.InputNumber,{value:s,step:1,precision:0,max:20,min:0,onChange:e=>{let n=e||0;c(n),o((0,t.setPatternDecimal)(`_("${p}"* #,##0${n>0?`.0`:``}_)`,n))}})})]}),(0,d.jsxs)(`div`,{className:`option`,children:[(0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:g.t(`sheets-numfmt-ui.currencyType`)}),(0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-36`,children:(0,d.jsx)(l.Select,{options:h,value:p,onChange:e=>{m(e),o((0,t.setPatternDecimal)(`_("${e}"* #,##0${s>0?`.0`:``}_)`,s))}})})]})]}),(0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:g.t(`sheets-numfmt-ui.accountingDes`)})]})}let Je=e=>!!(0,t.getCurrencyType)(e)&&!e.startsWith(`_(`);function Ye(e){let{onActionChange:i,onChange:a}=e,o=(0,n.useDependency)(r.LocaleService),s=(0,u.useContext)(K),[c,f]=(0,u.useState)(()=>(0,t.getCurrencyType)(e.defaultPattern)||s[0]),[p,m]=(0,u.useState)(()=>(0,t.getDecimalFromPattern)(e.defaultPattern||``,2)),[h,g]=(0,u.useState)(()=>{var n;let i=(0,t.getCurrencyFormatOptions)(c);return((n=i.find(t=>(0,r.isPatternEqualWithoutDecimal)(t.value,e.defaultPattern)))==null?void 0:n.value)||i[0].value}),_=(0,u.useMemo)(()=>(0,t.getCurrencyFormatOptions)(c),[c]),v=(0,u.useMemo)(()=>s.map(e=>({label:e,value:e})),[s]);return(0,u.useLayoutEffect)(()=>{i(()=>(0,t.setPatternDecimal)(h,p))},[p,i,h]),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`univer-mt-4 univer-flex univer-justify-between`,children:[(0,d.jsxs)(`div`,{className:`option`,children:[(0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.decimalLength`)}),(0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-32`,children:(0,d.jsx)(l.InputNumber,{value:p,max:20,min:0,onChange:e=>{m(e||0),a((0,t.setPatternDecimal)(h,e||0))}})})]}),(0,d.jsxs)(`div`,{className:`option`,children:[(0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.currencyType`)}),(0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-36`,children:(0,d.jsx)(l.Select,{value:c,options:v,onChange:e=>{if(e===void 0)return;f(e);let n=(0,t.getCurrencyFormatOptions)(e)[0].value;g(n),a((0,t.setPatternDecimal)(n,p))}})})]})]}),(0,d.jsx)(`div`,{className:`label univer-mt-4`,children:o.t(`sheets-numfmt-ui.negType`)}),(0,d.jsx)(`div`,{className:`univer-mt-2`,children:(0,d.jsx)(l.SelectList,{value:h,options:_,onChange:e=>{e!==void 0&&(g(e),a((0,t.setPatternDecimal)(e,p)))}})}),(0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.currencyDes`)})]})}let J=`customFormat`,Y=`numfmt_custom_pattern`;function Xe(e){let{defaultPattern:i,onActionChange:a,onChange:o}=e,s=(0,n.useDependency)(q),c=(0,n.useDependency)(r.ILocalStorageService),f=(0,n.useDependency)(r.LocaleService),p=(0,n.useObservable)(f.currentLocale$,f.getCurrentLocale()),[m,h]=(0,u.useState)(i);(0,u.useLayoutEffect)(()=>{a(()=>(s.markHabit(J,m),c.getItem(Y).then((e=[])=>{let t=[...new Set([m,...e||[]])].splice(0,10).filter(e=>!!e);return c.setItem(Y,t)}).catch(console.error),m))},[c,a,m,s]);let[g,_]=(0,u.useState)([]);(0,u.useEffect)(()=>{let e=!1;return c.getItem(Y).then(e=>{let n=[...t.CURRENCYFORMAT.map(e=>e.suffix(`$`)),...(0,t.getDateFormatOptions)(p).map(e=>e.value),...t.NUMBERFORMAT.map(e=>e.suffix),...e??[]];return s.addHabit(J,[]).then(()=>s.getHabit(J,n))}).then(t=>{e||_([...new Set(t)])}).catch(console.error),()=>{e=!0}},[p,c,s]);let v=e=>{h(e),o(e)};return(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:f.t(`sheets-numfmt-ui.customFormat`)}),(0,d.jsx)(l.Input,{placeholder:f.t(`sheets-numfmt-ui.customFormat`),onBlur:()=>{o(m)},value:m,onChange:h,className:`univer-mt-2 univer-w-full`}),(0,d.jsx)(`div`,{className:(0,l.clsx)(`univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2`,l.borderClassName),children:g.map(e=>(0,d.jsxs)(`div`,{onClick:()=>v(e),className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-1.5 univer-py-1.5 univer-text-sm`,children:[(0,d.jsx)(`div`,{className:`univer-flex univer-w-4 univer-items-center univer-text-primary-600`,children:m===e&&(0,d.jsx)(B,{})}),(0,d.jsx)(`div`,{children:e})]},e))}),(0,d.jsx)(`div`,{className:`univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200`,children:f.t(`sheets-numfmt-ui.customFormatDes`)})]})}let Ze=e=>{let t=r.numfmt.getFormatInfo(e);return[`date`,`datetime`,`time`].includes(t.type)};function Qe(e){let{onActionChange:i,onChange:a,defaultPattern:o}=e,s=(0,n.useDependency)(r.LocaleService),c=(0,n.useObservable)(s.currentLocale$,s.getCurrentLocale()),[f,p]=(0,u.useState)(()=>o||(0,t.getDateFormatOptions)(c)[0].value),m=(0,u.useMemo)(()=>(0,t.getDateFormatOptions)(c,f),[c,f]);return(0,u.useLayoutEffect)(()=>{i(()=>f)},[i,f]),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:s.t(`sheets-numfmt-ui.dateType`)}),(0,d.jsx)(`div`,{className:`univer-mt-2`,children:(0,d.jsx)(l.SelectList,{value:f,options:m,onChange:e=>{typeof e==`string`&&(p(e),a(e))}})}),(0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200`,children:s.t(`sheets-numfmt-ui.dateDes`)})]})}let $e=e=>!e;function et(e){let t=(0,n.useDependency)(r.LocaleService),{onActionChange:i}=e;return(0,u.useLayoutEffect)(()=>{i(()=>``)},[i]),(0,d.jsx)(`div`,{children:(0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200`,children:t.t(`sheets-numfmt-ui.generalDes`)})})}let tt=e=>(0,t.getNumberFormatOptions)().some(t=>(0,r.isPatternEqualWithoutDecimal)(t.value,e));function nt(e){let{onActionChange:i,onChange:a}=e,o=(0,n.useDependency)(r.LocaleService),s=(0,u.useMemo)(t.getNumberFormatOptions,[]),[c,f]=(0,u.useState)(()=>(0,t.getDecimalFromPattern)(e.defaultPattern||``,0)),[p,m]=(0,u.useState)(()=>{let t=s.find(t=>(0,r.isPatternEqualWithoutDecimal)(t.value,e.defaultPattern||``));return(t==null?void 0:t.value)||s[0].value}),h=(0,u.useMemo)(()=>(0,t.setPatternDecimal)(p,Number(c||0)),[p,c]),g=!(0,t.isPatternHasDecimal)(p);return(0,u.useLayoutEffect)(()=>{i(()=>h)},[i,h]),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.decimalLength`)}),(0,d.jsx)(`div`,{className:`univer-mt-2`,children:(0,d.jsx)(l.InputNumber,{disabled:g,value:c,max:20,min:0,onChange:e=>{f(e||0),a((0,t.setPatternDecimal)(p,Number(e||0)))}})}),(0,d.jsxs)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:[` `,o.t(`sheets-numfmt-ui.negType`)]}),(0,d.jsx)(`div`,{className:`univer-mt-2`,children:(0,d.jsx)(l.SelectList,{onChange:e=>{e!==void 0&&(f((0,t.getDecimalFromPattern)(e,0)),m(e),a(e))},options:s,value:p})}),(0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200`,children:o.t(`sheets-numfmt-ui.thousandthPercentileDes`)})]})}let rt=`numfmtCurrency`,it=e=>{let t=(0,n.useDependency)(q),[i,a]=(0,u.useState)(r.currencySymbols);return(0,u.useEffect)(()=>{t.addHabit(`numfmtCurrency`,[]).then(()=>{t.getHabit(rt,[...r.currencySymbols]).then(t=>{a(t),e&&e(t)})})},[]),{userHabitCurrency:i,mark:e=>{t.markHabit(rt,e)}}},at=()=>{let e=(0,u.useRef)([]),[t,n]=(0,u.useState)({});return(0,u.useEffect)(()=>{e.current.forEach(e=>{e()}),e.current=[]},[t]),t=>{e.current.push(t),n({})}},X=[{label:`sheets-numfmt-ui.general`,component:et},{label:`sheets-numfmt-ui.accounting`,component:qe},{label:`sheets-numfmt-ui.currency`,component:Ye},{label:`sheets-numfmt-ui.date`,component:Qe},{label:`sheets-numfmt-ui.thousandthPercentile`,component:nt},{label:`sheets-numfmt-ui.customFormat`,component:Xe}];function ot(e){let{row:t,col:n,defaultPattern:r}=e.value;return(0,u.createElement)(st,{...e,key:`${t}_${n}_${r}`})}function st(e){var i;let{onChange:a}=e,{defaultValue:o,defaultPattern:s,row:c,col:f}=e.value,p=(0,n.useDependency)(r.LocaleService);(0,n.useObservable)(p.currentLocale$,p.getCurrentLocale());let m=(0,u.useRef)(()=>``),h=at(),[g,_]=(0,u.useState)(C),[v,y]=(0,u.useState)(()=>`${c}_${f}_${s}`),{mark:b,userHabitCurrency:x}=it(()=>y(`${c}_${f}_${s}_userCurrency`)),S=(i=X.find(e=>e.label===g))==null?void 0:i.component;function C(){return[$e,Ke,Je,Ze,tt].reduce((e,t,n)=>e||(t(s)?X[n].label:``),``)||`sheets-numfmt-ui.customFormat`}let w=X.map(e=>({label:p.t(e.label),value:e.label})),ee=e=>{_(e),h(()=>a({type:`change`,value:m.current()||``}))},te=(0,u.useCallback)(e=>{a({type:`change`,value:e})},[a]),ne=(0,u.useCallback)(e=>{m.current=e},[]),re=()=>{let e=m.current()||``,n=(0,t.getCurrencyType)(e);n&&b(n),a({type:`confirm`,value:e})},ie=()=>{a({type:`cancel`,value:``})},ae={onChange:te,onActionChange:ne,defaultValue:o,defaultPattern:s};return(0,d.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5`,l.scrollbarClassName),children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm univer-text-gray-400`,children:p.t(`sheets-numfmt-ui.numfmtType`)}),(0,d.jsx)(`div`,{className:`univer-mt-2`,children:(0,d.jsx)(l.Select,{className:`univer-w-full`,value:g,options:w,onChange:ee})}),(0,d.jsx)(`div`,{children:S&&(0,d.jsx)(K.Provider,{value:x,children:(0,u.createElement)(S,{...ae,key:v})})})]}),(0,d.jsxs)(`div`,{className:`univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end univer-gap-2 rtl:univer-flex-row-reverse`,children:[(0,d.jsx)(l.Button,{onClick:ie,children:p.t(`sheets-numfmt-ui.cancel`)}),(0,d.jsx)(l.Button,{variant:`primary`,onClick:re,children:p.t(`sheets-numfmt-ui.confirm`)})]})]})}let Z=class extends r.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerIcons(){this.disposeWithMe(this._iconManager.register({AddDigitsIcon:z,DollarIcon:V,DongIcon:H,EuroIcon:U,PercentIcon:W,ReduceDigitsIcon:Pe,RialIcon:Ie,RmbIcon:Re,RoubleIcon:Be,RupiahIcon:He,WonIcon:We,ZlotyIcon:G}))}_registerComponents(){this.disposeWithMe(this._componentManager.register(`SHEET_NUMFMT_PANEL`,ot)),[[C,ee],[w,te]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};Z=y([v(0,(0,r.Inject)(n.ComponentManager)),v(1,(0,r.Inject)(n.IconManager))],Z);let Q=class extends r.Disposable{constructor(e){super(),this._menuManagerService=e,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(se)}};Q=y([v(0,n.IMenuManagerService)],Q);let $=class extends r.Plugin{constructor(e=O,t,n,i){super(),this._config=e,this._injector=t,this._configService=n,this._renderManagerService=i;let{menu:a,...o}=(0,r.merge)({},O,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(D,o)}onStarting(){this._injector.add([Z]),this._injector.get(Z),(0,r.registerDependencies)(this._injector,[[b],[P],[q],[Q],[N]])}onRendered(){this._registerRenderModules(),(0,r.touchDependencies)(this._injector,[[b],[P],[Q],[N]])}_registerRenderModules(){[[M]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(r.UniverInstanceType.UNIVER_SHEET,e))})}};_($,`pluginName`,`SHEET_NUMFMT_UI_PLUGIN`),_($,`packageName`,T),_($,`version`,E),_($,`type`,r.UniverInstanceType.UNIVER_SHEET),$=y([(0,r.DependentOn)(i.UniverRenderEnginePlugin,a.UniverSheetsPlugin,t.UniverSheetsNumfmtPlugin,o.UniverSheetsUIPlugin),v(1,(0,r.Inject)(r.Injector)),v(2,r.IConfigService),v(3,i.IRenderManagerService)],$),e.SheetsNumfmtUIMenuSchema=se,Object.defineProperty(e,"UniverSheetsNumfmtMobileUIPlugin",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"UniverSheetsNumfmtUIPlugin",{enumerable:!0,get:function(){return $}})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/sheets-numfmt"),require("@univerjs/ui"),require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("rxjs"),require("rxjs/operators"),require("@univerjs/design"),require("react"),require("react/jsx-runtime"),require("@univerjs/engine-formula")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/sheets-numfmt`,`@univerjs/ui`,`@univerjs/core`,`@univerjs/engine-render`,`@univerjs/sheets`,`@univerjs/sheets-ui`,`rxjs`,`rxjs/operators`,`@univerjs/design`,`react`,`react/jsx-runtime`,`@univerjs/engine-formula`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsNumfmtUi={},e.UniverSheetsNumfmt,e.UniverUi,e.UniverCore,e.UniverEngineRender,e.UniverSheets,e.UniverSheetsUi,e.rxjs,e.rxjs.operators,e.UniverDesign,e.React,e.React,e.UniverEngineFormula))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let p={id:`sheet.operation.close.numfmt.panel`,type:r.CommandType.OPERATION,handler:()=>!0};function m(e){"@babel/helpers - typeof";return m=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},m(e)}function h(e,t){if(m(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(m(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g(e){var t=h(e,`string`);return m(t)==`symbol`?t:t+``}function _(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){return function(n,r){t(n,r,e)}}function y(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let b=class extends r.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._sheetInterceptorService=e,this._themeService=t,this._univerInstanceService=n,this._commandService=r,this._selectionManagerService=i,this._renderManagerService=a,this._numfmtService=o,this._sidebarService=s,this._localeService=c,this._sheetsNumfmtCellContentController=l,_(this,`_previewPattern`,``),_(this,`_sidebarDisposable`,null),this._initRealTimeRenderingInterceptor(),this._initCommands(),this._initCloseListener(),this._commandExecutedListener(),this._initNumfmtLocalChange()}_initNumfmtLocalChange(){this.disposeWithMe((0,s.merge)(this._sheetsNumfmtCellContentController.locale$,this._localeService.currentLocale$).subscribe(()=>{this._forceUpdate()}))}openPanel(){var e;let n=this._sidebarService,i=this._selectionManagerService,a=this._commandService,o=this._univerInstanceService,s=this._numfmtService,c=this._localeService,l=(((e=i.getCurrentSelections())==null?void 0:e.map(e=>e.range))||[])[0];if(!l)return!1;let u=o.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET),d=u.getActiveSheet();if(!d)return!1;let f=d.getCellRaw(l.startRow,l.startColumn),m=s.getValue(u.getUnitId(),d.getSheetId(),l.startRow,l.startColumn),h=``;m&&(h=m.pattern);let g=(f==null?void 0:f.t)===r.CellValueType.NUMBER?f.v:12345678,_={onChange:e=>{if(e.type===`change`)this._previewPattern=e.value,this._forceUpdate();else if(e.type===`confirm`){var o;let s=((o=i.getCurrentSelections())==null?void 0:o.map(e=>e.range))||[],c={values:[]},l=(0,t.getPatternType)(e.value);s.forEach(t=>{r.Range.foreach(t,(t,n)=>{c.values.push({row:t,col:n,pattern:e.value,type:l})})}),a.executeCommand(t.SetNumfmtCommand.id,c),n.close()}else e.type===`cancel`&&n.close()},value:{defaultPattern:h,defaultValue:g,row:l.startRow,col:l.startColumn}};return this._sidebarDisposable=n.open({header:{title:c.t(`sheets-numfmt-ui.title`)},children:{label:`SHEET_NUMFMT_PANEL`,..._},onClose:()=>{this._forceUpdate(),a.executeCommand(p.id)}}),!0}_forceUpdate(e){var t,n;let i=e??((t=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getUnitId());if(!i)return;let a=this._renderManagerService.getRenderUnitById(i);a==null||a.with(o.SheetSkeletonManagerService).reCalculate(),a==null||(n=a.mainComponent)==null||n.makeDirty()}_initCommands(){[x,p].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initRealTimeRenderingInterceptor(){let e=new s.Observable(e=>{this._commandService.onCommandExecuted(t=>{t.id===x.id&&e.next(!0),t.id===p.id&&e.next(!1)})}),n=(0,s.combineLatest)([e,this._selectionManagerService.selectionMoveEnd$.pipe((0,c.map)(e=>e?e.map(e=>e.range):[]))]);this.disposeWithMe((0,r.toDisposable)(n.pipe((0,c.switchMap)(([e,t])=>new s.Observable(n=>{let i=new r.DisposableCollection;return e&&t.length&&n.next({selectionRanges:t,disposableCollection:i}),()=>{i.dispose()}})),(0,c.tap)(()=>{this._previewPattern=null})).subscribe(({disposableCollection:e,selectionRanges:n})=>{var i;let o=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET);this.openPanel(),e.add(this._sheetInterceptorService.intercept(a.INTERCEPTOR_POINT.CELL_CONTENT,{priority:99,effect:r.InterceptorEffectEnum.Value|r.InterceptorEffectEnum.Style,handler:(e,i,a)=>{let{row:o,col:s}=i,c=a(e)||{};if(n.find(e=>e.startColumn<=s&&e.endColumn>=s&&e.startRow<=o&&e.endRow>=o)){let e=i.worksheet.getCellRaw(o,s),n=e==null?void 0:e.v,a=e==null?void 0:e.t;if(n==null||a!==r.CellValueType.NUMBER||this._previewPattern===null)return c;let l=(0,t.getPatternPreviewIgnoreGeneral)(this._previewPattern,n,this._sheetsNumfmtCellContentController.locale);if(l.color){let e=this._themeService.getColorFromTheme(`${l.color}.500`)??l.color;return{...c,v:l.result,t:r.CellValueType.STRING,s:{cl:{rgb:e}}}}return{...c,v:l.result,t:r.CellValueType.STRING}}return c}})),(i=this._renderManagerService.getRenderUnitById(o.getUnitId()))==null||(i=i.mainComponent)==null||i.makeDirty()})))}_commandExecutedListener(){let e=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id];this.disposeWithMe(new s.Observable(t=>{let n=this._commandService.onCommandExecuted(n=>{if(e.includes(n.id)){let e=n.params;t.next(e.unitId)}});return()=>n.dispose()}).pipe((0,c.debounceTime)(16)).subscribe(e=>this._forceUpdate(e)))}_initCloseListener(){this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_SHEET).subscribe(e=>{if(!e){var t;(t=this._sidebarDisposable)==null||t.dispose(),this._sidebarDisposable=null}})}};b=y([v(0,(0,r.Inject)(a.SheetInterceptorService)),v(1,(0,r.Inject)(r.ThemeService)),v(2,r.IUniverInstanceService),v(3,r.ICommandService),v(4,(0,r.Inject)(a.SheetsSelectionsService)),v(5,i.IRenderManagerService),v(6,a.INumfmtService),v(7,n.ISidebarService),v(8,(0,r.Inject)(r.LocaleService)),v(9,(0,r.Inject)(t.SheetsNumfmtCellContentController))],b);let x={id:`sheet.operation.open.numfmt.panel`,type:r.CommandType.OPERATION,handler:e=>(e.get(b).openPanel(),!0)},S=e=>[{label:`sheets-numfmt-ui.general`,pattern:null},{label:`sheets-numfmt-ui.text`,pattern:r.DEFAULT_TEXT_FORMAT_EXCEL},`|`,{label:`sheets-numfmt-ui.number`,pattern:`0`},{label:`sheets-numfmt-ui.percent`,pattern:`0.00%`},{label:`sheets-numfmt-ui.scientific`,pattern:`0.00E+00`},`|`,{label:`sheets-numfmt-ui.accounting`,pattern:`"${e}" #,##0.00_);[Red]("${e}"#,##0.00)`},{label:`sheets-numfmt-ui.financialValue`,pattern:`#,##0.00;[Red]#,##0.00`},{label:`sheets-numfmt-ui.currency`,pattern:`"${e}"#,##0.00_);[Red]("${e}"#,##0.00)`},{label:`sheets-numfmt-ui.roundingCurrency`,pattern:`"${e}"#,##0;[Red]"${e}"#,##0`},`|`,{label:`sheets-numfmt-ui.date`,pattern:`yyyy-mm-dd;@`},{label:`sheets-numfmt-ui.time`,pattern:`am/pm h":"mm":"ss`},{label:`sheets-numfmt-ui.dateTime`,pattern:`yyyy-m-d am/pm h:mm`},{label:`sheets-numfmt-ui.timeDuration`,pattern:`[h]:mm:ss`},`|`,{label:`sheets-numfmt-ui.moreFmt`,pattern:``}],C=`sheets-numfmt-ui.moreNumfmtType`,w=`sheets-numfmt-ui.moreNumfmtType.options`;function ee(e){let{value:t}=e,i=(0,n.useDependency)(r.LocaleService),a=t??i.t(`sheets-numfmt-ui.general`);return/* @__PURE__ */ (0,d.jsx)(`span`,{className:`univer-text-sm`,children:a})}function te(){let e=(0,n.useDependency)(r.ICommandService),i=(0,n.useDependency)(r.LocaleService),o=(0,n.useDependency)(r.RegionService),s=(0,n.useDependency)(n.ILayoutService),c=(0,n.useDependency)(t.SheetsNumfmtCellContentController),f=(0,n.useObservable)(i.direction$,i.getDirection()),p=(0,n.useObservable)(o.currentRegion$,o.getCurrentRegion()),m=(0,n.useDependency)(a.SheetsSelectionsService),h=n=>{let i=m.getCurrentLastSelection();if(!i)return;let a=i.range,o=[];r.Range.foreach(a,(e,r)=>{n?o.push({row:e,col:r,pattern:n,type:(0,t.getPatternType)(n)}):o.push({row:e,col:r})}),e.executeCommand(t.SetNumfmtCommand.id,{values:o}),s.focus()},g=(0,u.useMemo)(()=>{let e=(0,t.getCurrencySymbolByLocale)(p);return S(e)},[p]),_=t=>{if(t===0)h(null);else if(t===g.length-1)e.executeCommand(x.id),s.focus();else{let e=g[t];e.pattern&&h(e.pattern)}};return/* @__PURE__ */ (0,d.jsx)(`div`,{dir:f,className:`univer-grid univer-gap-1 univer-p-1.5`,children:g.map((e,n)=>e===`|`?/* @__PURE__ */ (0,d.jsx)(l.Separator,{},n):/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`univer-flex univer-h-7 univer-cursor-default 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:()=>_(n),children:[/* @__PURE__ */ (0,d.jsx)(`span`,{children:i.t(e.label)}),/* @__PURE__ */ (0,d.jsx)(`span`,{className:`univer-text-xs univer-text-gray-500 dark:!univer-text-gray-400`,children:e.pattern?(0,t.getPatternPreview)(e.pattern||``,1220,c.locale).result.trim():``})]},n))})}let ne={currency:`sheets-numfmt-ui.currency`,date:`sheets-numfmt-ui.date`,datetime:`sheets-numfmt-ui.dateTime`,general:`sheets-numfmt-ui.general`,grouped:`sheets-numfmt-ui.number`,number:`sheets-numfmt-ui.number`,percent:`sheets-numfmt-ui.percent`,scientific:`sheets-numfmt-ui.scientific`,text:`sheets-numfmt-ui.text`,time:`sheets-numfmt-ui.time`};function T(e,n){if(!e||(0,r.isDefaultFormat)(e))return`sheets-numfmt-ui.general`;if((0,r.isTextFormat)(e))return`sheets-numfmt-ui.text`;let i=S(n).find(t=>typeof t==`object`&&t.pattern&&(0,r.isPatternEqualWithoutDecimal)(e,t.pattern));return i&&typeof i==`object`?i.label:ne[(0,t.getPatternType)(e)]??`sheets-numfmt-ui.moreFmt`}function E(e){let t=e.get(r.ICommandService),n=e.get(r.IUniverInstanceService),i=e.get(a.SheetsSelectionsService),c=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id,a.SetRangeValuesMutation.id];return(0,o.deriveStateFromActiveSheet$)(n,void 0,({worksheet:e})=>(0,s.merge)(i.selectionChanged$,(0,r.fromCallback)(t.onCommandExecuted.bind(t)).pipe((0,s.filter)(([e])=>c.includes(e.id)))).pipe((0,s.startWith)(null),(0,s.map)(()=>{var t;let n=i.getCurrentLastSelection();if(!n)return;let r=n.primary??n.range;return(t=e.getCellStyle(r.startRow,r.startColumn))==null||(t=t.n)==null?void 0:t.pattern}))).pipe((0,s.distinctUntilChanged)())}function D(e){let i=e.get(r.RegionService);return{icon:i.currentRegion$.pipe((0,s.map)(e=>(0,t.getCurrencySymbolIconByLocale)(e).icon)),id:t.SetCurrencyCommand.id,title:`sheets-numfmt-ui.currency`,tooltip:`sheets-numfmt-ui.currency`,type:n.MenuItemType.BUTTON,activated$:(0,s.combineLatest)([E(e),i.currentRegion$]).pipe((0,s.map)(([e,n])=>!!e&&(0,t.getPatternType)(e)===`currency`&&(0,t.getCurrencyType)(e)===(0,t.getCurrencySymbolIconByLocale)(n).symbol),(0,s.distinctUntilChanged)()),hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function re(e){return{icon:`AddDigitsIcon`,id:t.AddDecimalCommand.id,title:`sheets-numfmt-ui.addDecimal`,tooltip:`sheets-numfmt-ui.addDecimal`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function ie(e){return{icon:`ReduceDigitsIcon`,id:t.SubtractDecimalCommand.id,title:`sheets-numfmt-ui.subtractDecimal`,tooltip:`sheets-numfmt-ui.subtractDecimal`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function ae(e){return{icon:`PercentIcon`,id:t.SetPercentCommand.id,title:`sheets-numfmt-ui.percent`,tooltip:`sheets-numfmt-ui.percent`,type:n.MenuItemType.BUTTON,activated$:E(e).pipe((0,s.map)(e=>!!e&&(0,t.getPatternType)(e)===`percent`),(0,s.distinctUntilChanged)()),hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetEditPermission,a.WorksheetSetCellStylePermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}function oe(e){let i=e.get(r.LocaleService),c=e.get(r.RegionService),l=(0,s.combineLatest)([E(e),c.currentRegion$,i.currentLocale$]).pipe((0,s.map)(([e,n])=>i.t(T(e,(0,t.getCurrencySymbolByLocale)(n)))),(0,s.distinctUntilChanged)());return{label:C,id:x.id,tooltip:`sheets-numfmt-ui.title`,type:n.MenuItemType.SELECTOR,slot:!0,selections:[{label:{name:w,hoverable:!1,selectable:!1}}],value$:l,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetSetCellStylePermission,a.WorksheetEditPermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]})}}let O={[n.RibbonStartGroup.NUMBER]:{[x.id]:{order:9,gridLayout:{row:1,column:1,columnSpan:4,width:160},menuItemFactory:oe},[t.SetPercentCommand.id]:{order:9.1,gridLayout:{row:2,column:1},menuItemFactory:ae},[t.SetCurrencyCommand.id]:{order:9.2,gridLayout:{row:2,column:2},menuItemFactory:D},[t.AddDecimalCommand.id]:{order:9.3,gridLayout:{row:2,column:3},menuItemFactory:re},[t.SubtractDecimalCommand.id]:{order:9.4,gridLayout:{row:2,column:4},menuItemFactory:ie}}};var k=`@univerjs/sheets-numfmt-ui`,A=`1.1.0`;let se=`sheets-numfmt-ui.config`,j={},M={id:`sheet.command.mobile.numfmt.set`,type:r.CommandType.COMMAND,handler:async(e,n)=>{let i=e.get(a.SheetsSelectionsService).getCurrentSelections();if(!(i!=null&&i.length))return!1;let o=(n==null?void 0:n.value)||void 0,s=o?(0,t.getPatternType)(o):void 0,c=[];return i.forEach(e=>{r.Range.foreach(e.range,(e,t)=>c.push({row:e,col:t,pattern:o,type:s}))}),e.get(r.ICommandService).executeCommand(t.SetNumfmtCommand.id,{values:c})}},ce=`sheet.menu.mobile.numfmt`,le=`sheets-numfmt-ui.mobile.custom-format`;function ue(e){let n=S(e).slice(0,-1).map(e=>e===`|`?{divider:!0}:{label:e.label,value:e.pattern});return n.push({label:`sheets-numfmt-ui.customFormat`,custom:!0}),{kind:`number-format`,title:`sheets-numfmt-ui.title`,commandId:M.id,detailTitle:`sheets-numfmt-ui.moreFmt`,customTitle:`sheets-numfmt-ui.customFormat`,customComponent:le,quickOptions:[{label:`sheets-numfmt-ui.percent`,commandId:t.SetPercentCommand.id},{label:`sheets-numfmt-ui.currency`,commandId:t.SetCurrencyCommand.id},{label:`sheets-numfmt-ui.date`,commandId:M.id,value:`yyyy-mm-dd;@`},{label:`sheets-numfmt-ui.text`,commandId:M.id,value:r.DEFAULT_TEXT_FORMAT_EXCEL}],decimalOptions:[{label:`sheets-numfmt-ui.subtractDecimal`,commandId:t.SubtractDecimalCommand.id},{label:`sheets-numfmt-ui.addDecimal`,commandId:t.AddDecimalCommand.id}],detailOptions:n,customPatterns:[.../* @__PURE__ */ new Set([...t.CURRENCYFORMAT.map(t=>t.suffix(e)),...t.NUMBERFORMAT.map(e=>e.suffix)])]}}function de(e){let i=e.get(r.LocaleService),c=e.get(r.RegionService),l=(0,s.combineLatest)([E(e),c.currentRegion$,i.currentLocale$]).pipe((0,s.map)(([e,n])=>i.t(T(e,(0,t.getCurrencySymbolByLocale)(n)))),(0,s.distinctUntilChanged)());return{id:ce,title:`sheets-numfmt-ui.title`,tooltip:`sheets-numfmt-ui.title`,type:n.MenuItemType.SELECTOR,selections:[],value$:l,hidden$:(0,n.getMenuHiddenObservable)(e,r.UniverInstanceType.UNIVER_SHEET),disabled$:(0,o.getCurrentRangeDisable$)(e,{workbookTypes:[a.WorkbookEditablePermission],worksheetTypes:[a.WorksheetSetCellStylePermission,a.WorksheetEditPermission],rangeTypes:[a.RangeProtectionPermissionEditPoint]}),mobileNumberFormat:ue((0,t.getCurrencySymbolByLocale)(c.getCurrentRegion()))}}function fe(e){let{patterns:i,onConfirm:a}=e,o=(0,n.useDependency)(r.LocaleService),s=(0,n.useObservable)(o.currentLocale$,o.getCurrentLocale()),[c,f]=(0,u.useState)(``),p=o.t(`sheets-numfmt-ui.customFormat`),m=(0,u.useMemo)(()=>[.../* @__PURE__ */ new Set([...i,...(0,t.getDateFormatOptions)(s).map(e=>e.value),...c?[c]:[]])].map(e=>({label:e,value:e})),[s,c,i]);return/* @__PURE__ */ (0,d.jsxs)(`div`,{"data-u-comp":`mobile-custom-format`,className:`univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-gap-4`,children:[/* @__PURE__ */ (0,d.jsx)(l.Input,{className:`univer-shrink-0`,"aria-label":p,value:c,placeholder:p,onChange:f}),/* @__PURE__ */ (0,d.jsx)(l.MobileSelect,{className:`univer-w-full univer-shrink-0 [&>div]:univer-font-mono`,value:c||p,options:m,onChange:f}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-flex-1 univer-px-1 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200`,children:o.t(`sheets-numfmt-ui.customFormatDes`)}),/* @__PURE__ */ (0,d.jsx)(l.MobileActionRowGroup,{className:`univer-shrink-0`,children:/* @__PURE__ */ (0,d.jsx)(l.Button,{variant:`primary`,disabled:!c.trim(),onClick:()=>a(c.trim()),children:o.t(`sheets-numfmt-ui.confirm`)})})]})}let N=class extends r.Disposable{constructor(e){super(),this.disposeWithMe(e.register(le,fe))}};N=y([v(0,(0,r.Inject)(n.ComponentManager))],N);let P=class extends r.Disposable{constructor(e,t,n,r,i){super(),this._commandService=e,this._univerInstanceService=t,this._renderManagerService=n,this._localeService=r,this._sheetsNumfmtCellContentController=i,this.disposeWithMe(this._commandService.registerCommand(M)),this._initNumfmtLocalChange(),this._initCommandExecutedListener()}_initNumfmtLocalChange(){this.disposeWithMe((0,s.merge)(this._sheetsNumfmtCellContentController.locale$,this._localeService.currentLocale$).subscribe(()=>this._forceUpdate()))}_initCommandExecutedListener(){let e=[a.RemoveNumfmtMutation.id,a.SetNumfmtMutation.id];this.disposeWithMe(new s.Observable(t=>{let n=this._commandService.onCommandExecuted(n=>{if(e.includes(n.id)){let e=n.params;t.next(e.unitId)}});return()=>n.dispose()}).pipe((0,c.debounceTime)(16)).subscribe(e=>this._forceUpdate(e)))}_forceUpdate(e){var t,n;let i=e??((t=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getUnitId());if(!i)return;let a=this._renderManagerService.getRenderUnitById(i);a==null||a.with(o.SheetSkeletonManagerService).reCalculate(),a==null||(n=a.mainComponent)==null||n.makeDirty()}};P=y([v(0,r.ICommandService),v(1,r.IUniverInstanceService),v(2,i.IRenderManagerService),v(3,(0,r.Inject)(r.LocaleService)),v(4,(0,r.Inject)(t.SheetsNumfmtCellContentController))],P);let F=class extends r.Disposable{constructor(e,t,n,r,i,a,o,s){super(),this._context=e,this._selectionManagerService=t,this._cellAlertManagerService=n,this._localeService=r,this._numfmtService=i,this._configService=a,this._commandService=o,this._univerInstanceService=s,this._init()}_init(){this._initCellAlertPopup()}_initCellAlertPopup(){this.disposeWithMe(this._selectionManagerService.selectionChanged$.subscribe(e=>this._updateAlert(e))),this.disposeWithMe(this._context.unit.activeSheet$.subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections()))),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(r.UniverInstanceType.UNIVER_SHEET).subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections())))}_isCurrentSheet(e){let t=this._selectionManagerService.currentSelectionParam;return!!(e&&(t==null?void 0:t.unitId)===this._context.unit.getUnitId()&&t.sheetId===e.getSheetId())}_updateAlert(e){var n,i;this._hideAlert();let s=this._context.unit,c=s.getActiveSheet();if(!this._isCurrentSheet(c)||(e==null?void 0:e.length)!==1||(n=this._configService.getConfig(t.SHEETS_NUMFMT_PLUGIN_CONFIG_KEY))!=null&&n.disableTextFormatAlert)return;let l=e[0],u=l.primary;if(!u)return;let d=u.actualRow,f=u.actualColumn,p=s.getUnitId(),m=c.getSheetId(),h=c.getCell(d,f),g;if(h!=null&&h.s){var _;g=(_=s.getStyles().get(h.s))==null?void 0:_.n}g||=this._numfmtService.getValue(p,m,d,f);let v=h==null?void 0:h.v,y=(0,r.isRealNum)(v)||typeof v==`string`&&typeof((i=(0,r.getNumfmtParseValueFilter)(v))==null?void 0:i.v)==`number`;if(!(0,r.isTextFormat)(g==null?void 0:g.pattern)||!r.Tools.isDefine(v)||!y)return;let b={...l.range};this._cellAlertManagerService.showAlert({type:o.CellAlertType.WARNING,title:this._localeService.t(`sheets-numfmt-ui.info.error`),message:this._localeService.t(`sheets-numfmt-ui.info.forceStringInfo`),location:{unitId:p,subUnitId:m,row:d,col:f},width:200,height:74,key:this._alertKey,menu:[{label:this._localeService.t(`sheets-numfmt-ui.info.convertToNumber`),onSelect:()=>{this._commandService.syncExecuteCommand(a.TextToNumberCommand.id,{unitId:p,subUnitId:m,ranges:[b]})&&this._hideAlert()}}]})}get _alertKey(){return`SHEET_NUMFMT_ALERT:${this._context.unit.getUnitId()}`}_hideAlert(){this._cellAlertManagerService.removeAlert(this._alertKey)}};F=y([v(1,(0,r.Inject)(a.SheetsSelectionsService)),v(2,(0,r.Inject)(o.CellAlertManagerService)),v(3,(0,r.Inject)(r.LocaleService)),v(4,(0,r.Inject)(a.INumfmtService)),v(5,r.IConfigService),v(6,r.ICommandService),v(7,r.IUniverInstanceService)],F);let I=class extends r.Disposable{constructor(e){super(),this._repeatLastActionService=e,this._initCommandRecording()}_initCommandRecording(){this._repeatLastActionService&&this.disposeWithMe(this._repeatLastActionService.registerRepeatableCommand(t.SetNumfmtCommand.id,(e,t)=>{if(!t)return;let{values:n}=t,r=n.find(e=>e.pattern);if(!r)return;let{pattern:i,type:a}=r,o=[],s=/* @__PURE__ */ new Set;for(let t of e){let{startRow:e,startColumn:n,endRow:r,endColumn:c}=t;for(let t=e;t<=r;t++)for(let e=n;e<=c;e++){let n=`${t}-${e}`;s.has(n)||(s.add(n),o.push({row:t,col:e,pattern:i,type:a}))}}return{...t,values:o}},o.RepeatLastActionPermission.CellStyle))}};I=y([v(0,(0,r.Optional)(o.IRepeatLastActionService))],I);function L(e){if(r.numfmt.getFormatDateInfo(e).isDuration)return`duration`;let t=r.numfmt.getFormatInfo(e).type;return t===`date`||t===`datetime`||t===`time`?t:null}function pe(e,t){var n;let i=((n=r.numfmt.getLocale(t))==null?void 0:n.decimal)??`.`,a=e.lastIndexOf(i);if(a<0)return e;let o=e.indexOf(` `,a),s=o<0?e.length:o,c=s;for(;c>a+1&&e[c-1]===`0`;)c--;return e.slice(0,c)+e.slice(s)}function me(e,t){var n;let i=Math.round(Math.abs(e)*864e5),a=Math.floor(i/36e5),o=Math.floor(i/6e4)%60,s=Math.floor(i/1e3)%60,c=i%1e3,l=c?`${((n=r.numfmt.getLocale(t))==null?void 0:n.decimal)??`.`}${String(c).padStart(3,`0`).replace(/0+$/,``)}`:``;return`${e<0?`-`:``}${a}:${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}${l}`}function he(e){let{serial:t,pattern:n,locale:i,dateSystem:a}=e,o=L(n);if(!o||!Number.isFinite(t)||t<0&&o!==`duration`)return null;if(o===`duration`)return me(t,i);let s=(0,r.excelSerialToDateTimeParts)(t,{dateSystem:a});if(!s)return null;let c=Math.round(s.fractionalSecond*1e3)>0,l=r.numfmt.getDateTimeEditPattern(n,t);if(!l)return null;let u=r.numfmt.format(l,t,{locale:i,dateSystem:a,throws:!1});return c?pe(u,i):u}function ge(e,t){var n;let i=((n=r.numfmt.getLocale(t))==null?void 0:n.decimal)??`.`,a=i===`.`?e:e.replace(i,`.`),o=/^\s*([+-])?(\d+):([0-5]?\d):([0-5]?\d)(\.\d{1,10})?\s*$/.exec(a);if(!o)return null;let s=o[1]===`-`?-1:1,c=Number(o[2]),l=Number(o[3]),u=Number(o[4]),d=Number(o[5]??0);return s*(c*3600+l*60+u+d)/86400}function _e(e){let{content:t,originalSerial:n,pattern:i,locale:a,dateSystem:o}=e,s=L(i);if(!s||!Number.isFinite(n)||n<0&&s!==`duration`)return null;if(s===`duration`)return ge(t,a);if(s===`time`){let e=r.numfmt.parseTime(t,{locale:a,dateSystem:o});return e?Math.floor(n)+Number(e.v):null}let c=r.numfmt.parseDate(t,{locale:a,dateSystem:o});return!c||typeof c.v!=`number`?null:s===`date`?Math.floor(c.v)+(n-Math.floor(n)):c.v}let ve=()=>{let e=[];return{add:(t,n,r,i,a)=>e.push({unitId:t,subUnitId:n,row:r,col:i,value:a}),getEffects:()=>e,clean:()=>{e=[]}}},R=class extends r.Disposable{constructor(e,t,n,r,i,a){super(),this._sheetInterceptorService=e,this._numfmtService=t,this._univerInstanceService=n,this._injector=r,this._sheetsNumfmtCellContentController=i,this._editorBridgeService=a,_(this,`_collectEffectMutation`,ve()),this._initInterceptorEditorStart(),this._initInterceptorEditorEnd(),this._initInterceptorCommands()}_initInterceptorEditorStart(){this._editorBridgeService&&this.disposeWithMe((0,r.toDisposable)(this._sheetInterceptorService.writeCellInterceptor.intercept(a.BEFORE_CELL_EDIT,{handler:(e,n,i)=>{let a=n.row,o=n.col,s=this._numfmtService.getValue(n.unitId,n.subUnitId,a,o);if(s){let c=n.worksheet.getCellRaw(a,o);if(!(c!=null&&c.f)&&(c==null?void 0:c.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(c.v)){let e=he({serial:Number(c.v),pattern:s.pattern,locale:this._sheetsNumfmtCellContentController.getLocale(n.workbook),dateSystem:n.workbook.getDateSystem()});if(e!=null)return i&&i({...c,v:e})}switch((0,t.getPatternType)(s.pattern)){case`scientific`:case`currency`:case`grouped`:case`number`:{let e={...n.worksheet.getCellRaw(a,o)};return(e==null?void 0:e.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(e.v)&&(e.v=(0,f.stripErrorMargin)(Number(e.v))),i&&i(e)}case`percent`:{let e={...n.worksheet.getCellRaw(a,o)};return(e==null?void 0:e.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(e.v)&&(e.v=`${(0,f.stripErrorMargin)(Number(e.v)*100)}%`,e.isPercentFormat=!0),i&&i(e)}default:return i&&i(e)}}return i(e)}})))}_initInterceptorEditorEnd(){this.disposeWithMe((0,r.toDisposable)(this._sheetInterceptorService.writeCellInterceptor.intercept(a.AFTER_CELL_EDIT,{handler:(e,n,i)=>{var a,o;if(!(e!=null&&e.v)&&!(e!=null&&e.p))return i(e);this._collectEffectMutation.clean();let s=this._numfmtService.getValue(n.unitId,n.subUnitId,n.row,n.col),c=n.worksheet.getCellRaw(n.row,n.col);if((0,r.isTextFormat)(s==null?void 0:s.pattern)||e.t===r.CellValueType.FORCE_STRING)return i(e);let l=(a=e.p)==null?void 0:a.body,u=e!=null&&(o=e.p)!=null&&(o=o.body)!=null&&o.dataStream?e.p.body.dataStream.replace(/\r\n$/,``):String(e.v),d=this._sheetsNumfmtCellContentController.getLocale(n.workbook),p=n.workbook.getDateSystem(),m=(0,r.getNumfmtParseValueFilter)(u,{locale:d,dateSystem:p});if(l){if(ye(l)){let{dataStream:t}=l,n=t.replace(/\r\n$/,``),r=Number(n);if(Number.isNaN(r)&&!m)return i(e)}else return i(e)}if(s!=null&&s.pattern&&(c==null?void 0:c.t)===r.CellValueType.NUMBER&&(0,r.isRealNum)(c.v)){let t=_e({content:u,originalSerial:Number(c.v),pattern:s.pattern,locale:d,dateSystem:p});if(t!=null)return i({...e,p:void 0,v:(0,f.stripErrorMargin)(t,16),t:r.CellValueType.NUMBER})}if(m){if(!m.z&&!(s!=null&&s.pattern)&&(c==null?void 0:c.t)!==r.CellValueType.STRING&&(c==null?void 0:c.t)!==r.CellValueType.FORCE_STRING&&(0,r.willLoseNumericPrecision)(u))return i({...e,p:void 0,v:u,t:r.CellValueType.FORCE_STRING});m.z&&(!(s!=null&&s.pattern)||(0,t.getPatternType)(m.z)!==(0,t.getPatternType)(s.pattern))&&this._collectEffectMutation.add(n.unitId,n.subUnitId,n.row,n.col,{pattern:m.z});let a=(0,f.stripErrorMargin)(Number(m.v),16);return i({...e,p:void 0,v:a,t:r.CellValueType.NUMBER})}return i(e)}})))}_initInterceptorCommands(){let e=this;this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations(t){switch(t.id){case a.SetRangeValuesCommand.id:{let n=e._collectEffectMutation.getEffects();if(e._collectEffectMutation.clean(),!n.length)return{redos:[],undos:[]};let r=(0,a.getSheetCommandTarget)(e._univerInstanceService,t.params);if(!r)return{redos:[],undos:[]};let{unitId:i,subUnitId:o}=r,s=n.filter(e=>e.unitId===i&&e.subUnitId===o),c=s.filter(e=>{var t;return!!((t=e.value)!=null&&t.pattern)}).map(e=>({row:e.row,col:e.col,pattern:e.value.pattern})),l=s.filter(e=>{var t;return!((t=e.value)!=null&&t.pattern)}).map(e=>({startRow:e.row,endColumn:e.col,startColumn:e.col,endRow:e.row})),u=[],d=[];if(c.length){let t={id:a.SetNumfmtMutation.id,params:(0,a.transformCellsToRange)(i,o,c)};u.push(t),d.push(...(0,a.factorySetNumfmtUndoMutation)(e._injector,t.params))}if(l.length){let t={id:a.RemoveNumfmtMutation.id,params:{unitId:i,subUnitId:o,ranges:l}};u.push(t),d.push(...(0,a.factoryRemoveNumfmtUndoMutation)(e._injector,t.params))}return{redos:u,undos:d.reverse()}}}return{redos:[],undos:[]}}}))}dispose(){super.dispose(),this._collectEffectMutation.clean()}};R=y([v(0,(0,r.Inject)(a.SheetInterceptorService)),v(1,(0,r.Inject)(a.INumfmtService)),v(2,(0,r.Inject)(r.IUniverInstanceService)),v(3,(0,r.Inject)(r.Injector)),v(4,(0,r.Inject)(t.SheetsNumfmtCellContentController)),v(5,(0,r.Optional)(o.IEditorBridgeService))],R);function ye(e){let{textRuns:t=[],paragraphs:n=[],customRanges:r,customBlocks:i=[]}=e,a=[`va`];return!(t.some(e=>!!(e.ts&&Object.keys(e.ts).some(e=>a.includes(e))))||n.some(e=>e.bullet)||n.length>=2||r!=null&&r.length||i.length>0)}let be={[n.RibbonStartGroup.NUMBER]:{[ce]:{order:9,menuItemFactory:de}}},z=class extends r.Disposable{constructor(e){super(),e.mergeMenu(be)}};z=y([v(0,n.IMenuManagerService)],z);let B=class extends r.Plugin{constructor(e=j,t,n,i){super(),this._config=e,this._injector=t,this._configService=n,this._renderManagerService=i;let{menu:a,...o}=(0,r.merge)({},j,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(se,o)}onStarting(){(0,r.registerDependencies)(this._injector,[[N],[P],[R],[z],[I]]),(0,r.touchDependencies)(this._injector,[[N],[P]])}onRendered(){[[F]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(r.UniverInstanceType.UNIVER_SHEET,e))}),(0,r.touchDependencies)(this._injector,[[R],[z],[I]])}};_(B,`pluginName`,`SHEET_NUMFMT_UI_PLUGIN`),_(B,`packageName`,k),_(B,`version`,A),_(B,`type`,r.UniverInstanceType.UNIVER_SHEET),B=y([(0,r.DependentOn)(i.UniverRenderEnginePlugin,a.UniverSheetsPlugin,t.UniverSheetsNumfmtPlugin,o.UniverSheetsMobileUIPlugin,n.UniverMobileUIPlugin),v(1,(0,r.Inject)(r.Injector)),v(2,r.IConfigService),v(3,i.IRenderManagerService)],B);function V({ref:e,...t}){let{preserveStrokeWidth:n,icon:r,id:i,className:a,extend:o,...s}=t,c=`univerjs-icon univerjs-icon-${i} ${a||``}`.trim(),l=`_${(0,u.useId)()}`,d=(0,u.useRef)(null);return(0,u.useImperativeHandle)(e,()=>d.current),(0,u.useLayoutEffect)(()=>{if(n&&d.current&&d.current.localName===r.tag)return Ce(d.current)},[n,r]),H(r,`${i}`,{defIds:r.defIds,idSuffix:l},{ref:d,className:c,...s},o)}function H(e,t,n,r,i){return(0,u.createElement)(e.tag,{key:t,...xe(e,n,i),...r},(Se(e,n).children||[]).map((r,a)=>H(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function xe(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0||(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))})),r}function Se(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function Ce(e){let t=e.viewBox.baseVal,n=Math.max(t.width,t.height);if(!Number.isFinite(n)||n<=0||t.width<=0||t.height<=0)return()=>void 0;let r=16/n,i=Array.from(e.querySelectorAll(`circle, ellipse, line, path, polygon, polyline, rect, text, textPath, tspan, use`)).flatMap(e=>{let t=getComputedStyle(e),n=Number.parseFloat(t.strokeWidth);return t.stroke===`none`||Number.parseFloat(t.strokeOpacity)===0||t.vectorEffect===`non-scaling-stroke`||!Number.isFinite(n)||n<=0?[]:[{element:e,hadStyleAttribute:e.hasAttribute(`style`),originalStrokeWidth:n,strokeWidth:we(e.style,`stroke-width`)}]}).map(e=>({appliedStrokeWidth:null,element:e.element,hadStyleAttribute:e.hadStyleAttribute,isReleased:!1,originalStrokeWidth:e.originalStrokeWidth,strokeWidth:e.strokeWidth}));if(i.length===0)return()=>void 0;let a=(e,n)=>{if(t.width<=0||t.height<=0||e<=0||n<=0)return;let a=Math.min(e/t.width,n/t.height);!Number.isFinite(a)||a<=0||i.forEach(e=>{if(e.isReleased)return;if(e.appliedStrokeWidth!==null&&(e.element.style.getPropertyValue(`stroke-width`)!==e.appliedStrokeWidth||e.element.style.getPropertyPriority(`stroke-width`)!==e.strokeWidth.priority)){e.appliedStrokeWidth=null,e.isReleased=!0;return}let t=e.originalStrokeWidth*r/a,n=`${Number(t.toFixed(12))}px`;e.element.style.setProperty(`stroke-width`,n,e.strokeWidth.priority),e.appliedStrokeWidth=n})},o=e.getBoundingClientRect();a(o.width,o.height);let s=typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{if(t.some(t=>t.target===e)){let t=e.getBoundingClientRect();a(t.width,t.height)}});return s==null||s.observe(e),()=>{s==null||s.disconnect(),i.forEach(e=>{e.appliedStrokeWidth!==null&&(Te(e.element.style,`stroke-width`,e.appliedStrokeWidth,e.strokeWidth.priority,e.strokeWidth),!e.hadStyleAttribute&&e.element.style.length===0&&e.element.removeAttribute(`style`))})}}function we(e,t){return{priority:e.getPropertyPriority(t),value:e.getPropertyValue(t)}}function Te(e,t,n,r,i){e.getPropertyValue(t)===n&&e.getPropertyPriority(t)===r&&(i.value?e.setProperty(t,i.value,i.priority):e.removeProperty(t))}V.displayName=`UniverIcon`;let Ee={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:`M4.06641 3.49366C4.06641 2.27555 5.14145 1.3916 6.33307 1.3916C7.52469 1.3916 8.59974 2.27555 8.59974 3.49366V6.49777C8.59974 7.71586 7.52469 8.59982 6.33307 8.59982C5.14145 8.59982 4.06641 7.71586 4.06641 6.49777V3.49366ZM6.33307 2.5916C5.68376 2.5916 5.26641 3.05264 5.26641 3.49366V6.49777C5.26641 6.93878 5.68376 7.39982 6.33307 7.39982C6.98239 7.39982 7.39974 6.93878 7.39974 6.49777V3.49366C7.39974 3.05264 6.98239 2.5916 6.33307 2.5916Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.0664 3.49366C10.0664 2.27555 11.1415 1.3916 12.3331 1.3916C13.5247 1.3916 14.5997 2.27555 14.5997 3.49366V6.49777C14.5997 7.71586 13.5247 8.59982 12.3331 8.59982C11.1415 8.59982 10.0664 7.71586 10.0664 6.49777V3.49366ZM12.3331 2.5916C11.6838 2.5916 11.2664 3.05264 11.2664 3.49366V6.49777C11.2664 6.93878 11.6838 7.39982 12.3331 7.39982C12.9824 7.39982 13.3997 6.93878 13.3997 6.49777V3.49366C13.3997 3.05264 12.9824 2.5916 12.3331 2.5916Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.4242 9.5417C12.1899 9.30739 11.81 9.30739 11.5756 9.5417C11.3413 9.77602 11.3413 10.1559 11.5756 10.3902L12.5514 11.366H6.3334C6.00203 11.366 5.7334 11.6346 5.7334 11.966C5.7334 12.2973 6.00203 12.566 6.3334 12.566H12.5514L11.5756 13.5417C11.3413 13.776 11.3413 14.1559 11.5756 14.3902C11.81 14.6245 12.1899 14.6245 12.4242 14.3902L14.4159 12.3985C14.5294 12.2893 14.6001 12.1359 14.6001 11.966C14.6001 11.796 14.5294 11.6426 14.4159 11.5334L12.4242 9.5417Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 8.3002C1.3999 7.96882 1.66853 7.7002 1.9999 7.7002H2.33324C2.66461 7.7002 2.93324 7.96882 2.93324 8.3002C2.93324 8.63157 2.66461 8.9002 2.33324 8.9002H1.9999C1.66853 8.9002 1.3999 8.63157 1.3999 8.3002Z`}}]},U=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`add-digits-icon`,ref:t,icon:Ee}))});U.displayName=`AddDigitsIcon`;let De={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`}}]},W=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`check-mark-icon`,ref:t,icon:De}))});W.displayName=`CheckMarkIcon`;let Oe={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:`M7.3999 2.8999V1.6C7.3999 1.26863 7.66853 1 7.9999 1C8.33127 1 8.5999 1.26863 8.5999 1.6V2.8999H10.2044C11.6655 2.8999 12.8499 4.08431 12.8499 5.54536C12.8499 5.87673 12.5813 6.14536 12.2499 6.14536C11.9185 6.14536 11.6499 5.87673 11.6499 5.54536C11.6499 4.74705 11.0028 4.0999 10.2044 4.0999H5.7384C4.97155 4.0999 4.3499 4.72155 4.3499 5.4884C4.3499 6.14439 4.80899 6.71087 5.45074 6.84677L10.7977 7.97906C11.994 8.23242 12.8499 9.28849 12.8499 10.5114C12.8499 11.941 11.691 13.0999 10.2614 13.0999H8.5999V14.4C8.5999 14.7314 8.33127 15 7.9999 15C7.66853 15 7.3999 14.7314 7.3999 14.4V13.0999H5.79536C4.33431 13.0999 3.1499 11.9155 3.1499 10.4544C3.1499 10.1231 3.41853 9.85445 3.7499 9.85445C4.08127 9.85445 4.3499 10.1231 4.3499 10.4544C4.3499 11.2527 4.99705 11.8999 5.79536 11.8999H10.2614C11.0283 11.8999 11.6499 11.2782 11.6499 10.5114C11.6499 9.85542 11.1908 9.28893 10.5491 9.15303L5.20214 8.02074C4.00575 7.76739 3.1499 6.71132 3.1499 5.4884C3.1499 4.05881 4.30881 2.8999 5.7384 2.8999H7.3999Z`}}]},G=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`dollar-icon`,ref:t,icon:Oe}))});G.displayName=`DollarIcon`;let ke={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:`M12.2058 3.459H11.2416V12.6604H9.6438V11.6962Q8.9091 12.844 7.4858 12.844Q5.8971 12.844 4.8456 11.6686Q3.7942 10.4932 3.7942 8.5739Q3.7942 6.5904 4.7814 5.4471Q5.7685 4.3038 7.4031 4.3038Q8.9183 4.3038 9.5887 5.3415V3.459H7.5041V2.1091H9.5887V1.2H11.2416V2.1091H12.2058V3.459ZM7.6143 11.4941Q8.5234 11.4941 9.0744 10.8008Q9.6254 10.1075 9.6254 8.7484Q9.6254 5.6629 7.5592 5.6629Q6.5491 5.6629 6.0211 6.4297Q5.493 7.1965 5.493 8.5923Q5.493 11.4941 7.6143 11.4941ZM11.2416 14.8H4.0421V13.4501H11.2416V14.8Z`}}]},Ae=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`dong-icon`,ref:t,icon:ke}))});Ae.displayName=`DongIcon`;let je={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:`M5.84964 5.80918C6.71946 3.63548 8.84516 2.2 11.3295 2.2C11.8324 2.2 12.3198 2.26279 12.7846 2.38065C13.1058 2.46209 13.4322 2.26773 13.5137 1.94652C13.5951 1.62532 13.4008 1.2989 13.0795 1.21746C12.5191 1.07535 11.9327 1 11.3295 1C8.17278 1 5.49724 2.96009 4.57394 5.80918H3.06582C2.73445 5.80918 2.46582 6.07781 2.46582 6.40918C2.46582 6.74055 2.73445 7.00918 3.06582 7.00918H4.29808C4.25287 7.33297 4.22949 7.66376 4.22949 8C4.22949 8.33608 4.25284 8.6667 4.29801 8.99033H3.06582C2.73445 8.99033 2.46582 9.25896 2.46582 9.59033C2.46582 9.9217 2.73445 10.1903 3.06582 10.1903H4.57378C5.49693 13.0397 8.1726 15 11.3295 15C11.9336 15 12.5209 14.9244 13.0821 14.7819C13.4033 14.7003 13.5975 14.3738 13.5159 14.0527C13.4344 13.7315 13.1079 13.5373 12.7867 13.6188C12.3213 13.737 11.8332 13.8 11.3295 13.8C8.84497 13.8 6.71914 12.3643 5.84944 10.1903H11.4291C11.7605 10.1903 12.0291 9.9217 12.0291 9.59033C12.0291 9.25896 11.7605 8.99033 11.4291 8.99033H5.51225C5.45783 8.66834 5.42949 8.33748 5.42949 8C5.42949 7.66235 5.45786 7.33133 5.51233 7.00918H11.4291C11.7605 7.00918 12.0291 6.74055 12.0291 6.40918C12.0291 6.07781 11.7605 5.80918 11.4291 5.80918H5.84964Z`}}]},Me=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`euro-icon`,ref:t,icon:je}))});Me.displayName=`EuroIcon`;let Ne={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:`M1.85059 4.06725C1.85059 2.84302 2.84302 1.85059 4.06725 1.85059C5.29148 1.85059 6.28392 2.84302 6.28392 4.06725C6.28392 5.29148 5.29148 6.28392 4.06725 6.28392C2.84302 6.28392 1.85059 5.29148 1.85059 4.06725ZM4.06725 2.95059C3.45053 2.95059 2.95059 3.45053 2.95059 4.06725C2.95059 4.68397 3.45053 5.18392 4.06725 5.18392C4.68397 5.18392 5.18392 4.68397 5.18392 4.06725C5.18392 3.45053 4.68397 2.95059 4.06725 2.95059Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.7168 11.933C9.7168 10.7087 10.7092 9.71631 11.9335 9.71631C13.1577 9.71631 14.1501 10.7087 14.1501 11.933C14.1501 13.1572 13.1577 14.1496 11.9335 14.1496C10.7092 14.1496 9.7168 13.1572 9.7168 11.933ZM11.9335 10.8163C11.3167 10.8163 10.8168 11.3163 10.8168 11.933C10.8168 12.5497 11.3167 13.0496 11.9335 13.0496C12.5502 13.0496 13.0501 12.5497 13.0501 11.933C13.0501 11.3163 12.5502 10.8163 11.9335 10.8163Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.5241 3.32407C13.7584 3.08975 13.7584 2.70986 13.5241 2.47554C13.2898 2.24123 12.9099 2.24123 12.6755 2.47554L2.47554 12.6755C2.24123 12.9099 2.24123 13.2898 2.47554 13.5241C2.70986 13.7584 3.08975 13.7584 3.32407 13.5241L13.5241 3.32407Z`}}]},Pe=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`percent-icon`,ref:t,icon:Ne}))});Pe.displayName=`PercentIcon`;let Fe={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:`M6.33307 1.3916C5.14145 1.3916 4.06641 2.27555 4.06641 3.49366V6.49777C4.06641 7.71586 5.14145 8.59982 6.33307 8.59982C7.52469 8.59982 8.59974 7.71586 8.59974 6.49777V3.49366C8.59974 2.27555 7.52469 1.3916 6.33307 1.3916ZM5.26641 3.49366C5.26641 3.05264 5.68376 2.5916 6.33307 2.5916C6.98239 2.5916 7.39974 3.05264 7.39974 3.49366V6.49777C7.39974 6.93878 6.98239 7.39982 6.33307 7.39982C5.68376 7.39982 5.26641 6.93878 5.26641 6.49777V3.49366Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.90913 9.5417C8.14345 9.30739 8.52335 9.30739 8.75766 9.5417C8.99198 9.77602 8.99198 10.1559 8.75766 10.3902L7.78193 11.366H13.9999C14.3313 11.366 14.5999 11.6346 14.5999 11.966C14.5999 12.2973 14.3313 12.566 13.9999 12.566H7.78193L8.75766 13.5417C8.99198 13.776 8.99198 14.1559 8.75766 14.3902C8.52335 14.6245 8.14345 14.6245 7.90913 14.3902L5.91739 12.3985C5.80388 12.2893 5.73324 12.1359 5.73324 11.966C5.73324 11.796 5.80388 11.6426 5.91739 11.5334L7.90913 9.5417Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 8.3002C1.3999 7.96882 1.66853 7.7002 1.9999 7.7002H2.33324C2.66461 7.7002 2.93324 7.96882 2.93324 8.3002C2.93324 8.63157 2.66461 8.9002 2.33324 8.9002H1.9999C1.66853 8.9002 1.3999 8.63157 1.3999 8.3002Z`}}]},Ie=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`reduce-digits-icon`,ref:t,icon:Fe}))});Ie.displayName=`ReduceDigitsIcon`;let Le={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:`M6.7937 8.6977Q6.7937 9.5729 6.7228 9.9277Q6.6045 10.8264 5.7057 11.3704Q4.8543 11.8908 3.577 12.0327H3.4115Q2.6783 12.0327 2.2052 11.3468Q1.7795 10.7555 1.7795 9.9277Q1.7795 9.5965 1.945 8.887Q2.1343 8.0828 2.3944 7.8226Q2.4417 7.7517 2.5127 7.7517Q2.6546 7.7517 2.6546 7.9172Q2.6546 7.9882 2.489 8.4139Q2.3235 8.8397 2.3235 9.0762Q2.3235 9.904 2.7256 10.2588Q3.1277 10.6136 3.9791 10.6136Q4.9016 10.6136 5.6111 10.1878Q6.4863 9.6911 6.4153 8.8397Q6.2261 8.1774 5.8713 6.4271Q5.4456 4.2038 5.1617 3.0449Q4.9489 2.6191 4.807 2.4536Q4.9489 2.1934 5.0198 1.8859Q5.1617 1.2 5.28 1.2Q5.351 1.2 5.4456 1.4602Q5.5638 1.744 5.6821 1.8623Q6.1078 2.217 6.1551 2.288Q6.1551 2.3353 6.1788 2.3826Q6.2261 2.6191 5.9186 3.2577Q6.2024 4.535 6.4863 6.4271Q6.6991 7.8463 6.7937 8.6977ZM11.3586 8.9816Q11.3823 9.6911 11.0748 10.3061Q10.8856 10.7082 10.0577 10.7082Q9.3009 10.7082 8.8751 9.9277Q8.5677 9.4073 8.4021 7.8226Q8.1656 5.8122 7.9054 4.0146Q7.7398 3.0922 7.6452 2.6428L7.7871 1.9332Q7.8581 1.4602 7.929 1.4602Q7.9763 1.4602 8 1.5784Q8.2365 2.2407 8.4257 3.8963Q8.7096 6.167 8.8042 6.6637Q9.0643 8.5795 9.2299 8.9106Q9.3245 9.1235 9.5729 9.3127Q9.8212 9.5019 10.0577 9.5019Q10.72 9.5019 10.791 9.1471Q10.7437 8.9816 10.4835 8.6268Q10.2706 8.2957 10.247 8.0355L10.3889 7.657Q10.4598 7.4442 10.5781 7.2077Q10.6017 7.184 10.6254 7.184Q10.8383 7.184 11.0275 7.6334Q11.335 8.272 11.3586 8.9816ZM14.2205 10.7318Q14.2205 12.2219 13.511 13.3099Q13.1325 13.8776 12.2574 14.6108Q11.9736 14.8 11.4532 14.8Q10.9329 14.8 9.3245 14.4689Q9.2536 14.4689 9.1471 14.3624Q9.0407 14.256 9.0407 14.2087Q9.0643 14.185 9.0643 14.185L9.088 14.1614Q9.703 14.1141 10.0577 14.1141Q10.72 14.0904 11.0038 13.9722Q13.1089 13.1917 13.7475 11.2995Q13.6765 11.1339 13.2035 10.3061Q12.825 9.6438 12.825 9.3363Q12.825 9.289 12.9197 9.1471Q12.9433 9.1235 13.0379 8.7923Q13.1089 8.5558 13.1798 8.5558Q13.4637 8.5558 13.8657 9.3363Q14.2205 10.0459 14.2205 10.377V10.7318ZM10.6017 12.1273Q10.6254 12.1983 10.4243 12.6122Q10.2233 13.0261 10.105 13.0261Q9.9631 13.0261 9.6793 12.7777Q9.3955 12.5294 9.3245 12.3638Q9.632 11.536 9.7976 11.465Q9.8685 11.465 10.1997 11.7607Q10.5308 12.0563 10.6017 12.1273ZM9.1353 12.4584Q9.159 12.6003 8.9579 12.967Q8.7569 13.3336 8.6386 13.3336Q8.4967 13.3336 8.201 13.097Q7.9054 12.8605 7.9054 12.7423Q7.8344 12.553 8.3075 11.8198Q8.6386 11.9617 9.1353 12.4584Z`}}]},Re=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`rial-icon`,ref:t,icon:Le}))});Re.displayName=`RialIcon`;let ze={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:`M11.9445 1.55649C12.2184 1.744 12.2895 2.11755 12.1033 2.39085L9.24342 6.58659H12.8001C13.1315 6.58659 13.4001 6.85522 13.4001 7.18659C13.4001 7.51796 13.1315 7.78659 12.8001 7.78659H8.5999V9.91276H13.2221C13.5534 9.91276 13.8221 10.1814 13.8221 10.5128C13.8221 10.8441 13.5534 11.1128 13.2221 11.1128H8.5999V14.0877C8.5999 14.4191 8.33127 14.6877 7.9999 14.6877C7.66853 14.6877 7.3999 14.4191 7.3999 14.0877V11.1128H2.77773C2.44636 11.1128 2.17773 10.8441 2.17773 10.5128C2.17773 10.1814 2.44636 9.91276 2.77773 9.91276H7.3999V7.78659H3.2001C2.86873 7.78659 2.6001 7.51796 2.6001 7.18659C2.6001 6.85522 2.86873 6.58659 3.2001 6.58659H6.75736L3.89753 2.39085C3.71125 2.11755 3.78234 1.744 4.05631 1.55649C4.33029 1.36899 4.7034 1.43854 4.88968 1.71184L7.94595 6.19577C7.96752 6.22741 7.98564 6.2604 8.00039 6.29429C8.01514 6.2604 8.03326 6.22741 8.05483 6.19577L11.1111 1.71184C11.2974 1.43854 11.6705 1.36899 11.9445 1.55649Z`}}]},Be=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`rmb-icon`,ref:t,icon:ze}))});Be.displayName=`RmbIcon`;let Ve={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:`M9.72502 1.02051H6.07803C4.97346 1.02051 4.07803 1.91594 4.07803 3.02051V7.57046H3.00039C2.66902 7.57046 2.40039 7.83909 2.40039 8.17046C2.40039 8.50183 2.66902 8.77046 3.00039 8.77046H4.07803V10.4854H3.00039C2.66902 10.4854 2.40039 10.754 2.40039 11.0854C2.40039 11.4167 2.66902 11.6854 3.00039 11.6854H4.07803V14.3795C4.07803 14.7108 4.34666 14.9795 4.67803 14.9795C5.0094 14.9795 5.27803 14.7108 5.27803 14.3795V11.6854H10.3637C10.695 11.6854 10.9637 11.4167 10.9637 11.0854C10.9637 10.754 10.695 10.4854 10.3637 10.4854H5.27803V8.77046H9.72503C11.8651 8.77046 13.6 7.03557 13.6 4.89548C13.6 2.75539 11.8651 1.02051 9.72502 1.02051ZM9.72503 7.57046H5.27803V3.12051C5.27803 2.62345 5.68097 2.22051 6.17803 2.22051H9.72502C11.2024 2.22051 12.4 3.41814 12.4 4.89548C12.4 6.37283 11.2024 7.57046 9.72503 7.57046Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},He=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`rouble-icon`,ref:t,icon:Ve}))});He.displayName=`RoubleIcon`;let Ue={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:`M8.5953 11.0279H7.1987Q5.9451 9.0475 5.6418 8.5953Q5.3384 8.1431 5.0035 7.8197Q4.6687 7.4963 4.3739 7.4104Q4.0791 7.3246 3.5926 7.3246H2.3104V11.0279H1.2V2.6367H4.9148Q5.6761 2.6367 6.1912 2.734Q6.7064 2.8313 7.0956 3.1433Q7.4848 3.4552 7.6938 3.9303Q7.9027 4.4054 7.9027 4.932Q7.9027 5.8822 7.3017 6.4603Q6.7007 7.0384 5.5502 7.1929V7.2158Q6.3916 7.5879 7.13 8.7441L8.5953 11.0279ZM2.3104 6.3286H4.6916Q5.4128 6.3286 5.8335 6.2056Q6.2542 6.0825 6.5061 5.7276Q6.7579 5.3727 6.7579 4.932Q6.7579 4.3596 6.3401 3.9589Q5.9222 3.5582 4.9606 3.5582H2.3104V6.3286ZM10.4842 5.7391Q11.0623 4.8175 12.2185 4.8175Q13.4148 4.8175 14.1074 5.6847Q14.8 6.5519 14.8 7.9428Q14.8 9.4253 14.033 10.2981Q13.266 11.171 12.1498 11.171Q11.171 11.171 10.5815 10.3926H10.5529V13.3633H9.5226V4.9549H10.4613V5.7391H10.4842ZM12.0811 10.3239Q12.8024 10.3239 13.2746 9.7258Q13.7468 9.1276 13.7468 7.9428Q13.7468 6.8266 13.2918 6.2256Q12.8367 5.6246 12.1269 5.6246Q11.3943 5.6246 10.9221 6.2943Q10.4498 6.964 10.4498 8.0286Q10.4498 9.1562 10.902 9.7401Q11.3542 10.3239 12.0811 10.3239Z`}}]},We=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`rupiah-icon`,ref:t,icon:Ue}))});We.displayName=`RupiahIcon`;let Ge={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.8 9.4486H12.955L11.8883 13.2829H10.5477L9.4811 9.4486H6.5189L5.4378 13.2829H4.0108L2.9874 9.4486H1.2V8.4685H2.7351L2.4541 7.409H1.2V6.436H2.1946L1.2 2.7171H2.6342L3.4919 6.436H6.1153L7.182 2.7171H8.8613L9.9135 6.436H12.4649L13.3802 2.7171H14.8L13.7622 6.436H14.8V7.409H13.5099L13.2144 8.4685H14.8V9.4486ZM8.645 6.436Q8.0757 4.3676 7.9892 4Q7.8667 4.6342 7.3261 6.436H8.645ZM12.2414 7.409H10.209L10.5045 8.4685H11.9748L12.2414 7.409ZM9.2144 8.4685L8.9189 7.409H7.0739L6.7856 8.4685H9.2144ZM5.8559 7.409H3.7297L3.9748 8.4685H5.5604L5.8559 7.409ZM11.7586 9.4486H10.7351Q11.0955 11.1063 11.1964 11.8054L11.7586 9.4486ZM5.2937 9.4486H4.1838Q4.573 11.1063 4.7027 11.8054Q4.955 10.7315 5.2937 9.4486Z`}}]},Ke=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`won-icon`,ref:t,icon:Ge}))});Ke.displayName=`WonIcon`;let qe={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:`M10.092 14.8H1.3716V13.4548L7.6428 6.2652Q6.5389 6.3302 5.7596 6.3302H1.7334V4.9572H9.7858V6.0426L4.4516 12.2767Q4.2939 12.4715 3.6352 13.1858Q3.4775 13.3342 3.4218 13.4363Q4.3774 13.3528 5.5277 13.3528H10.092V14.8ZM14.6284 6.9888L13.376 8.0557V14.8H11.7247V9.4843L10.5094 10.4862V9.0205L11.7247 8.0186V1.2H13.376V6.5899L14.6284 5.5323V6.9888Z`}}]},Je=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(V,Object.assign({},e,{id:`zloty-icon`,ref:t,icon:qe}))});Je.displayName=`ZlotyIcon`;let K=(0,u.createContext)([]),q=class{constructor(e){this._localStorageService=e}_getKey(e){return`userHabitController_${e}`}async addHabit(e,t){let n=this._getKey(e);return this._localStorageService.getItem(n).then(e=>{e||this._localStorageService.setItem(n,t)})}markHabit(e,t){let n=this._getKey(e);this._localStorageService.getItem(n).then(e=>{if(e){let r=e.findIndex(e=>e===t);r>-1&&e.splice(r,1),e.unshift(t),this._localStorageService.setItem(n,e)}})}async getHabit(e,t){let n=this._getKey(e),r=await this._localStorageService.getItem(n);if(t&&r){let e=r.map((e,t,n)=>({value:e,priority:n.length-t}));return t.sort((t,n)=>{var r,i;let a=((r=e.find(e=>e.value===t))==null?void 0:r.priority)||-1;return(((i=e.find(e=>e.value===n))==null?void 0:i.priority)||-1)-a})}return r||[]}deleteHabit(e){this._localStorageService.removeItem(e)}};q=y([v(0,(0,r.Inject)(r.ILocalStorageService))],q);let Ye=e=>!!(0,t.getCurrencyType)(e)&&e.startsWith(`_(`);function Xe(e){let{defaultPattern:i,onActionChange:a,onChange:o}=e,[s,c]=(0,u.useState)(()=>(0,t.getDecimalFromPattern)(i||``,2)),f=(0,u.useContext)(K),[p,m]=(0,u.useState)(()=>(0,t.getCurrencyType)(i)||f[0]),h=(0,u.useMemo)(()=>f.map(e=>({label:e,value:e})),[]),g=(0,n.useDependency)(r.LocaleService);return(0,u.useLayoutEffect)(()=>{a(()=>(0,t.setPatternDecimal)(`_("${p}"* #,##0${s>0?`.0`:``}_)`,s))},[s,a,p]),/* @__PURE__ */ (0,d.jsxs)(`div`,{children:[/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`univer-mt-4 univer-flex univer-justify-between`,children:[/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`option`,children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:g.t(`sheets-numfmt-ui.decimalLength`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-32`,children:/* @__PURE__ */ (0,d.jsx)(l.InputNumber,{value:s,step:1,precision:0,max:20,min:0,onChange:e=>{let n=e||0;c(n),o((0,t.setPatternDecimal)(`_("${p}"* #,##0${n>0?`.0`:``}_)`,n))}})})]}),/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`option`,children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:g.t(`sheets-numfmt-ui.currencyType`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-36`,children:/* @__PURE__ */ (0,d.jsx)(l.Select,{options:h,value:p,onChange:e=>{m(e),o((0,t.setPatternDecimal)(`_("${e}"* #,##0${s>0?`.0`:``}_)`,s))}})})]})]}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:g.t(`sheets-numfmt-ui.accountingDes`)})]})}let Ze=e=>!!(0,t.getCurrencyType)(e)&&!e.startsWith(`_(`);function Qe(e){let{onActionChange:i,onChange:a}=e,o=(0,n.useDependency)(r.LocaleService),s=(0,u.useContext)(K),[c,f]=(0,u.useState)(()=>(0,t.getCurrencyType)(e.defaultPattern)||s[0]),[p,m]=(0,u.useState)(()=>(0,t.getDecimalFromPattern)(e.defaultPattern||``,2)),[h,g]=(0,u.useState)(()=>{var n;let i=(0,t.getCurrencyFormatOptions)(c);return((n=i.find(t=>(0,r.isPatternEqualWithoutDecimal)(t.value,e.defaultPattern)))==null?void 0:n.value)||i[0].value}),_=(0,u.useMemo)(()=>(0,t.getCurrencyFormatOptions)(c),[c]),v=(0,u.useMemo)(()=>s.map(e=>({label:e,value:e})),[s]);return(0,u.useLayoutEffect)(()=>{i(()=>(0,t.setPatternDecimal)(h,p))},[p,i,h]),/* @__PURE__ */ (0,d.jsxs)(`div`,{children:[/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`univer-mt-4 univer-flex univer-justify-between`,children:[/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`option`,children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.decimalLength`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-32`,children:/* @__PURE__ */ (0,d.jsx)(l.InputNumber,{value:p,max:20,min:0,onChange:e=>{m(e||0),a((0,t.setPatternDecimal)(h,e||0))}})})]}),/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`option`,children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.currencyType`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2 univer-w-36`,children:/* @__PURE__ */ (0,d.jsx)(l.Select,{value:c,options:v,onChange:e=>{if(e===void 0)return;f(e);let n=(0,t.getCurrencyFormatOptions)(e)[0].value;g(n),a((0,t.setPatternDecimal)(n,p))}})})]})]}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`label univer-mt-4`,children:o.t(`sheets-numfmt-ui.negType`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2`,children:/* @__PURE__ */ (0,d.jsx)(l.SelectList,{value:h,options:_,onChange:e=>{e!==void 0&&(g(e),a((0,t.setPatternDecimal)(e,p)))}})}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.currencyDes`)})]})}let J=`customFormat`,Y=`numfmt_custom_pattern`;function $e(e){let{defaultPattern:i,onActionChange:a,onChange:o}=e,s=(0,n.useDependency)(q),c=(0,n.useDependency)(r.ILocalStorageService),f=(0,n.useDependency)(r.LocaleService),p=(0,n.useObservable)(f.currentLocale$,f.getCurrentLocale()),[m,h]=(0,u.useState)(i);(0,u.useLayoutEffect)(()=>{a(()=>(s.markHabit(J,m),c.getItem(Y).then((e=[])=>{let t=[.../* @__PURE__ */ new Set([m,...e||[]])].splice(0,10).filter(e=>!!e);return c.setItem(Y,t)}).catch(console.error),m))},[c,a,m,s]);let[g,_]=(0,u.useState)([]);(0,u.useEffect)(()=>{let e=!1;return c.getItem(Y).then(e=>{let n=[...t.CURRENCYFORMAT.map(e=>e.suffix(`$`)),...(0,t.getDateFormatOptions)(p).map(e=>e.value),...t.NUMBERFORMAT.map(e=>e.suffix),...e??[]];return s.addHabit(J,[]).then(()=>s.getHabit(J,n))}).then(t=>{e||_([...new Set(t)])}).catch(console.error),()=>{e=!0}},[p,c,s]);let v=e=>{h(e),o(e)};return/* @__PURE__ */ (0,d.jsxs)(`div`,{children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:f.t(`sheets-numfmt-ui.customFormat`)}),/* @__PURE__ */ (0,d.jsx)(l.Input,{placeholder:f.t(`sheets-numfmt-ui.customFormat`),onBlur:()=>{o(m)},value:m,onChange:h,className:`univer-mt-2 univer-w-full`}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:(0,l.clsx)(`univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2`,l.borderClassName),children:g.map(e=>/* @__PURE__ */ (0,d.jsxs)(`div`,{onClick:()=>v(e),className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-1.5 univer-py-1.5 univer-text-sm`,children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-flex univer-w-4 univer-items-center univer-text-primary-600`,children:m===e&&/* @__PURE__ */ (0,d.jsx)(W,{})}),/* @__PURE__ */ (0,d.jsx)(`div`,{children:e})]},e))}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200`,children:f.t(`sheets-numfmt-ui.customFormatDes`)})]})}let et=e=>{let t=r.numfmt.getFormatInfo(e);return[`date`,`datetime`,`time`].includes(t.type)};function tt(e){let{onActionChange:i,onChange:a,defaultPattern:o}=e,s=(0,n.useDependency)(r.LocaleService),c=(0,n.useObservable)(s.currentLocale$,s.getCurrentLocale()),[f,p]=(0,u.useState)(()=>o||(0,t.getDateFormatOptions)(c)[0].value),m=(0,u.useMemo)(()=>(0,t.getDateFormatOptions)(c,f),[c,f]);return(0,u.useLayoutEffect)(()=>{i(()=>f)},[i,f]),/* @__PURE__ */ (0,d.jsxs)(`div`,{children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:s.t(`sheets-numfmt-ui.dateType`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2`,children:/* @__PURE__ */ (0,d.jsx)(l.SelectList,{value:f,options:m,onChange:e=>{typeof e==`string`&&(p(e),a(e))}})}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200`,children:s.t(`sheets-numfmt-ui.dateDes`)})]})}let nt=e=>!e;function rt(e){let t=(0,n.useDependency)(r.LocaleService),{onActionChange:i}=e;return(0,u.useLayoutEffect)(()=>{i(()=>``)},[i]),/* @__PURE__ */ (0,d.jsx)(`div`,{children:/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200`,children:t.t(`sheets-numfmt-ui.generalDes`)})})}let it=e=>(0,t.getNumberFormatOptions)().some(t=>(0,r.isPatternEqualWithoutDecimal)(t.value,e));function at(e){let{onActionChange:i,onChange:a}=e,o=(0,n.useDependency)(r.LocaleService),s=(0,u.useMemo)(t.getNumberFormatOptions,[]),[c,f]=(0,u.useState)(()=>(0,t.getDecimalFromPattern)(e.defaultPattern||``,0)),[p,m]=(0,u.useState)(()=>{let t=s.find(t=>(0,r.isPatternEqualWithoutDecimal)(t.value,e.defaultPattern||``));return(t==null?void 0:t.value)||s[0].value}),h=(0,u.useMemo)(()=>(0,t.setPatternDecimal)(p,Number(c||0)),[p,c]),g=!(0,t.isPatternHasDecimal)(p);return(0,u.useLayoutEffect)(()=>{i(()=>h)},[i,h]),/* @__PURE__ */ (0,d.jsxs)(`div`,{children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:o.t(`sheets-numfmt-ui.decimalLength`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2`,children:/* @__PURE__ */ (0,d.jsx)(l.InputNumber,{disabled:g,value:c,max:20,min:0,onChange:e=>{f(e||0),a((0,t.setPatternDecimal)(p,Number(e||0)))}})}),/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`univer-mt-4 univer-text-sm univer-text-gray-400`,children:[` `,o.t(`sheets-numfmt-ui.negType`)]}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2`,children:/* @__PURE__ */ (0,d.jsx)(l.SelectList,{onChange:e=>{e!==void 0&&(f((0,t.getDecimalFromPattern)(e,0)),m(e),a(e))},options:s,value:p})}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200`,children:o.t(`sheets-numfmt-ui.thousandthPercentileDes`)})]})}let ot=`numfmtCurrency`,st=e=>{let t=(0,n.useDependency)(q),[i,a]=(0,u.useState)(r.currencySymbols);return(0,u.useEffect)(()=>{t.addHabit(`numfmtCurrency`,[]).then(()=>{t.getHabit(ot,[...r.currencySymbols]).then(t=>{a(t),e&&e(t)})})},[]),{userHabitCurrency:i,mark:e=>{t.markHabit(ot,e)}}},ct=()=>{let e=(0,u.useRef)([]),[t,n]=(0,u.useState)({});return(0,u.useEffect)(()=>{e.current.forEach(e=>{e()}),e.current=[]},[t]),t=>{e.current.push(t),n({})}},X=[{label:`sheets-numfmt-ui.general`,component:rt},{label:`sheets-numfmt-ui.accounting`,component:Xe},{label:`sheets-numfmt-ui.currency`,component:Qe},{label:`sheets-numfmt-ui.date`,component:tt},{label:`sheets-numfmt-ui.thousandthPercentile`,component:at},{label:`sheets-numfmt-ui.customFormat`,component:$e}];function lt(e){let{row:t,col:n,defaultPattern:r}=e.value;return/* @__PURE__ */ (0,u.createElement)(ut,{...e,key:`${t}_${n}_${r}`})}function ut(e){var i;let{onChange:a}=e,{defaultValue:o,defaultPattern:s,row:c,col:f}=e.value,p=(0,n.useDependency)(r.LocaleService);(0,n.useObservable)(p.currentLocale$,p.getCurrentLocale());let m=(0,u.useRef)(()=>``),h=ct(),[g,_]=(0,u.useState)(C),[v,y]=(0,u.useState)(()=>`${c}_${f}_${s}`),{mark:b,userHabitCurrency:x}=st(()=>y(`${c}_${f}_${s}_userCurrency`)),S=(i=X.find(e=>e.label===g))==null?void 0:i.component;function C(){return[nt,Ye,Ze,et,it].reduce((e,t,n)=>e||(t(s)?X[n].label:``),``)||`sheets-numfmt-ui.customFormat`}let w=X.map(e=>({label:p.t(e.label),value:e.label})),ee=e=>{_(e),h(()=>a({type:`change`,value:m.current()||``}))},te=(0,u.useCallback)(e=>{a({type:`change`,value:e})},[a]),ne=(0,u.useCallback)(e=>{m.current=e},[]),T=()=>{let e=m.current()||``,n=(0,t.getCurrencyType)(e);n&&b(n),a({type:`confirm`,value:e})},E=()=>{a({type:`cancel`,value:``})},D={onChange:te,onActionChange:ne,defaultValue:o,defaultPattern:s};return/* @__PURE__ */ (0,d.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5`,l.scrollbarClassName),children:[/* @__PURE__ */ (0,d.jsxs)(`div`,{children:[/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-3.5 univer-text-sm univer-text-gray-400`,children:p.t(`sheets-numfmt-ui.numfmtType`)}),/* @__PURE__ */ (0,d.jsx)(`div`,{className:`univer-mt-2`,children:/* @__PURE__ */ (0,d.jsx)(l.Select,{className:`univer-w-full`,value:g,options:w,onChange:ee})}),/* @__PURE__ */ (0,d.jsx)(`div`,{children:S&&/* @__PURE__ */ (0,d.jsx)(K.Provider,{value:x,children:/* @__PURE__ */ (0,u.createElement)(S,{...D,key:v})})})]}),/* @__PURE__ */ (0,d.jsxs)(`div`,{className:`univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end univer-gap-2 rtl:univer-flex-row-reverse`,children:[/* @__PURE__ */ (0,d.jsx)(l.Button,{onClick:E,children:p.t(`sheets-numfmt-ui.cancel`)}),/* @__PURE__ */ (0,d.jsx)(l.Button,{variant:`primary`,onClick:T,children:p.t(`sheets-numfmt-ui.confirm`)})]})]})}let Z=class extends r.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerIcons(){this.disposeWithMe(this._iconManager.register({AddDigitsIcon:U,DollarIcon:G,DongIcon:Ae,EuroIcon:Me,PercentIcon:Pe,ReduceDigitsIcon:Ie,RialIcon:Re,RmbIcon:Be,RoubleIcon:He,RupiahIcon:We,WonIcon:Ke,ZlotyIcon:Je}))}_registerComponents(){this.disposeWithMe(this._componentManager.register(`SHEET_NUMFMT_PANEL`,lt)),[[C,ee],[w,te]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};Z=y([v(0,(0,r.Inject)(n.ComponentManager)),v(1,(0,r.Inject)(n.IconManager))],Z);let Q=class extends r.Disposable{constructor(e){super(),this._menuManagerService=e,this._initMenu()}_initMenu(){this._menuManagerService.mergeMenu(O)}};Q=y([v(0,n.IMenuManagerService)],Q);let $=class extends r.Plugin{constructor(e=j,t,n,i){super(),this._config=e,this._injector=t,this._configService=n,this._renderManagerService=i;let{menu:a,...o}=(0,r.merge)({},j,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(se,o)}onStarting(){this._injector.add([Z]),this._injector.get(Z),(0,r.registerDependencies)(this._injector,[[b],[R],[q],[Q],[I]])}onRendered(){this._registerRenderModules(),(0,r.touchDependencies)(this._injector,[[b],[R],[Q],[I]])}_registerRenderModules(){[[F]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(r.UniverInstanceType.UNIVER_SHEET,e))})}};_($,`pluginName`,`SHEET_NUMFMT_UI_PLUGIN`),_($,`packageName`,k),_($,`version`,A),_($,`type`,r.UniverInstanceType.UNIVER_SHEET),$=y([(0,r.DependentOn)(i.UniverRenderEnginePlugin,a.UniverSheetsPlugin,t.UniverSheetsNumfmtPlugin,o.UniverSheetsUIPlugin),v(1,(0,r.Inject)(r.Injector)),v(2,r.IConfigService),v(3,i.IRenderManagerService)],$),e.SheetsNumfmtUIMenuSchema=O,Object.defineProperty(e,"UniverSheetsNumfmtMobileUIPlugin",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"UniverSheetsNumfmtUIPlugin",{enumerable:!0,get:function(){return $}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-numfmt-ui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Number format menus, editors, and previews for Univer Sheets.",
|
|
6
6
|
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
@@ -58,24 +58,24 @@
|
|
|
58
58
|
"rxjs": ">=7.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@univerjs/core": "1.0
|
|
62
|
-
"@univerjs/design": "1.0
|
|
63
|
-
"@univerjs/engine-formula": "1.0
|
|
64
|
-
"@univerjs/engine-render": "1.0
|
|
65
|
-
"@univerjs/icons": "1.
|
|
66
|
-
"@univerjs/sheets": "1.0
|
|
67
|
-
"@univerjs/sheets-numfmt": "1.0
|
|
68
|
-
"@univerjs/sheets-ui": "1.0
|
|
69
|
-
"@univerjs/ui": "1.0
|
|
61
|
+
"@univerjs/core": "1.1.0",
|
|
62
|
+
"@univerjs/design": "1.1.0",
|
|
63
|
+
"@univerjs/engine-formula": "1.1.0",
|
|
64
|
+
"@univerjs/engine-render": "1.1.0",
|
|
65
|
+
"@univerjs/icons": "1.46.0",
|
|
66
|
+
"@univerjs/sheets": "1.1.0",
|
|
67
|
+
"@univerjs/sheets-numfmt": "1.1.0",
|
|
68
|
+
"@univerjs/sheets-ui": "1.1.0",
|
|
69
|
+
"@univerjs/ui": "1.1.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@univerjs-infra/shared": "1.0
|
|
73
|
-
"postcss": "^8.5.
|
|
72
|
+
"@univerjs-infra/shared": "1.1.0",
|
|
73
|
+
"postcss": "^8.5.29",
|
|
74
74
|
"react": "18.3.1",
|
|
75
75
|
"rxjs": "^7.8.2",
|
|
76
76
|
"tailwindcss": "3.4.18",
|
|
77
77
|
"typescript": "^6.0.3",
|
|
78
|
-
"vitest": "^5.0.
|
|
78
|
+
"vitest": "^5.0.4"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"test": "vitest run",
|