@univerjs/sheets-data-validation 0.1.7 → 0.1.8
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/README.md +33 -0
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +2122 -2602
- package/lib/index.css +1 -1
- package/lib/types/common/const.d.ts +1 -1
- package/lib/types/controllers/dv-alert.controller.d.ts +1 -3
- package/lib/types/controllers/dv-copy-paste.controller.d.ts +3 -1
- package/lib/types/controllers/dv-ref-range.controller.d.ts +0 -1
- package/lib/types/controllers/dv-render.controller.d.ts +3 -0
- package/lib/types/index.d.ts +0 -1
- package/lib/types/locale/zh-CN.d.ts +2 -0
- package/lib/types/models/sheet-data-validation-manager.d.ts +2 -1
- package/lib/types/plugin.d.ts +3 -1
- package/lib/types/services/dv-custom-formula.service.d.ts +4 -5
- package/lib/types/services/dv-formula.service.d.ts +3 -4
- package/lib/types/validators/list-multiple-validator.d.ts +2 -20
- package/lib/types/validators/list-validator.d.ts +12 -7
- package/lib/types/widgets/dropdown-widget.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +28 -27
- package/lib/types/services/formula-common.d.ts +0 -19
- package/lib/types/services/register-formula.service.d.ts +0 -28
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-data-validation-options-button{cursor:pointer;margin-bottom:12px;font-size:var(--font-size-sm);color:rgba(var(--color-black));display:flex;align-items:center}.univer-data-validation-options-button-icon{font-size:8px;margin-left:4px}.univer-data-validation-detail-form-item{width:100%}.univer-data-validation-detail-buttons{margin-top:20px;display:flex;flex-direction:row;justify-content:flex-end}.univer-data-validation-detail-button{margin-left:12px}.univer-data-validation-item-container{border-radius:var(--border-radius-base);background-color:rgba(var(--bg-color-secondary));padding:var(--padding-sm);padding-right:36px;margin-left:-8px;margin-right:-8px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;cursor:pointer;position:relative;border-radius:6px;width:287px;overflow:hidden}.univer-data-validation-item-container:hover{background-color:rgba(var(--grey-50))}.univer-data-validation-item-title{font-size:var(--font-size-sm);color:rgba(var(--color-black));line-height:22px;font-weight:500;overflow:hidden;text-overflow:ellipsis}.univer-data-validation-item-content{color:rgba(var(--text-color-secondary));font-size:var(--font-size-xs);line-height:18px;overflow:hidden;text-overflow:ellipsis}.univer-data-validation-item-icon{position:absolute;top:19px;right:8px;width:20px;height:20px;display:flex;justify-content:center;align-items:center;border-radius:4px}.univer-data-validation-item-icon:hover{background:rgba(var(--grey-200))}.univer-data-validation-list-buttons{margin-top:20px;display:flex;flex-direction:row;justify-content:flex-end}.univer-data-validation-list-button{margin-left:12px}.univer-dv-list-dropdown{border-radius:var(--border-radius-lg);border:1px solid rgb(var(--border-color));background:rgba(var(--color-white));box-shadow:var(--box-shadow-base);box-sizing:border-box}.univer-dv-list-dropdown-title{padding:var(--padding-sm) 14px;color:rgb(var(--text-color));font-size:12px;line-height:1.5;flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-list{max-height:200px}.univer-dv-list-dropdown-list-container{padding:0 var(--padding-sm)}.univer-dv-list-dropdown-selected-icon{width:16px;height:16px;font-size:16px;color:rgba(var(--blue-500));flex-shrink:0;flex-grow:0;margin-left:12px}.univer-dv-list-dropdown-item-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--padding-xs) 6px;border-radius:6px;margin-top:4px;cursor:pointer}.univer-dv-list-dropdown-item-container:hover{background-color:rgba(var(--grey-50))}.univer-dv-list-dropdown-item{padding:0 4px;font-size:12px;font-style:normal;font-weight:400;line-height:16px;border-radius:8px;height:16px;width:fit-content;flex:0 1 auto;text-overflow:ellipsis;overflow:hidden;color:rgba(var(--color-black));white-space:nowrap}.univer-dv-list-dropdown-split{height:1px;margin:4px 0;background:rgba(var(--grey-200));flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-edit{padding:0 var(--padding-xs) var(--padding-xs) var(--padding-xs);flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-edit a{padding:3px 6px;font-size:12px;line-height:1.5;cursor:pointer;border-radius:6px;display:block}.univer-dv-list-dropdown-edit a:hover{background:#f5f5f5}.univer-dv-date-dropdown{background:#fff;border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-lg);padding:var(--padding-sm)}.univer-data-validation-formula{width:100%}.univer-data-validation-formula-and{margin-top:-4px;font-size:var(--font-size-sm);color:rgba(var(--grey-400))}.univer-data-validation-formula-list-item{display:flex;padding-bottom:2px;align-items:center}.univer-data-validation-formula-list-item-icon{font-size:16px;cursor:pointer;margin-left:4px;border-radius:4px}.univer-data-validation-formula-list-item-icon:hover{background:rgba(var(--grey-100))}.univer-data-validation-formula-list-item-drag{cursor:move}.univer-data-validation-formula-list-add{color:#274fee;font-size:13px;font-weight:400;cursor:pointer;display:flex;flex-direction:row;align-items:center;border-radius:4px;padding:4px 8px;width:fit-content}.univer-data-validation-formula-list-add svg{margin-right:4px}.univer-data-validation-formula-list-add:hover{background:#274fee0d}.univer-data-validation-formula-color-select{width:92px;margin-left:4px;margin-right:8px
|
|
1
|
+
.univer-data-validation-options-button{cursor:pointer;margin-bottom:12px;font-size:var(--font-size-sm);color:rgba(var(--color-black));display:flex;align-items:center}.univer-data-validation-options-button-icon{font-size:8px;margin-left:4px}.univer-data-validation-detail-form-item{width:100%}.univer-data-validation-detail-buttons{margin-top:20px;display:flex;flex-direction:row;justify-content:flex-end}.univer-data-validation-detail-button{margin-left:12px}.univer-data-validation-item-container{border-radius:var(--border-radius-base);background-color:rgba(var(--bg-color-secondary));padding:var(--padding-sm);padding-right:36px;margin-left:-8px;margin-right:-8px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;cursor:pointer;position:relative;border-radius:6px;width:287px;overflow:hidden}.univer-data-validation-item-container:hover{background-color:rgba(var(--grey-50))}.univer-data-validation-item-title{font-size:var(--font-size-sm);color:rgba(var(--color-black));line-height:22px;font-weight:500;overflow:hidden;text-overflow:ellipsis}.univer-data-validation-item-content{color:rgba(var(--text-color-secondary));font-size:var(--font-size-xs);line-height:18px;overflow:hidden;text-overflow:ellipsis}.univer-data-validation-item-icon{position:absolute;top:19px;right:8px;width:20px;height:20px;display:flex;justify-content:center;align-items:center;border-radius:4px}.univer-data-validation-item-icon:hover{background:rgba(var(--grey-200))}.univer-data-validation-list-buttons{margin-top:20px;display:flex;flex-direction:row;justify-content:flex-end}.univer-data-validation-list-button{margin-left:12px}.univer-dv-list-dropdown{border-radius:var(--border-radius-lg);border:1px solid rgb(var(--border-color));background:rgba(var(--color-white));box-shadow:var(--box-shadow-base);box-sizing:border-box}.univer-dv-list-dropdown-title{padding:var(--padding-sm) 14px;color:rgb(var(--text-color));font-size:12px;line-height:1.5;flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-list{max-height:200px}.univer-dv-list-dropdown-list-container{padding:0 var(--padding-sm)}.univer-dv-list-dropdown-selected-icon{width:16px;height:16px;font-size:16px;color:rgba(var(--blue-500));flex-shrink:0;flex-grow:0;margin-left:12px}.univer-dv-list-dropdown-item-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--padding-xs) 6px;border-radius:6px;margin-top:4px;cursor:pointer}.univer-dv-list-dropdown-item-container:hover{background-color:rgba(var(--grey-50))}.univer-dv-list-dropdown-item{padding:0 4px;font-size:12px;font-style:normal;font-weight:400;line-height:16px;border-radius:8px;height:16px;width:fit-content;flex:0 1 auto;text-overflow:ellipsis;overflow:hidden;color:rgba(var(--color-black));white-space:nowrap}.univer-dv-list-dropdown-split{height:1px;margin:4px 0;background:rgba(var(--grey-200));flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-edit{padding:0 var(--padding-xs) var(--padding-xs) var(--padding-xs);flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-edit a{padding:3px 6px;font-size:12px;line-height:1.5;cursor:pointer;border-radius:6px;display:block}.univer-dv-list-dropdown-edit a:hover{background:#f5f5f5}.univer-dv-date-dropdown{background:#fff;border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-lg);padding:var(--padding-sm)}.univer-data-validation-formula{width:100%}.univer-data-validation-formula-and{margin-top:-4px;font-size:var(--font-size-sm);color:rgba(var(--grey-400))}.univer-data-validation-formula-list-item{display:flex;padding-bottom:2px;align-items:center}.univer-data-validation-formula-list-item-icon{font-size:16px;cursor:pointer;margin-left:4px;border-radius:4px}.univer-data-validation-formula-list-item-icon:hover{background:rgba(var(--grey-100))}.univer-data-validation-formula-list-item-drag{cursor:move}.univer-data-validation-formula-list-add{color:#274fee;font-size:13px;font-weight:400;cursor:pointer;display:flex;flex-direction:row;align-items:center;border-radius:4px;padding:4px 8px;width:fit-content}.univer-data-validation-formula-list-add svg{margin-right:4px}.univer-data-validation-formula-list-add:hover{background:#274fee0d}.univer-data-validation-formula-color-select{width:92px;margin-left:4px;margin-right:8px}.univer-data-validation-formula-color-select-panel{width:112px;display:flex;flex-direction:row;justify-content:space-between;padding:12px 4px 4px 12px;flex-wrap:wrap;box-sizing:border-box}.univer-data-validation-formula-color-select-panel .univer-data-validation-formula-color-item{margin-bottom:8px;margin-right:8px;box-sizing:border-box;cursor:pointer}.univer-data-validation-formula-color-item{border-radius:3px;border:1px solid rgba(var(--grey-400));width:16px;height:16px;box-sizing:border-box;font-size:16px}
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare const DATA_VALIDATION_PLUGIN_NAME = "
|
|
16
|
+
export declare const DATA_VALIDATION_PLUGIN_NAME = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
17
17
|
export declare const DROP_DOWN_DEFAULT_COLOR = "#ECECEC";
|
|
18
18
|
export declare const DROP_DOWN_COLORS: never[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SheetDataValidationService } from '../services/dv.service';
|
|
2
1
|
import { CellAlertManagerService, HoverManagerService } from '@univerjs/sheets-ui';
|
|
3
2
|
import { Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
4
3
|
|
|
@@ -6,9 +5,8 @@ export declare class DataValidationAlertController extends Disposable {
|
|
|
6
5
|
private readonly _hoverManagerService;
|
|
7
6
|
private readonly _cellAlertManagerService;
|
|
8
7
|
private readonly _univerInstanceService;
|
|
9
|
-
private readonly _sheetDataValidationService;
|
|
10
8
|
private readonly _localeService;
|
|
11
|
-
constructor(_hoverManagerService: HoverManagerService, _cellAlertManagerService: CellAlertManagerService, _univerInstanceService: IUniverInstanceService,
|
|
9
|
+
constructor(_hoverManagerService: HoverManagerService, _cellAlertManagerService: CellAlertManagerService, _univerInstanceService: IUniverInstanceService, _localeService: LocaleService);
|
|
12
10
|
private _init;
|
|
13
11
|
private _initCellAlertPopup;
|
|
14
12
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
2
|
+
import { Injector } from '@wendellhu/redi';
|
|
2
3
|
import { ISheetClipboardService } from '@univerjs/sheets-ui';
|
|
3
4
|
import { Disposable } from '@univerjs/core';
|
|
4
5
|
|
|
5
6
|
export declare class DataValidationCopyPasteController extends Disposable {
|
|
6
7
|
private _sheetClipboardService;
|
|
7
8
|
private _dataValidationModel;
|
|
9
|
+
private _injector;
|
|
8
10
|
private _copyInfo;
|
|
9
|
-
constructor(_sheetClipboardService: ISheetClipboardService, _dataValidationModel: DataValidationModel);
|
|
11
|
+
constructor(_sheetClipboardService: ISheetClipboardService, _dataValidationModel: DataValidationModel, _injector: Injector);
|
|
10
12
|
private _initCopyPaste;
|
|
11
13
|
private _collect;
|
|
12
14
|
private _generateMutations;
|
|
@@ -25,6 +25,5 @@ export declare class DataValidationRefRangeController extends Disposable {
|
|
|
25
25
|
registerRule: (unitId: string, subUnitId: string, rule: ISheetDataValidationRule) => void;
|
|
26
26
|
registerFormula(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
27
27
|
register(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
28
|
-
registerRange(propUnitId: string, propSubUnitId: string, rule: ISheetDataValidationRule): void;
|
|
29
28
|
private _initRefRange;
|
|
30
29
|
}
|
|
@@ -7,6 +7,9 @@ import { ComponentManager, IMenuService } from '@univerjs/ui';
|
|
|
7
7
|
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
8
8
|
import { IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @todo RenderUnit
|
|
12
|
+
*/
|
|
10
13
|
export declare class DataValidationRenderController extends RxDisposable {
|
|
11
14
|
private _componentManager;
|
|
12
15
|
private _menuService;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ export { AddSheetDataValidationAndOpenCommand, AddSheetDataValidationCommand, Up
|
|
|
24
24
|
export { DataValidationCacheService } from './services/dv-cache.service';
|
|
25
25
|
export { DataValidationFormulaService } from './services/dv-formula.service';
|
|
26
26
|
export { DataValidationCustomFormulaService } from './services/dv-custom-formula.service';
|
|
27
|
-
export { RegisterOtherFormulaService } from './services/register-formula.service';
|
|
28
27
|
export { DataValidationRefRangeController } from './controllers/dv-ref-range.controller';
|
|
29
28
|
export { DATA_VALIDATION_PLUGIN_NAME } from './common/const';
|
|
30
29
|
export { DataValidationAutoFillController } from './controllers/dv-auto-fill.controller';
|
|
@@ -23,6 +23,7 @@ declare const locale: {
|
|
|
23
23
|
integer: string;
|
|
24
24
|
date: string;
|
|
25
25
|
list: string;
|
|
26
|
+
listInvalid: string;
|
|
26
27
|
};
|
|
27
28
|
panel: {
|
|
28
29
|
title: string;
|
|
@@ -116,6 +117,7 @@ declare const locale: {
|
|
|
116
117
|
options: string;
|
|
117
118
|
customOptions: string;
|
|
118
119
|
refOptions: string;
|
|
120
|
+
formulaError: string;
|
|
119
121
|
};
|
|
120
122
|
listMultiple: {
|
|
121
123
|
title: string;
|
|
@@ -17,7 +17,8 @@ export declare class SheetDataValidationManager extends DataValidationManager<IS
|
|
|
17
17
|
private _cache;
|
|
18
18
|
private _dataValidationRefRangeController;
|
|
19
19
|
constructor(unitId: string, subUnitId: string, rules: ISheetDataValidationRule[] | undefined, _injector: Injector);
|
|
20
|
-
|
|
20
|
+
private _addRuleSideEffect;
|
|
21
|
+
addRule(rule: ISheetDataValidationRule | ISheetDataValidationRule[], index?: number): void;
|
|
21
22
|
updateRule(ruleId: string, payload: IUpdateRulePayload): ISheetDataValidationRule;
|
|
22
23
|
removeRule(ruleId: string): void;
|
|
23
24
|
getRuleIdByLocation(row: number, col: number): string | undefined;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Injector } from '@wendellhu/redi';
|
|
2
|
-
import { ICommandService, LocaleService, Plugin } from '@univerjs/core';
|
|
2
|
+
import { ICommandService, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare class UniverSheetsDataValidationPlugin extends Plugin {
|
|
5
5
|
protected _injector: Injector;
|
|
6
6
|
private readonly _commandService;
|
|
7
7
|
private readonly _localeService;
|
|
8
|
+
static pluginName: string;
|
|
9
|
+
static type: UniverInstanceType;
|
|
8
10
|
constructor(_config: unknown, _injector: Injector, _commandService: ICommandService, _localeService: LocaleService);
|
|
9
11
|
onStarting(injector: Injector): void;
|
|
10
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
2
|
-
import { RegisterOtherFormulaService } from '
|
|
2
|
+
import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';
|
|
3
3
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
4
4
|
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
5
|
-
import { IRange, ISheetDataValidationRule, Disposable
|
|
5
|
+
import { IRange, ISheetDataValidationRule, Disposable } from '@univerjs/core';
|
|
6
6
|
|
|
7
7
|
interface IFormulaData {
|
|
8
8
|
formula: string;
|
|
@@ -14,7 +14,6 @@ interface IFormulaData {
|
|
|
14
14
|
export declare class DataValidationCustomFormulaService extends Disposable {
|
|
15
15
|
private _registerOtherFormulaService;
|
|
16
16
|
private _lexerTreeBuilder;
|
|
17
|
-
private readonly _univerInstanceService;
|
|
18
17
|
private readonly _dataValidationModel;
|
|
19
18
|
private readonly _dataValidationCacheService;
|
|
20
19
|
private _formulaMap;
|
|
@@ -26,7 +25,7 @@ export declare class DataValidationCustomFormulaService extends Disposable {
|
|
|
26
25
|
* reflect of formulaId to cell, only store transformable formula
|
|
27
26
|
*/
|
|
28
27
|
private _formulaCellMap;
|
|
29
|
-
constructor(_registerOtherFormulaService: RegisterOtherFormulaService, _lexerTreeBuilder: LexerTreeBuilder,
|
|
28
|
+
constructor(_registerOtherFormulaService: RegisterOtherFormulaService, _lexerTreeBuilder: LexerTreeBuilder, _dataValidationModel: DataValidationModel, _dataValidationCacheService: DataValidationCacheService);
|
|
30
29
|
private _initFormulaResultHandler;
|
|
31
30
|
private _ensureMaps;
|
|
32
31
|
private _registerFormula;
|
|
@@ -35,7 +34,7 @@ export declare class DataValidationCustomFormulaService extends Disposable {
|
|
|
35
34
|
addRule(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
36
35
|
updateRuleRanges(unitId: string, subUnitId: string, ruleId: string, oldRanges: IRange[], newRanges: IRange[]): void;
|
|
37
36
|
updateRuleFormula(unitId: string, subUnitId: string, ruleId: string, ranges: IRange[], formula: string): void;
|
|
38
|
-
getCellFormulaValue(unitId: string, subUnitId: string, row: number, col: number): Promise<import('@univerjs/core').Nullable<import(
|
|
37
|
+
getCellFormulaValue(unitId: string, subUnitId: string, row: number, col: number): Promise<import('@univerjs/core').Nullable<import('@univerjs/sheets-formula').IOtherFormulaResult>>;
|
|
39
38
|
getRuleFormulaInfo(unitId: string, subUnitId: string, ruleId: string): IFormulaData | undefined;
|
|
40
39
|
}
|
|
41
40
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
2
|
-
import { RegisterOtherFormulaService } from '
|
|
3
|
-
import { IDataValidationFormulaResult, IFormulaInfo } from './formula-common';
|
|
2
|
+
import { IFormulaInfo, IOtherFormulaResult, RegisterOtherFormulaService } from '@univerjs/sheets-formula';
|
|
4
3
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
5
4
|
import { Nullable, Disposable } from '@univerjs/core';
|
|
6
5
|
|
|
@@ -15,7 +14,7 @@ export declare class DataValidationFormulaService extends Disposable {
|
|
|
15
14
|
addRule(unitId: string, subUnitId: string, ruleId: string, formula1: string | undefined, formula2: string | undefined): void;
|
|
16
15
|
removeRule(unitId: string, subUnitId: string, ruleId: string): void;
|
|
17
16
|
updateRuleFormulaText(unitId: string, subUnitId: string, ruleId: string, formula1: string | undefined, formula2: string | undefined): void;
|
|
18
|
-
getRuleFormulaResult(unitId: string, subUnitId: string, ruleId: string): Promise<Nullable<[Nullable<
|
|
19
|
-
getRuleFormulaResultSync(unitId: string, subUnitId: string, ruleId: string): Nullable<
|
|
17
|
+
getRuleFormulaResult(unitId: string, subUnitId: string, ruleId: string): Promise<Nullable<[Nullable<IOtherFormulaResult>, Nullable<IOtherFormulaResult>]>>;
|
|
18
|
+
getRuleFormulaResultSync(unitId: string, subUnitId: string, ruleId: string): Nullable<IOtherFormulaResult>[] | undefined;
|
|
20
19
|
getRuleFormulaInfo(unitId: string, subUnitId: string, ruleId: string): [IFormulaInfo | undefined, IFormulaInfo | undefined] | undefined;
|
|
21
20
|
}
|
|
@@ -1,27 +1,9 @@
|
|
|
1
|
+
import { ListValidator } from './list-validator';
|
|
1
2
|
import { DropdownMultipleWidget } from '../widgets/dropdown-multiple-widget';
|
|
2
|
-
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
|
-
import { CellValue, DataValidationOperator, IDataValidationRule, IDataValidationRuleBase, Nullable } from '@univerjs/core';
|
|
4
3
|
|
|
5
|
-
export declare class ListMultipleValidator extends
|
|
4
|
+
export declare class ListMultipleValidator extends ListValidator {
|
|
6
5
|
id: string;
|
|
7
6
|
title: string;
|
|
8
|
-
operators: DataValidationOperator[];
|
|
9
|
-
scopes: string | string[];
|
|
10
|
-
formulaInput: string;
|
|
11
|
-
private _univerInstanceService;
|
|
12
7
|
canvasRender: DropdownMultipleWidget;
|
|
13
|
-
dropdown: string | undefined;
|
|
14
8
|
skipDefaultFontRender(): boolean;
|
|
15
|
-
validatorFormula(rule: IDataValidationRuleBase): IFormulaValidResult;
|
|
16
|
-
parseCellValue(cellValue: CellValue, rule: IDataValidationRule): string[];
|
|
17
|
-
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult<string[] | undefined>>;
|
|
18
|
-
isValidType(cellInfo: IValidatorCellInfo<Nullable<CellValue>>, formula: IFormulaResult<any>, rule: IDataValidationRule): Promise<boolean>;
|
|
19
|
-
generateRuleName(): string;
|
|
20
|
-
generateRuleErrorMessage(): string;
|
|
21
|
-
getList(rule: IDataValidationRule, propUnitId?: string, propSubUnitId?: string): string[];
|
|
22
|
-
getListWithColor(rule: IDataValidationRule, currentUnitId?: string, currentSubUnitId?: string): {
|
|
23
|
-
label: string;
|
|
24
|
-
color: string;
|
|
25
|
-
}[];
|
|
26
|
-
getListWithColorMap(rule: IDataValidationRule, currentUnitId?: string, currentSubUnitId?: string): Record<string, string>;
|
|
27
9
|
}
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DataValidationFormulaService } from '../services/dv-formula.service';
|
|
2
|
+
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
3
|
+
import { IBaseDataValidationWidget, IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
4
|
+
import { CellValue, DataValidationOperator, ICellData, IDataValidationRule, IDataValidationRuleBase, ISheetDataValidationRule, Nullable } from '@univerjs/core';
|
|
4
5
|
|
|
6
|
+
export declare function getRuleFormulaResultSet(result: Nullable<Nullable<ICellData>[][]>): string[];
|
|
7
|
+
export declare function isValidListFormula(formula: string, lexer: LexerTreeBuilder): boolean | undefined;
|
|
5
8
|
export declare class ListValidator extends BaseDataValidator {
|
|
9
|
+
protected formulaService: DataValidationFormulaService;
|
|
10
|
+
private _lexer;
|
|
6
11
|
id: string;
|
|
7
12
|
title: string;
|
|
8
13
|
operators: DataValidationOperator[];
|
|
9
14
|
scopes: string | string[];
|
|
10
15
|
formulaInput: string;
|
|
11
|
-
|
|
12
|
-
canvasRender: DropdownWidget;
|
|
16
|
+
canvasRender: Nullable<IBaseDataValidationWidget>;
|
|
13
17
|
dropdown: string | undefined;
|
|
14
18
|
optionsInput: string | undefined;
|
|
15
19
|
skipDefaultFontRender(rule: ISheetDataValidationRule): boolean;
|
|
16
20
|
validatorFormula(rule: IDataValidationRuleBase): IFormulaValidResult;
|
|
17
|
-
|
|
21
|
+
parseCellValue(cellValue: CellValue): string[];
|
|
18
22
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult<string[] | undefined>>;
|
|
19
|
-
isValidType(cellInfo: IValidatorCellInfo<Nullable<CellValue>>, formula: IFormulaResult<
|
|
23
|
+
isValidType(cellInfo: IValidatorCellInfo<Nullable<CellValue>>, formula: IFormulaResult<string[] | undefined>, rule: IDataValidationRule): Promise<boolean>;
|
|
20
24
|
generateRuleName(): string;
|
|
21
25
|
generateRuleErrorMessage(): string;
|
|
22
26
|
getList(rule: IDataValidationRule, currentUnitId?: string, currentSubUnitId?: string): string[];
|
|
27
|
+
getListAsync(rule: IDataValidationRule, currentUnitId?: string, currentSubUnitId?: string): Promise<string[]>;
|
|
23
28
|
getListWithColor(rule: IDataValidationRule, currentUnitId?: string, currentSubUnitId?: string): {
|
|
24
29
|
label: string;
|
|
25
30
|
color: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataValidationModel, DataValidatorRegistryService, IBaseDataValidationWidget } from '@univerjs/data-validation';
|
|
2
|
-
import { IMouseEvent, IPointerEvent,
|
|
2
|
+
import { IMouseEvent, IPointerEvent, SpreadsheetSkeleton, UniverRenderingContext2D } from '@univerjs/engine-render';
|
|
3
3
|
import { ICommandService, LocaleService, ICellRenderContext, IPaddingData } from '@univerjs/core';
|
|
4
4
|
|
|
5
5
|
export interface IDropdownInfo {
|
|
@@ -22,7 +22,7 @@ export declare class DropdownWidget implements IBaseDataValidationWidget {
|
|
|
22
22
|
private _ensureMap;
|
|
23
23
|
private _generateKey;
|
|
24
24
|
private _drawDownIcon;
|
|
25
|
-
drawWith(ctx: UniverRenderingContext2D, info: ICellRenderContext, skeleton: SpreadsheetSkeleton
|
|
25
|
+
drawWith(ctx: UniverRenderingContext2D, info: ICellRenderContext, skeleton: SpreadsheetSkeleton): void;
|
|
26
26
|
calcCellAutoHeight(info: ICellRenderContext): number | undefined;
|
|
27
27
|
isHit(position: {
|
|
28
28
|
x: number;
|