@univerjs/sheets-data-validation 0.17.0 → 0.18.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/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1628
- package/lib/es/index.js +1 -2640
- package/lib/facade.js +1 -1628
- package/lib/index.js +1 -2640
- package/lib/types/commands/commands/data-validation.command.d.ts +19 -4
- package/lib/types/common/date-text-map.d.ts +15 -0
- package/lib/types/controllers/dv-formula-ref-range.controller.d.ts +17 -1
- package/lib/types/controllers/dv-formula.controller.d.ts +15 -0
- package/lib/types/controllers/dv-ref-range.controller.d.ts +17 -1
- package/lib/types/controllers/dv-sheet.controller.d.ts +15 -0
- package/lib/types/controllers/dv.controller.d.ts +15 -0
- package/lib/types/facade/f-data-validation-builder.d.ts +18 -2
- package/lib/types/facade/f-data-validation.d.ts +16 -1
- package/lib/types/facade/f-event.d.ts +20 -5
- package/lib/types/facade/f-range.d.ts +18 -2
- package/lib/types/facade/f-univer.d.ts +16 -1
- package/lib/types/facade/f-workbook.d.ts +20 -3
- package/lib/types/facade/f-worksheet.d.ts +18 -2
- package/lib/types/models/rule-matrix.d.ts +17 -2
- package/lib/types/models/sheet-data-validation-model.d.ts +24 -7
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/dv-cache.service.d.ts +18 -2
- package/lib/types/services/dv-custom-formula.service.d.ts +21 -5
- package/lib/types/services/dv-formula.service.d.ts +19 -2
- package/lib/types/services/dv-list-cache.service.d.ts +18 -2
- package/lib/types/services/dv-validator-service.d.ts +17 -1
- package/lib/types/types/const/operator-text-map.d.ts +15 -0
- package/lib/types/types/const/two-formula-operators.d.ts +15 -0
- package/lib/types/utils/create.d.ts +18 -2
- package/lib/types/utils/formula.d.ts +18 -3
- package/lib/types/utils/get-cell-data-origin.d.ts +17 -2
- package/lib/types/validators/any-validator.d.ts +18 -2
- package/lib/types/validators/checkbox-validator.d.ts +19 -2
- package/lib/types/validators/custom-validator.d.ts +18 -2
- package/lib/types/validators/date-validator.d.ts +20 -3
- package/lib/types/validators/decimal-validator.d.ts +23 -6
- package/lib/types/validators/list-multiple-validator.d.ts +15 -0
- package/lib/types/validators/list-validator.d.ts +18 -2
- package/lib/types/validators/text-length-validator.d.ts +23 -6
- package/lib/types/validators/util.d.ts +18 -3
- package/lib/types/validators/whole-validator.d.ts +23 -6
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +11 -10
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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, ICommand, IDataValidationRuleBase, IDataValidationRuleOptions, IMutationInfo, Injector, IRange, ISheetDataValidationRule } from '@univerjs/core';
|
|
17
|
+
import type { DataValidationChangeSource, IRemoveDataValidationMutationParams } from '@univerjs/data-validation';
|
|
18
|
+
import type { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
19
|
+
import type { RangeMutation } from '../../models/rule-matrix';
|
|
5
20
|
export interface IUpdateSheetDataValidationRangeCommandParams {
|
|
6
21
|
unitId: string;
|
|
7
22
|
subUnitId: string;
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { DataValidationOperator } from '@univerjs/core';
|
|
2
17
|
export declare const DateOperatorNameMap: Record<DataValidationOperator, string>;
|
|
3
18
|
export declare const DateOperatorTextMap: Record<DataValidationOperator, string>;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 { ISheetDataValidationRule } from '@univerjs/core';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
2
18
|
import { DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
19
|
import { FormulaRefRangeService } from '@univerjs/sheets-formula';
|
|
4
20
|
import { SheetDataValidationModel } from '../models/sheet-data-validation-model';
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { Disposable, IPermissionService, IUniverInstanceService } from '@univerjs/core';
|
|
2
17
|
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
3
18
|
export declare class DataValidationFormulaController extends Disposable {
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 { ISheetDataValidationRule } from '@univerjs/core';
|
|
17
|
+
import { Disposable, Injector } from '@univerjs/core';
|
|
2
18
|
import { DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
19
|
import { RefRangeService } from '@univerjs/sheets';
|
|
4
20
|
import { FormulaRefRangeService } from '@univerjs/sheets-formula';
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
17
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
18
|
import { SheetDataValidationModel } from '../models/sheet-data-validation-model';
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
17
|
import { DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
18
|
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { IDataValidationRule, IDataValidationRuleOptions } from '@univerjs/core';
|
|
17
|
+
import type { FRange } from '@univerjs/sheets/facade';
|
|
18
|
+
import { DataValidationType } from '@univerjs/core';
|
|
3
19
|
import { FDataValidation } from './f-data-validation';
|
|
4
20
|
/**
|
|
5
21
|
* Builder for data validation rules. use {@link FUniver} `univerAPI.newDataValidation()` to create a new builder.
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
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 { DataValidationOperator, DataValidationType, IDataValidationRule, IDataValidationRuleOptions, Injector, Worksheet } from '@univerjs/core';
|
|
2
17
|
import { FRange } from '@univerjs/sheets/facade';
|
|
3
18
|
import { FDataValidationBuilder } from './f-data-validation-builder';
|
|
4
19
|
/**
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 { DataValidationStatus, IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleOptions, IRange, ISheetDataValidationRule } from '@univerjs/core';
|
|
17
|
+
import type { IEventBase } from '@univerjs/core/facade';
|
|
18
|
+
import type { DataValidationChangeType, IRuleChange } from '@univerjs/data-validation';
|
|
19
|
+
import type { FWorkbook, FWorksheet } from '@univerjs/sheets/facade';
|
|
20
|
+
import type { FDataValidation } from './f-data-validation';
|
|
6
21
|
/**
|
|
7
22
|
* Event interface triggered when a data validation rule is changed
|
|
8
23
|
* @interface ISheetDataValidationChangedEvent
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IDataValidationError } from './f-workbook';
|
|
18
|
+
import { DataValidationStatus } from '@univerjs/core';
|
|
3
19
|
import { FRange } from '@univerjs/sheets/facade';
|
|
4
20
|
import { FDataValidation } from './f-data-validation';
|
|
5
21
|
/**
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
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 { Injector } from '@univerjs/core';
|
|
2
17
|
import { FUniver } from '@univerjs/core/facade';
|
|
3
18
|
import { FDataValidationBuilder } from './f-data-validation-builder';
|
|
4
19
|
/**
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 { IDataValidationRule, IDisposable, IExecutionOptions, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
17
|
+
import type { IRuleChange } from '@univerjs/data-validation';
|
|
18
|
+
import type { IAddSheetDataValidationCommandParams, IRemoveSheetAllDataValidationCommandParams, IRemoveSheetDataValidationCommandParams, IUpdateSheetDataValidationOptionsCommandParams, IUpdateSheetDataValidationRangeCommandParams, IUpdateSheetDataValidationSettingCommandParams, IValidStatusChange } from '@univerjs/sheets-data-validation';
|
|
19
|
+
import { DataValidationStatus } from '@univerjs/core';
|
|
20
|
+
import { SheetDataValidationModel } from '@univerjs/sheets-data-validation';
|
|
4
21
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
5
22
|
export interface IDataValidationError {
|
|
6
23
|
sheetName: string;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { Nullable, ObjectMatrix } from '@univerjs/core';
|
|
17
|
+
import type { IDataValidationError } from './f-workbook';
|
|
18
|
+
import { DataValidationStatus } from '@univerjs/core';
|
|
3
19
|
import { FWorksheet } from '@univerjs/sheets/facade';
|
|
4
20
|
import { FDataValidation } from './f-data-validation';
|
|
5
21
|
/**
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
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 { IRange, ISheetDataValidationRule, IUniverInstanceService } from '@univerjs/core';
|
|
2
17
|
export type RangeMutation = {
|
|
3
18
|
type: 'update';
|
|
4
19
|
ruleId: string;
|
|
@@ -24,7 +39,7 @@ export declare class RuleMatrix {
|
|
|
24
39
|
constructor(value: Map<string, IRange[]>, _unitId: string, _subUnitId: string, _univerInstanceService: IUniverInstanceService, _disableTree?: boolean);
|
|
25
40
|
private _buildTree;
|
|
26
41
|
private _debonceBuildTree;
|
|
27
|
-
get _worksheet(): import(
|
|
42
|
+
get _worksheet(): import("@univerjs/core").Nullable<import("@univerjs/core").Worksheet>;
|
|
28
43
|
private _addRule;
|
|
29
44
|
addRule(rule: ISheetDataValidationRule): void;
|
|
30
45
|
removeRange(_ranges: IRange[]): void;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 { DataValidationType, ISheetDataValidationRule } from '@univerjs/core';
|
|
17
|
+
import type { IRuleChange } from '@univerjs/data-validation';
|
|
18
|
+
import type { ISheetLocation } from '@univerjs/sheets';
|
|
19
|
+
import { DataValidationStatus, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
20
|
+
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
4
21
|
import { DataValidationCacheService } from '../services/dv-cache.service';
|
|
5
22
|
import { DataValidationCustomFormulaService } from '../services/dv-custom-formula.service';
|
|
6
23
|
import { DataValidationFormulaService } from '../services/dv-formula.service';
|
|
@@ -24,8 +41,8 @@ export declare class SheetDataValidationModel extends Disposable {
|
|
|
24
41
|
private readonly _ruleMatrixMap;
|
|
25
42
|
private readonly _validStatusChange$;
|
|
26
43
|
private readonly _ruleChange$;
|
|
27
|
-
readonly ruleChange$: import(
|
|
28
|
-
readonly validStatusChange$: import(
|
|
44
|
+
readonly ruleChange$: import("rxjs").Observable<IRuleChange>;
|
|
45
|
+
readonly validStatusChange$: import("rxjs").Observable<IValidStatusChange>;
|
|
29
46
|
constructor(_dataValidationModel: DataValidationModel, _univerInstanceService: IUniverInstanceService, _dataValidatorRegistryService: DataValidatorRegistryService, _dataValidationCacheService: DataValidationCacheService, _dataValidationFormulaService: DataValidationFormulaService, _dataValidationCustomFormulaService: DataValidationCustomFormulaService, _commandService: ICommandService);
|
|
30
47
|
private _initUniverInstanceListener;
|
|
31
48
|
private _initRuleUpdateListener;
|
|
@@ -34,7 +51,7 @@ export declare class SheetDataValidationModel extends Disposable {
|
|
|
34
51
|
private _addRule;
|
|
35
52
|
private _updateRule;
|
|
36
53
|
private _removeRule;
|
|
37
|
-
getValidator(type: DataValidationType | string): import(
|
|
54
|
+
getValidator(type: DataValidationType | string): import("@univerjs/data-validation").BaseDataValidator | undefined;
|
|
38
55
|
getRuleIdByLocation(unitId: string, subUnitId: string, row: number, col: number): string | undefined;
|
|
39
56
|
getRuleByLocation(unitId: string, subUnitId: string, row: number, col: number): ISheetDataValidationRule | undefined;
|
|
40
57
|
validator(rule: ISheetDataValidationRule, pos: ISheetLocation, _onCompete?: (status: DataValidationStatus, changed: boolean) => void): DataValidationStatus;
|
|
@@ -45,5 +62,5 @@ export declare class SheetDataValidationModel extends Disposable {
|
|
|
45
62
|
getUnitRules(unitId: string): [string, ISheetDataValidationRule[]][];
|
|
46
63
|
deleteUnitRules(unitId: string): void;
|
|
47
64
|
getSubUnitIds(unitId: string): string[];
|
|
48
|
-
getAll(): (readonly [string, [string, import(
|
|
65
|
+
getAll(): (readonly [string, [string, import("@univerjs/core").IDataValidationRule[]][]])[];
|
|
49
66
|
}
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
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 { IUniverSheetsDataValidationConfig } from './config/config';
|
|
2
17
|
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
18
|
export declare class UniverSheetsDataValidationPlugin extends Plugin {
|
|
4
19
|
private readonly _config;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 { DataValidationStatus, IRange, ISheetDataValidationRule, Nullable } from '@univerjs/core';
|
|
17
|
+
import { Disposable, ICommandService, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
2
18
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
3
19
|
export declare class DataValidationCacheService extends Disposable {
|
|
4
20
|
private readonly _commandService;
|
|
@@ -6,7 +22,7 @@ export declare class DataValidationCacheService extends Disposable {
|
|
|
6
22
|
private readonly _sheetDataValidationModel;
|
|
7
23
|
private _cacheMatrix;
|
|
8
24
|
private _dirtyRanges$;
|
|
9
|
-
readonly dirtyRanges$: import(
|
|
25
|
+
readonly dirtyRanges$: import("rxjs").Observable<{
|
|
10
26
|
unitId: string;
|
|
11
27
|
subUnitId: string;
|
|
12
28
|
ranges: IRange[];
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 { ISheetDataValidationRule } from '@univerjs/core';
|
|
17
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
18
|
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
19
|
import { RegisterOtherFormulaService } from '@univerjs/engine-formula';
|
|
4
20
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
@@ -29,10 +45,10 @@ export declare class DataValidationCustomFormulaService extends Disposable {
|
|
|
29
45
|
deleteByRuleId(unitId: string, subUnitId: string, ruleId: string): void;
|
|
30
46
|
private _addFormulaByRange;
|
|
31
47
|
addRule(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
32
|
-
getCellFormulaValue(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): Promise<import(
|
|
33
|
-
getCellFormula2Value(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): Promise<import(
|
|
34
|
-
getCellFormulaValueSync(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): import(
|
|
35
|
-
getCellFormula2ValueSync(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): import(
|
|
48
|
+
getCellFormulaValue(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): Promise<import("@univerjs/core").Nullable<import("@univerjs/core").ICellData>>;
|
|
49
|
+
getCellFormula2Value(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): Promise<import("@univerjs/core").Nullable<import("@univerjs/core").ICellData>>;
|
|
50
|
+
getCellFormulaValueSync(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): import("@univerjs/core").Nullable<import("@univerjs/core").ICellData>;
|
|
51
|
+
getCellFormula2ValueSync(unitId: string, subUnitId: string, ruleId: string, row: number, column: number): import("@univerjs/core").Nullable<import("@univerjs/core").ICellData>;
|
|
36
52
|
getRuleFormulaInfo(unitId: string, subUnitId: string, ruleId: string): IFormulaData | undefined;
|
|
37
53
|
makeRuleDirty(unitId: string, subUnitId: string, ruleId: string): void;
|
|
38
54
|
}
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { ISheetDataValidationRule, Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IFormulaInfo, IOtherFormulaResult } from '@univerjs/engine-formula';
|
|
18
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
3
19
|
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
20
|
+
import { RegisterOtherFormulaService } from '@univerjs/engine-formula';
|
|
4
21
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
5
22
|
import { DataValidationListCacheService } from './dv-list-cache.service';
|
|
6
23
|
export declare class DataValidationFormulaService extends Disposable {
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { IDataValidationRule, Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IOtherFormulaResult } from '@univerjs/engine-formula';
|
|
18
|
+
import { Disposable, Injector } from '@univerjs/core';
|
|
3
19
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
4
20
|
export interface IListCacheItem {
|
|
5
21
|
list: string[];
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 { IDataValidationRule, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
17
|
+
import { DataValidationStatus, Disposable, IUniverInstanceService, LifecycleService } from '@univerjs/core';
|
|
2
18
|
import { SheetDataValidationModel } from '../models/sheet-data-validation-model';
|
|
3
19
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
4
20
|
export declare class SheetsDataValidationValidatorService extends Disposable {
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { DataValidationOperator } from '@univerjs/core';
|
|
2
17
|
export declare const OperatorTextMap: Record<DataValidationOperator, string>;
|
|
3
18
|
export declare const OperatorTitleMap: Record<DataValidationOperator, string>;
|
|
@@ -1,2 +1,17 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { DataValidationOperator } from '@univerjs/core';
|
|
2
17
|
export declare const TWO_FORMULA_OPERATOR_COUNT: DataValidationOperator[];
|