@cloudbase/weda-ui 3.9.6 → 3.9.7
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/dist/style/index.scss +1 -1
- package/dist/web/components/form/select/dropdown-select/index.css +3 -1
- package/dist/web/components/index.d.ts +1 -1
- package/dist/web/components/index.js +3 -1
- package/dist/web/components/wd-markdown/wd-markdown.js +20 -1
- package/dist/web/components/wd-select/wd-select.css +11 -0
- package/dist/web/components/wd-select-multiple/wd-select-multiple.css +12 -0
- package/package.json +1 -1
|
@@ -143,7 +143,7 @@ export const WdCodeEditor: any;
|
|
|
143
143
|
export const WdMember: any;
|
|
144
144
|
export const WdLocation: any;
|
|
145
145
|
export const WdRichText: any;
|
|
146
|
-
export
|
|
146
|
+
export const WdMarkdown: any;
|
|
147
147
|
export { default as WdCanvas } from "./wd-canvas";
|
|
148
148
|
export { default as WdAudio } from "./wd-audio";
|
|
149
149
|
export { default as WdFormObj } from "./wd-form-obj";
|
|
@@ -202,7 +202,9 @@ export const WdLocation = loadable(() => import('./wd-location'), {
|
|
|
202
202
|
export const WdRichText = loadable(() => import('./wd-rich-text'), {
|
|
203
203
|
fallback,
|
|
204
204
|
});
|
|
205
|
-
export
|
|
205
|
+
export const WdMarkdown = loadable(() => import('./wd-markdown'), {
|
|
206
|
+
fallback,
|
|
207
|
+
});
|
|
206
208
|
export { default as WdCanvas } from './wd-canvas';
|
|
207
209
|
export { default as WdAudio } from './wd-audio';
|
|
208
210
|
export { default as WdFormObj } from './wd-form-obj';
|
|
@@ -22,7 +22,21 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
22
22
|
[className]: className,
|
|
23
23
|
});
|
|
24
24
|
// markdown-it实例
|
|
25
|
-
const [mdInstance, setMdInstance] = useState(
|
|
25
|
+
const [mdInstance, setMdInstance] = useState(() => {
|
|
26
|
+
return new MarkdownIt({
|
|
27
|
+
// 默认开启高亮
|
|
28
|
+
highlight: function (str, lang) {
|
|
29
|
+
if (lang && hljs.getLanguage(lang)) {
|
|
30
|
+
try {
|
|
31
|
+
return hljs.highlight(lang, str).value;
|
|
32
|
+
}
|
|
33
|
+
catch (__) { }
|
|
34
|
+
}
|
|
35
|
+
return ''; // 使用额外的默认转义
|
|
36
|
+
},
|
|
37
|
+
...options,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
26
40
|
const destroy = useCallback(() => {
|
|
27
41
|
if (!mdInstance) {
|
|
28
42
|
return;
|
|
@@ -62,6 +76,11 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
62
76
|
useEffect(() => {
|
|
63
77
|
init(options);
|
|
64
78
|
}, [init, options]);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
return () => {
|
|
81
|
+
destroy();
|
|
82
|
+
};
|
|
83
|
+
}, [destroy]);
|
|
65
84
|
const [html, setHtml] = useState('');
|
|
66
85
|
useEffect(() => {
|
|
67
86
|
if (mdInstance) {
|
|
@@ -57,3 +57,14 @@
|
|
|
57
57
|
.wd-form-item.wd-pc-select-root .wedatea2td-text-weak {
|
|
58
58
|
color: var(--wd-color-text-placeholder) !important;
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
.wd-pc-select-root .wd-form-item-wrap__control {
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
}
|
|
64
|
+
.wd-pc-select-root .wd-form-input-wrap {
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
}
|
|
67
|
+
.wd-pc-select-root .wd-form-input-wrap__content {
|
|
68
|
+
width: 100%;
|
|
69
|
+
padding-right: calc(var(--wd-size-icon-md));
|
|
70
|
+
}
|
|
@@ -75,3 +75,15 @@
|
|
|
75
75
|
div:not(.weda-ui-show-label) {
|
|
76
76
|
color: var(--wd-color-text-placeholder) !important;
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
.wd-pc-select-multiple-root .wd-form-item-wrap__control {
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.wd-pc-select-multiple-root .wd-form-input-wrap {
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
}
|
|
86
|
+
.wd-pc-select-multiple-root .wd-form-input-wrap__content {
|
|
87
|
+
width: 100%;
|
|
88
|
+
padding-right: calc(var(--wd-size-icon-md));
|
|
89
|
+
}
|