Skip to content

Commit 83f90ba

Browse files
authored
fix intl (#51)
* feat: bump openinula first major version * fix: intl parse expressions * fix: intl
1 parent d24aa5e commit 83f90ba

File tree

6 files changed

+34
-319
lines changed

6 files changed

+34
-319
lines changed

Licenses/Third Party Open Source Software Notice.docx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,3 +496,15 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
496496
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
497497
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
498498
SOFTWARE.
499+
500+
Software: @types/react
501+
Copyright notice: Microsoft Corporation
502+
License: MIT License
503+
This project is licensed under the MIT license.
504+
Copyrights are respective of each contributor listed at the beginning of each definition file.
505+
506+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
507+
508+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
509+
510+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

next-packages/runtime/types/baseAttr.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
/*
2-
* Copyright (c) 2024 Huawei Technologies Co.,Ltd.
3-
*
4-
* openInula is licensed under Mulan PSL v2.
5-
* You can use this software according to the terms and conditions of the Mulan PSL v2.
6-
* You may obtain a copy of Mulan PSL v2 at:
7-
*
8-
* http://license.coscl.org.cn/MulanPSL2
9-
*
10-
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11-
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12-
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13-
* See the Mulan PSL v2 for more details.
14-
*/
1+
// Base on type definitions of React 17.0.2
152

163
import { InulaNode, KVObject } from './jsx';
174

packages/inula-intl/src/utils/parseRuleUtils.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,23 @@ function getRulesByArray(array: any[]) {
145145
return result;
146146
}
147147

148+
// 创建默认选项对象的工厂函数
149+
function createDefaultOptions(defaultType: any, obj: any): Record<string, any> {
150+
const lineBreaks = !!obj.error || !!obj.fallback;
151+
return {
152+
lineBreaks,
153+
defaultType,
154+
value: null,
155+
pop: false,
156+
push: null,
157+
next: null,
158+
error: false,
159+
fallback: false,
160+
shouldThrow: false,
161+
type: null,
162+
};
163+
}
164+
148165
function getRuleOptions(type: any, obj: any) {
149166
// 如果 obj 不是一个对象,则将其转换为包含 'match' 属性的对象
150167
if (!checkObject(obj)) {
@@ -156,19 +173,7 @@ function getRuleOptions(type: any, obj: any) {
156173
throw new Error('The matching rule cannot contain the status!');
157174
}
158175

159-
// 创建默认的选项对象,初始化各个选项属性
160-
const options: Record<string, any> = {
161-
value: null,
162-
type: null,
163-
defaultType: type,
164-
pop: false,
165-
push: null,
166-
next: null,
167-
error: false,
168-
fallback: false,
169-
shouldThrow: false,
170-
lineBreaks: !!obj.error || !!obj.fallback,
171-
};
176+
const options = createDefaultOptions(type, obj);
172177

173178
Object.assign(options, obj);
174179

@@ -215,6 +220,7 @@ const ruleUtils = {
215220
getReg,
216221
getRulesByObject,
217222
getRulesByArray,
223+
createDefaultOptions,
218224
getRuleOptions,
219225
getRules,
220226
};

packages/inula/src/jsx-type/baseAttr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Base on type definitions of React 17.0.2
12
import {
23
InulaAnimationEventHandler,
34
InulaChangeEventHandler,

packages/inula/src/types.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
/*
2-
* Copyright (c) 2023 Huawei Technologies Co.,Ltd.
3-
*
4-
* openInula is licensed under Mulan PSL v2.
5-
* You can use this software according to the terms and conditions of the Mulan PSL v2.
6-
* You may obtain a copy of Mulan PSL v2 at:
7-
*
8-
* http://license.coscl.org.cn/MulanPSL2
9-
*
10-
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11-
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12-
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13-
* See the Mulan PSL v2 for more details.
14-
*/
1+
// Base on type definitions of React 17.0.2
152

163
import { Component } from './renderer/components/BaseClassComponent';
174
import { MutableRef, RefCallBack, RefObject } from './renderer/hooks/HookType';

packages/inula/tests/EventTest/MouseEnterEvent.test.js

Lines changed: 0 additions & 278 deletions
This file was deleted.

0 commit comments

Comments
 (0)