@cloudbase/weda-ui 3.9.5 → 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/form/selectMultiple/dropdown-select/index.js +4 -7
- package/dist/web/components/richTextView/index.css +1 -1
- package/dist/web/components/wd-markdown/github-markdown-light.css +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 +2 -2
|
@@ -101,13 +101,10 @@ export function PureSelect({ params, selectedValue, updateValue, placeholder, si
|
|
|
101
101
|
const option = isSearch && staticSearchable ? searchOptions : options;
|
|
102
102
|
return platform === 'h5' ? option : transFormatTeaSelectKey(option);
|
|
103
103
|
}, [isSearch, searchOptions, options, platform, staticSearchable]);
|
|
104
|
-
const allOptions = useMemo(() => {
|
|
105
|
-
return transFormatTeaSelectKey(options);
|
|
106
|
-
}, [options]);
|
|
107
104
|
useEffect(() => {
|
|
108
|
-
allOption(
|
|
109
|
-
recycleBack === null || recycleBack === void 0 ? void 0 : recycleBack(
|
|
110
|
-
}, [
|
|
105
|
+
allOption(currentOption);
|
|
106
|
+
recycleBack === null || recycleBack === void 0 ? void 0 : recycleBack(currentOption);
|
|
107
|
+
}, [currentOption]);
|
|
111
108
|
useEffect(() => {
|
|
112
109
|
// 本地搜索
|
|
113
110
|
if (!isTurnPages || options.length < PAGE_SIZE) {
|
|
@@ -217,5 +214,5 @@ export function PureSelect({ params, selectedValue, updateValue, placeholder, si
|
|
|
217
214
|
const getIsShow = () => {
|
|
218
215
|
closeModal();
|
|
219
216
|
};
|
|
220
|
-
return platform === 'h5' ? (_jsx(SelectPickerH5, { updateValue: updateValue, options: currentOption, loadMore: loadMore, reTry: reTry, isTurnPages: isTurnPages, status: currentStatus, onSearchValue: onSearchValue, isShow: isShow, selectedValue: selectedValue, getIsShow: getIsShow, onSearchValueInput: onSearchValueInput })) : (_jsx(SelectPickerPc, { placeholder: placeholder, size: size, selectedValue: selectedValue, disabled: disabled, updateValue: updateValue, reTry: reTry, loadMore: loadMore, format: format, status: currentStatus, options: currentOption, allOptions:
|
|
217
|
+
return platform === 'h5' ? (_jsx(SelectPickerH5, { updateValue: updateValue, options: currentOption, loadMore: loadMore, reTry: reTry, isTurnPages: isTurnPages, status: currentStatus, onSearchValue: onSearchValue, isShow: isShow, selectedValue: selectedValue, getIsShow: getIsShow, onSearchValueInput: onSearchValueInput })) : (_jsx(SelectPickerPc, { placeholder: placeholder, size: size, selectedValue: selectedValue, disabled: disabled, updateValue: updateValue, reTry: reTry, loadMore: loadMore, format: format, status: currentStatus, options: currentOption, allOptions: currentOption, onSearchValue: onSearchValue, defaultSearchValue: '', onSearchValueInput: onSearchValueInput }));
|
|
221
218
|
}
|
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.7",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
"!.temp/dist/*.map"
|
|
270
270
|
],
|
|
271
271
|
"webpack": false,
|
|
272
|
-
"limit": "
|
|
272
|
+
"limit": "1200 KB"
|
|
273
273
|
}
|
|
274
274
|
],
|
|
275
275
|
"nyc": {
|