@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.
Files changed (104) hide show
  1. package/lib/cjs/index.js +98 -99
  2. package/lib/cjs/locale/ar-SA.js +1 -0
  3. package/lib/cjs/locale/ca-ES.js +1 -0
  4. package/lib/cjs/locale/de-DE.js +1 -0
  5. package/lib/cjs/locale/en-US.js +1 -0
  6. package/lib/cjs/locale/es-ES.js +1 -0
  7. package/lib/cjs/locale/fa-IR.js +1 -0
  8. package/lib/cjs/locale/fr-FR.js +1 -0
  9. package/lib/cjs/locale/id-ID.js +1 -0
  10. package/lib/cjs/locale/it-IT.js +1 -0
  11. package/lib/cjs/locale/ja-JP.js +1 -0
  12. package/lib/cjs/locale/ko-KR.js +1 -0
  13. package/lib/cjs/locale/pl-PL.js +1 -0
  14. package/lib/cjs/locale/pt-BR.js +1 -0
  15. package/lib/cjs/locale/ru-RU.js +1 -0
  16. package/lib/cjs/locale/sk-SK.js +1 -0
  17. package/lib/cjs/locale/vi-VN.js +1 -0
  18. package/lib/cjs/locale/zh-CN.js +1 -0
  19. package/lib/cjs/locale/zh-HK.js +1 -0
  20. package/lib/cjs/locale/zh-TW.js +1 -0
  21. package/lib/es/index.js +105 -100
  22. package/lib/es/locale/ar-SA.js +1 -0
  23. package/lib/es/locale/ca-ES.js +1 -0
  24. package/lib/es/locale/de-DE.js +1 -0
  25. package/lib/es/locale/en-US.js +1 -0
  26. package/lib/es/locale/es-ES.js +1 -0
  27. package/lib/es/locale/fa-IR.js +1 -0
  28. package/lib/es/locale/fr-FR.js +1 -0
  29. package/lib/es/locale/id-ID.js +1 -0
  30. package/lib/es/locale/it-IT.js +1 -0
  31. package/lib/es/locale/ja-JP.js +1 -0
  32. package/lib/es/locale/ko-KR.js +1 -0
  33. package/lib/es/locale/pl-PL.js +1 -0
  34. package/lib/es/locale/pt-BR.js +1 -0
  35. package/lib/es/locale/ru-RU.js +1 -0
  36. package/lib/es/locale/sk-SK.js +1 -0
  37. package/lib/es/locale/vi-VN.js +1 -0
  38. package/lib/es/locale/zh-CN.js +1 -0
  39. package/lib/es/locale/zh-HK.js +1 -0
  40. package/lib/es/locale/zh-TW.js +1 -0
  41. package/lib/index.js +105 -100
  42. package/lib/locale/ar-SA.js +1 -0
  43. package/lib/locale/ca-ES.js +1 -0
  44. package/lib/locale/de-DE.js +1 -0
  45. package/lib/locale/en-US.js +1 -0
  46. package/lib/locale/es-ES.js +1 -0
  47. package/lib/locale/fa-IR.js +1 -0
  48. package/lib/locale/fr-FR.js +1 -0
  49. package/lib/locale/id-ID.js +1 -0
  50. package/lib/locale/it-IT.js +1 -0
  51. package/lib/locale/ja-JP.js +1 -0
  52. package/lib/locale/ko-KR.js +1 -0
  53. package/lib/locale/pl-PL.js +1 -0
  54. package/lib/locale/pt-BR.js +1 -0
  55. package/lib/locale/ru-RU.js +1 -0
  56. package/lib/locale/sk-SK.js +1 -0
  57. package/lib/locale/vi-VN.js +1 -0
  58. package/lib/locale/zh-CN.js +1 -0
  59. package/lib/locale/zh-HK.js +1 -0
  60. package/lib/locale/zh-TW.js +1 -0
  61. package/lib/types/controllers/components.controller.d.ts +23 -0
  62. package/lib/types/controllers/dv-alert.controller.d.ts +1 -4
  63. package/lib/types/index.d.ts +0 -1
  64. package/lib/types/locale/en-US.d.ts +3 -0
  65. package/lib/types/locale/types.d.ts +18 -0
  66. package/lib/types/menu/dv.menu.d.ts +4 -3
  67. package/lib/types/services/dropdown-manager.service.d.ts +1 -5
  68. package/lib/types/views/components/{panel/index.d.ts → DataValidationDetail.d.ts} +1 -1
  69. package/lib/types/views/components/{item/index.d.ts → DataValidationItem.d.ts} +2 -1
  70. package/lib/types/views/components/{list/index.d.ts → DataValidationList.d.ts} +1 -1
  71. package/lib/types/views/components/{options/index.d.ts → DataValidationOptions.d.ts} +1 -1
  72. package/lib/types/views/components/{detail/index.d.ts → DataValidationPanel.d.ts} +1 -1
  73. package/lib/types/views/components/{show-time/index.d.ts → DateShowTimeOption.d.ts} +1 -1
  74. package/lib/types/views/components/{render-mode/index.d.ts → ListRenderModeInput.d.ts} +1 -1
  75. package/lib/types/views/components/formula-input/BaseFormulaInput.d.ts +2 -2
  76. package/lib/types/views/components/formula-input/CheckboxFormulaInput.d.ts +2 -2
  77. package/lib/types/views/components/formula-input/CustomFormulaInput.d.ts +2 -2
  78. package/lib/types/views/components/formula-input/ListFormulaInput.d.ts +2 -2
  79. package/lib/types/views/components/formula-input/formula-input.d.ts +1 -1
  80. package/lib/types/views/components/formula-input/index.d.ts +1 -1
  81. package/lib/types/views/components/formula-input/interface.d.ts +28 -0
  82. package/lib/types/views/components/index.d.ts +1 -1
  83. package/lib/umd/index.js +1 -1
  84. package/lib/umd/locale/ar-SA.js +1 -1
  85. package/lib/umd/locale/ca-ES.js +1 -1
  86. package/lib/umd/locale/de-DE.js +1 -1
  87. package/lib/umd/locale/en-US.js +1 -1
  88. package/lib/umd/locale/es-ES.js +1 -1
  89. package/lib/umd/locale/fa-IR.js +1 -1
  90. package/lib/umd/locale/fr-FR.js +1 -1
  91. package/lib/umd/locale/id-ID.js +1 -1
  92. package/lib/umd/locale/it-IT.js +1 -1
  93. package/lib/umd/locale/ja-JP.js +1 -1
  94. package/lib/umd/locale/ko-KR.js +1 -1
  95. package/lib/umd/locale/pl-PL.js +1 -1
  96. package/lib/umd/locale/pt-BR.js +1 -1
  97. package/lib/umd/locale/ru-RU.js +1 -1
  98. package/lib/umd/locale/sk-SK.js +1 -1
  99. package/lib/umd/locale/vi-VN.js +1 -1
  100. package/lib/umd/locale/zh-CN.js +1 -1
  101. package/lib/umd/locale/zh-HK.js +1 -1
  102. package/lib/umd/locale/zh-TW.js +1 -1
  103. package/package.json +15 -15
  104. /package/lib/types/controllers/{dv-ui.controller.d.ts → ui.controller.d.ts} +0 -0
@@ -0,0 +1,23 @@
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 { Disposable } from '@univerjs/core';
17
+ import { ComponentManager, IconManager } from '@univerjs/ui';
18
+ export declare class ComponentsController extends Disposable {
19
+ private readonly _componentManager;
20
+ private readonly _iconManager;
21
+ constructor(_componentManager: ComponentManager, _iconManager: IconManager);
22
+ private _registerIcons;
23
+ }
@@ -16,16 +16,13 @@
16
16
  import { Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
17
17
  import { SheetDataValidationModel } from '@univerjs/sheets-data-validation';
18
18
  import { CellAlertManagerService, HoverManagerService } from '@univerjs/sheets-ui';
19
- import { IZenZoneService } from '@univerjs/ui';
20
19
  export declare class DataValidationAlertController extends Disposable {
21
20
  private readonly _hoverManagerService;
22
21
  private readonly _cellAlertManagerService;
23
22
  private readonly _univerInstanceService;
24
23
  private readonly _localeService;
25
- private readonly _zenZoneService;
26
24
  private readonly _dataValidationModel;
27
- constructor(_hoverManagerService: HoverManagerService, _cellAlertManagerService: CellAlertManagerService, _univerInstanceService: IUniverInstanceService, _localeService: LocaleService, _zenZoneService: IZenZoneService, _dataValidationModel: SheetDataValidationModel);
25
+ constructor(_hoverManagerService: HoverManagerService, _cellAlertManagerService: CellAlertManagerService, _univerInstanceService: IUniverInstanceService, _localeService: LocaleService, _dataValidationModel: SheetDataValidationModel);
28
26
  private _init;
29
27
  private _initCellAlertPopup;
30
- private _initZenService;
31
28
  }
@@ -17,4 +17,3 @@ import './global.css';
17
17
  export type { IUniverSheetsDataValidationUIConfig } from './config/config';
18
18
  export { UniverSheetsDataValidationMobileUIPlugin } from './mobile-plugin';
19
19
  export { UniverSheetsDataValidationUIPlugin } from './plugin';
20
- export { BaseSheetDataValidatorView } from './views/validator-views/sheet-validator-view';
@@ -16,6 +16,9 @@
16
16
  declare const locale: {
17
17
  'sheets-data-validation-ui': {
18
18
  title: string;
19
+ operators: {
20
+ legal: string;
21
+ };
19
22
  validFail: {
20
23
  value: string;
21
24
  common: string;
@@ -0,0 +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
+ */
16
+ import type { LocaleLeafKeys } from '@univerjs/core';
17
+ import type enUS from './en-US';
18
+ export type LocaleKey = LocaleLeafKeys<typeof enUS>;
@@ -15,7 +15,8 @@
15
15
  */
16
16
  import type { IAccessor } from '@univerjs/core';
17
17
  import type { IMenuItem } from '@univerjs/ui';
18
+ import type { LocaleKey } from '../locale/types';
18
19
  export declare const DATA_VALIDATION_MENU_ID = "sheet.menu.data-validation";
19
- export declare function dataValidationMenuFactory(accessor: IAccessor): IMenuItem;
20
- export declare function openDataValidationMenuFactory(_accessor: IAccessor): IMenuItem;
21
- export declare function addDataValidationMenuFactory(_accessor: IAccessor): IMenuItem;
20
+ export declare function dataValidationMenuFactory(accessor: IAccessor): IMenuItem<LocaleKey>;
21
+ export declare function openDataValidationMenuFactory(): IMenuItem<LocaleKey>;
22
+ export declare function addDataValidationMenuFactory(): IMenuItem<LocaleKey>;
@@ -20,7 +20,6 @@ import { DataValidatorRegistryService } from '@univerjs/data-validation';
20
20
  import { SheetsSelectionsService } from '@univerjs/sheets';
21
21
  import { SheetDataValidationModel } from '@univerjs/sheets-data-validation';
22
22
  import { IEditorBridgeService, ISheetCellDropdownManagerService } from '@univerjs/sheets-ui';
23
- import { IZenZoneService } from '@univerjs/ui';
24
23
  export interface IDataValidationDropdownParam {
25
24
  location: ISheetLocation;
26
25
  onHide?: () => void;
@@ -35,7 +34,6 @@ export interface IDropdownComponentProps {
35
34
  export declare class DataValidationDropdownManagerService extends Disposable {
36
35
  private readonly _univerInstanceService;
37
36
  private readonly _dataValidatorRegistryService;
38
- private readonly _zenZoneService;
39
37
  private readonly _dataValidationModel;
40
38
  private readonly _sheetsSelectionsService;
41
39
  private readonly _cellDropdownManagerService;
@@ -48,10 +46,8 @@ export declare class DataValidationDropdownManagerService extends Disposable {
48
46
  private _activeDropdown$;
49
47
  private _currentPopup;
50
48
  activeDropdown$: import("rxjs").Observable<Nullable<IDataValidationDropdownParam>>;
51
- private _zenVisible;
52
49
  get activeDropdown(): Nullable<IDataValidationDropdownParam>;
53
- constructor(_univerInstanceService: IUniverInstanceService, _dataValidatorRegistryService: DataValidatorRegistryService, _zenZoneService: IZenZoneService, _dataValidationModel: SheetDataValidationModel, _sheetsSelectionsService: SheetsSelectionsService, _cellDropdownManagerService: ISheetCellDropdownManagerService, _sheetDataValidationModel: SheetDataValidationModel, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _injector: Injector, _configService: IConfigService);
54
- private _init;
50
+ constructor(_univerInstanceService: IUniverInstanceService, _dataValidatorRegistryService: DataValidatorRegistryService, _dataValidationModel: SheetDataValidationModel, _sheetsSelectionsService: SheetsSelectionsService, _cellDropdownManagerService: ISheetCellDropdownManagerService, _sheetDataValidationModel: SheetDataValidationModel, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _injector: Injector, _configService: IConfigService);
55
51
  private _getDropdownByCell;
56
52
  private _initSelectionChange;
57
53
  showDropdown(param: IDataValidationDropdownParam): void;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const DataValidationPanel: () => import("react/jsx-runtime").JSX.Element | null;
16
+ export declare function DataValidationDetail(): import("react").JSX.Element | null;
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { ISheetDataValidationRule } from '@univerjs/core';
17
+ import * as React from 'react';
17
18
  export interface IDataValidationDetailProps {
18
19
  rule: ISheetDataValidationRule;
19
20
  onClick: () => void;
@@ -21,4 +22,4 @@ export interface IDataValidationDetailProps {
21
22
  subUnitId: string;
22
23
  disable?: boolean;
23
24
  }
24
- export declare const DataValidationItem: (props: IDataValidationDetailProps) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const DataValidationItem: (props: IDataValidationDetailProps) => React.JSX.Element;
@@ -16,4 +16,4 @@
16
16
  import type { Workbook } from '@univerjs/core';
17
17
  export declare function DataValidationList(props: {
18
18
  workbook: Workbook;
19
- }): import("react/jsx-runtime").JSX.Element;
19
+ }): import("react").JSX.Element;
@@ -19,4 +19,4 @@ export interface IDataValidationOptionsParams {
19
19
  onChange: (value: IDataValidationRuleOptions) => void;
20
20
  extraComponent?: string;
21
21
  }
22
- export declare function DataValidationOptions(props: IDataValidationOptionsParams): import("react/jsx-runtime").JSX.Element;
22
+ export declare function DataValidationOptions(props: IDataValidationOptionsParams): import("react").JSX.Element;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare function DataValidationDetail(): import("react/jsx-runtime").JSX.Element | null;
16
+ export declare const DataValidationPanel: () => import("react").JSX.Element | null;
@@ -18,7 +18,7 @@ export interface IDateShowTimeOptionProps {
18
18
  value: IDataValidationRuleOptions;
19
19
  onChange: (value: IDataValidationRuleOptions) => void;
20
20
  }
21
- export declare function DateShowTimeOption(props: IDateShowTimeOptionProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function DateShowTimeOption(props: IDateShowTimeOptionProps): import("react").JSX.Element;
22
22
  export declare namespace DateShowTimeOption {
23
23
  var componentKey: string;
24
24
  }
@@ -18,7 +18,7 @@ export interface IListRenderModeInputProps {
18
18
  value: IDataValidationRuleOptions;
19
19
  onChange: (value: IDataValidationRuleOptions) => void;
20
20
  }
21
- export declare function ListRenderModeInput(props: IListRenderModeInputProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function ListRenderModeInput(props: IListRenderModeInputProps): import("react").JSX.Element;
22
22
  export declare namespace ListRenderModeInput {
23
23
  var componentKey: string;
24
24
  }
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IFormulaInputProps } from '@univerjs/data-validation';
17
- export declare const BaseFormulaInput: (props: IFormulaInputProps) => import("react/jsx-runtime").JSX.Element;
16
+ import type { IFormulaInputProps } from './interface';
17
+ export declare const BaseFormulaInput: (props: IFormulaInputProps) => import("react").JSX.Element;
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IFormulaInputProps } from '@univerjs/data-validation';
17
- export declare function CheckboxFormulaInput(props: IFormulaInputProps): import("react/jsx-runtime").JSX.Element;
16
+ import type { IFormulaInputProps } from './interface';
17
+ export declare function CheckboxFormulaInput(props: IFormulaInputProps): import("react").JSX.Element;
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IFormulaInputProps } from '@univerjs/data-validation';
17
- export declare function CustomFormulaInput(props: IFormulaInputProps): import("react/jsx-runtime").JSX.Element;
16
+ import type { IFormulaInputProps } from './interface';
17
+ export declare function CustomFormulaInput(props: IFormulaInputProps): import("react").JSX.Element;
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IFormulaInputProps } from '@univerjs/data-validation';
17
- export declare function ListFormulaInput(props: IFormulaInputProps): import("react/jsx-runtime").JSX.Element;
16
+ import type { IFormulaInputProps } from './interface';
17
+ export declare function ListFormulaInput(props: IFormulaInputProps): import("react").JSX.Element;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { FormulaInputType } from '@univerjs/data-validation';
16
+ import type { FormulaInputType } from './interface';
17
17
  export declare const BASE_FORMULA_INPUT_NAME = "data-validation.formula-input";
18
18
  export declare const LIST_FORMULA_INPUT_NAME = "data-validation.list-formula-input";
19
19
  export declare const FORMULA_INPUTS: [string, FormulaInputType][];
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { FormulaInputType } from '@univerjs/data-validation';
16
+ import type { FormulaInputType } from './interface';
17
17
  import { BASE_FORMULA_INPUT_NAME, CHECKBOX_FORMULA_INPUT_NAME, CUSTOM_FORMULA_INPUT_NAME, LIST_FORMULA_INPUT_NAME } from '@univerjs/sheets-data-validation';
18
18
  export { BASE_FORMULA_INPUT_NAME, CHECKBOX_FORMULA_INPUT_NAME, CUSTOM_FORMULA_INPUT_NAME, LIST_FORMULA_INPUT_NAME, };
19
19
  export declare const FORMULA_INPUTS: [string, FormulaInputType][];
@@ -0,0 +1,28 @@
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 { IFormulaValidResult, IFormulaValue } from '@univerjs/data-validation';
17
+ import type { ComponentType } from 'react';
18
+ export interface IFormulaInputProps {
19
+ isTwoFormula?: boolean;
20
+ value?: IFormulaValue;
21
+ onChange?: (value?: IFormulaValue) => void;
22
+ unitId: string;
23
+ subUnitId: string;
24
+ showError?: boolean;
25
+ validResult?: IFormulaValidResult;
26
+ ruleId: string;
27
+ }
28
+ export type FormulaInputType = ComponentType<IFormulaInputProps>;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { DataValidationPanel } from './panel';
16
+ export { DataValidationPanel } from './DataValidationPanel';