tntd 3.1.8 → 3.1.9
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/button/button.js +2 -2
- package/es/button/button.js.map +1 -1
- package/es/button/button.less +147 -54
- package/es/segmented/index.less +2 -1
- package/es/select/select.js.map +1 -1
- package/es/tntd-checkbox-select/index.less +6 -5
- package/lib/button/button.d.ts +2 -2
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +2 -2
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +147 -54
- package/lib/segmented/index.less +2 -1
- package/lib/select/select.js.map +1 -1
- package/lib/tntd-checkbox-select/index.less +6 -5
- package/package.json +1 -1
- package/themes/default/variables.less +5 -8
- package/themes/default/variablesVar.less +5 -8
- package/dist/930.tntd.min.js +0 -1
- package/dist/tntd.min.css +0 -37372
- package/dist/tntd.min.js +0 -1830
- package/dist/tntd.min.js.LICENSE.txt +0 -73
package/es/button/button.js
CHANGED
|
@@ -70,9 +70,9 @@ var Button = exports.Button = (0, _react.forwardRef)(function (_a, ref) {
|
|
|
70
70
|
componentName: "Button"
|
|
71
71
|
}, function (locale, localeCode) {
|
|
72
72
|
return _react["default"].createElement(_button["default"], Object.assign({}, rest, {
|
|
73
|
-
type: type === 'tertiary' || type === 'ai' ? undefined : type,
|
|
73
|
+
type: type === 'tertiary' || type === 'ai' || type === 'ai-default' ? undefined : type,
|
|
74
74
|
size: size === 'mini' ? undefined : size,
|
|
75
|
-
className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary'), "".concat(tntPrefixCls, "-ai"), type === 'ai')),
|
|
75
|
+
className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary'), "".concat(tntPrefixCls, "-ai"), type === 'ai'), "".concat(tntPrefixCls, "-ai-default"), type === 'ai-default')),
|
|
76
76
|
children: getNewChildren(children, unUpperConverted, upperCaseIgnore, localeCode),
|
|
77
77
|
ref: ref
|
|
78
78
|
}));
|
package/es/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAMzC,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,cAAc,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAMzC,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,cAAc,gBAAgB,CAAA;AA2B9B,MAAM,YAAY,GAAG,SAAS,CAAA;AAE9B,MAAM,cAAc,GAAG,CACrB,QAAa,EACb,gBAAqC,EACrC,eAA+B,EAC/B,UAA8B,EAC9B,EAAE;IACF,IAAI,WAAW,GAAG,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A;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACiB,CAAA;AAEpB,MAAM,WAAW,GAA+B,CAAC,EAA4B,EAAE,EAAE;QAAhC,EAAE,SAAS,EAAE,IAAI,OAAW,EAAN,IAAI,cAA1B,qBAA4B,CAAF;IACzE,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,oBAAC,UAAU,CAAC,KAAK,oBACX,IAAI,IACR,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE;gBAC/B,CAAC,GAAG,YAAY,aAAa,CAAC,EAAE,IAAI,KAAK,MAAM;aAChD,CAAC,IACF,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,KAAK,GAAG,WAAW,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-10-26 09:46:28\n * @LastEditors: 郑泳健\n * @LastEditTime: 2026-01-14 14:51:59\n * @FilePath: /tntd/packages/tntd/src/button/button.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type {\n ButtonProps as AntdButtonProps,\n ButtonGroupProps as AntdButtonGroupProps,\n ButtonType,\n} from 'antd/es/button'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport { ConfigConsumer } from '../config-provider'\nimport { default as AntdButton } from 'antd/es/button'\nimport { doUpperTitle } from '../utils/lang'\nimport classNames from 'classnames'\n\nexport * from 'antd/es/button'\n\nexport type TntButtonType = ButtonType | 'tertiary' | 'ai' | 'ai-default'\nexport interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {\n upperCaseIgnore?: []\n unUpperConverted?: boolean\n size?: 'large' | 'default' | 'small' | 'mini'\n type?:\n | 'default'\n | 'primary'\n | 'tertiary'\n | 'ai'\n | 'ai-default'\n | 'ghost'\n | 'dashed'\n | 'danger'\n | 'link'\n}\nexport interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {\n size?: 'large' | 'default' | 'small' | 'mini'\n}\n\ninterface ButtonComponent\n extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<AntdButton>> {\n Group: React.FC<ButtonGroupProps>\n}\n\nconst tntPrefixCls = 'tnt-btn'\n\nconst getNewChildren = (\n children: any,\n unUpperConverted: boolean | undefined,\n upperCaseIgnore: [] | undefined,\n localeCode: string | undefined\n) => {\n let newChildren = children\n if (!unUpperConverted) {\n newChildren = doUpperTitle(newChildren, upperCaseIgnore, localeCode)\n }\n return newChildren\n}\n\nexport const Button = forwardRef<AntdButton, ButtonProps>(\n ({ className, size, type, children, unUpperConverted, upperCaseIgnore, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <LocaleReceiver componentName=\"Button\">\n {(locale, localeCode) => {\n return (\n <AntdButton\n {...rest}\n type={\n type === 'tertiary' || type === 'ai' || type === 'ai-default'\n ? undefined\n : type\n }\n size={size === 'mini' ? undefined : size}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-mini`]: size === 'mini',\n [`${tntPrefixCls}-tertiary`]: type === 'tertiary',\n [`${tntPrefixCls}-ai`]: type === 'ai',\n [`${tntPrefixCls}-ai-default`]: type === 'ai-default',\n })}\n children={getNewChildren(\n children,\n unUpperConverted,\n upperCaseIgnore,\n localeCode\n )}\n ref={ref}\n />\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as ButtonComponent\n\nconst ButtonGroup: React.FC<ButtonGroupProps> = ({ className, size, ...rest }) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdButton.Group\n {...rest}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, {\n [`${tntPrefixCls}-group-mini`]: size === 'mini',\n })}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nButton.Group = ButtonGroup\n"]}
|
package/es/button/button.less
CHANGED
|
@@ -3,55 +3,122 @@
|
|
|
3
3
|
|
|
4
4
|
@btn-prefix-cls: ~'@{ant-prefix}-btn';
|
|
5
5
|
|
|
6
|
+
@btn-ai-hover-bg: linear-gradient(128deg, #2e69ff 6.08%, #bf5fff 96.35%);
|
|
7
|
+
@btn-ai-center-bg: linear-gradient(128deg, #2e69ff 6.08%, #bf5fff 96.35%);
|
|
8
|
+
@btn-ai-step-bg1: linear-gradient(128deg, #bf5fff 15.08%, #2e69ff 105.35%);
|
|
9
|
+
@btn-ai-step-bg2: linear-gradient(128deg, #bf5fff 24.08%, #2e69ff 114.35%);
|
|
10
|
+
@btn-ai-step-bg3: linear-gradient(128deg, #bf5fff 33.08%, #2e69ff 123.35%);
|
|
11
|
+
@btn-ai-step-bg4: linear-gradient(128deg, #bf5fff 42.08%, #2e69ff 132.35%);
|
|
12
|
+
@btn-ai-step-bg5: linear-gradient(128deg, #2e69ff -39.19%, #bf5fff 51.08%, #2e69ff 141.35%);
|
|
13
|
+
@btn-ai-step-bg6: linear-gradient(128deg, #2e69ff -30.19%, #bf5fff 60.08%, #2e69ff 150.35%);
|
|
14
|
+
@btn-ai-step-bg7: linear-gradient(128deg, #2e69ff -21.19%, #bf5fff 69.08%, #2e69ff 159.35%);
|
|
15
|
+
@btn-ai-step-bg8: linear-gradient(128deg, #2e69ff -12.19%, #bf5fff 78.08%, #2e69ff 168.35%);
|
|
16
|
+
@btn-ai-step-bg9: linear-gradient(128deg, #2e69ff -3.19%, #bf5fff 87.08%, #2e69ff 177.35%);
|
|
17
|
+
|
|
6
18
|
.tnt-btn {
|
|
7
19
|
&.tnt-btn-mini {
|
|
8
20
|
.button-size(@btn-height-mini; @btn-padding-mini; @btn-font-size-mini; @btn-border-radius-sm);
|
|
21
|
+
|
|
9
22
|
&.@{btn-prefix-cls}-icon-only {
|
|
10
23
|
.square(@btn-height-mini);
|
|
11
24
|
padding-right: 0;
|
|
12
25
|
padding-left: 0;
|
|
13
26
|
}
|
|
27
|
+
|
|
14
28
|
&.@{btn-prefix-cls}-circle {
|
|
15
29
|
min-width: @btn-height-mini;
|
|
16
30
|
border-radius: 50%;
|
|
17
31
|
}
|
|
32
|
+
|
|
18
33
|
&.@{btn-prefix-cls}-round {
|
|
19
34
|
.button-size(@btn-circle-size-mini; 0 @btn-circle-size-mini / 2; @btn-font-size-mini; @btn-circle-size-mini);
|
|
35
|
+
|
|
20
36
|
&.@{btn-prefix-cls}-icon-only {
|
|
21
37
|
width: auto;
|
|
22
38
|
}
|
|
23
39
|
}
|
|
24
40
|
}
|
|
41
|
+
|
|
25
42
|
&-group-mini {
|
|
26
|
-
|
|
27
|
-
|
|
43
|
+
|
|
44
|
+
&>.@{btn-prefix-cls},
|
|
45
|
+
&>span>.@{btn-prefix-cls} {
|
|
28
46
|
.button-size(@btn-height-mini; @btn-padding-mini; @btn-font-size-mini; 0);
|
|
29
47
|
line-height: calc(@btn-height-mini - 2px);
|
|
30
48
|
}
|
|
31
|
-
|
|
49
|
+
|
|
50
|
+
&>.@{btn-prefix-cls}.@{btn-prefix-cls}-icon-only {
|
|
32
51
|
.square(@btn-height-mini);
|
|
33
52
|
padding-right: 0;
|
|
34
53
|
padding-left: 0;
|
|
35
54
|
}
|
|
36
55
|
}
|
|
56
|
+
|
|
37
57
|
&-tertiary {
|
|
38
58
|
.button-variant-tertiary(@btn-default-color, @primary-color, @btn-tertiary-bg);
|
|
39
59
|
}
|
|
60
|
+
|
|
40
61
|
&-ai {
|
|
41
|
-
.button-variant-ai(@btn-primary-color, @primary-color, @btn-ai-bg);
|
|
62
|
+
.button-variant-ai(@btn-primary-color, @primary-color, @btn-ai-bg, @btn-ai-hover-bg);
|
|
42
63
|
}
|
|
64
|
+
|
|
65
|
+
&-ai-default {
|
|
66
|
+
>span {
|
|
67
|
+
background: linear-gradient(128deg, #BF5FFF 6.08%, #2E69FF 96.35%);
|
|
68
|
+
background-clip: text;
|
|
69
|
+
-webkit-background-clip: text;
|
|
70
|
+
-webkit-text-fill-color: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:hover,
|
|
74
|
+
&:focus {
|
|
75
|
+
border-color: @btn-default-border;
|
|
76
|
+
background: linear-gradient(142deg, #F8EEFF 6.08%, #E0E9FE 96.35%);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:active,
|
|
80
|
+
&.active {
|
|
81
|
+
border-color: transparent;
|
|
82
|
+
background: linear-gradient(142deg, #F8EEFF 6.08%, #E0E9FE 96.35%) padding-box,
|
|
83
|
+
linear-gradient(142deg, #BF5FFF 6.08%, #2E69FF 96.35%) border-box;
|
|
84
|
+
background-origin: border-box;
|
|
85
|
+
background-clip: padding-box, border-box;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.button-disabled();
|
|
89
|
+
|
|
90
|
+
// AI 按钮禁用状态的额外样式
|
|
91
|
+
&[disabled],
|
|
92
|
+
&.@{btn-prefix-cls}-disabled {
|
|
93
|
+
span {
|
|
94
|
+
color: @disabled-color;
|
|
95
|
+
background: transparent;
|
|
96
|
+
-webkit-text-fill-color: unset;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:hover,
|
|
100
|
+
&:focus,
|
|
101
|
+
&:active {
|
|
102
|
+
background: @btn-disable-bg !important;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
43
107
|
&.@{btn-prefix-cls}-primary {
|
|
44
108
|
.button-disabled(@btn-primary-color, @blue-3, @blue-3);
|
|
45
109
|
}
|
|
110
|
+
|
|
46
111
|
&.@{btn-prefix-cls}-danger {
|
|
47
112
|
.button-disabled(@btn-primary-color, @red-3, @red-3);
|
|
48
113
|
}
|
|
114
|
+
|
|
49
115
|
&.@{btn-prefix-cls}-link {
|
|
50
116
|
.button-disabled(@blue-3, transparent, transparent);
|
|
51
117
|
padding: 0;
|
|
52
118
|
}
|
|
53
|
-
|
|
54
|
-
|
|
119
|
+
|
|
120
|
+
>.@{iconfont-css-prefix}+span,
|
|
121
|
+
>span+.@{iconfont-css-prefix} {
|
|
55
122
|
margin-left: 4px;
|
|
56
123
|
}
|
|
57
124
|
}
|
|
@@ -64,16 +131,12 @@
|
|
|
64
131
|
|
|
65
132
|
&:hover,
|
|
66
133
|
&:focus {
|
|
67
|
-
.button-color(
|
|
68
|
-
@hover-color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
|
|
69
|
-
);
|
|
134
|
+
.button-color(@hover-color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `);
|
|
70
135
|
}
|
|
71
136
|
|
|
72
137
|
&:active,
|
|
73
138
|
&.active {
|
|
74
|
-
.button-color(
|
|
75
|
-
@hover-color; ~`colorPalette('@{background}', 6) `; ~`colorPalette('@{background}', 6) `
|
|
76
|
-
);
|
|
139
|
+
.button-color(@hover-color; ~`colorPalette('@{background}', 6) `; ~`colorPalette('@{background}', 6) `);
|
|
77
140
|
}
|
|
78
141
|
|
|
79
142
|
.button-disabled(@btn-disable-color; @btn-disable-bg; transparent);
|
|
@@ -88,134 +151,164 @@
|
|
|
88
151
|
background: linear-gradient(0deg, @overlay-color 0%, @overlay-color 100%), @base-gradient;
|
|
89
152
|
}
|
|
90
153
|
|
|
91
|
-
.generate-hover-in-animation(@name; @background) {
|
|
154
|
+
.generate-hover-in-animation(@name; @background; @background-hover) {
|
|
92
155
|
@keyframes @name {
|
|
93
156
|
0% {
|
|
94
157
|
background: @background;
|
|
95
158
|
}
|
|
159
|
+
|
|
96
160
|
10% {
|
|
97
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.02), @
|
|
161
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.02), @btn-ai-step-bg1);
|
|
98
162
|
}
|
|
163
|
+
|
|
99
164
|
20% {
|
|
100
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.04), @
|
|
165
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.04), @btn-ai-step-bg2);
|
|
101
166
|
}
|
|
167
|
+
|
|
102
168
|
30% {
|
|
103
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.06), @
|
|
169
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.06), @btn-ai-step-bg3);
|
|
104
170
|
}
|
|
171
|
+
|
|
105
172
|
40% {
|
|
106
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.08), @
|
|
173
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.08), @btn-ai-step-bg4);
|
|
107
174
|
}
|
|
175
|
+
|
|
108
176
|
50% {
|
|
109
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.1), @
|
|
177
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.1), @btn-ai-step-bg5);
|
|
110
178
|
}
|
|
179
|
+
|
|
111
180
|
60% {
|
|
112
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.12), @
|
|
181
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.12), @btn-ai-step-bg6);
|
|
113
182
|
}
|
|
183
|
+
|
|
114
184
|
70% {
|
|
115
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.14), @
|
|
185
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.14), @btn-ai-step-bg7);
|
|
116
186
|
}
|
|
187
|
+
|
|
117
188
|
80% {
|
|
118
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.16), @
|
|
189
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.16), @btn-ai-step-bg8);
|
|
119
190
|
}
|
|
191
|
+
|
|
120
192
|
90% {
|
|
121
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.18), @
|
|
193
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.18), @btn-ai-step-bg9);
|
|
122
194
|
}
|
|
195
|
+
|
|
123
196
|
100% {
|
|
124
|
-
.ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background);
|
|
197
|
+
.ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background-hover);
|
|
125
198
|
}
|
|
126
199
|
}
|
|
127
200
|
}
|
|
128
201
|
|
|
129
|
-
.generate-hover-out-animation(@name; @background) {
|
|
202
|
+
.generate-hover-out-animation(@name; @background; @background-hover) {
|
|
130
203
|
@keyframes @name {
|
|
131
204
|
0% {
|
|
132
205
|
.ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background);
|
|
133
206
|
}
|
|
207
|
+
|
|
134
208
|
10% {
|
|
135
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.18), @
|
|
209
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.18), @btn-ai-step-bg9);
|
|
136
210
|
}
|
|
211
|
+
|
|
137
212
|
20% {
|
|
138
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.16), @
|
|
213
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.16), @btn-ai-step-bg8);
|
|
139
214
|
}
|
|
215
|
+
|
|
140
216
|
30% {
|
|
141
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.14), @
|
|
217
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.14), @btn-ai-step-bg7);
|
|
142
218
|
}
|
|
219
|
+
|
|
143
220
|
40% {
|
|
144
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.12), @
|
|
221
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.12), @btn-ai-step-bg6);
|
|
145
222
|
}
|
|
223
|
+
|
|
146
224
|
50% {
|
|
147
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.1), @
|
|
225
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.1), @btn-ai-step-bg5);
|
|
148
226
|
}
|
|
227
|
+
|
|
149
228
|
60% {
|
|
150
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.08), @
|
|
229
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.08), @btn-ai-step-bg4);
|
|
151
230
|
}
|
|
231
|
+
|
|
152
232
|
70% {
|
|
153
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.06), @
|
|
233
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.06), @btn-ai-step-bg3);
|
|
154
234
|
}
|
|
235
|
+
|
|
155
236
|
80% {
|
|
156
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.04), @
|
|
237
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.04), @btn-ai-step-bg2);
|
|
157
238
|
}
|
|
239
|
+
|
|
158
240
|
90% {
|
|
159
|
-
.ai-gradient-overlay(rgba(255, 255, 255, 0.02), @
|
|
241
|
+
.ai-gradient-overlay(rgba(255, 255, 255, 0.02), @btn-ai-step-bg1);
|
|
160
242
|
}
|
|
243
|
+
|
|
161
244
|
100% {
|
|
162
|
-
background: @background;
|
|
245
|
+
background: @background-hover;
|
|
163
246
|
}
|
|
164
247
|
}
|
|
165
248
|
}
|
|
166
249
|
|
|
167
|
-
.generate-active-animation(@name; @background) {
|
|
250
|
+
.generate-active-animation(@name; @background; @background-hover) {
|
|
168
251
|
@keyframes @name {
|
|
169
252
|
0% {
|
|
170
253
|
background: @background;
|
|
171
254
|
}
|
|
255
|
+
|
|
172
256
|
10% {
|
|
173
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.02), @
|
|
257
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.02), @btn-ai-step-bg1);
|
|
174
258
|
}
|
|
259
|
+
|
|
175
260
|
20% {
|
|
176
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.04), @
|
|
261
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.04), @btn-ai-step-bg2);
|
|
177
262
|
}
|
|
263
|
+
|
|
178
264
|
30% {
|
|
179
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.06), @
|
|
265
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.06), @btn-ai-step-bg3);
|
|
180
266
|
}
|
|
267
|
+
|
|
181
268
|
40% {
|
|
182
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.08), @
|
|
269
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.08), @btn-ai-step-bg4);
|
|
183
270
|
}
|
|
271
|
+
|
|
184
272
|
50% {
|
|
185
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.1), @
|
|
273
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.1), @btn-ai-step-bg5);
|
|
186
274
|
}
|
|
275
|
+
|
|
187
276
|
60% {
|
|
188
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.12), @
|
|
277
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.12), @btn-ai-step-bg6);
|
|
189
278
|
}
|
|
279
|
+
|
|
190
280
|
70% {
|
|
191
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.14), @
|
|
281
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.14), @btn-ai-step-bg7);
|
|
192
282
|
}
|
|
283
|
+
|
|
193
284
|
80% {
|
|
194
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.16), @
|
|
285
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.16), @btn-ai-step-bg8);
|
|
195
286
|
}
|
|
287
|
+
|
|
196
288
|
90% {
|
|
197
|
-
.ai-gradient-overlay(rgba(0, 0, 0, 0.18), @
|
|
289
|
+
.ai-gradient-overlay(rgba(0, 0, 0, 0.18), @btn-ai-step-bg9);
|
|
198
290
|
}
|
|
291
|
+
|
|
199
292
|
100% {
|
|
200
|
-
.ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background);
|
|
293
|
+
.ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background-hover);
|
|
201
294
|
}
|
|
202
295
|
}
|
|
203
296
|
}
|
|
204
297
|
|
|
205
|
-
.button-variant-ai(@color; @hover-color; @background) {
|
|
298
|
+
.button-variant-ai(@color; @hover-color; @background; @background-hover) {
|
|
206
299
|
color: @color;
|
|
207
300
|
background: @background;
|
|
208
301
|
border: none;
|
|
209
302
|
text-shadow: @btn-text-shadow;
|
|
210
303
|
box-shadow: @btn-primary-shadow;
|
|
211
304
|
|
|
212
|
-
animation: ai-hover-out @ai-animation-duration @ai-animation-easing;
|
|
213
|
-
animation-fill-mode: both;
|
|
305
|
+
// animation: ai-hover-out @ai-animation-duration @ai-animation-easing;
|
|
306
|
+
// animation-fill-mode: both;
|
|
214
307
|
|
|
215
308
|
&:hover,
|
|
216
309
|
&:focus {
|
|
217
310
|
color: @color;
|
|
218
|
-
.ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background);
|
|
311
|
+
.ai-gradient-overlay(rgba(255, 255, 255, @ai-overlay-opacity), @background-hover);
|
|
219
312
|
animation: ai-hover-in @ai-animation-duration @ai-animation-easing;
|
|
220
313
|
animation-fill-mode: both;
|
|
221
314
|
}
|
|
@@ -223,7 +316,7 @@
|
|
|
223
316
|
&:active,
|
|
224
317
|
&.active {
|
|
225
318
|
color: @color;
|
|
226
|
-
.ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background);
|
|
319
|
+
.ai-gradient-overlay(rgba(0, 0, 0, @ai-overlay-opacity), @background-hover);
|
|
227
320
|
animation: ai-active-in @ai-animation-duration @ai-animation-easing;
|
|
228
321
|
animation-fill-mode: both;
|
|
229
322
|
}
|
|
@@ -246,7 +339,7 @@
|
|
|
246
339
|
}
|
|
247
340
|
|
|
248
341
|
// linear-gradient不支持 transition 动画,使用 animation模拟 transition 动画,目前10帧差不多可以很丝滑
|
|
249
|
-
.generate-hover-in-animation(ai-hover-in; @background);
|
|
250
|
-
.generate-hover-out-animation(ai-hover-out; @background);
|
|
251
|
-
.generate-active-animation(ai-active-in; @background);
|
|
252
|
-
}
|
|
342
|
+
.generate-hover-in-animation(ai-hover-in; @background; @background-hover);
|
|
343
|
+
.generate-hover-out-animation(ai-hover-out; @background-hover; @background);
|
|
344
|
+
.generate-active-animation(ai-active-in; @background-hover; @background; );
|
|
345
|
+
}
|
package/es/segmented/index.less
CHANGED
package/es/select/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,WAAW,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAA;AA4BnC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;AAE7B,MAAM,YAAY,GAAG,YAAY,CAAA;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CACtC,CACE,EAA4F,EAC5F,GAAG,EACH,EAAE;QAFF,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,OAAY,EAAP,KAAK,cAA1F,8FAA4F,CAAF;IAEvF,OAAA,CACH,oBAAC,cAAc,QACZ,GAAG,EAAE;QACJ,OAAO,CACL,oBAAC,cAAc,IAAC,aAAa,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"select.js","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AY,UAAU,CAAC,EAAE,WAAW,KAAK,SAAS;oBACtD,CAAC,GAAG,YAAY,OAAO,CAAC,EAAE,WAAW,KAAK,MAAM;iBACjD,CAAC,EACF,GAAG,EAAE,GAAG,KAEP,QAAQ;gBACP,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;oBACtB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;wBAC9B,OAAO,CACL,oBAAC,MAAM,IACL,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAC,EAC9C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAC,EAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,IAE1B,GAAG,CAAC,MAAM,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAC,CACnC,CACV,CAAA;qBACF;oBAED,OAAO,CACL,oBAAC,MAAM,IAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAC/B,MAAM,CACA,CACV,CAAA;gBACH,CAAC,CAAC,CACK,CACd,CAAA;QACH,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;CAAA,CACiB,CAAA;AAEpB,MAAM,CAAC,MAAM,MAAM,GAAG,wBAAwB,CAC5C,cAAc,EACd,WAAW,CAAC,MAAM,CACA,CAAA;AAEpB,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAA;AACrC,MAAM,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA","sourcesContent":["import React, { ReactNode, forwardRef } from 'react'\nimport { default as AntdSelect } from 'antd/es/select'\nimport { ConfigConsumer } from '../config-provider'\nimport type { SelectProps as AntdSelectProps } from 'antd/es/select'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport { get } from 'lodash'\nimport { connectReadonlyComponent } from '../connect'\nimport PreviewText from '../preview-text'\nimport { capitalizeFirstLetter } from '../utils'\nimport en_US from '../locale/en_US'\nexport interface SelectProps extends AntdSelectProps {\n // 线框风格\n borderStyle?: 'outline' | 'fill'\n children?: ReactNode\n options?: Array<\n | string\n | number\n | {\n label: string\n value: string | number\n disabled?: boolean\n }\n >\n fieldNames?: {\n label?: string\n value?: string\n options?: string\n }\n readonly?: boolean\n}\n\ninterface SelectComponent\n extends React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<AntdSelect>> {\n OptGroup: typeof AntdSelect.OptGroup\n Option: typeof AntdSelect.Option\n}\n\nconst { Option } = AntdSelect\n\nconst tntPrefixCls = 'tnt-select'\n\nexport const InternalSelect = forwardRef<AntdSelect, SelectProps & { capitalize?: boolean }>(\n (\n { className, borderStyle, options, fieldNames, children, placeholder, capitalize, ...props },\n ref\n ) => (\n <ConfigConsumer>\n {() => {\n return (\n <LocaleReceiver componentName=\"Select\" defaultLocale={en_US.Select}>\n {(locale: any, localeCode) => {\n return (\n <AntdSelect\n {...props}\n placeholder={capitalizeFirstLetter(\n placeholder || locale.select,\n capitalize,\n localeCode\n )}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-outline`]: borderStyle === 'outline',\n [`${tntPrefixCls}-fill`]: borderStyle === 'fill',\n })}\n ref={ref}\n >\n {children\n ? children\n : options?.map((option) => {\n if (typeof option === 'object') {\n return (\n <Option\n key={get(option, fieldNames?.value || 'value')}\n value={get(option, fieldNames?.value || 'value')}\n disabled={!!option.disabled}\n >\n {get(option, fieldNames?.label || 'label')}\n </Option>\n )\n }\n\n return (\n <Option key={option} value={option}>\n {option}\n </Option>\n )\n })}\n </AntdSelect>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n) as SelectComponent\n\nexport const Select = connectReadonlyComponent(\n InternalSelect,\n PreviewText.Select\n) as SelectComponent\n\nSelect.OptGroup = AntdSelect.OptGroup\nSelect.Option = AntdSelect.Option\n"]}
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.tntd-checkbox-select-dropdown-wrap{
|
|
44
|
+
.tntd-checkbox-select-dropdown-wrap {
|
|
45
45
|
border-radius: 8px;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.tntd-checkbox-select-item-tag {
|
|
48
|
+
.tnt-tag.tntd-checkbox-select-item-tag {
|
|
49
49
|
margin-right: 4px;
|
|
50
50
|
font-size: 14px;
|
|
51
51
|
margin-top: 2px;
|
|
@@ -54,15 +54,16 @@
|
|
|
54
54
|
display: flex;
|
|
55
55
|
align-items: center;
|
|
56
56
|
border: none;
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
.tntd-checkbox-select-item-tag-label {
|
|
58
59
|
flex: 1;
|
|
59
60
|
overflow: hidden;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
.anticon-close{
|
|
63
|
+
.anticon-close {
|
|
63
64
|
color: rgba(23, 35, 61, 0.8);
|
|
64
65
|
font-size: 12px !important;
|
|
65
66
|
font-weight: bold;
|
|
66
67
|
margin-top: 2px;
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
}
|
package/lib/button/button.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import type { ButtonProps as AntdButtonProps, ButtonGroupProps as AntdButtonGroupProps, ButtonType } from 'antd/lib/button';
|
|
3
3
|
import { default as AntdButton } from 'antd/lib/button';
|
|
4
4
|
export * from 'antd/lib/button';
|
|
5
|
-
export declare type TntButtonType = ButtonType | 'tertiary' | 'ai';
|
|
5
|
+
export declare type TntButtonType = ButtonType | 'tertiary' | 'ai' | 'ai-default';
|
|
6
6
|
export interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {
|
|
7
7
|
upperCaseIgnore?: [];
|
|
8
8
|
unUpperConverted?: boolean;
|
|
9
9
|
size?: 'large' | 'default' | 'small' | 'mini';
|
|
10
|
-
type?: 'default' | 'primary' | 'tertiary' | 'ai' | 'ghost' | 'dashed' | 'danger' | 'link';
|
|
10
|
+
type?: 'default' | 'primary' | 'tertiary' | 'ai' | 'ai-default' | 'ghost' | 'dashed' | 'danger' | 'link';
|
|
11
11
|
}
|
|
12
12
|
export interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {
|
|
13
13
|
size?: 'large' | 'default' | 'small' | 'mini';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,gBAAgB,IAAI,oBAAoB,EACxC,UAAU,EACX,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAItD,cAAc,gBAAgB,CAAA;AAE9B,oBAAY,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,gBAAgB,IAAI,oBAAoB,EACxC,UAAU,EACX,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAItD,cAAc,gBAAgB,CAAA;AAE9B,oBAAY,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,YAAY,CAAA;AACzE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACzE,eAAe,CAAC,EAAE,EAAE,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC7C,IAAI,CAAC,EACD,SAAS,GACT,SAAS,GACT,UAAU,GACV,IAAI,GACJ,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,CAAA;CACX;AACD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC1E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;CAC9C;AAED,UAAU,eACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACtF,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAA;CAClC;AAiBD,eAAO,MAAM,MAAM,iBAuCC,CAAA"}
|
package/lib/button/button.js
CHANGED
|
@@ -124,9 +124,9 @@ var Button = exports.Button = (0, _react.forwardRef)(function (_a, ref) {
|
|
|
124
124
|
componentName: "Button"
|
|
125
125
|
}, function (locale, localeCode) {
|
|
126
126
|
return _react["default"].createElement(_button["default"], Object.assign({}, rest, {
|
|
127
|
-
type: type === 'tertiary' || type === 'ai' ? undefined : type,
|
|
127
|
+
type: type === 'tertiary' || type === 'ai' || type === 'ai-default' ? undefined : type,
|
|
128
128
|
size: size === 'mini' ? undefined : size,
|
|
129
|
-
className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary'), "".concat(tntPrefixCls, "-ai"), type === 'ai')),
|
|
129
|
+
className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary'), "".concat(tntPrefixCls, "-ai"), type === 'ai'), "".concat(tntPrefixCls, "-ai-default"), type === 'ai-default')),
|
|
130
130
|
children: getNewChildren(children, unUpperConverted, upperCaseIgnore, localeCode),
|
|
131
131
|
ref: ref
|
|
132
132
|
}));
|
package/lib/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAyC;AAMzC,4FAAmE;AACnE,wDAAmD;AACnD,4DAAsD;AACtD,wCAA4C;AAC5C,4DAAmC;AAEnC,iDAA8B;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAyC;AAMzC,4FAAmE;AACnE,wDAAmD;AACnD,4DAAsD;AACtD,wCAA4C;AAC5C,4DAAmC;AAEnC,iDAA8B;AA2B9B,MAAM,YAAY,GAAG,SAAS,CAAA;AAE9B,MAAM,cAAc,GAAG,CACrB,QAAa,EACb,gBAAqC,EACrC,eAA+B,EAC/B,UAA8B,EAC9B,EAAE;IACF,IAAI,WAAW,GAAG,QAAQ,CAAA;IAC1B,IAAI,CAAC,gBAAgB,EAAE;QACrB,WAAW,GAAG,IAAA,mBAAY,EAAC,WAAW,EAAE,eAAe,EAAE,UAAU,CAAC,CAAA;KACrE;IACD,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAEY,QAAA,MAAM,GAAG,IAAA,kBAAU,EAC9B,CAAC,EAA+E,EAAE,GAAG,EAAE,EAAE;QAAxF,EAAE,SAA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,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,8BAAC,gBAAU,CAAC,KAAK,oBACX,IAAI,IACR,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE;gBAC/B,CAAC,GAAG,YAAY,aAAa,CAAC,EAAE,IAAI,KAAK,MAAM;aAChD,CAAC,IACF,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,cAAM,CAAC,KAAK,GAAG,WAAW,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-10-26 09:46:28\n * @LastEditors: 郑泳健\n * @LastEditTime: 2026-01-14 14:51:59\n * @FilePath: /tntd/packages/tntd/src/button/button.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type {\n ButtonProps as AntdButtonProps,\n ButtonGroupProps as AntdButtonGroupProps,\n ButtonType,\n} from 'antd/lib/button'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport { ConfigConsumer } from '../config-provider'\nimport { default as AntdButton } from 'antd/lib/button'\nimport { doUpperTitle } from '../utils/lang'\nimport classNames from 'classnames'\n\nexport * from 'antd/lib/button'\n\nexport type TntButtonType = ButtonType | 'tertiary' | 'ai' | 'ai-default'\nexport interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {\n upperCaseIgnore?: []\n unUpperConverted?: boolean\n size?: 'large' | 'default' | 'small' | 'mini'\n type?:\n | 'default'\n | 'primary'\n | 'tertiary'\n | 'ai'\n | 'ai-default'\n | 'ghost'\n | 'dashed'\n | 'danger'\n | 'link'\n}\nexport interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {\n size?: 'large' | 'default' | 'small' | 'mini'\n}\n\ninterface ButtonComponent\n extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<AntdButton>> {\n Group: React.FC<ButtonGroupProps>\n}\n\nconst tntPrefixCls = 'tnt-btn'\n\nconst getNewChildren = (\n children: any,\n unUpperConverted: boolean | undefined,\n upperCaseIgnore: [] | undefined,\n localeCode: string | undefined\n) => {\n let newChildren = children\n if (!unUpperConverted) {\n newChildren = doUpperTitle(newChildren, upperCaseIgnore, localeCode)\n }\n return newChildren\n}\n\nexport const Button = forwardRef<AntdButton, ButtonProps>(\n ({ className, size, type, children, unUpperConverted, upperCaseIgnore, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <LocaleReceiver componentName=\"Button\">\n {(locale, localeCode) => {\n return (\n <AntdButton\n {...rest}\n type={\n type === 'tertiary' || type === 'ai' || type === 'ai-default'\n ? undefined\n : type\n }\n size={size === 'mini' ? undefined : size}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-mini`]: size === 'mini',\n [`${tntPrefixCls}-tertiary`]: type === 'tertiary',\n [`${tntPrefixCls}-ai`]: type === 'ai',\n [`${tntPrefixCls}-ai-default`]: type === 'ai-default',\n })}\n children={getNewChildren(\n children,\n unUpperConverted,\n upperCaseIgnore,\n localeCode\n )}\n ref={ref}\n />\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as ButtonComponent\n\nconst ButtonGroup: React.FC<ButtonGroupProps> = ({ className, size, ...rest }) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdButton.Group\n {...rest}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, {\n [`${tntPrefixCls}-group-mini`]: size === 'mini',\n })}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nButton.Group = ButtonGroup\n"]}
|