@hi-ui/form 5.0.0-canary.2 → 5.0.0-canary.4
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/CHANGELOG.md +42 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/styles/index.scss.js +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/styles/index.scss.js +1 -1
- package/lib/types/FormList.d.ts +18 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @hi-ui/form
|
|
2
2
|
|
|
3
|
+
## 5.0.0-canary.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- chore: rebase master (5.0)
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @hi-ui/core@5.0.0-canary.2
|
|
10
|
+
- @hi-ui/use-latest@5.0.0-canary.2
|
|
11
|
+
- @hi-ui/button@5.0.0-canary.5
|
|
12
|
+
- @hi-ui/array-utils@5.0.0-canary.2
|
|
13
|
+
- @hi-ui/classname@5.0.0-canary.2
|
|
14
|
+
- @hi-ui/dom-utils@5.0.0-canary.2
|
|
15
|
+
- @hi-ui/env@5.0.0-canary.2
|
|
16
|
+
- @hi-ui/func-utils@5.0.0-canary.2
|
|
17
|
+
- @hi-ui/object-utils@5.0.0-canary.2
|
|
18
|
+
- @hi-ui/type-assertion@5.0.0-canary.2
|
|
19
|
+
|
|
20
|
+
## 5.0.0-canary.3
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 4b09e728b: build: 将 package.json 中 exports 配置中的 types 配置放在最上面 (5.0)
|
|
25
|
+
- Updated dependencies [4b09e728b]
|
|
26
|
+
- @hi-ui/core@5.0.0-canary.1
|
|
27
|
+
- @hi-ui/use-latest@5.0.0-canary.1
|
|
28
|
+
- @hi-ui/button@5.0.0-canary.4
|
|
29
|
+
- @hi-ui/array-utils@5.0.0-canary.1
|
|
30
|
+
- @hi-ui/classname@5.0.0-canary.1
|
|
31
|
+
- @hi-ui/dom-utils@5.0.0-canary.1
|
|
32
|
+
- @hi-ui/env@5.0.0-canary.1
|
|
33
|
+
- @hi-ui/func-utils@5.0.0-canary.1
|
|
34
|
+
- @hi-ui/object-utils@5.0.0-canary.1
|
|
35
|
+
- @hi-ui/type-assertion@5.0.0-canary.1
|
|
36
|
+
|
|
3
37
|
## 5.0.0-canary.2
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -42,6 +76,14 @@
|
|
|
42
76
|
- @hi-ui/object-utils@5.0.0-canary.0
|
|
43
77
|
- @hi-ui/type-assertion@5.0.0-canary.0
|
|
44
78
|
|
|
79
|
+
## 4.3.2
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- [#3160](https://github.com/XiaoMi/hiui/pull/3160) [`3244e5a`](https://github.com/XiaoMi/hiui/commit/3244e5a94d1cfa3d85a65bc8804a21b8b60b80a4) Thanks [@zyprepare](https://github.com/zyprepare)! - <br>
|
|
84
|
+
- feat(form): 入口新增 FormLabel 组件导出
|
|
85
|
+
- feat(form): 更新 FormListProps 中 children 渲染函数中 fields 参数的类型
|
|
86
|
+
|
|
45
87
|
## 4.3.1
|
|
46
88
|
|
|
47
89
|
### Patch Changes
|
package/lib/cjs/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var FormItem = require('./FormItem.js');
|
|
|
18
18
|
var FormList = require('./FormList.js');
|
|
19
19
|
var FormSubmit = require('./FormSubmit.js');
|
|
20
20
|
var FormReset = require('./FormReset.js');
|
|
21
|
+
var FormLabel = require('./FormLabel.js');
|
|
21
22
|
var Form = Object.assign(Form$1.Form, {
|
|
22
23
|
Item: FormItem.FormItem,
|
|
23
24
|
List: FormList.FormList,
|
|
@@ -30,4 +31,5 @@ exports.FormItem = FormItem.FormItem;
|
|
|
30
31
|
exports.FormList = FormList.FormList;
|
|
31
32
|
exports.FormSubmit = FormSubmit.FormSubmit;
|
|
32
33
|
exports.FormReset = FormReset.FormReset;
|
|
34
|
+
exports.FormLabel = FormLabel.FormLabel;
|
|
33
35
|
exports["default"] = Form;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
var css_248z = ".hi-v5-form {max-width: 100%;position: relative;}.hi-v5-form fieldset {margin: 0;padding: 0;border: 0;}.hi-v5-form fieldset + fieldset {margin-top: 16px;}.hi-v5-form legend {margin: 0 0 16px;color: var(--hi-v5-color-gray-800, #
|
|
15
|
+
var css_248z = ".hi-v5-form {max-width: 100%;position: relative;}.hi-v5-form fieldset {margin: 0;padding: 0;border: 0;}.hi-v5-form fieldset + fieldset {margin-top: 16px;}.hi-v5-form legend {margin: 0 0 16px;color: var(--hi-v5-color-gray-800, #1d1e26);}.hi-v5-form--placement-horizontal {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;-webkit-column-gap: var(--hi-v5-spacing-10, 20px);-moz-column-gap: var(--hi-v5-spacing-10, 20px);column-gap: var(--hi-v5-spacing-10, 20px);}.hi-v5-form--placement-horizontal .hi-v5-form-label__indent {min-height: var(--hi-v5-height-8, 32px);}.hi-v5-form-label {font-size: var(--hi-v5-text-size-md, 0.875rem);-webkit-box-sizing: border-box;box-sizing: border-box;margin-right: 0;}.hi-v5-form-label__content {display: -webkit-box;display: -ms-flexbox;display: flex;}.hi-v5-form-label--placement-top > .hi-v5-form-label__content {text-align: left;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;padding-right: 0;}.hi-v5-form-label__content__text, .hi-v5-form-label__content__indent {-ms-flex-negative: 0;flex-shrink: 0;-webkit-box-sizing: border-box;box-sizing: border-box;vertical-align: top;color: var(--hi-v5-color-gray-800, #1d1e26);overflow-wrap: break-word;}.hi-v5-form-label__content__text {padding-right: var(--hi-v5-spacing-6, 12px);min-height: var(--hi-v5-height-8, 32px);line-height: var(--hi-v5-height-8, 32px);}.hi-v5-form-label--placement-left > .hi-v5-form-label__content > .hi-v5-form-label__content__text {text-align: left;}.hi-v5-form-label--placement-right > .hi-v5-form-label__content > .hi-v5-form-label__content__text {text-align: right;}.hi-v5-form-label--placement-top > .hi-v5-form-label__content > .hi-v5-form-label__content__text {min-height: 22px;line-height: 22px;padding-right: 0;margin-bottom: var(--hi-v5-spacing-3, 6px);}.hi-v5-form-label--required > .hi-v5-form-label__content > .hi-v5-form-label__content__text::after {margin-left: var(--hi-v5-spacing-2, 4px);content: \"*\";color: var(--hi-v5-color-danger-500, var(--hi-v5-color-red-500, #fa4646));}.hi-v5-form-label__content__control {min-width: 1px;min-height: var(--hi-v5-height-8, 32px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v5-form-message {-webkit-box-sizing: content-box;box-sizing: content-box;display: block;font-size: var(--hi-v5-text-size-sm, 0.75rem);line-height: var(--hi-v5-text-lineheight-sm, 1.25rem);min-height: var(--hi-v5-height-5, 20px);padding-bottom: var(--hi-v5-spacing-2, 4px);-webkit-transform: translateY(-10%);transform: translateY(-10%);opacity: 0;color: var(--hi-v5-color-danger-500, var(--hi-v5-color-red-500, #fa4646));-webkit-transition: all 0.3s;transition: all 0.3s;}.hi-v5-form-message--show {opacity: 1;-webkit-transform: translateY(0);transform: translateY(0);}.hi-v5-form-item {position: relative;}";
|
|
16
16
|
var __styleInject__ = require('@hi-ui/style-inject')["default"];
|
|
17
17
|
__styleInject__(css_248z);
|
|
18
18
|
exports["default"] = css_248z;
|
package/lib/esm/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { FormItem } from './FormItem.js';
|
|
|
14
14
|
import { FormList } from './FormList.js';
|
|
15
15
|
import { FormSubmit } from './FormSubmit.js';
|
|
16
16
|
import { FormReset } from './FormReset.js';
|
|
17
|
+
export { FormLabel } from './FormLabel.js';
|
|
17
18
|
var Form = Object.assign(Form$1, {
|
|
18
19
|
Item: FormItem,
|
|
19
20
|
List: FormList,
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import __styleInject__ from '@hi-ui/style-inject';
|
|
11
|
-
var css_248z = ".hi-v5-form {max-width: 100%;position: relative;}.hi-v5-form fieldset {margin: 0;padding: 0;border: 0;}.hi-v5-form fieldset + fieldset {margin-top: 16px;}.hi-v5-form legend {margin: 0 0 16px;color: var(--hi-v5-color-gray-800, #
|
|
11
|
+
var css_248z = ".hi-v5-form {max-width: 100%;position: relative;}.hi-v5-form fieldset {margin: 0;padding: 0;border: 0;}.hi-v5-form fieldset + fieldset {margin-top: 16px;}.hi-v5-form legend {margin: 0 0 16px;color: var(--hi-v5-color-gray-800, #1d1e26);}.hi-v5-form--placement-horizontal {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;-webkit-column-gap: var(--hi-v5-spacing-10, 20px);-moz-column-gap: var(--hi-v5-spacing-10, 20px);column-gap: var(--hi-v5-spacing-10, 20px);}.hi-v5-form--placement-horizontal .hi-v5-form-label__indent {min-height: var(--hi-v5-height-8, 32px);}.hi-v5-form-label {font-size: var(--hi-v5-text-size-md, 0.875rem);-webkit-box-sizing: border-box;box-sizing: border-box;margin-right: 0;}.hi-v5-form-label__content {display: -webkit-box;display: -ms-flexbox;display: flex;}.hi-v5-form-label--placement-top > .hi-v5-form-label__content {text-align: left;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;padding-right: 0;}.hi-v5-form-label__content__text, .hi-v5-form-label__content__indent {-ms-flex-negative: 0;flex-shrink: 0;-webkit-box-sizing: border-box;box-sizing: border-box;vertical-align: top;color: var(--hi-v5-color-gray-800, #1d1e26);overflow-wrap: break-word;}.hi-v5-form-label__content__text {padding-right: var(--hi-v5-spacing-6, 12px);min-height: var(--hi-v5-height-8, 32px);line-height: var(--hi-v5-height-8, 32px);}.hi-v5-form-label--placement-left > .hi-v5-form-label__content > .hi-v5-form-label__content__text {text-align: left;}.hi-v5-form-label--placement-right > .hi-v5-form-label__content > .hi-v5-form-label__content__text {text-align: right;}.hi-v5-form-label--placement-top > .hi-v5-form-label__content > .hi-v5-form-label__content__text {min-height: 22px;line-height: 22px;padding-right: 0;margin-bottom: var(--hi-v5-spacing-3, 6px);}.hi-v5-form-label--required > .hi-v5-form-label__content > .hi-v5-form-label__content__text::after {margin-left: var(--hi-v5-spacing-2, 4px);content: \"*\";color: var(--hi-v5-color-danger-500, var(--hi-v5-color-red-500, #fa4646));}.hi-v5-form-label__content__control {min-width: 1px;min-height: var(--hi-v5-height-8, 32px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v5-form-message {-webkit-box-sizing: content-box;box-sizing: content-box;display: block;font-size: var(--hi-v5-text-size-sm, 0.75rem);line-height: var(--hi-v5-text-lineheight-sm, 1.25rem);min-height: var(--hi-v5-height-5, 20px);padding-bottom: var(--hi-v5-spacing-2, 4px);-webkit-transform: translateY(-10%);transform: translateY(-10%);opacity: 0;color: var(--hi-v5-color-danger-500, var(--hi-v5-color-red-500, #fa4646));-webkit-transition: all 0.3s;transition: all 0.3s;}.hi-v5-form-message--show {opacity: 1;-webkit-transform: translateY(0);transform: translateY(0);}.hi-v5-form-item {position: relative;}";
|
|
12
12
|
__styleInject__(css_248z);
|
|
13
13
|
export { css_248z as default };
|
package/lib/types/FormList.d.ts
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HiBaseHTMLProps } from '@hi-ui/core';
|
|
3
3
|
import { FormFieldPath, FormListChildrenAction, FormListHelper } from './types';
|
|
4
|
+
declare const fieldListSymbol: unique symbol;
|
|
4
5
|
export declare const FormList: React.ForwardRefExoticComponent<FormListProps & React.RefAttributes<HTMLDivElement | null>>;
|
|
6
|
+
export interface FormListChildField {
|
|
7
|
+
/**
|
|
8
|
+
* 字段名
|
|
9
|
+
* - 实际上是元素在数组中的索引
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* 字段符号
|
|
14
|
+
*/
|
|
15
|
+
symbol: typeof fieldListSymbol;
|
|
16
|
+
/**
|
|
17
|
+
* 字段值
|
|
18
|
+
*/
|
|
19
|
+
value: unknown;
|
|
20
|
+
}
|
|
5
21
|
export interface FormListProps extends HiBaseHTMLProps<'div'> {
|
|
6
22
|
/**
|
|
7
23
|
* 表单控件渲染函数
|
|
8
24
|
*/
|
|
9
|
-
children?: (fields:
|
|
25
|
+
children?: (fields: FormListChildField[], action: FormListChildrenAction) => React.ReactElement;
|
|
10
26
|
/**
|
|
11
27
|
* 列表名称
|
|
12
28
|
*/
|
|
@@ -16,3 +32,4 @@ export interface FormListProps extends HiBaseHTMLProps<'div'> {
|
|
|
16
32
|
*/
|
|
17
33
|
innerRef?: React.Ref<FormListHelper>;
|
|
18
34
|
}
|
|
35
|
+
export {};
|
package/lib/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/form",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.4",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"typings": "lib/types/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"types": "./lib/types/index.d.ts",
|
|
22
23
|
"require": "./lib/cjs/index.js",
|
|
23
|
-
"default": "./lib/esm/index.js"
|
|
24
|
-
"types": "./lib/types/index.d.ts"
|
|
24
|
+
"default": "./lib/esm/index.js"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
@@ -44,26 +44,26 @@
|
|
|
44
44
|
"url": "https://github.com/XiaoMi/hiui/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@hi-ui/array-utils": "^5.0.0-canary.
|
|
48
|
-
"@hi-ui/button": "^5.0.0-canary.
|
|
49
|
-
"@hi-ui/classname": "^5.0.0-canary.
|
|
50
|
-
"@hi-ui/dom-utils": "^5.0.0-canary.
|
|
51
|
-
"@hi-ui/env": "^5.0.0-canary.
|
|
52
|
-
"@hi-ui/func-utils": "^5.0.0-canary.
|
|
53
|
-
"@hi-ui/object-utils": "^5.0.0-canary.
|
|
54
|
-
"@hi-ui/type-assertion": "^5.0.0-canary.
|
|
55
|
-
"@hi-ui/use-latest": "^5.0.0-canary.
|
|
47
|
+
"@hi-ui/array-utils": "^5.0.0-canary.2",
|
|
48
|
+
"@hi-ui/button": "^5.0.0-canary.5",
|
|
49
|
+
"@hi-ui/classname": "^5.0.0-canary.2",
|
|
50
|
+
"@hi-ui/dom-utils": "^5.0.0-canary.2",
|
|
51
|
+
"@hi-ui/env": "^5.0.0-canary.2",
|
|
52
|
+
"@hi-ui/func-utils": "^5.0.0-canary.2",
|
|
53
|
+
"@hi-ui/object-utils": "^5.0.0-canary.2",
|
|
54
|
+
"@hi-ui/type-assertion": "^5.0.0-canary.2",
|
|
55
|
+
"@hi-ui/use-latest": "^5.0.0-canary.2",
|
|
56
56
|
"async-validator": "^4.0.7",
|
|
57
57
|
"scroll-into-view-if-needed": "^3.1.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@hi-ui/core": ">=5.0.0-canary.
|
|
60
|
+
"@hi-ui/core": ">=5.0.0-canary.2",
|
|
61
61
|
"react": ">=16.8.6",
|
|
62
62
|
"react-dom": ">=16.8.6"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@hi-ui/core": "^5.0.0-canary.
|
|
66
|
-
"@hi-ui/core-css": "^5.0.0-canary.
|
|
65
|
+
"@hi-ui/core": "^5.0.0-canary.2",
|
|
66
|
+
"@hi-ui/core-css": "^5.0.0-canary.6",
|
|
67
67
|
"react": "^17.0.1",
|
|
68
68
|
"react-dom": "^17.0.1"
|
|
69
69
|
}
|