@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/cjs/index.js
CHANGED
|
@@ -45,10 +45,10 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
45
45
|
|
|
46
46
|
//#region package.json
|
|
47
47
|
var name = "@univerjs/sheets-data-validation-ui";
|
|
48
|
-
var version = "0.
|
|
48
|
+
var version = "1.0.0-alpha.0";
|
|
49
49
|
|
|
50
50
|
//#endregion
|
|
51
|
-
//#region \0@oxc-project+runtime@0.
|
|
51
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
52
52
|
function _typeof(o) {
|
|
53
53
|
"@babel/helpers - typeof";
|
|
54
54
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -59,7 +59,7 @@ function _typeof(o) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region \0@oxc-project+runtime@0.
|
|
62
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
63
63
|
function toPrimitive(t, r) {
|
|
64
64
|
if ("object" != _typeof(t) || !t) return t;
|
|
65
65
|
var e = t[Symbol.toPrimitive];
|
|
@@ -72,14 +72,14 @@ function toPrimitive(t, r) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region \0@oxc-project+runtime@0.
|
|
75
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
76
76
|
function toPropertyKey(t) {
|
|
77
77
|
var i = toPrimitive(t, "string");
|
|
78
78
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region \0@oxc-project+runtime@0.
|
|
82
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
83
83
|
function _defineProperty(e, r, t) {
|
|
84
84
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
85
85
|
value: t,
|
|
@@ -90,7 +90,7 @@ function _defineProperty(e, r, t) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
//#endregion
|
|
93
|
-
//#region \0@oxc-project+runtime@0.
|
|
93
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
|
|
94
94
|
function __decorateParam(paramIndex, decorator) {
|
|
95
95
|
return function(target, key) {
|
|
96
96
|
decorator(target, key, paramIndex);
|
|
@@ -98,7 +98,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region \0@oxc-project+runtime@0.
|
|
101
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
102
102
|
function __decorate(decorators, target, key, desc) {
|
|
103
103
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
104
104
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -199,21 +199,6 @@ const DROP_DOWN_DEFAULT_COLOR = "#ECECEC";
|
|
|
199
199
|
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region src/controllers/dv-reject-input.controller.ts
|
|
202
|
-
/**
|
|
203
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
204
|
-
*
|
|
205
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
206
|
-
* you may not use this file except in compliance with the License.
|
|
207
|
-
* You may obtain a copy of the License at
|
|
208
|
-
*
|
|
209
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
210
|
-
*
|
|
211
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
212
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
213
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
214
|
-
* See the License for the specific language governing permissions and
|
|
215
|
-
* limitations under the License.
|
|
216
|
-
*/
|
|
217
202
|
let DataValidationRejectInputController = class DataValidationRejectInputController extends _univerjs_core.Disposable {
|
|
218
203
|
constructor(_sheetInterceptorService, _dataValidationModel, _dataValidatorRegistryService, _dialogService, _localeService, _sheetsDataValidationValidatorService) {
|
|
219
204
|
super();
|
|
@@ -303,11 +288,10 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
303
288
|
get activeDropdown() {
|
|
304
289
|
return this._activeDropdown;
|
|
305
290
|
}
|
|
306
|
-
constructor(_univerInstanceService, _dataValidatorRegistryService,
|
|
291
|
+
constructor(_univerInstanceService, _dataValidatorRegistryService, _dataValidationModel, _sheetsSelectionsService, _cellDropdownManagerService, _sheetDataValidationModel, _commandService, _editorBridgeService, _injector, _configService) {
|
|
307
292
|
super();
|
|
308
293
|
this._univerInstanceService = _univerInstanceService;
|
|
309
294
|
this._dataValidatorRegistryService = _dataValidatorRegistryService;
|
|
310
|
-
this._zenZoneService = _zenZoneService;
|
|
311
295
|
this._dataValidationModel = _dataValidationModel;
|
|
312
296
|
this._sheetsSelectionsService = _sheetsSelectionsService;
|
|
313
297
|
this._cellDropdownManagerService = _cellDropdownManagerService;
|
|
@@ -320,19 +304,11 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
320
304
|
_defineProperty(this, "_activeDropdown$", new rxjs.Subject());
|
|
321
305
|
_defineProperty(this, "_currentPopup", null);
|
|
322
306
|
_defineProperty(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
|
323
|
-
_defineProperty(this, "_zenVisible", false);
|
|
324
|
-
this._init();
|
|
325
307
|
this._initSelectionChange();
|
|
326
308
|
this.disposeWithMe(() => {
|
|
327
309
|
this._activeDropdown$.complete();
|
|
328
310
|
});
|
|
329
311
|
}
|
|
330
|
-
_init() {
|
|
331
|
-
this.disposeWithMe(this._zenZoneService.visible$.subscribe((visible) => {
|
|
332
|
-
this._zenVisible = visible;
|
|
333
|
-
if (visible) this.hideDropdown();
|
|
334
|
-
}));
|
|
335
|
-
}
|
|
336
312
|
_getDropdownByCell(unitId, subUnitId, row, col) {
|
|
337
313
|
const workbook = unitId ? this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
338
314
|
if (!workbook) return;
|
|
@@ -352,7 +328,6 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
352
328
|
const { location } = param;
|
|
353
329
|
const { row, col, unitId, subUnitId, workbook, worksheet } = location;
|
|
354
330
|
if (this._currentPopup) this._currentPopup.dispose();
|
|
355
|
-
if (this._zenVisible) return;
|
|
356
331
|
this._activeDropdown = param;
|
|
357
332
|
this._activeDropdown$.next(this._activeDropdown);
|
|
358
333
|
const rule = this._sheetDataValidationModel.getRuleByLocation(unitId, subUnitId, row, col);
|
|
@@ -644,15 +619,14 @@ let DataValidationDropdownManagerService = class DataValidationDropdownManagerSe
|
|
|
644
619
|
DataValidationDropdownManagerService = __decorate([
|
|
645
620
|
__decorateParam(0, _univerjs_core.IUniverInstanceService),
|
|
646
621
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_data_validation.DataValidatorRegistryService)),
|
|
647
|
-
__decorateParam(2,
|
|
648
|
-
__decorateParam(3, (0, _univerjs_core.Inject)(
|
|
649
|
-
__decorateParam(4, (0, _univerjs_core.Inject)(
|
|
650
|
-
__decorateParam(5, (0, _univerjs_core.Inject)(
|
|
651
|
-
__decorateParam(6,
|
|
652
|
-
__decorateParam(7,
|
|
653
|
-
__decorateParam(8,
|
|
654
|
-
__decorateParam(9,
|
|
655
|
-
__decorateParam(10, _univerjs_core.IConfigService)
|
|
622
|
+
__decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets_data_validation.SheetDataValidationModel)),
|
|
623
|
+
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService)),
|
|
624
|
+
__decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_sheets_ui.ISheetCellDropdownManagerService)),
|
|
625
|
+
__decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_sheets_data_validation.SheetDataValidationModel)),
|
|
626
|
+
__decorateParam(6, _univerjs_core.ICommandService),
|
|
627
|
+
__decorateParam(7, _univerjs_sheets_ui.IEditorBridgeService),
|
|
628
|
+
__decorateParam(8, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
629
|
+
__decorateParam(9, _univerjs_core.IConfigService)
|
|
656
630
|
], DataValidationDropdownManagerService);
|
|
657
631
|
|
|
658
632
|
//#endregion
|
|
@@ -760,23 +734,51 @@ const AddSheetDataValidationAndOpenCommand = {
|
|
|
760
734
|
}
|
|
761
735
|
};
|
|
762
736
|
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/controllers/components.controller.ts
|
|
739
|
+
/**
|
|
740
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
741
|
+
*
|
|
742
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
743
|
+
* you may not use this file except in compliance with the License.
|
|
744
|
+
* You may obtain a copy of the License at
|
|
745
|
+
*
|
|
746
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
747
|
+
*
|
|
748
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
749
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
750
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
751
|
+
* See the License for the specific language governing permissions and
|
|
752
|
+
* limitations under the License.
|
|
753
|
+
*/
|
|
754
|
+
let ComponentsController = class ComponentsController extends _univerjs_core.Disposable {
|
|
755
|
+
constructor(_componentManager, _iconManager) {
|
|
756
|
+
super();
|
|
757
|
+
this._componentManager = _componentManager;
|
|
758
|
+
this._iconManager = _iconManager;
|
|
759
|
+
this._registerIcons();
|
|
760
|
+
}
|
|
761
|
+
_registerIcons() {
|
|
762
|
+
this.disposeWithMe(this._iconManager.register({ DataValidationIcon: _univerjs_icons.DataValidationIcon }));
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
ComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], ComponentsController);
|
|
766
|
+
|
|
763
767
|
//#endregion
|
|
764
768
|
//#region src/controllers/dv-alert.controller.ts
|
|
765
769
|
const ALERT_KEY = "SHEET_DATA_VALIDATION_ALERT";
|
|
766
770
|
let DataValidationAlertController = class DataValidationAlertController extends _univerjs_core.Disposable {
|
|
767
|
-
constructor(_hoverManagerService, _cellAlertManagerService, _univerInstanceService, _localeService,
|
|
771
|
+
constructor(_hoverManagerService, _cellAlertManagerService, _univerInstanceService, _localeService, _dataValidationModel) {
|
|
768
772
|
super();
|
|
769
773
|
this._hoverManagerService = _hoverManagerService;
|
|
770
774
|
this._cellAlertManagerService = _cellAlertManagerService;
|
|
771
775
|
this._univerInstanceService = _univerInstanceService;
|
|
772
776
|
this._localeService = _localeService;
|
|
773
|
-
this._zenZoneService = _zenZoneService;
|
|
774
777
|
this._dataValidationModel = _dataValidationModel;
|
|
775
778
|
this._init();
|
|
776
779
|
}
|
|
777
780
|
_init() {
|
|
778
781
|
this._initCellAlertPopup();
|
|
779
|
-
this._initZenService();
|
|
780
782
|
}
|
|
781
783
|
_initCellAlertPopup() {
|
|
782
784
|
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe((0, rxjs.debounceTime)(100)).subscribe((cellPos) => {
|
|
@@ -821,19 +823,13 @@ let DataValidationAlertController = class DataValidationAlertController extends
|
|
|
821
823
|
this._cellAlertManagerService.removeAlert(ALERT_KEY);
|
|
822
824
|
}));
|
|
823
825
|
}
|
|
824
|
-
_initZenService() {
|
|
825
|
-
this.disposeWithMe(this._zenZoneService.visible$.subscribe((visible) => {
|
|
826
|
-
if (visible) this._cellAlertManagerService.removeAlert(ALERT_KEY);
|
|
827
|
-
}));
|
|
828
|
-
}
|
|
829
826
|
};
|
|
830
827
|
DataValidationAlertController = __decorate([
|
|
831
828
|
__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_sheets_ui.HoverManagerService)),
|
|
832
829
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_sheets_ui.CellAlertManagerService)),
|
|
833
830
|
__decorateParam(2, _univerjs_core.IUniverInstanceService),
|
|
834
831
|
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService)),
|
|
835
|
-
__decorateParam(4,
|
|
836
|
-
__decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_sheets_data_validation.SheetDataValidationModel))
|
|
832
|
+
__decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_sheets_data_validation.SheetDataValidationModel))
|
|
837
833
|
], DataValidationAlertController);
|
|
838
834
|
|
|
839
835
|
//#endregion
|
|
@@ -1152,14 +1148,14 @@ function dataValidationMenuFactory(accessor) {
|
|
|
1152
1148
|
})
|
|
1153
1149
|
};
|
|
1154
1150
|
}
|
|
1155
|
-
function openDataValidationMenuFactory(
|
|
1151
|
+
function openDataValidationMenuFactory() {
|
|
1156
1152
|
return {
|
|
1157
1153
|
id: OpenValidationPanelOperation.id,
|
|
1158
1154
|
title: "sheets-data-validation-ui.panel.title",
|
|
1159
1155
|
type: _univerjs_ui.MenuItemType.BUTTON
|
|
1160
1156
|
};
|
|
1161
1157
|
}
|
|
1162
|
-
function addDataValidationMenuFactory(
|
|
1158
|
+
function addDataValidationMenuFactory() {
|
|
1163
1159
|
return {
|
|
1164
1160
|
id: AddSheetDataValidationAndOpenCommand.id,
|
|
1165
1161
|
title: "sheets-data-validation-ui.panel.add",
|
|
@@ -1496,7 +1492,7 @@ let SheetsDataValidationReRenderController = class SheetsDataValidationReRenderC
|
|
|
1496
1492
|
SheetsDataValidationReRenderController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_sheets_data_validation.SheetDataValidationModel)), __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets_ui.SheetSkeletonManagerService))], SheetsDataValidationReRenderController);
|
|
1497
1493
|
|
|
1498
1494
|
//#endregion
|
|
1499
|
-
//#region src/views/components/
|
|
1495
|
+
//#region src/views/components/DataValidationOptions.tsx
|
|
1500
1496
|
function DataValidationOptions(props) {
|
|
1501
1497
|
var _value$errorStyle;
|
|
1502
1498
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -1552,7 +1548,7 @@ function DataValidationOptions(props) {
|
|
|
1552
1548
|
}
|
|
1553
1549
|
|
|
1554
1550
|
//#endregion
|
|
1555
|
-
//#region src/views/components/
|
|
1551
|
+
//#region src/views/components/DataValidationDetail.tsx
|
|
1556
1552
|
const debounceExecuteFactory = (commandService) => (0, _univerjs_core.debounce)(async (id, params, options, callback) => {
|
|
1557
1553
|
const res = await commandService.executeCommand(id, params, options);
|
|
1558
1554
|
callback === null || callback === void 0 || callback(res);
|
|
@@ -1566,10 +1562,20 @@ function getSheetIdByName(univerInstanceService, unitId, name) {
|
|
|
1566
1562
|
return ((_univerInstanceServic2 = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _univerInstanceServic2 === void 0 || (_univerInstanceServic2 = _univerInstanceServic2.getSheetBySheetName(name)) === null || _univerInstanceServic2 === void 0 ? void 0 : _univerInstanceServic2.getSheetId()) || "";
|
|
1567
1563
|
}
|
|
1568
1564
|
function DataValidationDetail() {
|
|
1565
|
+
const dataValidationPanelService = (0, _univerjs_ui.useDependency)(DataValidationPanelService);
|
|
1566
|
+
const { unitId, subUnitId, rule } = (0, _univerjs_ui.useObservable)(dataValidationPanelService.activeRule$, dataValidationPanelService.activeRule) || {};
|
|
1567
|
+
if (!unitId || !subUnitId || !rule) return null;
|
|
1568
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataValidationDetailInner, { activeRuleInfo: {
|
|
1569
|
+
unitId,
|
|
1570
|
+
subUnitId,
|
|
1571
|
+
rule
|
|
1572
|
+
} });
|
|
1573
|
+
}
|
|
1574
|
+
function DataValidationDetailInner(props) {
|
|
1569
1575
|
var _validators$sort, _localRule$allowBlank;
|
|
1570
1576
|
const [key, setKey] = (0, react.useState)(0);
|
|
1571
1577
|
const dataValidationPanelService = (0, _univerjs_ui.useDependency)(DataValidationPanelService);
|
|
1572
|
-
const { unitId, subUnitId, rule } =
|
|
1578
|
+
const { unitId, subUnitId, rule } = props.activeRuleInfo;
|
|
1573
1579
|
const ruleId = rule.uid;
|
|
1574
1580
|
const validatorService = (0, _univerjs_ui.useDependency)(_univerjs_data_validation.DataValidatorRegistryService);
|
|
1575
1581
|
const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
@@ -1789,7 +1795,7 @@ function DataValidationDetail() {
|
|
|
1789
1795
|
value: `${localRule.operator}`,
|
|
1790
1796
|
options: [{
|
|
1791
1797
|
value: "",
|
|
1792
|
-
label: localeService.t("data-validation.operators.legal")
|
|
1798
|
+
label: localeService.t("sheets-data-validation-ui.operators.legal")
|
|
1793
1799
|
}, ...operators.map((op, i) => ({
|
|
1794
1800
|
value: `${op}`,
|
|
1795
1801
|
label: operatorNames[i]
|
|
@@ -1854,7 +1860,7 @@ function DataValidationDetail() {
|
|
|
1854
1860
|
}
|
|
1855
1861
|
|
|
1856
1862
|
//#endregion
|
|
1857
|
-
//#region src/views/components/
|
|
1863
|
+
//#region src/views/components/DataValidationItem.tsx
|
|
1858
1864
|
const DataValidationItem = (props) => {
|
|
1859
1865
|
const { rule, onClick, unitId, subUnitId, disable } = props;
|
|
1860
1866
|
const validatorRegistry = (0, _univerjs_ui.useDependency)(_univerjs_data_validation.DataValidatorRegistryService);
|
|
@@ -1935,7 +1941,7 @@ const DataValidationItem = (props) => {
|
|
|
1935
1941
|
};
|
|
1936
1942
|
|
|
1937
1943
|
//#endregion
|
|
1938
|
-
//#region src/views/components/
|
|
1944
|
+
//#region src/views/components/DataValidationList.tsx
|
|
1939
1945
|
function DataValidationList(props) {
|
|
1940
1946
|
const sheetDataValidationModel = (0, _univerjs_ui.useDependency)(_univerjs_sheets_data_validation.SheetDataValidationModel);
|
|
1941
1947
|
const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
@@ -2029,7 +2035,7 @@ function DataValidationList(props) {
|
|
|
2029
2035
|
}
|
|
2030
2036
|
|
|
2031
2037
|
//#endregion
|
|
2032
|
-
//#region src/views/components/
|
|
2038
|
+
//#region src/views/components/DataValidationPanel.tsx
|
|
2033
2039
|
const DataValidationPanel = () => {
|
|
2034
2040
|
const dataValidationPanelService = (0, _univerjs_ui.useDependency)(DataValidationPanelService);
|
|
2035
2041
|
const activeRule = (0, _univerjs_ui.useObservable)(dataValidationPanelService.activeRule$, dataValidationPanelService.activeRule);
|
|
@@ -2043,6 +2049,29 @@ const DataValidationPanel = () => {
|
|
|
2043
2049
|
return activeRule && (activeRule.subUnitId === worksheet.getSheetId() || activeRule.subUnitId === dataValidationPanelService.getFocusFormulaEditorActiveRuleSubUnitId()) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataValidationDetail, {}, activeRule.rule.uid) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataValidationList, { workbook });
|
|
2044
2050
|
};
|
|
2045
2051
|
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region src/views/components/DateShowTimeOption.tsx
|
|
2054
|
+
const DATE_SHOW_TIME_OPTION = "DATE_SHOW_TIME_OPTION";
|
|
2055
|
+
function DateShowTimeOption(props) {
|
|
2056
|
+
var _value$bizInfo;
|
|
2057
|
+
const { value, onChange } = props;
|
|
2058
|
+
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
2059
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
|
|
2060
|
+
checked: (_value$bizInfo = value.bizInfo) === null || _value$bizInfo === void 0 ? void 0 : _value$bizInfo.showTime,
|
|
2061
|
+
onChange: (showTime) => {
|
|
2062
|
+
onChange({
|
|
2063
|
+
...value,
|
|
2064
|
+
bizInfo: {
|
|
2065
|
+
...value.bizInfo,
|
|
2066
|
+
showTime
|
|
2067
|
+
}
|
|
2068
|
+
});
|
|
2069
|
+
},
|
|
2070
|
+
children: localeService.t("sheets-data-validation-ui.showTime.label")
|
|
2071
|
+
}) });
|
|
2072
|
+
}
|
|
2073
|
+
DateShowTimeOption.componentKey = DATE_SHOW_TIME_OPTION;
|
|
2074
|
+
|
|
2046
2075
|
//#endregion
|
|
2047
2076
|
//#region src/views/components/formula-input/BaseFormulaInput.tsx
|
|
2048
2077
|
const BaseFormulaInput = (props) => {
|
|
@@ -2284,7 +2313,7 @@ const Template = (props) => {
|
|
|
2284
2313
|
children: [
|
|
2285
2314
|
!item.isRef && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2286
2315
|
className: (0, _univerjs_design.clsx)("univer-cursor-move", "draggableHandle"),
|
|
2287
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.
|
|
2316
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.GripVerticalIcon, {})
|
|
2288
2317
|
}),
|
|
2289
2318
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColorSelect, {
|
|
2290
2319
|
value: item.color,
|
|
@@ -2517,7 +2546,7 @@ const FORMULA_INPUTS = [
|
|
|
2517
2546
|
];
|
|
2518
2547
|
|
|
2519
2548
|
//#endregion
|
|
2520
|
-
//#region src/views/components/
|
|
2549
|
+
//#region src/views/components/ListRenderModeInput.tsx
|
|
2521
2550
|
const LIST_RENDER_MODE_OPTION_INPUT = "LIST_RENDER_MODE_OPTION_INPUT";
|
|
2522
2551
|
function ListRenderModeInput(props) {
|
|
2523
2552
|
var _value$renderMode;
|
|
@@ -2550,29 +2579,6 @@ function ListRenderModeInput(props) {
|
|
|
2550
2579
|
}
|
|
2551
2580
|
ListRenderModeInput.componentKey = LIST_RENDER_MODE_OPTION_INPUT;
|
|
2552
2581
|
|
|
2553
|
-
//#endregion
|
|
2554
|
-
//#region src/views/components/show-time/index.tsx
|
|
2555
|
-
const DATE_SHOW_TIME_OPTION = "DATE_SHOW_TIME_OPTION";
|
|
2556
|
-
function DateShowTimeOption(props) {
|
|
2557
|
-
var _value$bizInfo;
|
|
2558
|
-
const { value, onChange } = props;
|
|
2559
|
-
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
2560
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
|
|
2561
|
-
checked: (_value$bizInfo = value.bizInfo) === null || _value$bizInfo === void 0 ? void 0 : _value$bizInfo.showTime,
|
|
2562
|
-
onChange: (showTime) => {
|
|
2563
|
-
onChange({
|
|
2564
|
-
...value,
|
|
2565
|
-
bizInfo: {
|
|
2566
|
-
...value.bizInfo,
|
|
2567
|
-
showTime
|
|
2568
|
-
}
|
|
2569
|
-
});
|
|
2570
|
-
},
|
|
2571
|
-
children: localeService.t("sheets-data-validation-ui.showTime.label")
|
|
2572
|
-
}) });
|
|
2573
|
-
}
|
|
2574
|
-
DateShowTimeOption.componentKey = DATE_SHOW_TIME_OPTION;
|
|
2575
|
-
|
|
2576
2582
|
//#endregion
|
|
2577
2583
|
//#region src/views/widgets/checkbox-widget.ts
|
|
2578
2584
|
const MARGIN_H$2 = 6;
|
|
@@ -2818,10 +2824,6 @@ var CustomFormulaValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
2818
2824
|
}
|
|
2819
2825
|
};
|
|
2820
2826
|
|
|
2821
|
-
//#endregion
|
|
2822
|
-
//#region src/views/components/formula-input/formula-input.ts
|
|
2823
|
-
const BASE_FORMULA_INPUT_NAME = "data-validation.formula-input";
|
|
2824
|
-
|
|
2825
2827
|
//#endregion
|
|
2826
2828
|
//#region src/views/validator-views/date-validator-view.ts
|
|
2827
2829
|
/**
|
|
@@ -2843,7 +2845,7 @@ var DateValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
2843
2845
|
constructor(..._args) {
|
|
2844
2846
|
super(..._args);
|
|
2845
2847
|
_defineProperty(this, "id", _univerjs_core.DataValidationType.DATE);
|
|
2846
|
-
_defineProperty(this, "formulaInput", BASE_FORMULA_INPUT_NAME);
|
|
2848
|
+
_defineProperty(this, "formulaInput", _univerjs_sheets_data_validation.BASE_FORMULA_INPUT_NAME);
|
|
2847
2849
|
_defineProperty(this, "optionsInput", DateShowTimeOption.componentKey);
|
|
2848
2850
|
_defineProperty(this, "dropdownType", _univerjs_data_validation.DataValidatorDropdownType.DATE);
|
|
2849
2851
|
}
|
|
@@ -3571,7 +3573,7 @@ var WholeValidatorView = class extends BaseSheetDataValidatorView {
|
|
|
3571
3573
|
};
|
|
3572
3574
|
|
|
3573
3575
|
//#endregion
|
|
3574
|
-
//#region src/controllers/
|
|
3576
|
+
//#region src/controllers/ui.controller.ts
|
|
3575
3577
|
let SheetsDataValidationUIController = class SheetsDataValidationUIController extends _univerjs_core.RxDisposable {
|
|
3576
3578
|
constructor(_injector, _componentManger, _dataValidatorRegistryService) {
|
|
3577
3579
|
super();
|
|
@@ -3583,7 +3585,6 @@ let SheetsDataValidationUIController = class SheetsDataValidationUIController ex
|
|
|
3583
3585
|
}
|
|
3584
3586
|
_initComponents() {
|
|
3585
3587
|
[
|
|
3586
|
-
["DataValidationIcon", _univerjs_icons.DataValidationIcon],
|
|
3587
3588
|
[DATA_VALIDATION_PANEL, DataValidationPanel],
|
|
3588
3589
|
[ListRenderModeInput.componentKey, ListRenderModeInput],
|
|
3589
3590
|
[DateShowTimeOption.componentKey, DateShowTimeOption],
|
|
@@ -3634,6 +3635,8 @@ let UniverSheetsDataValidationMobileUIPlugin = class UniverSheetsDataValidationM
|
|
|
3634
3635
|
this._configService.setConfig(SHEETS_DATA_VALIDATION_UI_PLUGIN_CONFIG_KEY, rest);
|
|
3635
3636
|
}
|
|
3636
3637
|
onStarting() {
|
|
3638
|
+
this._injector.add([ComponentsController]);
|
|
3639
|
+
this._injector.get(ComponentsController);
|
|
3637
3640
|
[
|
|
3638
3641
|
[DataValidationPanelService],
|
|
3639
3642
|
[DataValidationDropdownManagerService],
|
|
@@ -3694,6 +3697,8 @@ let UniverSheetsDataValidationUIPlugin = class UniverSheetsDataValidationUIPlugi
|
|
|
3694
3697
|
this._configService.setConfig(SHEETS_DATA_VALIDATION_UI_PLUGIN_CONFIG_KEY, rest);
|
|
3695
3698
|
}
|
|
3696
3699
|
onStarting() {
|
|
3700
|
+
this._injector.add([ComponentsController]);
|
|
3701
|
+
this._injector.get(ComponentsController);
|
|
3697
3702
|
[
|
|
3698
3703
|
[DataValidationPanelService],
|
|
3699
3704
|
[DataValidationDropdownManagerService],
|
|
@@ -3745,12 +3750,6 @@ UniverSheetsDataValidationUIPlugin = __decorate([
|
|
|
3745
3750
|
], UniverSheetsDataValidationUIPlugin);
|
|
3746
3751
|
|
|
3747
3752
|
//#endregion
|
|
3748
|
-
Object.defineProperty(exports, 'BaseSheetDataValidatorView', {
|
|
3749
|
-
enumerable: true,
|
|
3750
|
-
get: function () {
|
|
3751
|
-
return BaseSheetDataValidatorView;
|
|
3752
|
-
}
|
|
3753
|
-
});
|
|
3754
3753
|
Object.defineProperty(exports, 'UniverSheetsDataValidationMobileUIPlugin', {
|
|
3755
3754
|
enumerable: true,
|
|
3756
3755
|
get: function () {
|
package/lib/cjs/locale/ar-SA.js
CHANGED
package/lib/cjs/locale/ca-ES.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
//#region src/locale/ca-ES.ts
|
|
3
3
|
const locale = { "sheets-data-validation-ui": {
|
|
4
4
|
title: "Validació de dades",
|
|
5
|
+
operators: { legal: "és tipus legal" },
|
|
5
6
|
validFail: {
|
|
6
7
|
value: "Si us plau, introdueix un valor",
|
|
7
8
|
common: "Si us plau, introdueix un valor o una fórmula",
|
package/lib/cjs/locale/de-DE.js
CHANGED
package/lib/cjs/locale/en-US.js
CHANGED
package/lib/cjs/locale/es-ES.js
CHANGED
package/lib/cjs/locale/fa-IR.js
CHANGED
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
//#region src/locale/fr-FR.ts
|
|
3
3
|
const locale = { "sheets-data-validation-ui": {
|
|
4
4
|
title: "Validation des données",
|
|
5
|
+
operators: { legal: "est de type légal" },
|
|
5
6
|
validFail: {
|
|
6
7
|
value: "Veuillez entrer une valeur",
|
|
7
8
|
common: "Veuillez entrer une valeur ou une formule",
|
package/lib/cjs/locale/id-ID.js
CHANGED
package/lib/cjs/locale/it-IT.js
CHANGED
package/lib/cjs/locale/ja-JP.js
CHANGED
package/lib/cjs/locale/ko-KR.js
CHANGED
package/lib/cjs/locale/pl-PL.js
CHANGED
package/lib/cjs/locale/pt-BR.js
CHANGED
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
//#region src/locale/ru-RU.ts
|
|
3
3
|
const locale = { "sheets-data-validation-ui": {
|
|
4
4
|
title: "Проверка данных",
|
|
5
|
+
operators: { legal: "является допустимым типом" },
|
|
5
6
|
validFail: {
|
|
6
7
|
value: "Пожалуйста, введите значение",
|
|
7
8
|
common: "Пожалуйста, введите значение или формулу",
|
package/lib/cjs/locale/sk-SK.js
CHANGED
package/lib/cjs/locale/vi-VN.js
CHANGED
package/lib/cjs/locale/zh-CN.js
CHANGED
package/lib/cjs/locale/zh-HK.js
CHANGED