-
-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sheet): optimize data validation i18n & dropdown bugfix (#1768)
* feat: optimize data-validation i18n * fix: dropdown error * feat: scrollbar style * feat: scrollbar style * feat: scrollbar style * feat: popup style
- Loading branch information
Showing
9 changed files
with
121 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
packages/sheets-data-validation/src/common/date-text-map.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { DataValidationOperator } from '@univerjs/core'; | ||
|
||
export const DateOperatorNameMap: Record<DataValidationOperator, string> = { | ||
[DataValidationOperator.BETWEEN]: 'dataValidation.date.operators.between', | ||
[DataValidationOperator.EQUAL]: 'dataValidation.date.operators.equal', | ||
[DataValidationOperator.GREATER_THAN]: 'dataValidation.date.operators.greaterThan', | ||
[DataValidationOperator.GREATER_THAN_OR_EQUAL]: 'dataValidation.date.operators.greaterThanOrEqual', | ||
[DataValidationOperator.LESS_THAN]: 'dataValidation.date.operators.lessThan', | ||
[DataValidationOperator.LESS_THAN_OR_EQUAL]: 'dataValidation.date.operators.lessThanOrEqual', | ||
[DataValidationOperator.NOT_BETWEEN]: 'dataValidation.date.operators.notBetween', | ||
[DataValidationOperator.NOT_EQUAL]: 'dataValidation.date.operators.notEqual', | ||
}; | ||
|
||
export const DateOperatorTextMap: Record<DataValidationOperator, string> = { | ||
[DataValidationOperator.BETWEEN]: 'dataValidation.date.operators.between', | ||
[DataValidationOperator.EQUAL]: 'dataValidation.date.operators.equal', | ||
[DataValidationOperator.GREATER_THAN]: 'dataValidation.date.operators.greaterThan', | ||
[DataValidationOperator.GREATER_THAN_OR_EQUAL]: 'dataValidation.date.operators.greaterThanOrEqual', | ||
[DataValidationOperator.LESS_THAN]: 'dataValidation.date.operators.lessThan', | ||
[DataValidationOperator.LESS_THAN_OR_EQUAL]: 'dataValidation.date.operators.lessThanOrEqual', | ||
[DataValidationOperator.NOT_BETWEEN]: 'dataValidation.date.operators.notBetween', | ||
[DataValidationOperator.NOT_EQUAL]: 'dataValidation.date.operators.notEqual', | ||
}; | ||
|
||
export const DateOperatorTitleMap: Record<DataValidationOperator, string> = { | ||
[DataValidationOperator.BETWEEN]: 'dataValidation.date.ruleName.between', | ||
[DataValidationOperator.EQUAL]: 'dataValidation.date.ruleName.equal', | ||
[DataValidationOperator.GREATER_THAN]: 'dataValidation.date.ruleName.greaterThan', | ||
[DataValidationOperator.GREATER_THAN_OR_EQUAL]: 'dataValidation.date.ruleName.greaterThanOrEqual', | ||
[DataValidationOperator.LESS_THAN]: 'dataValidation.date.ruleName.lessThan', | ||
[DataValidationOperator.LESS_THAN_OR_EQUAL]: 'dataValidation.date.ruleName.lessThanOrEqual', | ||
[DataValidationOperator.NOT_BETWEEN]: 'dataValidation.date.ruleName.notBetween', | ||
[DataValidationOperator.NOT_EQUAL]: 'dataValidation.date.ruleName.notEqual', | ||
}; | ||
|
||
export const DateOperatorErrorTitleMap: Record<DataValidationOperator, string> = { | ||
[DataValidationOperator.BETWEEN]: 'dataValidation.date.errorMsg.between', | ||
[DataValidationOperator.EQUAL]: 'dataValidation.date.errorMsg.equal', | ||
[DataValidationOperator.GREATER_THAN]: 'dataValidation.date.errorMsg.greaterThan', | ||
[DataValidationOperator.GREATER_THAN_OR_EQUAL]: 'dataValidation.date.errorMsg.greaterThanOrEqual', | ||
[DataValidationOperator.LESS_THAN]: 'dataValidation.date.errorMsg.lessThan', | ||
[DataValidationOperator.LESS_THAN_OR_EQUAL]: 'dataValidation.date.errorMsg.lessThanOrEqual', | ||
[DataValidationOperator.NOT_BETWEEN]: 'dataValidation.date.errorMsg.notBetween', | ||
[DataValidationOperator.NOT_EQUAL]: 'dataValidation.date.errorMsg.notEqual', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ export default { | |
title: '文本长度', | ||
}, | ||
decimal: { | ||
title: '小数', | ||
title: '数字', | ||
}, | ||
whole: { | ||
title: '整数', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters