@univerjs/sheets-data-validation 0.1.6 → 0.1.7

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/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}.univer-data-validation-item-container:hover{background-color:#f5f5f5}.univer-data-validation-item-title{font-size:var(--font-size-sm);color:rgba(var(--color-black));line-height:22px;font-weight:500}.univer-data-validation-item-content{color:#7a7a7a;font-size:var(--font-size-xs);line-height:18px}.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:#e5e5e5}.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:8px;border:1px solid rgba(var(--color-grey200));background:rgba(var(--color-white));box-shadow:var(--box-shadow-base);padding:8px;max-height:267px;display:flex;flex-direction:column;max-width:200px;box-sizing:border-box}.univer-dv-list-dropdown-title{padding:0 6px;color:var(--grey-500);font-size:12px;line-height:1.5;flex-shrink:0;flex-grow:0}.univer-dv-list-dropdown-list{flex:1;overflow-y:scroll;overflow-x:hidden;scrollbar-color:#73737366 transparent;scrollbar-gutter:stable;scrollbar-width:thin}.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:4px 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:3px 6px;margin-top:4px;font-size:12px;line-height:1.5;cursor:pointer;flex-shrink:0;flex-grow:0;border-radius:6px}.univer-dv-list-dropdown-edit: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;height:31px}.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;margin-top:2px}
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;height:31px}.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;margin-top:2px}
@@ -2,7 +2,7 @@ import { Injector } from '@wendellhu/redi';
2
2
  import { DataValidationModel } from '@univerjs/data-validation';
3
3
  import { Disposable, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
4
4
 
5
- export declare class DataValidationResourceController extends Disposable {
5
+ export declare class DataValidationModelController extends Disposable {
6
6
  private readonly _resourceManagerService;
7
7
  private readonly _univerInstanceService;
8
8
  private readonly _dataValidationModel;
@@ -10,5 +10,4 @@ export declare class DataValidationResourceController extends Disposable {
10
10
  constructor(_resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService, _dataValidationModel: DataValidationModel, _injector: Injector);
11
11
  private _createSheetDataValidationManager;
12
12
  private _initDataValidationDataSource;
13
- private _initSnapshot;
14
13
  }
@@ -22,6 +22,7 @@ export declare class DataValidationRefRangeController extends Disposable {
22
22
  private _disposableMap;
23
23
  constructor(_dataValidationModel: DataValidationModel, _univerInstanceService: IUniverInstanceService, _injector: Injector, _sheetSkeletonManagerService: SheetSkeletonManagerService, _refRangeService: RefRangeService, _dataValidationCustomFormulaService: DataValidationCustomFormulaService, _dataValidationFormulaService: DataValidationFormulaService, _formulaRefRangeService: FormulaRefRangeService, _commandService: ICommandService, _dataValidationCacheService: DataValidationCacheService);
24
24
  private _getIdWithUnitId;
25
+ registerRule: (unitId: string, subUnitId: string, rule: ISheetDataValidationRule) => void;
25
26
  registerFormula(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
26
27
  register(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
27
28
  registerRange(propUnitId: string, propSubUnitId: string, rule: ISheetDataValidationRule): void;
@@ -26,12 +26,9 @@ export { DataValidationFormulaService } from './services/dv-formula.service';
26
26
  export { DataValidationCustomFormulaService } from './services/dv-custom-formula.service';
27
27
  export { RegisterOtherFormulaService } from './services/register-formula.service';
28
28
  export { DataValidationRefRangeController } from './controllers/dv-ref-range.controller';
29
- export { DataValidationFormulaMarkDirty } from './commands/mutations/formula.mutation';
30
29
  export { DATA_VALIDATION_PLUGIN_NAME } from './common/const';
31
30
  export { DataValidationAutoFillController } from './controllers/dv-auto-fill.controller';
32
- export { DataValidationSheetController } from './controllers/dv-sheet.controller';
33
31
  export { DataValidationCopyPasteController } from './controllers/dv-copy-paste.controller';
34
- export { DataValidationResourceController } from './controllers/dv-resource.controller';
35
32
  export { HideDataValidationDropdown, ShowDataValidationDropdown } from './commands/operations/data-validation.operation';
36
33
  export { DataValidationRejectInputController } from './controllers/dv-reject-input.controller';
37
34
  export { enUS, zhCN } from './locale';
@@ -123,6 +123,16 @@ declare const locale: {
123
123
  };
124
124
  textLength: {
125
125
  title: string;
126
+ errorMsg: {
127
+ between: string;
128
+ greaterThan: string;
129
+ greaterThanOrEqual: string;
130
+ lessThan: string;
131
+ lessThanOrEqual: string;
132
+ equal: string;
133
+ notEqual: string;
134
+ notBetween: string;
135
+ };
126
136
  };
127
137
  decimal: {
128
138
  title: string;
@@ -5,6 +5,6 @@ export declare class UniverSheetsDataValidationPlugin extends Plugin {
5
5
  protected _injector: Injector;
6
6
  private readonly _commandService;
7
7
  private readonly _localeService;
8
- constructor(_injector: Injector, _commandService: ICommandService, _localeService: LocaleService);
8
+ constructor(_config: unknown, _injector: Injector, _commandService: ICommandService, _localeService: LocaleService);
9
9
  onStarting(injector: Injector): void;
10
10
  }
@@ -29,4 +29,5 @@ export declare class TextLengthValidator extends BaseDataValidator<number> {
29
29
  validatorIsGreaterThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
30
30
  validatorIsLessThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
31
31
  validatorIsLessThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
32
+ generateRuleErrorMessage(rule: IDataValidationRuleBase): string;
32
33
  }