@univerjs/sheets-data-validation-ui 0.25.0 → 1.0.0-alpha.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 +98 -99
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +105 -100
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.js +105 -100
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/controllers/components.controller.d.ts +23 -0
- package/lib/types/controllers/dv-alert.controller.d.ts +1 -4
- package/lib/types/index.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +3 -0
- package/lib/types/locale/types.d.ts +18 -0
- package/lib/types/menu/dv.menu.d.ts +4 -3
- package/lib/types/services/dropdown-manager.service.d.ts +1 -5
- package/lib/types/views/components/{panel/index.d.ts → DataValidationDetail.d.ts} +1 -1
- package/lib/types/views/components/{item/index.d.ts → DataValidationItem.d.ts} +2 -1
- package/lib/types/views/components/{list/index.d.ts → DataValidationList.d.ts} +1 -1
- package/lib/types/views/components/{options/index.d.ts → DataValidationOptions.d.ts} +1 -1
- package/lib/types/views/components/{detail/index.d.ts → DataValidationPanel.d.ts} +1 -1
- package/lib/types/views/components/{show-time/index.d.ts → DateShowTimeOption.d.ts} +1 -1
- package/lib/types/views/components/{render-mode/index.d.ts → ListRenderModeInput.d.ts} +1 -1
- package/lib/types/views/components/formula-input/BaseFormulaInput.d.ts +2 -2
- package/lib/types/views/components/formula-input/CheckboxFormulaInput.d.ts +2 -2
- package/lib/types/views/components/formula-input/CustomFormulaInput.d.ts +2 -2
- package/lib/types/views/components/formula-input/ListFormulaInput.d.ts +2 -2
- package/lib/types/views/components/formula-input/formula-input.d.ts +1 -1
- package/lib/types/views/components/formula-input/index.d.ts +1 -1
- package/lib/types/views/components/formula-input/interface.d.ts +28 -0
- package/lib/types/views/components/index.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +15 -15
- /package/lib/types/controllers/{dv-ui.controller.d.ts → ui.controller.d.ts} +0 -0
package/lib/es/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { CellValueType, ColorKit, CommandType, DEFAULT_STYLES, DataValidationErrorStyle, DataValidationRenderMode, DataValidationStatus, DataValidationType, DependentOn, Disposable, DisposableCollection, HorizontalAlign, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, ObjectMatrix, Optional, Plugin, Range, Rectangle, RedoCommand, RxDisposable, ThemeService, UndoCommand, UniverInstanceType, VerticalAlign, WrapStrategy, awaitTime, bufferDebounceTime, dateKit, debounce, generateRandomId, isFormulaString, isUnitRangesEqual, merge, numfmt, queryObjectMatrix, sequenceExecute, shallowEqual, toDisposable } from "@univerjs/core";
|
|
2
2
|
import { CURSOR_TYPE, CheckboxShape, DeviceInputEventType, DocSimpleSkeleton, FontCache, IRenderManagerService, Rect, Shape, Text, Transform, fixLineWidthByScale, getCurrentTypeOfRenderer, getFontStyleString } from "@univerjs/engine-render";
|
|
3
3
|
import { AUTO_FILL_APPLY_TYPE, AutoFillTools, IAutoFillService, INTERCEPTOR_POINT, InterceptCellContentPriority, RangeProtectionPermissionEditPoint, SetRangeValuesCommand, SetWorksheetActiveOperation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, VALIDATE_CELL, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, deserializeListOptions, getSheetCommandTarget, rangeToDiscreteRange, serializeListOptions } from "@univerjs/sheets";
|
|
4
|
-
import { AddSheetDataValidationCommand, BASE_FORMULA_INPUT_NAME
|
|
4
|
+
import { AddSheetDataValidationCommand, BASE_FORMULA_INPUT_NAME, CHECKBOX_FORMULA_1, CHECKBOX_FORMULA_2, CHECKBOX_FORMULA_INPUT_NAME, CUSTOM_FORMULA_INPUT_NAME, DATA_VALIDATION_PLUGIN_NAME, DataValidationCacheService, DataValidationFormulaController, DataValidationFormulaService, LIST_FORMULA_INPUT_NAME, RemoveSheetAllDataValidationCommand, RemoveSheetDataValidationCommand, SheetDataValidationModel, SheetsDataValidationValidatorService, UniverSheetsDataValidationPlugin, UpdateSheetDataValidationOptionsCommand, UpdateSheetDataValidationRangeCommand, UpdateSheetDataValidationSettingCommand, createDefaultNewRule, getCellValueOrigin, getDataValidationCellValue, getDataValidationDiffMutations, getFormulaResult, isLegalFormulaResult, transformCheckboxValue } from "@univerjs/sheets-data-validation";
|
|
5
5
|
import { DataValidationModel, DataValidatorDropdownType, DataValidatorRegistryScope, DataValidatorRegistryService, TWO_FORMULA_OPERATOR_COUNT, getRuleOptions, getRuleSetting } from "@univerjs/data-validation";
|
|
6
|
-
import { ComponentManager, IDialogService, IMenuManagerService, ISidebarService,
|
|
6
|
+
import { ComponentManager, IDialogService, IMenuManagerService, ISidebarService, IconManager, KeyCode, MenuItemType, RibbonDataGroup, getMenuHiddenObservable, useDependency, useEvent, useObservable, useSidebarClick } from "@univerjs/ui";
|
|
7
7
|
import { BehaviorSubject, Subject, bufferTime, debounceTime, distinctUntilChanged, filter, of } from "rxjs";
|
|
8
8
|
import { getPatternType } from "@univerjs/sheets-numfmt";
|
|
9
9
|
import { AutoHeightController, COPY_TYPE, CellAlertManagerService, CellAlertType, HoverManagerService, IEditorBridgeService, IMarkSelectionService, ISheetCellDropdownManagerService, ISheetClipboardService, PREDEFINED_HOOK_NAME_PASTE, SetCellEditVisibleOperation, SheetSkeletonManagerService, getCurrentRangeDisable$, getRepeatRange, virtualizeDiscreteRanges } from "@univerjs/sheets-ui";
|
|
10
10
|
import { Button, Checkbox, DraggableList, Dropdown, FormLayout, Input, Radio, RadioGroup, Select, borderClassName, clsx } from "@univerjs/design";
|
|
11
11
|
import { createElement, useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
-
import { DataValidationIcon, DeleteIcon, IncreaseIcon, MoreDownIcon, MoreUpIcon
|
|
12
|
+
import { DataValidationIcon, DeleteIcon, GripVerticalIcon, IncreaseIcon, MoreDownIcon, MoreUpIcon } from "@univerjs/icons";
|
|
13
13
|
import { deserializeRangeWithSheet, serializeRange } from "@univerjs/engine-formula";
|
|
14
14
|
import { FormulaEditor, RangeSelector } from "@univerjs/sheets-formula-ui";
|
|
15
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region package.json
|
|
18
18
|
var name = "@univerjs/sheets-data-validation-ui";
|
|
19
|
-
var version = "0.
|
|
19
|
+
var version = "1.0.0-alpha.0";
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region \0@oxc-project+runtime@0.
|
|
22
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
23
23
|
function _typeof(o) {
|
|
24
24
|
"@babel/helpers - typeof";
|
|
25
25
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -30,7 +30,7 @@ function _typeof(o) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
|
-
//#region \0@oxc-project+runtime@0.
|
|
33
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
34
34
|
function toPrimitive(t, r) {
|
|
35
35
|
if ("object" != _typeof(t) || !t) return t;
|
|
36
36
|
var e = t[Symbol.toPrimitive];
|
|
@@ -43,14 +43,14 @@ function toPrimitive(t, r) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
|
-
//#region \0@oxc-project+runtime@0.
|
|
46
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
47
47
|
function toPropertyKey(t) {
|
|
48
48
|
var i = toPrimitive(t, "string");
|
|
49
49
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
|
-
//#region \0@oxc-project+runtime@0.
|
|
53
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
54
54
|
function _defineProperty(e, r, t) {
|
|
55
55
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
56
56
|
value: t,
|
|
@@ -61,7 +61,7 @@ function _defineProperty(e, r, t) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
|
-
//#region \0@oxc-project+runtime@0.
|
|
64
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
|
|
65
65
|
function __decorateParam(paramIndex, decorator) {
|
|
66
66
|
return function(target, key) {
|
|
67
67
|
decorator(target, key, paramIndex);
|
|
@@ -69,7 +69,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region \0@oxc-project+runtime@0.
|
|
72
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
73
73
|
function __decorate(decorators, target, key, desc) {
|
|
74
74
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
75
75
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -170,21 +170,6 @@ const DROP_DOWN_DEFAULT_COLOR = "#ECECEC";
|
|
|
170
170
|
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region src/controllers/dv-reject-input.controller.ts
|
|
173
|
-
/**
|
|
174
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
175
|
-
*
|
|
176
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
177
|
-
* you may not use this file except in compliance with the License.
|
|
178
|
-
* You may obtain a copy of the License at
|
|
179
|
-
*
|
|
180
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
181
|
-
*
|
|
182
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
183
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
184
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
185
|
-
* See the License for the specific language governing permissions and
|
|
186
|
-
* limitations under the License.
|
|
187
|
-
*/
|
|
188
173
|
let DataValidationRejectInputController = class DataValidationRejectInputController extends Disposable {
|
|
189
174
|
constructor(_sheetInterceptorService, _dataValidationModel, _dataValidatorRegistryService, _dialogService, _localeService, _sheetsDataValidationValidatorService) {
|
|
190
175
|
super();
|
|
@@ -274,11 +259,10 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
274
259
|
get activeDropdown() {
|
|
275
260
|
return this._activeDropdown;
|
|
276
261
|
}
|
|
277
|
-
constructor(_univerInstanceService, _dataValidatorRegistryService,
|
|
262
|
+
constructor(_univerInstanceService, _dataValidatorRegistryService, _dataValidationModel, _sheetsSelectionsService, _cellDropdownManagerService, _sheetDataValidationModel, _commandService, _editorBridgeService, _injector, _configService) {
|
|
278
263
|
super();
|
|
279
264
|
this._univerInstanceService = _univerInstanceService;
|
|
280
265
|
this._dataValidatorRegistryService = _dataValidatorRegistryService;
|
|
281
|
-
this._zenZoneService = _zenZoneService;
|
|
282
266
|
this._dataValidationModel = _dataValidationModel;
|
|
283
267
|
this._sheetsSelectionsService = _sheetsSelectionsService;
|
|
284
268
|
this._cellDropdownManagerService = _cellDropdownManagerService;
|
|
@@ -291,19 +275,11 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
291
275
|
_defineProperty(this, "_activeDropdown$", new Subject());
|
|
292
276
|
_defineProperty(this, "_currentPopup", null);
|
|
293
277
|
_defineProperty(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
|
294
|
-
_defineProperty(this, "_zenVisible", false);
|
|
295
|
-
this._init();
|
|
296
278
|
this._initSelectionChange();
|
|
297
279
|
this.disposeWithMe(() => {
|
|
298
280
|
this._activeDropdown$.complete();
|
|
299
281
|
});
|
|
300
282
|
}
|
|
301
|
-
_init() {
|
|
302
|
-
this.disposeWithMe(this._zenZoneService.visible$.subscribe((visible) => {
|
|
303
|
-
this._zenVisible = visible;
|
|
304
|
-
if (visible) this.hideDropdown();
|
|
305
|
-
}));
|
|
306
|
-
}
|
|
307
283
|
_getDropdownByCell(unitId, subUnitId, row, col) {
|
|
308
284
|
const workbook = unitId ? this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
|
|
309
285
|
if (!workbook) return;
|
|
@@ -323,7 +299,6 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
323
299
|
const { location } = param;
|
|
324
300
|
const { row, col, unitId, subUnitId, workbook, worksheet } = location;
|
|
325
301
|
if (this._currentPopup) this._currentPopup.dispose();
|
|
326
|
-
if (this._zenVisible) return;
|
|
327
302
|
this._activeDropdown = param;
|
|
328
303
|
this._activeDropdown$.next(this._activeDropdown);
|
|
329
304
|
const rule = this._sheetDataValidationModel.getRuleByLocation(unitId, subUnitId, row, col);
|
|
@@ -615,15 +590,14 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
615
590
|
DataValidationDropdownManagerService = __decorate([
|
|
616
591
|
__decorateParam(0, IUniverInstanceService),
|
|
617
592
|
__decorateParam(1, Inject(DataValidatorRegistryService)),
|
|
618
|
-
__decorateParam(2,
|
|
619
|
-
__decorateParam(3, Inject(
|
|
620
|
-
__decorateParam(4, Inject(
|
|
621
|
-
__decorateParam(5, Inject(
|
|
622
|
-
__decorateParam(6,
|
|
623
|
-
__decorateParam(7,
|
|
624
|
-
__decorateParam(8,
|
|
625
|
-
__decorateParam(9,
|
|
626
|
-
__decorateParam(10, IConfigService)
|
|
593
|
+
__decorateParam(2, Inject(SheetDataValidationModel)),
|
|
594
|
+
__decorateParam(3, Inject(SheetsSelectionsService)),
|
|
595
|
+
__decorateParam(4, Inject(ISheetCellDropdownManagerService)),
|
|
596
|
+
__decorateParam(5, Inject(SheetDataValidationModel)),
|
|
597
|
+
__decorateParam(6, ICommandService),
|
|
598
|
+
__decorateParam(7, IEditorBridgeService),
|
|
599
|
+
__decorateParam(8, Inject(Injector)),
|
|
600
|
+
__decorateParam(9, IConfigService)
|
|
627
601
|
], DataValidationDropdownManagerService);
|
|
628
602
|
|
|
629
603
|
//#endregion
|
|
@@ -731,23 +705,51 @@ const AddSheetDataValidationAndOpenCommand = {
|
|
|
731
705
|
}
|
|
732
706
|
};
|
|
733
707
|
|
|
708
|
+
//#endregion
|
|
709
|
+
//#region src/controllers/components.controller.ts
|
|
710
|
+
/**
|
|
711
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
712
|
+
*
|
|
713
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
714
|
+
* you may not use this file except in compliance with the License.
|
|
715
|
+
* You may obtain a copy of the License at
|
|
716
|
+
*
|
|
717
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
718
|
+
*
|
|
719
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
720
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
721
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
722
|
+
* See the License for the specific language governing permissions and
|
|
723
|
+
* limitations under the License.
|
|
724
|
+
*/
|
|
725
|
+
let ComponentsController = class ComponentsController extends Disposable {
|
|
726
|
+
constructor(_componentManager, _iconManager) {
|
|
727
|
+
super();
|
|
728
|
+
this._componentManager = _componentManager;
|
|
729
|
+
this._iconManager = _iconManager;
|
|
730
|
+
this._registerIcons();
|
|
731
|
+
}
|
|
732
|
+
_registerIcons() {
|
|
733
|
+
this.disposeWithMe(this._iconManager.register({ DataValidationIcon }));
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
ComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], ComponentsController);
|
|
737
|
+
|
|
734
738
|
//#endregion
|
|
735
739
|
//#region src/controllers/dv-alert.controller.ts
|
|
736
740
|
const ALERT_KEY = "SHEET_DATA_VALIDATION_ALERT";
|
|
737
741
|
let DataValidationAlertController = class DataValidationAlertController extends Disposable {
|
|
738
|
-
constructor(_hoverManagerService, _cellAlertManagerService, _univerInstanceService, _localeService,
|
|
742
|
+
constructor(_hoverManagerService, _cellAlertManagerService, _univerInstanceService, _localeService, _dataValidationModel) {
|
|
739
743
|
super();
|
|
740
744
|
this._hoverManagerService = _hoverManagerService;
|
|
741
745
|
this._cellAlertManagerService = _cellAlertManagerService;
|
|
742
746
|
this._univerInstanceService = _univerInstanceService;
|
|
743
747
|
this._localeService = _localeService;
|
|
744
|
-
this._zenZoneService = _zenZoneService;
|
|
745
748
|
this._dataValidationModel = _dataValidationModel;
|
|
746
749
|
this._init();
|
|
747
750
|
}
|
|
748
751
|
_init() {
|
|
749
752
|
this._initCellAlertPopup();
|
|
750
|
-
this._initZenService();
|
|
751
753
|
}
|
|
752
754
|
_initCellAlertPopup() {
|
|
753
755
|
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(debounceTime(100)).subscribe((cellPos) => {
|
|
@@ -792,19 +794,13 @@ let DataValidationAlertController = class DataValidationAlertController extends
|
|
|
792
794
|
this._cellAlertManagerService.removeAlert(ALERT_KEY);
|
|
793
795
|
}));
|
|
794
796
|
}
|
|
795
|
-
_initZenService() {
|
|
796
|
-
this.disposeWithMe(this._zenZoneService.visible$.subscribe((visible) => {
|
|
797
|
-
if (visible) this._cellAlertManagerService.removeAlert(ALERT_KEY);
|
|
798
|
-
}));
|
|
799
|
-
}
|
|
800
797
|
};
|
|
801
798
|
DataValidationAlertController = __decorate([
|
|
802
799
|
__decorateParam(0, Inject(HoverManagerService)),
|
|
803
800
|
__decorateParam(1, Inject(CellAlertManagerService)),
|
|
804
801
|
__decorateParam(2, IUniverInstanceService),
|
|
805
802
|
__decorateParam(3, Inject(LocaleService)),
|
|
806
|
-
__decorateParam(4,
|
|
807
|
-
__decorateParam(5, Inject(SheetDataValidationModel))
|
|
803
|
+
__decorateParam(4, Inject(SheetDataValidationModel))
|
|
808
804
|
], DataValidationAlertController);
|
|
809
805
|
|
|
810
806
|
//#endregion
|
|
@@ -1123,14 +1119,14 @@ function dataValidationMenuFactory(accessor) {
|
|
|
1123
1119
|
})
|
|
1124
1120
|
};
|
|
1125
1121
|
}
|
|
1126
|
-
function openDataValidationMenuFactory(
|
|
1122
|
+
function openDataValidationMenuFactory() {
|
|
1127
1123
|
return {
|
|
1128
1124
|
id: OpenValidationPanelOperation.id,
|
|
1129
1125
|
title: "sheets-data-validation-ui.panel.title",
|
|
1130
1126
|
type: MenuItemType.BUTTON
|
|
1131
1127
|
};
|
|
1132
1128
|
}
|
|
1133
|
-
function addDataValidationMenuFactory(
|
|
1129
|
+
function addDataValidationMenuFactory() {
|
|
1134
1130
|
return {
|
|
1135
1131
|
id: AddSheetDataValidationAndOpenCommand.id,
|
|
1136
1132
|
title: "sheets-data-validation-ui.panel.add",
|
|
@@ -1467,7 +1463,7 @@ let SheetsDataValidationReRenderController = class SheetsDataValidationReRenderC
|
|
|
1467
1463
|
SheetsDataValidationReRenderController = __decorate([__decorateParam(1, Inject(SheetDataValidationModel)), __decorateParam(2, Inject(SheetSkeletonManagerService))], SheetsDataValidationReRenderController);
|
|
1468
1464
|
|
|
1469
1465
|
//#endregion
|
|
1470
|
-
//#region src/views/components/
|
|
1466
|
+
//#region src/views/components/DataValidationOptions.tsx
|
|
1471
1467
|
function DataValidationOptions(props) {
|
|
1472
1468
|
var _value$errorStyle;
|
|
1473
1469
|
const localeService = useDependency(LocaleService);
|
|
@@ -1523,7 +1519,7 @@ function DataValidationOptions(props) {
|
|
|
1523
1519
|
}
|
|
1524
1520
|
|
|
1525
1521
|
//#endregion
|
|
1526
|
-
//#region src/views/components/
|
|
1522
|
+
//#region src/views/components/DataValidationDetail.tsx
|
|
1527
1523
|
const debounceExecuteFactory = (commandService) => debounce(async (id, params, options, callback) => {
|
|
1528
1524
|
const res = await commandService.executeCommand(id, params, options);
|
|
1529
1525
|
callback === null || callback === void 0 || callback(res);
|
|
@@ -1537,10 +1533,20 @@ function getSheetIdByName(univerInstanceService, unitId, name) {
|
|
|
1537
1533
|
return ((_univerInstanceServic2 = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET)) === null || _univerInstanceServic2 === void 0 || (_univerInstanceServic2 = _univerInstanceServic2.getSheetBySheetName(name)) === null || _univerInstanceServic2 === void 0 ? void 0 : _univerInstanceServic2.getSheetId()) || "";
|
|
1538
1534
|
}
|
|
1539
1535
|
function DataValidationDetail() {
|
|
1536
|
+
const dataValidationPanelService = useDependency(DataValidationPanelService);
|
|
1537
|
+
const { unitId, subUnitId, rule } = useObservable(dataValidationPanelService.activeRule$, dataValidationPanelService.activeRule) || {};
|
|
1538
|
+
if (!unitId || !subUnitId || !rule) return null;
|
|
1539
|
+
return /* @__PURE__ */ jsx(DataValidationDetailInner, { activeRuleInfo: {
|
|
1540
|
+
unitId,
|
|
1541
|
+
subUnitId,
|
|
1542
|
+
rule
|
|
1543
|
+
} });
|
|
1544
|
+
}
|
|
1545
|
+
function DataValidationDetailInner(props) {
|
|
1540
1546
|
var _validators$sort, _localRule$allowBlank;
|
|
1541
1547
|
const [key, setKey] = useState(0);
|
|
1542
1548
|
const dataValidationPanelService = useDependency(DataValidationPanelService);
|
|
1543
|
-
const { unitId, subUnitId, rule } =
|
|
1549
|
+
const { unitId, subUnitId, rule } = props.activeRuleInfo;
|
|
1544
1550
|
const ruleId = rule.uid;
|
|
1545
1551
|
const validatorService = useDependency(DataValidatorRegistryService);
|
|
1546
1552
|
const univerInstanceService = useDependency(IUniverInstanceService);
|
|
@@ -1760,7 +1766,7 @@ function DataValidationDetail() {
|
|
|
1760
1766
|
value: `${localRule.operator}`,
|
|
1761
1767
|
options: [{
|
|
1762
1768
|
value: "",
|
|
1763
|
-
label: localeService.t("data-validation.operators.legal")
|
|
1769
|
+
label: localeService.t("sheets-data-validation-ui.operators.legal")
|
|
1764
1770
|
}, ...operators.map((op, i) => ({
|
|
1765
1771
|
value: `${op}`,
|
|
1766
1772
|
label: operatorNames[i]
|
|
@@ -1825,7 +1831,7 @@ function DataValidationDetail() {
|
|
|
1825
1831
|
}
|
|
1826
1832
|
|
|
1827
1833
|
//#endregion
|
|
1828
|
-
//#region src/views/components/
|
|
1834
|
+
//#region src/views/components/DataValidationItem.tsx
|
|
1829
1835
|
const DataValidationItem = (props) => {
|
|
1830
1836
|
const { rule, onClick, unitId, subUnitId, disable } = props;
|
|
1831
1837
|
const validatorRegistry = useDependency(DataValidatorRegistryService);
|
|
@@ -1906,7 +1912,7 @@ const DataValidationItem = (props) => {
|
|
|
1906
1912
|
};
|
|
1907
1913
|
|
|
1908
1914
|
//#endregion
|
|
1909
|
-
//#region src/views/components/
|
|
1915
|
+
//#region src/views/components/DataValidationList.tsx
|
|
1910
1916
|
function DataValidationList(props) {
|
|
1911
1917
|
const sheetDataValidationModel = useDependency(SheetDataValidationModel);
|
|
1912
1918
|
const univerInstanceService = useDependency(IUniverInstanceService);
|
|
@@ -2000,7 +2006,7 @@ function DataValidationList(props) {
|
|
|
2000
2006
|
}
|
|
2001
2007
|
|
|
2002
2008
|
//#endregion
|
|
2003
|
-
//#region src/views/components/
|
|
2009
|
+
//#region src/views/components/DataValidationPanel.tsx
|
|
2004
2010
|
const DataValidationPanel = () => {
|
|
2005
2011
|
const dataValidationPanelService = useDependency(DataValidationPanelService);
|
|
2006
2012
|
const activeRule = useObservable(dataValidationPanelService.activeRule$, dataValidationPanelService.activeRule);
|
|
@@ -2014,6 +2020,29 @@ const DataValidationPanel = () => {
|
|
|
2014
2020
|
return activeRule && (activeRule.subUnitId === worksheet.getSheetId() || activeRule.subUnitId === dataValidationPanelService.getFocusFormulaEditorActiveRuleSubUnitId()) ? /* @__PURE__ */ jsx(DataValidationDetail, {}, activeRule.rule.uid) : /* @__PURE__ */ jsx(DataValidationList, { workbook });
|
|
2015
2021
|
};
|
|
2016
2022
|
|
|
2023
|
+
//#endregion
|
|
2024
|
+
//#region src/views/components/DateShowTimeOption.tsx
|
|
2025
|
+
const DATE_SHOW_TIME_OPTION = "DATE_SHOW_TIME_OPTION";
|
|
2026
|
+
function DateShowTimeOption(props) {
|
|
2027
|
+
var _value$bizInfo;
|
|
2028
|
+
const { value, onChange } = props;
|
|
2029
|
+
const localeService = useDependency(LocaleService);
|
|
2030
|
+
return /* @__PURE__ */ jsx(FormLayout, { children: /* @__PURE__ */ jsx(Checkbox, {
|
|
2031
|
+
checked: (_value$bizInfo = value.bizInfo) === null || _value$bizInfo === void 0 ? void 0 : _value$bizInfo.showTime,
|
|
2032
|
+
onChange: (showTime) => {
|
|
2033
|
+
onChange({
|
|
2034
|
+
...value,
|
|
2035
|
+
bizInfo: {
|
|
2036
|
+
...value.bizInfo,
|
|
2037
|
+
showTime
|
|
2038
|
+
}
|
|
2039
|
+
});
|
|
2040
|
+
},
|
|
2041
|
+
children: localeService.t("sheets-data-validation-ui.showTime.label")
|
|
2042
|
+
}) });
|
|
2043
|
+
}
|
|
2044
|
+
DateShowTimeOption.componentKey = DATE_SHOW_TIME_OPTION;
|
|
2045
|
+
|
|
2017
2046
|
//#endregion
|
|
2018
2047
|
//#region src/views/components/formula-input/BaseFormulaInput.tsx
|
|
2019
2048
|
const BaseFormulaInput = (props) => {
|
|
@@ -2255,7 +2284,7 @@ const Template = (props) => {
|
|
|
2255
2284
|
children: [
|
|
2256
2285
|
!item.isRef && /* @__PURE__ */ jsx("div", {
|
|
2257
2286
|
className: clsx("univer-cursor-move", "draggableHandle"),
|
|
2258
|
-
children: /* @__PURE__ */ jsx(
|
|
2287
|
+
children: /* @__PURE__ */ jsx(GripVerticalIcon, {})
|
|
2259
2288
|
}),
|
|
2260
2289
|
/* @__PURE__ */ jsx(ColorSelect, {
|
|
2261
2290
|
value: item.color,
|
|
@@ -2482,13 +2511,13 @@ function ListFormulaInput(props) {
|
|
|
2482
2511
|
//#region src/views/components/formula-input/index.ts
|
|
2483
2512
|
const FORMULA_INPUTS = [
|
|
2484
2513
|
[CUSTOM_FORMULA_INPUT_NAME, CustomFormulaInput],
|
|
2485
|
-
[BASE_FORMULA_INPUT_NAME
|
|
2514
|
+
[BASE_FORMULA_INPUT_NAME, BaseFormulaInput],
|
|
2486
2515
|
[LIST_FORMULA_INPUT_NAME, ListFormulaInput],
|
|
2487
2516
|
[CHECKBOX_FORMULA_INPUT_NAME, CheckboxFormulaInput]
|
|
2488
2517
|
];
|
|
2489
2518
|
|
|
2490
2519
|
//#endregion
|
|
2491
|
-
//#region src/views/components/
|
|
2520
|
+
//#region src/views/components/ListRenderModeInput.tsx
|
|
2492
2521
|
const LIST_RENDER_MODE_OPTION_INPUT = "LIST_RENDER_MODE_OPTION_INPUT";
|
|
2493
2522
|
function ListRenderModeInput(props) {
|
|
2494
2523
|
var _value$renderMode;
|
|
@@ -2521,29 +2550,6 @@ function ListRenderModeInput(props) {
|
|
|
2521
2550
|
}
|
|
2522
2551
|
ListRenderModeInput.componentKey = LIST_RENDER_MODE_OPTION_INPUT;
|
|
2523
2552
|
|
|
2524
|
-
//#endregion
|
|
2525
|
-
//#region src/views/components/show-time/index.tsx
|
|
2526
|
-
const DATE_SHOW_TIME_OPTION = "DATE_SHOW_TIME_OPTION";
|
|
2527
|
-
function DateShowTimeOption(props) {
|
|
2528
|
-
var _value$bizInfo;
|
|
2529
|
-
const { value, onChange } = props;
|
|
2530
|
-
const localeService = useDependency(LocaleService);
|
|
2531
|
-
return /* @__PURE__ */ jsx(FormLayout, { children: /* @__PURE__ */ jsx(Checkbox, {
|
|
2532
|
-
checked: (_value$bizInfo = value.bizInfo) === null || _value$bizInfo === void 0 ? void 0 : _value$bizInfo.showTime,
|
|
2533
|
-
onChange: (showTime) => {
|
|
2534
|
-
onChange({
|
|
2535
|
-
...value,
|
|
2536
|
-
bizInfo: {
|
|
2537
|
-
...value.bizInfo,
|
|
2538
|
-
showTime
|
|
2539
|
-
}
|
|
2540
|
-
});
|
|
2541
|
-
},
|
|
2542
|
-
children: localeService.t("sheets-data-validation-ui.showTime.label")
|
|
2543
|
-
}) });
|
|
2544
|
-
}
|
|
2545
|
-
DateShowTimeOption.componentKey = DATE_SHOW_TIME_OPTION;
|
|
2546
|
-
|
|
2547
2553
|
//#endregion
|
|
2548
2554
|
//#region src/views/widgets/checkbox-widget.ts
|
|
2549
2555
|
const MARGIN_H$2 = 6;
|
|
@@ -2789,10 +2795,6 @@ var CustomFormulaValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
2789
2795
|
}
|
|
2790
2796
|
};
|
|
2791
2797
|
|
|
2792
|
-
//#endregion
|
|
2793
|
-
//#region src/views/components/formula-input/formula-input.ts
|
|
2794
|
-
const BASE_FORMULA_INPUT_NAME = "data-validation.formula-input";
|
|
2795
|
-
|
|
2796
2798
|
//#endregion
|
|
2797
2799
|
//#region src/views/validator-views/date-validator-view.ts
|
|
2798
2800
|
/**
|
|
@@ -2841,7 +2843,7 @@ var DecimalValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
2841
2843
|
constructor(..._args) {
|
|
2842
2844
|
super(..._args);
|
|
2843
2845
|
_defineProperty(this, "id", DataValidationType.DECIMAL);
|
|
2844
|
-
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME
|
|
2846
|
+
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME);
|
|
2845
2847
|
}
|
|
2846
2848
|
};
|
|
2847
2849
|
|
|
@@ -3512,7 +3514,7 @@ var TextLengthValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
3512
3514
|
constructor(..._args) {
|
|
3513
3515
|
super(..._args);
|
|
3514
3516
|
_defineProperty(this, "id", DataValidationType.TEXT_LENGTH);
|
|
3515
|
-
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME
|
|
3517
|
+
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME);
|
|
3516
3518
|
}
|
|
3517
3519
|
};
|
|
3518
3520
|
|
|
@@ -3537,12 +3539,12 @@ var WholeValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
3537
3539
|
constructor(..._args) {
|
|
3538
3540
|
super(..._args);
|
|
3539
3541
|
_defineProperty(this, "id", DataValidationType.WHOLE);
|
|
3540
|
-
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME
|
|
3542
|
+
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME);
|
|
3541
3543
|
}
|
|
3542
3544
|
};
|
|
3543
3545
|
|
|
3544
3546
|
//#endregion
|
|
3545
|
-
//#region src/controllers/
|
|
3547
|
+
//#region src/controllers/ui.controller.ts
|
|
3546
3548
|
let SheetsDataValidationUIController = class SheetsDataValidationUIController extends RxDisposable {
|
|
3547
3549
|
constructor(_injector, _componentManger, _dataValidatorRegistryService) {
|
|
3548
3550
|
super();
|
|
@@ -3554,7 +3556,6 @@ let SheetsDataValidationUIController = class SheetsDataValidationUIController ex
|
|
|
3554
3556
|
}
|
|
3555
3557
|
_initComponents() {
|
|
3556
3558
|
[
|
|
3557
|
-
["DataValidationIcon", DataValidationIcon],
|
|
3558
3559
|
[DATA_VALIDATION_PANEL, DataValidationPanel],
|
|
3559
3560
|
[ListRenderModeInput.componentKey, ListRenderModeInput],
|
|
3560
3561
|
[DateShowTimeOption.componentKey, DateShowTimeOption],
|
|
@@ -3605,6 +3606,8 @@ let UniverSheetsDataValidationMobileUIPlugin = class UniverSheetsDataValidationM
|
|
|
3605
3606
|
this._configService.setConfig(SHEETS_DATA_VALIDATION_UI_PLUGIN_CONFIG_KEY, rest);
|
|
3606
3607
|
}
|
|
3607
3608
|
onStarting() {
|
|
3609
|
+
this._injector.add([ComponentsController]);
|
|
3610
|
+
this._injector.get(ComponentsController);
|
|
3608
3611
|
[
|
|
3609
3612
|
[DataValidationPanelService],
|
|
3610
3613
|
[DataValidationDropdownManagerService],
|
|
@@ -3665,6 +3668,8 @@ let UniverSheetsDataValidationUIPlugin = class UniverSheetsDataValidationUIPlugi
|
|
|
3665
3668
|
this._configService.setConfig(SHEETS_DATA_VALIDATION_UI_PLUGIN_CONFIG_KEY, rest);
|
|
3666
3669
|
}
|
|
3667
3670
|
onStarting() {
|
|
3671
|
+
this._injector.add([ComponentsController]);
|
|
3672
|
+
this._injector.get(ComponentsController);
|
|
3668
3673
|
[
|
|
3669
3674
|
[DataValidationPanelService],
|
|
3670
3675
|
[DataValidationDropdownManagerService],
|
|
@@ -3716,4 +3721,4 @@ UniverSheetsDataValidationUIPlugin = __decorate([
|
|
|
3716
3721
|
], UniverSheetsDataValidationUIPlugin);
|
|
3717
3722
|
|
|
3718
3723
|
//#endregion
|
|
3719
|
-
export {
|
|
3724
|
+
export { UniverSheetsDataValidationMobileUIPlugin, UniverSheetsDataValidationUIPlugin };
|
package/lib/es/locale/ar-SA.js
CHANGED
package/lib/es/locale/ca-ES.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/locale/ca-ES.ts
|
|
2
2
|
const locale = { "sheets-data-validation-ui": {
|
|
3
3
|
title: "Validació de dades",
|
|
4
|
+
operators: { legal: "és tipus legal" },
|
|
4
5
|
validFail: {
|
|
5
6
|
value: "Si us plau, introdueix un valor",
|
|
6
7
|
common: "Si us plau, introdueix un valor o una fórmula",
|
package/lib/es/locale/de-DE.js
CHANGED
package/lib/es/locale/en-US.js
CHANGED
package/lib/es/locale/es-ES.js
CHANGED
package/lib/es/locale/fa-IR.js
CHANGED
package/lib/es/locale/fr-FR.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/locale/fr-FR.ts
|
|
2
2
|
const locale = { "sheets-data-validation-ui": {
|
|
3
3
|
title: "Validation des données",
|
|
4
|
+
operators: { legal: "est de type légal" },
|
|
4
5
|
validFail: {
|
|
5
6
|
value: "Veuillez entrer une valeur",
|
|
6
7
|
common: "Veuillez entrer une valeur ou une formule",
|
package/lib/es/locale/id-ID.js
CHANGED
package/lib/es/locale/it-IT.js
CHANGED
package/lib/es/locale/ja-JP.js
CHANGED
package/lib/es/locale/ko-KR.js
CHANGED
package/lib/es/locale/pl-PL.js
CHANGED
package/lib/es/locale/pt-BR.js
CHANGED
package/lib/es/locale/ru-RU.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/locale/ru-RU.ts
|
|
2
2
|
const locale = { "sheets-data-validation-ui": {
|
|
3
3
|
title: "Проверка данных",
|
|
4
|
+
operators: { legal: "является допустимым типом" },
|
|
4
5
|
validFail: {
|
|
5
6
|
value: "Пожалуйста, введите значение",
|
|
6
7
|
common: "Пожалуйста, введите значение или формулу",
|
package/lib/es/locale/sk-SK.js
CHANGED
package/lib/es/locale/vi-VN.js
CHANGED
package/lib/es/locale/zh-CN.js
CHANGED
package/lib/es/locale/zh-HK.js
CHANGED