@univerjs/sheets-data-validation 0.2.7 → 0.2.9

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.
Files changed (77) hide show
  1. package/README.md +54 -4
  2. package/lib/cjs/index.js +2 -2
  3. package/lib/es/index.js +473 -458
  4. package/lib/locale/en-US.json +10 -9
  5. package/lib/locale/ru-RU.json +2 -1
  6. package/lib/locale/vi-VN.json +2 -1
  7. package/lib/locale/zh-CN.json +10 -9
  8. package/lib/locale/zh-TW.json +2 -1
  9. package/lib/types/commands/commands/data-validation.command.d.ts +6 -1
  10. package/lib/types/commands/operations/data-validation.operation.d.ts +0 -1
  11. package/lib/types/common/date-text-map.d.ts +0 -1
  12. package/lib/types/controllers/dv-alert.controller.d.ts +0 -1
  13. package/lib/types/controllers/dv-auto-fill.controller.d.ts +0 -1
  14. package/lib/types/controllers/dv-copy-paste.controller.d.ts +0 -1
  15. package/lib/types/controllers/dv-formula.controller.d.ts +0 -1
  16. package/lib/types/controllers/dv-model.controller.d.ts +0 -1
  17. package/lib/types/controllers/dv-permission.controller.d.ts +0 -1
  18. package/lib/types/controllers/dv-ref-range.controller.d.ts +0 -1
  19. package/lib/types/controllers/dv-reject-input.controller.d.ts +0 -1
  20. package/lib/types/controllers/dv-render.controller.d.ts +0 -1
  21. package/lib/types/controllers/dv.controller.d.ts +1 -5
  22. package/lib/types/controllers/dv.menu.d.ts +0 -1
  23. package/lib/types/index.d.ts +5 -11
  24. package/lib/types/locale/en-US.d.ts +0 -1
  25. package/lib/types/locale/ru-RU.d.ts +0 -1
  26. package/lib/types/locale/vi-VN.d.ts +0 -1
  27. package/lib/types/locale/zh-CN.d.ts +1 -0
  28. package/lib/types/locale/zh-TW.d.ts +0 -1
  29. package/lib/types/mobile-plugin.d.ts +0 -1
  30. package/lib/types/models/rule-matrix.d.ts +0 -1
  31. package/lib/types/models/sheet-data-validation-manager.d.ts +4 -5
  32. package/lib/types/plugin.d.ts +0 -1
  33. package/lib/types/services/data-validation-panel.service.d.ts +0 -1
  34. package/lib/types/services/dropdown-manager.service.d.ts +5 -3
  35. package/lib/types/services/dv-cache.service.d.ts +1 -1
  36. package/lib/types/services/dv-custom-formula.service.d.ts +3 -3
  37. package/lib/types/services/dv-formula.service.d.ts +0 -1
  38. package/lib/types/services/dv-validator-service.d.ts +4 -2
  39. package/lib/types/types/const/operator-text-map.d.ts +0 -1
  40. package/lib/types/types/const/two-formula-operators.d.ts +0 -1
  41. package/lib/types/utils/formula.d.ts +1 -1
  42. package/lib/types/utils/get-cell-data-origin.d.ts +0 -1
  43. package/lib/types/validators/checkbox-validator.d.ts +0 -1
  44. package/lib/types/validators/custom-validator.d.ts +0 -1
  45. package/lib/types/validators/date-validator.d.ts +2 -3
  46. package/lib/types/validators/decimal-validator.d.ts +5 -2
  47. package/lib/types/validators/list-multiple-validator.d.ts +0 -1
  48. package/lib/types/validators/list-validator.d.ts +0 -1
  49. package/lib/types/validators/text-length-validator.d.ts +5 -2
  50. package/lib/types/validators/util.d.ts +0 -1
  51. package/lib/types/validators/whole-validator.d.ts +5 -2
  52. package/lib/types/views/date-dropdown/index.d.ts +0 -1
  53. package/lib/types/views/detail/index.d.ts +0 -1
  54. package/lib/types/views/drop-down/CellDropdown.d.ts +0 -1
  55. package/lib/types/views/formula-input/base-formula-input.d.ts +0 -1
  56. package/lib/types/views/formula-input/checkbox-formula-input.d.ts +0 -1
  57. package/lib/types/views/formula-input/custom-formula-input.d.ts +0 -1
  58. package/lib/types/views/formula-input/formula-input.d.ts +0 -1
  59. package/lib/types/views/formula-input/index.d.ts +0 -1
  60. package/lib/types/views/formula-input/list-formula-input.d.ts +0 -1
  61. package/lib/types/views/item/index.d.ts +0 -1
  62. package/lib/types/views/list/index.d.ts +0 -1
  63. package/lib/types/views/list-dropdown/index.d.ts +0 -1
  64. package/lib/types/views/options/index.d.ts +0 -1
  65. package/lib/types/views/panel/index.d.ts +0 -1
  66. package/lib/types/views/render-mode/index.d.ts +0 -1
  67. package/lib/types/views/show-time/index.d.ts +0 -1
  68. package/lib/types/widgets/checkbox-widget.d.ts +0 -1
  69. package/lib/types/widgets/dropdown-multiple-widget.d.ts +0 -1
  70. package/lib/types/widgets/dropdown-widget.d.ts +1 -3
  71. package/lib/types/widgets/shape/dropdown.d.ts +0 -1
  72. package/lib/types/widgets/shape/layout.d.ts +0 -1
  73. package/lib/umd/index.js +2 -2
  74. package/package.json +25 -25
  75. package/lib/types/services/dv.service.d.ts +0 -20
  76. package/lib/types/services/dv.tips.d.ts +0 -17
  77. package/lib/types/utils/date.d.ts +0 -17
@@ -1,6 +1,5 @@
1
- import { DataValidationOperator, CellValue, IDataValidationRule, IDataValidationRuleBase } from '@univerjs/core';
1
+ import { DataValidationOperator, CellValue, IDataValidationRule, IDataValidationRuleBase, Nullable } from '@univerjs/core';
2
2
  import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
3
-
4
3
  export declare class WholeValidator extends BaseDataValidator<number> {
5
4
  private _formulaService;
6
5
  id: string;
@@ -13,10 +12,14 @@ export declare class WholeValidator extends BaseDataValidator<number> {
13
12
  isValidType(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
14
13
  transform(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): {
15
14
  value: number;
15
+ interceptValue: Nullable<CellValue>;
16
16
  row: number;
17
17
  column: number;
18
18
  unitId: string;
19
19
  subUnitId: string;
20
+ worksheet: import('@univerjs/core').Worksheet;
21
+ workbook: import('@univerjs/core').Workbook;
22
+ t: Nullable<import('@univerjs/protocol').CellValueType>;
20
23
  };
21
24
  private _parseNumber;
22
25
  parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<{
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IDropdownComponentProps } from '../../services/dropdown-manager.service';
3
-
4
3
  export declare function DateDropdown(props: IDropdownComponentProps): React.JSX.Element | undefined;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function DataValidationDetail(): React.JSX.Element | null;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function CellDropdown(): React.JSX.Element | null;
@@ -1,4 +1,3 @@
1
1
  import { IFormulaInputProps } from '@univerjs/data-validation';
2
2
  import { default as React } from 'react';
3
-
4
3
  export declare const BaseFormulaInput: (props: IFormulaInputProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import { IFormulaInputProps } from '@univerjs/data-validation';
2
2
  import { default as React } from 'react';
3
-
4
3
  export declare function CheckboxFormulaInput(props: IFormulaInputProps): React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFormulaInputProps } from '@univerjs/data-validation';
3
-
4
3
  export declare function CustomFormulaInput(props: IFormulaInputProps): React.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { FormulaInputType } from '@univerjs/data-validation';
2
-
3
2
  export declare const BASE_FORMULA_INPUT_NAME = "data-validation.formula-input";
4
3
  export declare const LIST_FORMULA_INPUT_NAME = "data-validation.list-formula-input";
5
4
  export declare const FORMULA_INPUTS: [string, FormulaInputType][];
@@ -1,5 +1,4 @@
1
1
  import { FormulaInputType } from '@univerjs/data-validation';
2
-
3
2
  export declare const CUSTOM_FORMULA_INPUT_NAME = "data-validation.custom-formula-input";
4
3
  export declare const BASE_FORMULA_INPUT_NAME = "data-validation.formula-input";
5
4
  export declare const LIST_FORMULA_INPUT_NAME = "data-validation.list-formula-input";
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFormulaInputProps } from '@univerjs/data-validation';
3
-
4
3
  export declare function ListFormulaInput(props: IFormulaInputProps): React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { ISheetDataValidationRule } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
-
4
3
  export interface IDataValidationDetailProps {
5
4
  rule: ISheetDataValidationRule;
6
5
  onClick: () => void;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function DataValidationList(): React.JSX.Element | null;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IDropdownComponentProps } from '../../services/dropdown-manager.service';
3
-
4
3
  export declare function ListDropDown(props: IDropdownComponentProps): React.JSX.Element | null | undefined;
@@ -1,6 +1,5 @@
1
1
  import { IDataValidationRuleOptions } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
-
4
3
  export interface IDataValidationOptionsParams {
5
4
  value: IDataValidationRuleOptions;
6
5
  onChange: (value: IDataValidationRuleOptions) => void;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare const DataValidationPanel: () => React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { IDataValidationRuleOptions } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
-
4
3
  export interface IListRenderModeInputProps {
5
4
  value: IDataValidationRuleOptions;
6
5
  onChange: (value: IDataValidationRuleOptions) => void;
@@ -1,6 +1,5 @@
1
1
  import { IDataValidationRuleOptions } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
-
4
3
  export interface IDateShowTimeOptionProps {
5
4
  value: IDataValidationRuleOptions;
6
5
  onChange: (value: IDataValidationRuleOptions) => void;
@@ -2,7 +2,6 @@ import { IMouseEvent, IPointerEvent, UniverRenderingContext2D } from '@univerjs/
2
2
  import { ICommandService, ThemeService, ICellRenderContext } from '@univerjs/core';
3
3
  import { IBaseDataValidationWidget } from '@univerjs/data-validation';
4
4
  import { DataValidationFormulaService } from '../services/dv-formula.service';
5
-
6
5
  export declare class CheckboxRender implements IBaseDataValidationWidget {
7
6
  private readonly _commandService;
8
7
  private readonly _formulaService;
@@ -1,7 +1,6 @@
1
1
  import { ICommandService, ICellRenderContext } from '@univerjs/core';
2
2
  import { IMouseEvent, IPointerEvent, Spreadsheet, SpreadsheetSkeleton, UniverRenderingContext2D } from '@univerjs/engine-render';
3
3
  import { IBaseDataValidationWidget } from '@univerjs/data-validation';
4
-
5
4
  export declare class DropdownMultipleWidget implements IBaseDataValidationWidget {
6
5
  private readonly _commandService;
7
6
  zIndex?: number | undefined;
@@ -1,7 +1,6 @@
1
- import { ICommandService, LocaleService, ICellRenderContext, IPaddingData } from '@univerjs/core';
1
+ import { ICommandService, LocaleService, ICellRenderContext } from '@univerjs/core';
2
2
  import { IMouseEvent, IPointerEvent, SpreadsheetSkeleton, UniverRenderingContext2D } from '@univerjs/engine-render';
3
3
  import { IBaseDataValidationWidget } from '@univerjs/data-validation';
4
-
5
4
  export interface IDropdownInfo {
6
5
  top: number;
7
6
  left: number;
@@ -11,7 +10,6 @@ export interface IDropdownInfo {
11
10
  export declare class DropdownWidget implements IBaseDataValidationWidget {
12
11
  private readonly _localeService;
13
12
  private readonly _commandService;
14
- static padding: IPaddingData;
15
13
  private _dropdownInfoMap;
16
14
  constructor(_localeService: LocaleService, _commandService: ICommandService);
17
15
  zIndex?: number | undefined;
@@ -1,6 +1,5 @@
1
1
  import { IShapeProps, UniverRenderingContext, Shape } from '@univerjs/engine-render';
2
2
  import { IDropdownLayoutInfo } from './layout';
3
-
4
3
  export interface IDropdownProps extends IShapeProps {
5
4
  fontString: string;
6
5
  fontFamily: string;
@@ -1,6 +1,5 @@
1
1
  import { IStyleData, Nullable } from '@univerjs/core';
2
2
  import { IDocumentSkeletonFontStyle } from '@univerjs/engine-render';
3
-
4
3
  export declare const PADDING_H = 4;
5
4
  export declare const PADDING_V = 0;
6
5
  export declare const MARGIN_H = 4;