@alifd/chat 0.3.40-beta.0 → 0.3.40-beta.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/ai-loading/types.d.ts +1 -0
- package/es/button/button.d.ts +1 -2
- package/es/button/button.js +13 -19
- package/es/button/group.js +5 -42
- package/es/button/main.scss +36 -77
- package/es/card/main.scss +1 -1
- package/es/checkbox-group/main.scss +6 -7
- package/es/checkbox-group/types.d.ts +6 -0
- package/es/code-view/index.d.ts +11 -0
- package/es/code-view/index.js +63 -0
- package/es/code-view/main.scss +54 -0
- package/es/code-view/style.d.ts +4 -0
- package/es/code-view/style.js +4 -0
- package/es/code-view/types.d.ts +27 -0
- package/es/code-view/types.js +1 -0
- package/es/collapse/index.d.ts +157 -0
- package/es/collapse/index.js +20 -0
- package/es/collapse/main.scss +95 -0
- package/es/collapse/style.d.ts +2 -0
- package/es/collapse/style.js +2 -0
- package/es/collapse/types.d.ts +82 -0
- package/es/collapse/types.js +2 -0
- package/es/core/variables.scss +27 -12
- package/es/date-picker/DatePicker.d.ts +5 -0
- package/es/date-picker/DatePicker.js +15 -0
- package/es/date-picker/MonthPicker.d.ts +4 -0
- package/es/date-picker/MonthPicker.js +15 -0
- package/es/date-picker/RangePicker.d.ts +4 -0
- package/es/date-picker/RangePicker.js +17 -0
- package/es/date-picker/YearPicker.d.ts +4 -0
- package/es/date-picker/YearPicker.js +15 -0
- package/es/date-picker/index.d.ts +5 -23
- package/es/date-picker/index.js +11 -29
- package/es/date-picker/main.scss +23 -1
- package/es/date-picker/style.d.ts +1 -0
- package/es/date-picker/style.js +1 -0
- package/es/date-picker/types.d.ts +161 -81
- package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
- package/es/form/style.d.ts +0 -1
- package/es/form/style.js +2 -1
- package/es/form/types.d.ts +3 -517
- package/es/form/types.js +5 -1
- package/es/html-render/index.d.ts +1 -1
- package/es/html-render/index.js +118 -106
- package/es/html-render/main.scss +27 -8
- package/es/html-render/style.d.ts +1 -0
- package/es/html-render/style.js +1 -0
- package/es/icon/index.d.ts +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/input/index.d.ts +1 -1
- package/es/input/index.js +16 -6
- package/es/input/main.scss +25 -0
- package/es/input/style.d.ts +1 -0
- package/es/input/style.js +1 -0
- package/es/input/types.d.ts +58 -15
- package/es/markdown/index.d.ts +1 -2
- package/es/markdown/index.js +26 -15
- package/es/markdown/main.scss +4 -3
- package/es/markdown/style.d.ts +2 -1
- package/es/markdown/style.js +2 -1
- package/es/markdown/types.d.ts +20 -9
- package/es/message/index.d.ts +4 -4
- package/es/person-picker/index.d.ts +3 -190
- package/es/person-picker/index.js +23 -21
- package/es/person-picker/main.scss +15 -1
- package/es/person-picker/types.d.ts +53 -11
- package/es/radio-group/index.d.ts +1 -1
- package/es/radio-group/index.js +9 -3
- package/es/radio-group/main.scss +13 -5
- package/es/radio-group/types.d.ts +5 -3
- package/es/reference/index.d.ts +1 -1
- package/es/reference/index.js +14 -15
- package/es/reference/main.scss +1 -1
- package/es/reference/types.d.ts +1 -0
- package/es/select/button.d.ts +3 -0
- package/es/select/button.js +70 -0
- package/es/select/index.d.ts +79 -79
- package/es/select/index.js +13 -57
- package/es/select/main.scss +22 -4
- package/es/select/types.d.ts +108 -1
- package/es/step/index.js +2 -2
- package/es/step/main.scss +115 -66
- package/es/step/types.d.ts +13 -2
- package/es/table/index.d.ts +12 -0
- package/es/table/index.js +23 -0
- package/es/table/main.scss +30 -0
- package/es/table/style.d.ts +2 -0
- package/es/table/style.js +2 -0
- package/es/table/types.d.ts +98 -0
- package/es/table/types.js +1 -0
- package/es/tag/index.d.ts +5 -3
- package/es/tag/index.js +18 -2
- package/es/tag/main.scss +20 -4
- package/es/tag/types.d.ts +55 -0
- package/es/text/index.js +1 -1
- package/es/text/main.scss +4 -1
- package/es/text/types.d.ts +8 -0
- package/es/time-picker/index.d.ts +6 -15
- package/es/time-picker/index.js +71 -24
- package/es/time-picker/main.scss +19 -1
- package/es/time-picker/style.d.ts +1 -0
- package/es/time-picker/style.js +1 -0
- package/es/time-picker/types.d.ts +133 -8
- package/es/tool-status/index.d.ts +1 -1
- package/es/tool-status/index.js +1 -1
- package/es/tool-status/main.scss +2 -1
- package/es/tool-status/types.d.ts +7 -2
- package/es/utils/func.d.ts +1 -0
- package/es/utils/func.js +13 -0
- package/es/utils/github-dark.scss +137 -0
- package/es/utils/github.scss +137 -0
- package/es/utils/hoc/main.scss +166 -0
- package/es/utils/hoc/withLabel.d.ts +94 -0
- package/es/utils/hoc/withLabel.js +57 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/lib/ai-loading/types.d.ts +1 -0
- package/lib/button/button.d.ts +1 -2
- package/lib/button/button.js +13 -19
- package/lib/button/group.js +4 -41
- package/lib/button/main.scss +36 -77
- package/lib/card/main.scss +1 -1
- package/lib/checkbox-group/main.scss +6 -7
- package/lib/checkbox-group/types.d.ts +6 -0
- package/lib/code-view/index.d.ts +11 -0
- package/lib/code-view/index.js +66 -0
- package/lib/code-view/main.scss +54 -0
- package/lib/code-view/style.d.ts +4 -0
- package/lib/code-view/style.js +6 -0
- package/lib/code-view/types.d.ts +27 -0
- package/lib/code-view/types.js +2 -0
- package/lib/collapse/index.d.ts +157 -0
- package/lib/collapse/index.js +22 -0
- package/lib/collapse/main.scss +95 -0
- package/lib/collapse/style.d.ts +2 -0
- package/lib/collapse/style.js +4 -0
- package/lib/collapse/types.d.ts +82 -0
- package/lib/collapse/types.js +3 -0
- package/lib/core/variables.scss +27 -12
- package/lib/date-picker/DatePicker.d.ts +5 -0
- package/lib/date-picker/DatePicker.js +17 -0
- package/lib/date-picker/MonthPicker.d.ts +4 -0
- package/lib/date-picker/MonthPicker.js +17 -0
- package/lib/date-picker/RangePicker.d.ts +4 -0
- package/lib/date-picker/RangePicker.js +19 -0
- package/lib/date-picker/YearPicker.d.ts +4 -0
- package/lib/date-picker/YearPicker.js +17 -0
- package/lib/date-picker/index.d.ts +5 -23
- package/lib/date-picker/index.js +10 -27
- package/lib/date-picker/main.scss +23 -1
- package/lib/date-picker/style.d.ts +1 -0
- package/lib/date-picker/style.js +1 -0
- package/lib/date-picker/types.d.ts +161 -81
- package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
- package/lib/form/style.d.ts +0 -1
- package/lib/form/style.js +1 -2
- package/lib/form/types.d.ts +3 -517
- package/lib/form/types.js +4 -1
- package/lib/html-render/index.d.ts +1 -1
- package/lib/html-render/index.js +118 -106
- package/lib/html-render/main.scss +27 -8
- package/lib/html-render/style.d.ts +1 -0
- package/lib/html-render/style.js +1 -0
- package/lib/icon/index.d.ts +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +8 -2
- package/lib/input/index.d.ts +1 -1
- package/lib/input/index.js +16 -6
- package/lib/input/main.scss +25 -0
- package/lib/input/style.d.ts +1 -0
- package/lib/input/style.js +1 -0
- package/lib/input/types.d.ts +58 -15
- package/lib/markdown/index.d.ts +1 -2
- package/lib/markdown/index.js +26 -15
- package/lib/markdown/main.scss +4 -3
- package/lib/markdown/style.d.ts +2 -1
- package/lib/markdown/style.js +2 -1
- package/lib/markdown/types.d.ts +20 -9
- package/lib/message/index.d.ts +4 -4
- package/lib/person-picker/index.d.ts +3 -190
- package/lib/person-picker/index.js +22 -20
- package/lib/person-picker/main.scss +15 -1
- package/lib/person-picker/types.d.ts +53 -11
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-group/index.js +8 -2
- package/lib/radio-group/main.scss +13 -5
- package/lib/radio-group/types.d.ts +5 -3
- package/lib/reference/index.d.ts +1 -1
- package/lib/reference/index.js +17 -18
- package/lib/reference/main.scss +1 -1
- package/lib/reference/types.d.ts +1 -0
- package/lib/select/button.d.ts +3 -0
- package/lib/select/button.js +74 -0
- package/lib/select/index.d.ts +79 -79
- package/lib/select/index.js +11 -55
- package/lib/select/main.scss +22 -4
- package/lib/select/types.d.ts +108 -1
- package/lib/step/index.js +2 -2
- package/lib/step/main.scss +115 -66
- package/lib/step/types.d.ts +13 -2
- package/lib/table/index.d.ts +12 -0
- package/lib/table/index.js +25 -0
- package/lib/table/main.scss +30 -0
- package/lib/table/style.d.ts +2 -0
- package/lib/table/style.js +4 -0
- package/lib/table/types.d.ts +98 -0
- package/lib/table/types.js +2 -0
- package/lib/tag/index.d.ts +5 -3
- package/lib/tag/index.js +17 -1
- package/lib/tag/main.scss +20 -4
- package/lib/tag/types.d.ts +55 -0
- package/lib/text/index.js +1 -1
- package/lib/text/main.scss +4 -1
- package/lib/text/types.d.ts +8 -0
- package/lib/time-picker/index.d.ts +6 -15
- package/lib/time-picker/index.js +71 -23
- package/lib/time-picker/main.scss +19 -1
- package/lib/time-picker/style.d.ts +1 -0
- package/lib/time-picker/style.js +1 -0
- package/lib/time-picker/types.d.ts +133 -8
- package/lib/tool-status/index.d.ts +1 -1
- package/lib/tool-status/index.js +1 -1
- package/lib/tool-status/main.scss +2 -1
- package/lib/tool-status/types.d.ts +7 -2
- package/lib/utils/func.d.ts +1 -0
- package/lib/utils/func.js +15 -0
- package/lib/utils/github-dark.scss +137 -0
- package/lib/utils/github.scss +137 -0
- package/lib/utils/hoc/main.scss +166 -0
- package/lib/utils/hoc/withLabel.d.ts +94 -0
- package/lib/utils/hoc/withLabel.js +60 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +49 -4
- package/es/form/index.d.ts +0 -23
- package/es/form/index.js +0 -33
- package/es/form/main.scss +0 -5
- package/lib/form/index.d.ts +0 -23
- package/lib/form/index.js +0 -35
- package/lib/form/main.scss +0 -5
package/es/html-render/index.js
CHANGED
|
@@ -10,11 +10,9 @@ import classnames from 'classnames';
|
|
|
10
10
|
import sanitizeHtml from 'sanitize-html';
|
|
11
11
|
import parse, { domToReact, Element } from 'html-react-parser';
|
|
12
12
|
import { PhotoProvider } from 'react-photo-view';
|
|
13
|
-
import Img from '../img';
|
|
14
13
|
import { ConfigProvider } from '@alifd/next';
|
|
15
|
-
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
16
|
-
import
|
|
17
|
-
import { Message } from '@alifd/next';
|
|
14
|
+
import { PREFIX_DEFAULT, assignSubComponent, defaultCopyText } from '../utils';
|
|
15
|
+
import Img from '../img';
|
|
18
16
|
import Balloon from '../balloon';
|
|
19
17
|
import '../balloon/style';
|
|
20
18
|
const sanitizeHtmlOptions = {
|
|
@@ -51,7 +49,7 @@ const sanitizeHtmlOptions = {
|
|
|
51
49
|
allowProtocolRelative: false,
|
|
52
50
|
};
|
|
53
51
|
const isMobile = /HarmonyOS|ArkWeb|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent);
|
|
54
|
-
const HTMLRenderer = memo(function HTMLRenderer({ className, children, imagePreview, loose, handleOpenLink, sendTextMessage, copyText,
|
|
52
|
+
const HTMLRenderer = memo(function HTMLRenderer({ className, children, imagePreview, loose, handleOpenLink, sendTextMessage, copyText, handleImageClick, renderImage, typewriterEffect }) {
|
|
55
53
|
// // 处理钉钉特定链接
|
|
56
54
|
// function handleDingtalkUrl(href: string) {
|
|
57
55
|
// return () => {
|
|
@@ -65,14 +63,6 @@ const HTMLRenderer = memo(function HTMLRenderer({ className, children, imagePrev
|
|
|
65
63
|
}
|
|
66
64
|
window.open(url);
|
|
67
65
|
};
|
|
68
|
-
const defaultCopyText = (text) => {
|
|
69
|
-
if (!text) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
copy(text);
|
|
73
|
-
// TODO 换成 fusion/chat 的 toast
|
|
74
|
-
Message.success('复制成功');
|
|
75
|
-
};
|
|
76
66
|
// 暂时不做实现
|
|
77
67
|
const defaultSendMessage = () => {
|
|
78
68
|
return;
|
|
@@ -97,99 +87,121 @@ const HTMLRenderer = memo(function HTMLRenderer({ className, children, imagePrev
|
|
|
97
87
|
}, className: "generating-char" }, char));
|
|
98
88
|
})));
|
|
99
89
|
};
|
|
100
|
-
// 已替换
|
|
101
|
-
const parserOptionsOld = {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
90
|
+
// // 已替换
|
|
91
|
+
// const parserOptionsOld: HTMLReactParserOptions = {
|
|
92
|
+
// // @ts-expect-error html-react-parser 的类型定义不完整
|
|
93
|
+
// replace: domNode => {
|
|
94
|
+
// // 处理文本节点
|
|
95
|
+
// if ((domNode.type === 'text' || domNode.nodeType === 3) && typewriterEffect) {
|
|
96
|
+
// return processTextNode(domNode as Text);
|
|
97
|
+
// }
|
|
98
|
+
// if (domNode instanceof Element && domNode.attribs) {
|
|
99
|
+
// const { name } = domNode;
|
|
100
|
+
// if (name === 'link-reference') {
|
|
101
|
+
// const element = (domToReact([domNode])) as JSX.Element;
|
|
102
|
+
// // link-reference 的子元素一定是 a 标签
|
|
103
|
+
// const aElement = element.props?.children as JSX.Element;
|
|
104
|
+
// // a 标签的子元素一定是 span 节点
|
|
105
|
+
// const spanElement = aElement?.props?.children as JSX.Element;
|
|
106
|
+
// const handleUrlClick = () => {
|
|
107
|
+
// if (!aElement?.props?.href) {
|
|
108
|
+
// return;
|
|
109
|
+
// }
|
|
110
|
+
// if (handleOpenLink) {
|
|
111
|
+
// handleOpenLink?.(aElement.props.href);
|
|
112
|
+
// } else {
|
|
113
|
+
// defaultOpenLink(aElement.props.href);
|
|
114
|
+
// }
|
|
115
|
+
// };
|
|
116
|
+
// return (
|
|
117
|
+
// <Balloon
|
|
118
|
+
// v2
|
|
119
|
+
// align="b"
|
|
120
|
+
// className="link-reference-balloon"
|
|
121
|
+
// closable={false}
|
|
122
|
+
// offset={[0, -8]}
|
|
123
|
+
// triggerType={['hover']}
|
|
124
|
+
// trigger={
|
|
125
|
+
// <span className="link-reference-index" onClick={handleUrlClick}>
|
|
126
|
+
// {spanElement?.props?.children}
|
|
127
|
+
// </span>
|
|
128
|
+
// }
|
|
129
|
+
// >
|
|
130
|
+
// <div className="link-reference-content">
|
|
131
|
+
// <img
|
|
132
|
+
// className="link-reference-source-icon"
|
|
133
|
+
// src={element.props?.['data-source-icon'] || ''}
|
|
134
|
+
// />
|
|
135
|
+
// <a
|
|
136
|
+
// className="link-reference-title"
|
|
137
|
+
// onClick={handleUrlClick}
|
|
138
|
+
// title={element.props?.['data-title'] || ''}
|
|
139
|
+
// >
|
|
140
|
+
// {element.props?.['data-title'] || ''}
|
|
141
|
+
// </a>
|
|
142
|
+
// </div>
|
|
143
|
+
// </Balloon>
|
|
144
|
+
// );
|
|
145
|
+
// }
|
|
146
|
+
// if (name === 'a') {
|
|
147
|
+
// const element = (domToReact([domNode])) as JSX.Element;
|
|
148
|
+
// const { props } = element;
|
|
149
|
+
// if (props.href && props.href.startsWith('message://')) {
|
|
150
|
+
// const msgValue = decodeURIComponent(props.href.slice(10));
|
|
151
|
+
// return React.cloneElement(element, {
|
|
152
|
+
// onClick: () => {
|
|
153
|
+
// if(sendTextMessage){
|
|
154
|
+
// sendTextMessage(msgValue);
|
|
155
|
+
// return
|
|
156
|
+
// }
|
|
157
|
+
// defaultSendMessage();
|
|
158
|
+
// },
|
|
159
|
+
// href: undefined
|
|
160
|
+
// });
|
|
161
|
+
// }
|
|
162
|
+
// if (props.href && props.href.startsWith('copy://')) {
|
|
163
|
+
// const copyValue = decodeURIComponent(props.href.slice(7));
|
|
164
|
+
// return React.cloneElement(element, {
|
|
165
|
+
// onClick: ()=>{
|
|
166
|
+
// if(copyText){
|
|
167
|
+
// copyText(copyValue);
|
|
168
|
+
// return;
|
|
169
|
+
// }
|
|
170
|
+
// defaultCopyText(copyValue);
|
|
171
|
+
// },
|
|
172
|
+
// href: undefined
|
|
173
|
+
// });
|
|
174
|
+
// }
|
|
175
|
+
// // H5场景和钉协议场景都需要代理Click事件
|
|
176
|
+
// if (props.href && (/^dtmd:\/\/dingtalkclient|^dingtalk:\/\/dingtalkclient\/action\/jumprobot|^(https?:)?\/\/qr.dingtalk.com\/action\/jumprobot|^https:\/\/applink\.dingtalk\.com\/page\/link/.test(props.href) || isMobile)) {
|
|
177
|
+
// return React.cloneElement(element, {
|
|
178
|
+
// onClick: ()=> {
|
|
179
|
+
// if(handleOpenLink){
|
|
180
|
+
// handleOpenLink?.(props.href);
|
|
181
|
+
// return;
|
|
182
|
+
// }
|
|
183
|
+
// defaultOpenLink(props.href);
|
|
184
|
+
// },
|
|
185
|
+
// href: undefined
|
|
186
|
+
// });
|
|
187
|
+
// }
|
|
188
|
+
// return React.cloneElement(element, {
|
|
189
|
+
// target: '_blank',
|
|
190
|
+
// });
|
|
191
|
+
// }
|
|
192
|
+
// if (name === 'img') {
|
|
193
|
+
// const element = (domToReact([domNode])) as JSX.Element;
|
|
194
|
+
// if(renderImage){
|
|
195
|
+
// return renderImage(element.props);
|
|
196
|
+
// }
|
|
197
|
+
// // 换成统一的图片渲染
|
|
198
|
+
// return <Img {...element.props} imageClassName={element.props?.className} enablePreview={imagePreview} onImageClick={()=>{
|
|
199
|
+
// handleImageClick?.(element.props.src)
|
|
200
|
+
// }}/>
|
|
201
|
+
// }
|
|
202
|
+
// }
|
|
203
|
+
// }
|
|
204
|
+
// };
|
|
193
205
|
const element = useMemo(() => {
|
|
194
206
|
indexRef.current = 0;
|
|
195
207
|
// 已替换
|
package/es/html-render/main.scss
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
font-family: inherit;
|
|
10
10
|
color: $color-text1-4;
|
|
11
11
|
|
|
12
|
+
// 最后一个子元素的 margin-bottom 为 0
|
|
13
|
+
> *:last-child {
|
|
14
|
+
margin-bottom: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
&.loose {
|
|
13
18
|
font-size: 16px;
|
|
14
19
|
line-height: 1.85;
|
|
@@ -55,12 +60,12 @@
|
|
|
55
60
|
h1, h2, h3, h4, h5, h6 {
|
|
56
61
|
font-weight: bold;
|
|
57
62
|
color: $color-text1-4;
|
|
63
|
+
margin-bottom: var(--s-1, 4px);
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
h1 {
|
|
61
67
|
font-size: 18px;
|
|
62
|
-
line-height:
|
|
63
|
-
margin: 0.5rem 0;
|
|
68
|
+
line-height: 24px;
|
|
64
69
|
|
|
65
70
|
&.loose {
|
|
66
71
|
font-size: 28px;
|
|
@@ -69,8 +74,7 @@
|
|
|
69
74
|
|
|
70
75
|
h2 {
|
|
71
76
|
font-size: 16px;
|
|
72
|
-
line-height:
|
|
73
|
-
margin: 0.5rem 0;
|
|
77
|
+
line-height: 24px;
|
|
74
78
|
|
|
75
79
|
&.loose {
|
|
76
80
|
font-size: 24px;
|
|
@@ -79,7 +83,7 @@
|
|
|
79
83
|
|
|
80
84
|
h3, h4, h5, h6 {
|
|
81
85
|
font-size: 14px;
|
|
82
|
-
line-height:
|
|
86
|
+
line-height: 22px;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
h3 {
|
|
@@ -94,6 +98,12 @@
|
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
|
|
101
|
+
p {
|
|
102
|
+
line-height: 22px;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
margin-bottom: var(--s-1, 4px);
|
|
105
|
+
}
|
|
106
|
+
|
|
97
107
|
|
|
98
108
|
img, video, .image {
|
|
99
109
|
max-width: 100%;
|
|
@@ -157,7 +167,7 @@
|
|
|
157
167
|
|
|
158
168
|
table {
|
|
159
169
|
line-height: 1.6;
|
|
160
|
-
margin:
|
|
170
|
+
margin: var(--s-2, 8px) auto;
|
|
161
171
|
border-spacing: none;
|
|
162
172
|
border-collapse: collapse;
|
|
163
173
|
empty-cells: show;
|
|
@@ -199,10 +209,19 @@
|
|
|
199
209
|
list-style: revert;
|
|
200
210
|
padding-left: 20px;
|
|
201
211
|
margin: 0;
|
|
212
|
+
margin-bottom: var(--s-1, 4px);
|
|
202
213
|
|
|
203
214
|
&.loose {
|
|
204
215
|
padding-left: 30px;
|
|
205
216
|
}
|
|
217
|
+
|
|
218
|
+
li {
|
|
219
|
+
list-style: revert;
|
|
220
|
+
|
|
221
|
+
> *:last-child {
|
|
222
|
+
margin-bottom: 0;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
206
225
|
}
|
|
207
226
|
|
|
208
227
|
li {
|
|
@@ -230,8 +249,8 @@
|
|
|
230
249
|
opacity: 0.6;
|
|
231
250
|
font-style: italic;
|
|
232
251
|
position: relative;
|
|
233
|
-
margin-top:
|
|
234
|
-
margin-bottom:
|
|
252
|
+
margin-top: var(--s-2, 8px);
|
|
253
|
+
margin-bottom: var(--s-2, 8px);
|
|
235
254
|
|
|
236
255
|
&.loose {
|
|
237
256
|
margin-top: 20px;
|
package/es/html-render/style.js
CHANGED
package/es/icon/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import type { IconProps } from '@alifd/next/types/icon';
|
|
10
10
|
export * from './types';
|
|
11
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<IconProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<IconProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/icon/icon").default>>, keyof IconProps
|
|
11
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<IconProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<IconProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/icon/icon").default>>, "key" | keyof IconProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<IconProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/icon/icon").default>, {}>;
|
|
12
12
|
export default _default;
|
|
13
13
|
export declare function renderCommonIcon(icon: any, size?: number | 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl' | 'inherit'): React.JSX.Element | null;
|
package/es/index.d.ts
CHANGED
|
@@ -32,4 +32,7 @@ export { default as CheckboxGroup } from './checkbox-group';
|
|
|
32
32
|
export { default as Select } from './select';
|
|
33
33
|
export { default as Flip } from './flip';
|
|
34
34
|
export { default as ToolStatus } from './tool-status';
|
|
35
|
+
export { default as Collapse } from './collapse';
|
|
36
|
+
export { default as Table } from './table';
|
|
37
|
+
export { default as CodeView } from './code-view';
|
|
35
38
|
export declare const version: string;
|
package/es/index.js
CHANGED
|
@@ -32,4 +32,7 @@ export { default as CheckboxGroup } from './checkbox-group';
|
|
|
32
32
|
export { default as Select } from './select';
|
|
33
33
|
export { default as Flip } from './flip';
|
|
34
34
|
export { default as ToolStatus } from './tool-status';
|
|
35
|
-
export
|
|
35
|
+
export { default as Collapse } from './collapse';
|
|
36
|
+
export { default as Table } from './table';
|
|
37
|
+
export { default as CodeView } from './code-view';
|
|
38
|
+
export const version = '0.3.40-beta.1';
|
package/es/input/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @component 输入框
|
|
3
3
|
* @en Input
|
|
4
4
|
* @type 通用 - General
|
|
5
|
-
* @remarks
|
|
5
|
+
* @remarks [输入器组件] 是一个 [输入类] UI 组件,用于 [接收用户自由文本输入],包括数字、文本等类型,使用户能够 [动态提供信息并完成数据录入]。它在卡片中扮演 [数据输入与交互入口] 的角色,通常用于 [表单填写、参数配置等场景]。
|
|
6
6
|
* @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Inputs are used for emphasizing important functions on your page.
|
|
7
7
|
* @others
|
|
8
8
|
* ## 无障碍键盘操作指南
|
package/es/input/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @component 输入框
|
|
3
3
|
* @en Input
|
|
4
4
|
* @type 通用 - General
|
|
5
|
-
* @remarks
|
|
5
|
+
* @remarks [输入器组件] 是一个 [输入类] UI 组件,用于 [接收用户自由文本输入],包括数字、文本等类型,使用户能够 [动态提供信息并完成数据录入]。它在卡片中扮演 [数据输入与交互入口] 的角色,通常用于 [表单填写、参数配置等场景]。
|
|
6
6
|
* @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Inputs are used for emphasizing important functions on your page.
|
|
7
7
|
* @others
|
|
8
8
|
* ## 无障碍键盘操作指南
|
|
@@ -22,21 +22,31 @@ import React, { forwardRef } from 'react';
|
|
|
22
22
|
import { Input as NextInput, ConfigProvider } from '@alifd/next';
|
|
23
23
|
import cs from 'classnames';
|
|
24
24
|
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
25
|
-
|
|
25
|
+
import { withLabel } from '../utils/hoc/withLabel';
|
|
26
|
+
// 基础Input组件
|
|
27
|
+
const BaseInput = forwardRef((_a, ref) => {
|
|
26
28
|
var { className, size = 'medium' } = _a, props = __rest(_a, ["className", "size"]);
|
|
27
29
|
return (React.createElement(NextInput, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}input`, className), size: size, ref: ref })));
|
|
28
30
|
});
|
|
31
|
+
BaseInput.displayName = 'BaseInput';
|
|
32
|
+
// 基础TextArea组件
|
|
33
|
+
const BaseTextArea = forwardRef((_a, ref) => {
|
|
34
|
+
var { className, size = 'medium' } = _a, props = __rest(_a, ["className", "size"]);
|
|
35
|
+
return (React.createElement(NextInput.TextArea, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}textarea`, className), size: size, ref: ref })));
|
|
36
|
+
});
|
|
37
|
+
BaseTextArea.displayName = 'BaseTextArea';
|
|
38
|
+
// 带Label的Input组件
|
|
39
|
+
const Input = withLabel(BaseInput);
|
|
29
40
|
const InputWithSub = assignSubComponent(Input, {
|
|
30
41
|
displayName: 'Input',
|
|
31
42
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return (React.createElement(NextInput.TextArea, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}input`, className), size: size, ref: ref })));
|
|
35
|
-
});
|
|
43
|
+
// 带Label的TextArea组件
|
|
44
|
+
const InputTextArea = withLabel(BaseTextArea);
|
|
36
45
|
const InputTextAreaWithSub = assignSubComponent(InputTextArea, {
|
|
37
46
|
displayName: 'InputTextArea',
|
|
38
47
|
});
|
|
39
48
|
export * from './types';
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
50
|
const Result = ConfigProvider.config(InputWithSub);
|
|
41
51
|
Result.TextArea = ConfigProvider.config(InputTextAreaWithSub);
|
|
42
52
|
export default Result;
|
package/es/input/main.scss
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
@import "../core/variables.scss";
|
|
2
2
|
|
|
3
3
|
.#{$prefix}input {
|
|
4
|
+
&.next-input {
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
4
10
|
|
|
11
|
+
.next-input-control {
|
|
12
|
+
width: auto;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.#{$prefix}textarea {
|
|
17
|
+
border: none;
|
|
18
|
+
position: relative;
|
|
19
|
+
--input-multiple-font-size: 14px;
|
|
20
|
+
--input-multiple-padding-tb: var(---s-2, 8px);
|
|
21
|
+
--input-multiple-padding-lr: var(---s-2, 8px);
|
|
22
|
+
|
|
23
|
+
&.next-input:hover {
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
textarea {
|
|
28
|
+
line-height: var(--form-element-medium-line-height, 18px);
|
|
29
|
+
}
|
|
5
30
|
}
|
package/es/input/style.d.ts
CHANGED
package/es/input/style.js
CHANGED