tntd 2.8.0-beta.8 → 2.8.1
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/es/array-input/index.js +57 -42
- package/es/array-input/index.js.map +1 -1
- package/es/array-input/index.less +4 -1
- package/es/button/button.js +3 -7
- package/es/button/button.js.map +1 -1
- package/es/button/button.less +7 -0
- package/es/button/index.js +1 -0
- package/es/button/index.js.map +1 -1
- package/es/collapse/collapse.less +3 -3
- package/es/descriptions/descriptions.js +85 -24
- package/es/descriptions/descriptions.js.map +1 -1
- package/es/descriptions/descriptions.less +63 -62
- package/es/descriptions/style/index.less +1 -0
- package/es/drawer/drawer.js +118 -13
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/index.js +1 -1
- package/es/drawer/index.js.map +1 -1
- package/es/drawer/index.less +153 -0
- package/es/drawer/style/drawer.less +2 -4
- package/es/form/form.js +8 -3
- package/es/form/form.js.map +1 -1
- package/es/form/form.less +42 -0
- package/es/form/style/index.less +6 -6
- package/es/handle-icon/index.js +201 -0
- package/es/handle-icon/index.js.map +1 -0
- package/es/handle-icon/index.less +53 -0
- package/es/icon/style/style.less +1 -1
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/input/input.js +10 -6
- package/es/input/input.js.map +1 -1
- package/es/input/style/mixin.less +1 -1
- package/es/locale/en_US.js +8 -1
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +8 -1
- package/es/locale/zh_CN.js.map +1 -1
- package/es/mentions/style/index.less +1 -0
- package/es/modal/style/confirm.less +6 -10
- package/es/modal/style/modal.less +4 -2
- package/es/notification/assets/index.js +2 -0
- package/es/notification/assets/index.js.map +1 -0
- package/es/notification/assets/svg-error-tip.js +145 -0
- package/es/notification/assets/svg-error-tip.js.map +1 -0
- package/es/notification/assets/svg-success-tip.js +162 -0
- package/es/notification/assets/svg-success-tip.js.map +1 -0
- package/es/notification/index.js +1 -1
- package/es/notification/index.js.map +1 -1
- package/es/notification/notification.js +80 -0
- package/es/notification/notification.js.map +1 -0
- package/es/notification/notification.less +34 -0
- package/es/notification/style/index.less +1 -0
- package/es/page-container/index.js +1 -1
- package/es/page-container/index.js.map +1 -1
- package/es/page-loading/index.js +1 -1
- package/es/page-loading/index.js.map +1 -1
- package/es/select/select.js +5 -3
- package/es/select/select.js.map +1 -1
- package/es/select/style/index.less +7 -6
- package/es/spin/index.js +3 -2
- package/es/spin/index.js.map +1 -1
- package/es/spin/spin.js +36 -0
- package/es/spin/spin.js.map +1 -0
- package/es/spin/spin.less +9 -0
- package/es/style/themes/default.less +1 -1
- package/es/table/expand.less +49 -0
- package/es/table/hooks/index.js +2 -1
- package/es/table/hooks/index.js.map +1 -1
- package/es/table/hooks/use-expand-fixed.js +80 -0
- package/es/table/hooks/use-expand-fixed.js.map +1 -0
- package/es/table/index.js +1 -0
- package/es/table/index.js.map +1 -1
- package/es/table/style/index.less +77 -39
- package/es/table/style/size.less +1 -0
- package/es/table/table.js +43 -8
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +5 -5
- package/es/table/table.stories.js +413 -2
- package/es/table/table.stories.js.map +1 -1
- package/es/table/utils.js +11 -0
- package/es/table/utils.js.map +1 -1
- package/es/table-container/index.js +1 -1
- package/es/table-container/index.js.map +1 -1
- package/es/table-container/index.less +10 -10
- package/es/tabs-container/index.js +1 -1
- package/es/tabs-container/index.js.map +1 -1
- package/es/tag/color.less +53 -0
- package/es/tag/index.js +11 -2
- package/es/tag/index.js.map +1 -1
- package/es/tag/tag.js +171 -0
- package/es/tag/tag.js.map +1 -0
- package/es/tag/tag.less +228 -0
- package/es/title/index.js +4 -3
- package/es/title/index.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/index.less +12 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
- package/es/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
- package/es/tntd-form/FormItem/ItemHolder.js +1 -6
- package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
- package/es/tntd-form/FormItemLabel.js +2 -0
- package/es/tntd-form/FormItemLabel.js.map +1 -1
- package/es/tntd-select/index.js +9 -4
- package/es/tntd-select/index.js.map +1 -1
- package/es/tooltip/index.js +3 -2
- package/es/tooltip/index.js.map +1 -1
- package/es/tooltip/index.less +29 -0
- package/es/tooltip/tooltip.js +33 -0
- package/es/tooltip/tooltip.js.map +1 -0
- package/lib/array-input/index.d.ts +1 -12
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +62 -55
- package/lib/array-input/index.js.map +1 -1
- package/lib/array-input/index.less +4 -1
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +2 -14
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +7 -0
- package/lib/button/index.d.ts +1 -0
- package/lib/button/index.d.ts.map +1 -1
- package/lib/button/index.js +6 -5
- package/lib/button/index.js.map +1 -1
- package/lib/collapse/collapse.less +3 -3
- package/lib/descriptions/descriptions.d.ts +11 -6
- package/lib/descriptions/descriptions.d.ts.map +1 -1
- package/lib/descriptions/descriptions.js +92 -30
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/descriptions.less +63 -62
- package/lib/descriptions/style/index.less +1 -0
- package/lib/drawer/drawer.d.ts +28 -2
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +125 -13
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.d.ts +1 -1
- package/lib/drawer/index.d.ts.map +1 -1
- package/lib/drawer/index.js +5 -5
- package/lib/drawer/index.js.map +1 -1
- package/lib/drawer/index.less +153 -0
- package/lib/drawer/style/drawer.less +2 -4
- package/lib/form/form.d.ts +1 -0
- package/lib/form/form.d.ts.map +1 -1
- package/lib/form/form.js +9 -3
- package/lib/form/form.js.map +1 -1
- package/lib/form/form.less +42 -0
- package/lib/form/style/index.less +6 -6
- package/lib/handle-icon/index.d.ts +7 -0
- package/lib/handle-icon/index.d.ts.map +1 -0
- package/lib/handle-icon/index.js +221 -0
- package/lib/handle-icon/index.js.map +1 -0
- package/lib/handle-icon/index.less +53 -0
- package/lib/icon/style/style.less +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +8 -4
- package/lib/input/input.js.map +1 -1
- package/lib/input/style/mixin.less +1 -1
- package/lib/locale/default.d.ts +7 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +7 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +8 -1
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +7 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +8 -1
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/mentions/style/index.less +1 -0
- package/lib/modal/style/confirm.less +6 -10
- package/lib/modal/style/modal.less +4 -2
- package/lib/notification/assets/index.d.ts +3 -0
- package/lib/notification/assets/index.d.ts.map +1 -0
- package/lib/notification/assets/index.js +20 -0
- package/lib/notification/assets/index.js.map +1 -0
- package/lib/notification/assets/svg-error-tip.d.ts +4 -0
- package/lib/notification/assets/svg-error-tip.d.ts.map +1 -0
- package/lib/notification/assets/svg-error-tip.js +154 -0
- package/lib/notification/assets/svg-error-tip.js.map +1 -0
- package/lib/notification/assets/svg-success-tip.d.ts +4 -0
- package/lib/notification/assets/svg-success-tip.d.ts.map +1 -0
- package/lib/notification/assets/svg-success-tip.js +171 -0
- package/lib/notification/assets/svg-success-tip.js.map +1 -0
- package/lib/notification/index.d.ts +1 -1
- package/lib/notification/index.d.ts.map +1 -1
- package/lib/notification/index.js +7 -8
- package/lib/notification/index.js.map +1 -1
- package/lib/notification/notification.d.ts +9 -0
- package/lib/notification/notification.d.ts.map +1 -0
- package/lib/notification/notification.js +105 -0
- package/lib/notification/notification.js.map +1 -0
- package/lib/notification/notification.less +34 -0
- package/lib/notification/style/index.less +1 -0
- package/lib/page-container/index.js +1 -1
- package/lib/page-container/index.js.map +1 -1
- package/lib/page-loading/index.js +1 -1
- package/lib/page-loading/index.js.map +1 -1
- package/lib/segmented/index.d.ts +1 -1
- package/lib/select/select.d.ts.map +1 -1
- package/lib/select/select.js +4 -2
- package/lib/select/select.js.map +1 -1
- package/lib/select/style/index.less +7 -6
- package/lib/spin/index.d.ts +3 -2
- package/lib/spin/index.d.ts.map +1 -1
- package/lib/spin/index.js +4 -6
- package/lib/spin/index.js.map +1 -1
- package/lib/spin/spin.d.ts +9 -0
- package/lib/spin/spin.d.ts.map +1 -0
- package/lib/spin/spin.js +44 -0
- package/lib/spin/spin.js.map +1 -0
- package/lib/spin/spin.less +9 -0
- package/lib/style/themes/default.less +1 -1
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/table/assets/image-loading-background.d.ts +1 -1
- package/lib/table/assets/image-loading.d.ts +1 -1
- package/lib/table/expand.less +49 -0
- package/lib/table/hooks/index.d.ts +1 -0
- package/lib/table/hooks/index.d.ts.map +1 -1
- package/lib/table/hooks/index.js +11 -0
- package/lib/table/hooks/index.js.map +1 -1
- package/lib/table/hooks/use-expand-fixed.d.ts +4 -0
- package/lib/table/hooks/use-expand-fixed.d.ts.map +1 -0
- package/lib/table/hooks/use-expand-fixed.js +110 -0
- package/lib/table/hooks/use-expand-fixed.js.map +1 -0
- package/lib/table/index.d.ts +1 -0
- package/lib/table/index.d.ts.map +1 -1
- package/lib/table/index.js +1 -0
- package/lib/table/index.js.map +1 -1
- package/lib/table/style/index.less +77 -39
- package/lib/table/style/size.less +1 -0
- package/lib/table/table.d.ts +3 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +43 -4
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +5 -5
- package/lib/table/table.stories.d.ts +106 -29
- package/lib/table/table.stories.d.ts.map +1 -1
- package/lib/table/table.stories.js +426 -3
- package/lib/table/table.stories.js.map +1 -1
- package/lib/table/utils.d.ts +1 -0
- package/lib/table/utils.d.ts.map +1 -1
- package/lib/table/utils.js +13 -0
- package/lib/table/utils.js.map +1 -1
- package/lib/table-container/index.js +1 -1
- package/lib/table-container/index.js.map +1 -1
- package/lib/table-container/index.less +10 -10
- package/lib/tabs-container/index.js +1 -1
- package/lib/tabs-container/index.js.map +1 -1
- package/lib/tag/color.less +53 -0
- package/lib/tag/index.d.ts +3 -2
- package/lib/tag/index.d.ts.map +1 -1
- package/lib/tag/index.js +15 -9
- package/lib/tag/index.js.map +1 -1
- package/lib/tag/tag.d.ts +41 -0
- package/lib/tag/tag.d.ts.map +1 -0
- package/lib/tag/tag.js +183 -0
- package/lib/tag/tag.js.map +1 -0
- package/lib/tag/tag.less +228 -0
- package/lib/title/index.d.ts +1 -0
- package/lib/title/index.d.ts.map +1 -1
- package/lib/title/index.js +3 -2
- package/lib/title/index.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.d.ts.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
- package/lib/tntd-cascader/AntdCascader/index.less +12 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.d.ts.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
- package/lib/tntd-form/FormItem/ItemHolder.js +1 -6
- package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
- package/lib/tntd-form/FormItemLabel.d.ts.map +1 -1
- package/lib/tntd-form/FormItemLabel.js +2 -0
- package/lib/tntd-form/FormItemLabel.js.map +1 -1
- package/lib/tntd-rc-select/_util/PurePanel.d.ts +1 -1
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +8 -3
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tooltip/index.d.ts +3 -2
- package/lib/tooltip/index.d.ts.map +1 -1
- package/lib/tooltip/index.js +3 -2
- package/lib/tooltip/index.js.map +1 -1
- package/lib/tooltip/index.less +29 -0
- package/lib/tooltip/tooltip.d.ts +9 -0
- package/lib/tooltip/tooltip.d.ts.map +1 -0
- package/lib/tooltip/tooltip.js +53 -0
- package/lib/tooltip/tooltip.js.map +1 -0
- package/package.json +4 -3
- package/themes/default/variables.less +2 -2
- package/themes/default/variablesVar.less +2 -2
- package/es/array-input/icon.js +0 -25
- package/es/array-input/icon.js.map +0 -1
- package/es/drawer/drawer.less +0 -20
- package/lib/array-input/icon.d.ts +0 -4
- package/lib/array-input/icon.d.ts.map +0 -1
- package/lib/array-input/icon.js +0 -32
- package/lib/array-input/icon.js.map +0 -1
- package/lib/drawer/drawer.less +0 -20
|
@@ -5,94 +5,90 @@
|
|
|
5
5
|
@descriptions-small-padding: 8px 16px;
|
|
6
6
|
@descriptions-bg: #e1e6ee;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
.tnt-descriptions{
|
|
9
|
+
&.@{descriptions-prefix-cls} {
|
|
10
|
+
// 加粗的头部
|
|
11
|
+
&.tnt-descriptions-title-weight{
|
|
12
|
+
>.@{descriptions-prefix-cls}-title{
|
|
13
|
+
font-weight: 600 !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// label中有标签前缀
|
|
18
|
+
.tnt-descriptions-label-tag{
|
|
19
|
+
color:@primary-color;
|
|
20
|
+
margin-right: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// title样式
|
|
24
|
+
&[class*="tnt-descriptions-title-theme"]{
|
|
13
25
|
// 默认色主题
|
|
14
|
-
|
|
26
|
+
>.@{descriptions-prefix-cls}-title{
|
|
15
27
|
font-size:@font-size-base;
|
|
16
28
|
position: relative;
|
|
17
29
|
margin-bottom:12px;
|
|
18
30
|
padding-left:12px;
|
|
31
|
+
font-weight: 400;
|
|
19
32
|
&::before{
|
|
20
33
|
content: '';
|
|
21
34
|
width: 4px;
|
|
22
35
|
height: 12px;
|
|
23
36
|
background-color: @primary-color;
|
|
24
|
-
border-radius: 8px;
|
|
37
|
+
border-radius: @border-radius-base;//8px;
|
|
25
38
|
position: absolute;
|
|
26
|
-
top:
|
|
39
|
+
top:5px;
|
|
27
40
|
left:0;
|
|
28
41
|
}
|
|
29
42
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
// 默认没有前面的线条展示
|
|
44
|
+
&.title-theme-none{
|
|
45
|
+
>.@{descriptions-prefix-cls}-title{
|
|
46
|
+
padding-left:0;
|
|
34
47
|
&::before{
|
|
35
48
|
content: '';
|
|
36
|
-
|
|
49
|
+
display: none;
|
|
37
50
|
}
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
|
-
|
|
41
53
|
}
|
|
42
54
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
font-size:@font-size-base;
|
|
47
|
-
max-width: 100%;
|
|
48
|
-
display: inline-block;
|
|
49
|
-
padding: 6px 20px 6px 16px;
|
|
50
|
-
border-radius: 8px 20px 20px 0px;
|
|
51
|
-
background: linear-gradient(0deg, rgba(18, 107, 251, 0.16) 0%, rgba(18, 107, 251, 0.08) 76.56%);
|
|
52
|
-
margin-right: 4px;
|
|
53
|
-
margin-bottom:16px;
|
|
54
|
-
white-space: nowrap;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
|
-
font-weight: 600;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-bordered {
|
|
63
|
-
&.tntd-descriptions {
|
|
64
|
-
&.tntd-descriptions-ellipsis{
|
|
55
|
+
// 带边框
|
|
56
|
+
&-bordered {
|
|
57
|
+
&.tnt-descriptions-ellipsis{
|
|
65
58
|
.@{descriptions-prefix-cls}-item-label,
|
|
66
59
|
.@{descriptions-prefix-cls}-item-content {
|
|
67
|
-
white-space: nowrap;
|
|
68
60
|
overflow: hidden;
|
|
69
61
|
text-overflow: ellipsis;
|
|
62
|
+
-webkit-box-orient: vertical;
|
|
70
63
|
}
|
|
71
|
-
|
|
72
64
|
.@{descriptions-prefix-cls}-item-label{
|
|
73
|
-
width: 180px;
|
|
65
|
+
width: 180px; // 其他语言模式默认180
|
|
66
|
+
background-color: @fill-color-quaternary; //#F8F9FB;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
&.@{descriptions-prefix-cls}-cn{
|
|
70
|
+
.@{descriptions-prefix-cls}-item-label{
|
|
71
|
+
width: 160px; // 中文160
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
.@{descriptions-prefix-cls}-view > table {
|
|
77
75
|
table-layout: fixed;
|
|
78
76
|
}
|
|
77
|
+
.@{descriptions-prefix-cls}-item-label{
|
|
78
|
+
background-color: fade(@descriptions-bg, 40%); ;
|
|
79
|
+
}
|
|
80
|
+
.@{descriptions-prefix-cls}-item-label,
|
|
81
|
+
.@{descriptions-prefix-cls}-item-content {
|
|
82
|
+
padding: @descriptions-small-padding;
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
|
-
.@{descriptions-prefix-cls}-item-label{
|
|
81
|
-
background-color: fade(@descriptions-bg, 40%); ;
|
|
82
|
-
}
|
|
83
|
-
.@{descriptions-prefix-cls}-item-label,
|
|
84
|
-
.@{descriptions-prefix-cls}-item-content {
|
|
85
|
-
padding: 10px 16px;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
height:
|
|
93
|
-
line-height:
|
|
86
|
+
// 不带边框
|
|
87
|
+
&:not(.@{descriptions-prefix-cls}-bordered ){
|
|
88
|
+
.@{descriptions-prefix-cls}-item{
|
|
89
|
+
height: 30px;
|
|
90
|
+
line-height: 30px;
|
|
94
91
|
position: relative;
|
|
95
|
-
padding-right: 12px;
|
|
96
92
|
padding:0;
|
|
97
93
|
&:not(:first-of-type){
|
|
98
94
|
padding-left: 12px;
|
|
@@ -101,29 +97,34 @@
|
|
|
101
97
|
left:0;
|
|
102
98
|
position: absolute;
|
|
103
99
|
width:1px;
|
|
104
|
-
background-color:
|
|
100
|
+
background-color: @descriptions-bg;
|
|
105
101
|
height:16px;
|
|
106
102
|
top: 50%;
|
|
107
103
|
margin-top:-8px;
|
|
108
104
|
}
|
|
109
105
|
}
|
|
110
|
-
|
|
106
|
+
.@{descriptions-prefix-cls}-item-no-label{
|
|
111
107
|
display: none;
|
|
112
108
|
}
|
|
113
|
-
|
|
109
|
+
.@{descriptions-prefix-cls}-item-content{
|
|
114
110
|
display: flex;
|
|
115
111
|
width: 100%;
|
|
116
|
-
|
|
112
|
+
height:100%;
|
|
113
|
+
align-items: center;
|
|
114
|
+
&>.tntd-ellipsis,>.tnt-ellipsis{
|
|
117
115
|
width: 100%;
|
|
118
|
-
|
|
116
|
+
height: 100%;
|
|
117
|
+
align-items: center;
|
|
118
|
+
.tnt-descriptions-label-title{
|
|
119
119
|
max-width: 70%;
|
|
120
|
-
margin-right:
|
|
121
|
-
color
|
|
122
|
-
white-space: nowrap;
|
|
120
|
+
margin-right: 8px;
|
|
121
|
+
color: tint(@bg-color-spotilight, 50%);//#8B919E;
|
|
123
122
|
overflow: hidden;
|
|
124
123
|
text-overflow: ellipsis;
|
|
125
|
-
|
|
124
|
+
-webkit-box-orient: vertical;
|
|
125
|
+
&+.tnt-descriptions-item{
|
|
126
126
|
flex:1;
|
|
127
|
+
padding-right: 8px;
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
package/es/drawer/drawer.js
CHANGED
|
@@ -6,28 +6,133 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
6
6
|
}
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
|
-
import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
10
|
-
import classNames from 'classnames';
|
|
11
|
-
import React from 'react';
|
|
12
9
|
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
13
10
|
import { default as AntdDrawer } from 'antd/es/drawer';
|
|
11
|
+
import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import { doUpperTitle } from '../utils';
|
|
14
|
+
import React, { useCallback, useEffect } from 'react';
|
|
15
|
+
import { Button } from '../button';
|
|
16
|
+
import Icon from '../icon';
|
|
17
|
+
const DefaultFooter = ({
|
|
18
|
+
locale,
|
|
19
|
+
onCancel,
|
|
20
|
+
onOk,
|
|
21
|
+
okText,
|
|
22
|
+
okType,
|
|
23
|
+
cancelText,
|
|
24
|
+
confirmLoading,
|
|
25
|
+
okButtonProps,
|
|
26
|
+
cancelButtonProps,
|
|
27
|
+
cancelType
|
|
28
|
+
}) => {
|
|
29
|
+
return React.createElement(React.Fragment, null, React.createElement(Button, Object.assign({
|
|
30
|
+
onClick: onCancel,
|
|
31
|
+
type: cancelType || 'default'
|
|
32
|
+
}, cancelButtonProps), cancelText || (locale === null || locale === void 0 ? void 0 : locale.cancelText)), React.createElement(Button, Object.assign({
|
|
33
|
+
onClick: onOk,
|
|
34
|
+
type: okType || 'primary',
|
|
35
|
+
loading: confirmLoading
|
|
36
|
+
}, okButtonProps), okText || (locale === null || locale === void 0 ? void 0 : locale.okText)));
|
|
37
|
+
};
|
|
14
38
|
export const Drawer = _a => {
|
|
15
39
|
var {
|
|
16
|
-
closable,
|
|
17
|
-
className
|
|
40
|
+
closable = true,
|
|
41
|
+
className,
|
|
42
|
+
footer,
|
|
43
|
+
showFooter,
|
|
44
|
+
onClose,
|
|
45
|
+
onSubmit,
|
|
46
|
+
onCancel,
|
|
47
|
+
afterClose,
|
|
48
|
+
onOk,
|
|
49
|
+
okText = '',
|
|
50
|
+
cancelText = '',
|
|
51
|
+
locale,
|
|
52
|
+
okType = 'primary',
|
|
53
|
+
cancelType = 'default',
|
|
54
|
+
confirmLoading = false,
|
|
55
|
+
okButtonProps = {},
|
|
56
|
+
cancelButtonProps = {},
|
|
57
|
+
clickOnBlankToClose = false,
|
|
58
|
+
upperCaseIgnore,
|
|
59
|
+
unUpperConverted,
|
|
60
|
+
title
|
|
18
61
|
} = _a,
|
|
19
|
-
rest = __rest(_a, ["closable", "className"]);
|
|
62
|
+
rest = __rest(_a, ["closable", "className", "footer", "showFooter", "onClose", "onSubmit", "onCancel", "afterClose", "onOk", "okText", "cancelText", "locale", "okType", "cancelType", "confirmLoading", "okButtonProps", "cancelButtonProps", "clickOnBlankToClose", "upperCaseIgnore", "unUpperConverted", "title"]);
|
|
63
|
+
const drawerDom = React.useRef(null);
|
|
64
|
+
const _onCancel = useCallback(() => {
|
|
65
|
+
if (onCancel) {
|
|
66
|
+
onCancel();
|
|
67
|
+
} else if (onClose) {
|
|
68
|
+
onClose();
|
|
69
|
+
}
|
|
70
|
+
if (afterClose) {
|
|
71
|
+
afterClose();
|
|
72
|
+
}
|
|
73
|
+
}, [onCancel, onClose, afterClose]);
|
|
74
|
+
const _onOk = onOk || onSubmit;
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (clickOnBlankToClose) {
|
|
77
|
+
const handleOutsideClick = event => {
|
|
78
|
+
const drawer = drawerDom.current;
|
|
79
|
+
const targetElement = event.target;
|
|
80
|
+
let isInDrawer = false;
|
|
81
|
+
if (drawer && targetElement) {
|
|
82
|
+
isInDrawer = drawer.contains(targetElement) || targetElement === drawer;
|
|
83
|
+
}
|
|
84
|
+
drawerDom.current = null;
|
|
85
|
+
if (rest.visible && !isInDrawer && _onCancel) {
|
|
86
|
+
_onCancel();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
document.removeEventListener('click', handleOutsideClick);
|
|
90
|
+
document.addEventListener('click', handleOutsideClick);
|
|
91
|
+
return () => {
|
|
92
|
+
document.removeEventListener('click', handleOutsideClick);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}, [rest.visible, clickOnBlankToClose, _onCancel]);
|
|
20
96
|
return React.createElement(ConfigConsumer, null, ({
|
|
21
97
|
getPrefixCls
|
|
22
98
|
}) => {
|
|
23
99
|
const prefixCls = getPrefixCls('drawer');
|
|
24
100
|
return React.createElement(LocaleReceiver, {
|
|
25
|
-
componentName: "Drawer"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
101
|
+
componentName: "Drawer",
|
|
102
|
+
defaultLocale: locale
|
|
103
|
+
}, locale => {
|
|
104
|
+
return React.createElement("div", {
|
|
105
|
+
onClick: event => {
|
|
106
|
+
drawerDom.current = event.target;
|
|
107
|
+
}
|
|
108
|
+
}, React.createElement(AntdDrawer, Object.assign({
|
|
109
|
+
className: classNames(prefixCls, 'tnt-drawer', 'tntd-drawer', className, {
|
|
110
|
+
[`${prefixCls}-contain-closable`]: closable !== false,
|
|
111
|
+
[`${prefixCls}-footer`]: showFooter || footer
|
|
112
|
+
}),
|
|
113
|
+
closable: false,
|
|
114
|
+
onClose: _onCancel,
|
|
115
|
+
width: 480
|
|
116
|
+
}, rest, {
|
|
117
|
+
title: !unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title
|
|
118
|
+
}), React.createElement(React.Fragment, null, closable !== false && React.createElement(Icon, {
|
|
119
|
+
type: "close",
|
|
120
|
+
className: `${prefixCls}-close`,
|
|
121
|
+
onClick: _onCancel
|
|
122
|
+
}), rest.children, (showFooter || footer) && React.createElement("div", {
|
|
123
|
+
className: `${prefixCls}-footer-style`
|
|
124
|
+
}, footer || React.createElement(DefaultFooter, {
|
|
125
|
+
confirmLoading: confirmLoading,
|
|
126
|
+
okButtonProps: okButtonProps,
|
|
127
|
+
cancelButtonProps: cancelButtonProps,
|
|
128
|
+
okType: okType,
|
|
129
|
+
locale: locale,
|
|
130
|
+
okText: okText,
|
|
131
|
+
cancelType: cancelType,
|
|
132
|
+
cancelText: cancelText,
|
|
133
|
+
onOk: _onOk,
|
|
134
|
+
onCancel: _onCancel
|
|
135
|
+
})))));
|
|
136
|
+
});
|
|
32
137
|
});
|
|
33
138
|
};
|
package/es/drawer/drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/drawer/drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OA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M,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,GACnB,CACH,CACG,CACP,CACA,CACQ,CACT,CACP,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ConfigConsumer } from 'antd/es/config-provider'\nimport type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer'\nimport { default as AntdDrawer } from 'antd/es/drawer'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport type { BaseButtonProps } from 'antd/es/button/button'\nimport type { ButtonType } from '../button/button'\nimport { doUpperTitle } from '../utils'\nimport React, { FC, useCallback, useEffect, useRef } from 'react'\nimport { Button } from '../button'\nimport Icon from '../icon'\nconst DefaultFooter = ({\n locale,\n onCancel,\n onOk,\n okText,\n okType,\n cancelText,\n confirmLoading,\n okButtonProps,\n cancelButtonProps,\n cancelType,\n}: {\n locale?: {\n okText?: string\n cancelText?: string\n }\n onCancel?: () => void\n onOk?: () => void\n okText: string\n cancelText: string\n okType?: ButtonType\n cancelType: ButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n}) => {\n return (\n <>\n <Button onClick={onCancel} type={cancelType || 'default'} {...cancelButtonProps}>\n {cancelText || locale?.cancelText}\n </Button>\n <Button onClick={onOk} type={okType || 'primary'} loading={confirmLoading} {...okButtonProps}>\n {okText || locale?.okText}\n </Button>\n </>\n )\n}\n\ninterface CustomDrawerProps extends AntdDrawerProps {\n footer?: React.ReactNode\n showFooter?: boolean\n onClose?: () => void\n onSubmit?: () => void\n onCancel?: () => void\n afterClose?: () => void\n onOk?: () => void\n okText?: string\n cancelText?: string\n locale?: {\n okText?: string\n cancelText?: string\n }\n okType?: ButtonType\n cancelType?: ButtonType\n confirmLoading?: boolean\n okButtonProps?: BaseButtonProps\n cancelButtonProps?: BaseButtonProps\n clickOnBlankToClose: boolean\n upperCaseIgnore?: []\n unUpperConverted: boolean\n}\n\nexport const Drawer: FC<CustomDrawerProps> = ({\n closable = true,\n className,\n footer,\n showFooter,\n onClose,\n onSubmit,\n onCancel,\n afterClose,\n onOk,\n okText = '',\n cancelText = '',\n locale,\n okType = 'primary',\n cancelType = 'default',\n confirmLoading = false,\n okButtonProps = {},\n cancelButtonProps = {},\n clickOnBlankToClose = false,\n upperCaseIgnore,\n unUpperConverted,\n title,\n ...rest\n}) => {\n const drawerDom = React.useRef<EventTarget | null>(null)\n const _onCancel = useCallback(() => {\n if (onCancel) {\n onCancel()\n } else if (onClose) {\n onClose()\n }\n if (afterClose) {\n afterClose()\n }\n }, [onCancel, onClose, afterClose])\n const _onOk = onOk || onSubmit\n\n useEffect(() => {\n if (clickOnBlankToClose) {\n const handleOutsideClick = (event: Event) => {\n const drawer = drawerDom.current as Node\n const targetElement = event.target as Node\n\n let isInDrawer = false\n if (drawer && targetElement) {\n isInDrawer = drawer.contains(targetElement as Node) || targetElement === drawer\n }\n drawerDom.current = null\n if (rest.visible && !isInDrawer && _onCancel) {\n _onCancel()\n }\n }\n document.removeEventListener('click', handleOutsideClick)\n document.addEventListener('click', handleOutsideClick)\n return () => {\n document.removeEventListener('click', handleOutsideClick)\n }\n }\n }, [rest.visible, clickOnBlankToClose, _onCancel])\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('drawer')\n return (\n <LocaleReceiver componentName=\"Drawer\" defaultLocale={locale}>\n {(locale) => {\n return (\n <div\n onClick={(event: React.MouseEvent<HTMLDivElement>) => {\n drawerDom.current = event.target\n }}\n >\n <AntdDrawer\n className={classNames(prefixCls, 'tnt-drawer', 'tntd-drawer', className, {\n [`${prefixCls}-contain-closable`]: closable !== false,\n [`${prefixCls}-footer`]: showFooter || footer,\n })}\n closable={false}\n onClose={_onCancel}\n width={480}\n {...rest}\n title={!unUpperConverted ? doUpperTitle(title, upperCaseIgnore) : title}\n >\n <>\n {closable !== false && (\n <Icon type=\"close\" className={`${prefixCls}-close`} onClick={_onCancel} />\n )}\n {rest.children}\n {(showFooter || footer) && (\n <div className={`${prefixCls}-footer-style`}>\n {footer || (\n <DefaultFooter\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n cancelButtonProps={cancelButtonProps}\n okType={okType}\n locale={locale}\n okText={okText}\n cancelType={cancelType}\n cancelText={cancelText}\n onOk={_onOk}\n onCancel={_onCancel}\n />\n )}\n </div>\n )}\n </>\n </AntdDrawer>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n"]}
|
package/es/drawer/index.js
CHANGED
package/es/drawer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,cAAc,CAAA;AACrB,cAAc,gBAAgB,CAAA;AAE9B,eAAe,MAAM,CAAA","sourcesContent":["import './style'\nimport { Drawer } from './drawer'\n\nimport './index.less'\nexport * from 'antd/es/drawer'\n\nexport default Drawer\n"]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@drawer-prefix-cls: ~'@{ant-prefix}-drawer';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.tnt-drawer.@{drawer-prefix-cls} {
|
|
5
|
+
&-top {
|
|
6
|
+
.@{drawer-prefix-cls}-wrapper-body {
|
|
7
|
+
margin-top: 48px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
11
|
+
height: 480px !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-bottom {
|
|
16
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
17
|
+
height: 480px !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.@{drawer-prefix-cls}-wrapper-body {
|
|
22
|
+
margin-top: 48px;
|
|
23
|
+
max-height: ~'calc(100vh - 48px)';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-footer {
|
|
27
|
+
.@{drawer-prefix-cls}-header {
|
|
28
|
+
// border-bottom: none;
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 0;
|
|
31
|
+
top: 0;
|
|
32
|
+
background: #fff;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.@{drawer-prefix-cls}-wrapper-body {
|
|
37
|
+
max-height: ~'calc(100vh - 96px)' !important;
|
|
38
|
+
margin-top: 48px !important;
|
|
39
|
+
margin-bottom: 48px !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.@{drawer-prefix-cls}-title {
|
|
45
|
+
font-size: 16px !important;
|
|
46
|
+
font-weight: 500 !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.@{drawer-prefix-cls}-close {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: -2px;
|
|
52
|
+
right: 0;
|
|
53
|
+
z-index: 10;
|
|
54
|
+
display: block;
|
|
55
|
+
width: 48px;
|
|
56
|
+
height: 48px;
|
|
57
|
+
padding: 0;
|
|
58
|
+
color: rgba(23, 35, 61, 0.8);
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
font-size: 20px;
|
|
61
|
+
font-style: normal;
|
|
62
|
+
line-height: 56px;
|
|
63
|
+
text-align: center;
|
|
64
|
+
text-transform: none;
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
background: transparent;
|
|
67
|
+
border: 0;
|
|
68
|
+
outline: 0;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
transition: color 0.3s;
|
|
71
|
+
text-rendering: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
.@{drawer-prefix-cls}-contain-closable {
|
|
76
|
+
.@{drawer-prefix-cls}-header {
|
|
77
|
+
padding: 12px 36px 12px 20px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-right {
|
|
82
|
+
.@{drawer-prefix-cls}-content {
|
|
83
|
+
border-radius: @border-radius-base 0px 0px @border-radius-base;
|
|
84
|
+
background: #F8F9FB;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-left {
|
|
89
|
+
.@{drawer-prefix-cls}-content {
|
|
90
|
+
border-radius: 0px @border-radius-base @border-radius-base 0px;
|
|
91
|
+
background: #F8F9FB;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&-top {
|
|
96
|
+
.@{drawer-prefix-cls}-content {
|
|
97
|
+
border-radius: 0px 0px @border-radius-base @border-radius-base;
|
|
98
|
+
background: #F8F9FB;
|
|
99
|
+
padding-top: 48px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.@{drawer-prefix-cls}-wrapper-body {
|
|
103
|
+
margin-top: 0px !important;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&-bottom {
|
|
108
|
+
.@{drawer-prefix-cls}-content {
|
|
109
|
+
border-radius: @border-radius-base @border-radius-base 0px 0px;
|
|
110
|
+
background: #F8F9FB;
|
|
111
|
+
padding-top: 48px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.@{drawer-prefix-cls}-wrapper-body {
|
|
115
|
+
margin-top: 0px !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
.@{drawer-prefix-cls}-header {
|
|
121
|
+
padding: 13px 24px;
|
|
122
|
+
position: absolute;
|
|
123
|
+
right: 0;
|
|
124
|
+
top: 0;
|
|
125
|
+
width: 100%;
|
|
126
|
+
background: #fff;
|
|
127
|
+
border-bottom: 1px solid #E9EDF3;
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.@{drawer-prefix-cls}-body {
|
|
132
|
+
padding: 24px !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.@{drawer-prefix-cls}-wrapper-body {
|
|
136
|
+
|
|
137
|
+
.@{drawer-prefix-cls}-footer-style {
|
|
138
|
+
position: absolute;
|
|
139
|
+
right: 0;
|
|
140
|
+
bottom: 0;
|
|
141
|
+
width: 100%;
|
|
142
|
+
padding: 8px 24px;
|
|
143
|
+
background: #fff;
|
|
144
|
+
text-align: right;
|
|
145
|
+
border-top: 1px solid #E9EDF3;
|
|
146
|
+
|
|
147
|
+
.@{ant-prefix}-btn {
|
|
148
|
+
margin-left: 15px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
padding: 0;
|
|
158
158
|
color: @text-color-secondary;
|
|
159
159
|
font-weight: 700;
|
|
160
|
-
font-size:
|
|
160
|
+
font-size: @font-size-lg;
|
|
161
161
|
font-style: normal;
|
|
162
162
|
line-height: 56px;
|
|
163
163
|
text-align: center;
|
|
@@ -169,9 +169,7 @@
|
|
|
169
169
|
cursor: pointer;
|
|
170
170
|
transition: color @animation-duration-slow;
|
|
171
171
|
text-rendering: auto;
|
|
172
|
-
|
|
173
|
-
font-size: 20px;
|
|
174
|
-
}
|
|
172
|
+
|
|
175
173
|
&:focus,
|
|
176
174
|
&:hover {
|
|
177
175
|
color: @icon-color-hover;
|
package/es/form/form.js
CHANGED
|
@@ -10,6 +10,8 @@ import React, { forwardRef } from 'react';
|
|
|
10
10
|
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
11
11
|
import { default as AntdForm } from 'antd/es/form';
|
|
12
12
|
import { doUpperTitle } from '../utils';
|
|
13
|
+
import './form.less';
|
|
14
|
+
import classNames from 'classnames';
|
|
13
15
|
export * from 'antd/es/form';
|
|
14
16
|
export const Form = forwardRef((_a, ref) => {
|
|
15
17
|
var rest = __rest(_a, []);
|
|
@@ -17,6 +19,7 @@ export const Form = forwardRef((_a, ref) => {
|
|
|
17
19
|
getPrefixCls
|
|
18
20
|
}) => {
|
|
19
21
|
return React.createElement(AntdForm, Object.assign({}, rest, {
|
|
22
|
+
className: classNames(rest.className, 'tnt-form'),
|
|
20
23
|
ref: ref
|
|
21
24
|
}));
|
|
22
25
|
});
|
|
@@ -37,7 +40,7 @@ Form.Item = forwardRef((_a, ref) => {
|
|
|
37
40
|
});
|
|
38
41
|
const Create = options => WrappedComponent => {
|
|
39
42
|
const validateSubmitMap = {};
|
|
40
|
-
const CustomFormWrapper = props => {
|
|
43
|
+
const CustomFormWrapper = (props, ref) => {
|
|
41
44
|
const getFieldDecorator = props.form.getFieldDecorator;
|
|
42
45
|
props.form.getFieldDecorator = (name, options) => {
|
|
43
46
|
let opt = options || {};
|
|
@@ -49,7 +52,9 @@ const Create = options => WrappedComponent => {
|
|
|
49
52
|
}
|
|
50
53
|
return getFieldDecorator(name, opt);
|
|
51
54
|
};
|
|
52
|
-
return React.createElement(WrappedComponent, Object.assign({}, props
|
|
55
|
+
return React.createElement(WrappedComponent, Object.assign({}, props, {
|
|
56
|
+
ref: ref
|
|
57
|
+
}));
|
|
53
58
|
};
|
|
54
59
|
return AntdForm.create(Object.assign(Object.assign({}, options), {
|
|
55
60
|
onValuesChange: (props, changedValues, allValues) => {
|
|
@@ -69,7 +74,7 @@ const Create = options => WrappedComponent => {
|
|
|
69
74
|
options.onValuesChange(props, changedValues, allValues);
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
|
-
}))(CustomFormWrapper);
|
|
77
|
+
}))(forwardRef(CustomFormWrapper));
|
|
73
78
|
};
|
|
74
79
|
Form.createFormField = AntdForm.createFormField;
|
|
75
80
|
Form.create = Create;
|
package/es/form/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/form/form.tsx"],"names":[],"mappings":";;;;;;;;;;;AAMA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/form/form.tsx"],"names":[],"mappings":";;;;;;;;;;;AAMA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,aAAa,CAAA;AACpB,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,cAAc,cAAc,CAAA;AAW5B,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAA0B,CAAC,EAAW,EAAE,GAAG,EAAE,EAAE;QAAf,IAAI,cAAT,EAAW,CAAF;IAChE,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,oBAAC,QAAQ,oBAAK,IAAI,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAC5F,CAAC,CACc,CAClB,CAAA;AAC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,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YACvC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;gBACrB,IAAI,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE;oBACzB,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE;wBAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;4BACnB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;yBAC9B,CAAC,CAAA;qBACH;gBACH,CAAC,CAAC,CAAA;aACH;YACD,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,EAAE;gBACrC,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,CAAA;aACxD;QACH,CAAC,IACD,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAA;AAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA","sourcesContent":["import type {\n FormItemProps as AntdFormItemProps,\n FormProps as AntdFormProps,\n FormComponentProps,\n FormCreateOption,\n} from 'antd/es/form'\nimport React, { forwardRef } from 'react'\n\nimport { ConfigConsumer } from 'antd/es/config-provider'\n\nimport { default as AntdForm } from 'antd/es/form'\nimport type AntdFormItem from 'antd/es/form/FormItem'\n\nimport { doUpperTitle } from '../utils'\nimport './form.less'\nimport classNames from 'classnames'\nexport * from 'antd/es/form'\n\ninterface FormItemComponent\n extends React.ForwardRefExoticComponent<AntdFormItemProps & React.RefAttributes<AntdFormItem>> {}\ninterface FormComponent\n extends React.ForwardRefExoticComponent<AntdFormProps & React.RefAttributes<AntdForm>> {\n Item: FormItemComponent\n create: typeof AntdForm.create\n createFormField: typeof AntdForm.createFormField\n}\n\nexport const Form = forwardRef<AntdForm, AntdFormProps>(({ ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return <AntdForm {...rest} className={classNames(rest.className, 'tnt-form')} ref={ref} />\n }}\n </ConfigConsumer>\n )\n}) as FormComponent\n\nForm.Item = forwardRef<AntdFormItem, AntdFormItemProps>(({ label, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return <AntdForm.Item {...rest} label={doUpperTitle(label)} ref={ref} />\n }}\n </ConfigConsumer>\n )\n})\n\n// 定义 create 函数的类型\ntype CreateFunction = <TOwnProps extends FormComponentProps<any>>(\n options?: FormCreateOption<TOwnProps>\n) => any\n\nconst Create: CreateFunction = (options: any) => (WrappedComponent: any) => {\n const validateSubmitMap: any = {}\n const CustomFormWrapper = (props: any, ref: any) => {\n const getFieldDecorator = props.form.getFieldDecorator\n props.form.getFieldDecorator = (name: any, options: any) => {\n let opt = options || {}\n if (opt.validateSubmit) {\n opt = {\n ...options,\n validateTrigger: 'noEvent',\n }\n validateSubmitMap[name] = true\n }\n return getFieldDecorator(name, opt)\n }\n return <WrappedComponent {...props} ref={ref} />\n }\n\n return AntdForm.create({\n ...options,\n onValuesChange: (props: any, changedValues: any, allValues: any) => {\n const keys = Object.keys(changedValues)\n if (keys.length === 1) {\n keys.forEach((name: any) => {\n if (validateSubmitMap[name]) {\n props.form.setFields({\n [name]: { errors: undefined },\n })\n }\n })\n }\n if (options && options.onValuesChange) {\n options.onValuesChange(props, changedValues, allValues)\n }\n },\n })(forwardRef(CustomFormWrapper))\n}\n\nForm.createFormField = AntdForm.createFormField\nForm.create = Create\n"]}
|