@cloudbase/weda-ui 3.15.3 → 3.15.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/configs/actions/showMessage.json +1 -1
- package/dist/configs/actions/showModal.json +1 -1
- package/dist/configs/actions/showToast.json +1 -1
- package/dist/configs/components/auth.json +1 -1
- package/dist/configs/components/button.d.ts +1 -1
- package/dist/configs/components/button.js +1 -1
- package/dist/configs/components/calendar.d.ts +1 -1
- package/dist/configs/components/calendar.js +1 -1
- package/dist/configs/components/carousel.json +11 -4
- package/dist/configs/components/chart/bar.d.ts +1 -1
- package/dist/configs/components/chart/bar.js +1 -1
- package/dist/configs/components/chart/line.d.ts +1 -1
- package/dist/configs/components/chart/line.js +1 -1
- package/dist/configs/components/chart/pie.d.ts +1 -1
- package/dist/configs/components/chart/pie.js +1 -1
- package/dist/configs/components/chart/statisticsCard.json +11 -4
- package/dist/configs/components/container.d.ts +1 -1
- package/dist/configs/components/container.js +1 -1
- package/dist/configs/components/customer-service.d.ts +1 -1
- package/dist/configs/components/customer-service.js +1 -1
- package/dist/configs/components/dataView.js +1 -1
- package/dist/configs/components/echart.d.ts +1 -1
- package/dist/configs/components/echart.js +1 -1
- package/dist/configs/components/flow/flow.json +4 -2
- package/dist/configs/components/flow/flowbasic.json +4 -2
- package/dist/configs/components/flow/flowchart.json +4 -2
- package/dist/configs/components/flow/flowcontrol.json +4 -2
- package/dist/configs/components/flow/flowlayout.json +4 -2
- package/dist/configs/components/flow/flowprocess.json +4 -2
- package/dist/configs/components/flowgraph.json +4 -2
- package/dist/configs/components/form/checkbox.json +1 -1
- package/dist/configs/components/form/departTreeSelect.json +1 -1
- package/dist/configs/components/form/form.json +1 -1
- package/dist/configs/components/form/input.json +11 -4
- package/dist/configs/components/form/location.json +9 -3
- package/dist/configs/components/form/radio.json +4 -2
- package/dist/configs/components/form/richText.json +7 -3
- package/dist/configs/components/form/select.json +26 -6
- package/dist/configs/components/form/switch.json +1 -1
- package/dist/configs/components/form/textarea.json +4 -2
- package/dist/configs/components/form/tips.json +1 -1
- package/dist/configs/components/form/uploader.json +10 -4
- package/dist/configs/components/form/uploaderFile.json +7 -3
- package/dist/configs/components/form/userTreeSelect.json +9 -3
- package/dist/configs/components/form-checkbox.d.ts +1 -1
- package/dist/configs/components/form-checkbox.js +2 -2
- package/dist/configs/components/form-date.d.ts +1 -1
- package/dist/configs/components/form-date.js +2 -2
- package/dist/configs/components/form-depart-tree-select.d.ts +1 -1
- package/dist/configs/components/form-depart-tree-select.js +2 -2
- package/dist/configs/components/form-email.d.ts +1 -1
- package/dist/configs/components/form-email.js +2 -2
- package/dist/configs/components/form-image-uploader.d.ts +1 -1
- package/dist/configs/components/form-image-uploader.js +2 -2
- package/dist/configs/components/form-input.d.ts +1 -1
- package/dist/configs/components/form-input.js +1 -1
- package/dist/configs/components/form-location.d.ts +1 -1
- package/dist/configs/components/form-location.js +2 -2
- package/dist/configs/components/form-multi-region.d.ts +1 -1
- package/dist/configs/components/form-multi-region.js +2 -2
- package/dist/configs/components/form-phone.d.ts +1 -1
- package/dist/configs/components/form-phone.js +2 -2
- package/dist/configs/components/form-radio.d.ts +1 -1
- package/dist/configs/components/form-radio.js +2 -2
- package/dist/configs/components/form-region.d.ts +1 -1
- package/dist/configs/components/form-region.js +2 -2
- package/dist/configs/components/form-rich-text.d.ts +1 -1
- package/dist/configs/components/form-rich-text.js +2 -2
- package/dist/configs/components/form-select-multiple.d.ts +1 -1
- package/dist/configs/components/form-select-multiple.js +2 -2
- package/dist/configs/components/form-select.d.ts +1 -1
- package/dist/configs/components/form-select.js +2 -2
- package/dist/configs/components/form-switch.d.ts +1 -1
- package/dist/configs/components/form-switch.js +2 -2
- package/dist/configs/components/form-text-area.d.ts +1 -1
- package/dist/configs/components/form-text-area.js +2 -2
- package/dist/configs/components/form-time.d.ts +1 -1
- package/dist/configs/components/form-time.js +2 -2
- package/dist/configs/components/form-upload-file.d.ts +1 -1
- package/dist/configs/components/form-upload-file.js +2 -2
- package/dist/configs/components/form-url.d.ts +1 -1
- package/dist/configs/components/form-url.js +2 -2
- package/dist/configs/components/form-user-tree-select.d.ts +1 -1
- package/dist/configs/components/form-user-tree-select.js +2 -2
- package/dist/configs/components/formdetail.json +22 -8
- package/dist/configs/components/graphicCard.json +11 -4
- package/dist/configs/components/grid/col.d.ts +1 -1
- package/dist/configs/components/grid/col.js +2 -2
- package/dist/configs/components/grid/grid.d.ts +1 -1
- package/dist/configs/components/grid/grid.js +2 -2
- package/dist/configs/components/grid/row.d.ts +1 -1
- package/dist/configs/components/grid/row.js +2 -2
- package/dist/configs/components/image.d.ts +1 -1
- package/dist/configs/components/image.js +1 -1
- package/dist/configs/components/jsx.js +1 -1
- package/dist/configs/components/link.d.ts +1 -1
- package/dist/configs/components/link.js +1 -1
- package/dist/configs/components/listView.js +1 -1
- package/dist/configs/components/lottery.d.ts +1 -1
- package/dist/configs/components/lottery.js +2 -2
- package/dist/configs/components/modal.d.ts +1 -1
- package/dist/configs/components/modal.js +1 -1
- package/dist/configs/components/navLayout.json +11 -4
- package/dist/configs/components/navigationBar.json +1 -1
- package/dist/configs/components/pagelayout.json +8 -3
- package/dist/configs/components/picker/datePicker.json +1 -1
- package/dist/configs/components/qr_code.d.ts +1 -1
- package/dist/configs/components/qr_code.js +2 -7
- package/dist/configs/components/repeater-item.json +1 -1
- package/dist/configs/components/repeater.d.ts +1 -1
- package/dist/configs/components/repeater.js +1 -1
- package/dist/configs/components/richtextview.json +4 -2
- package/dist/configs/components/scrollVeiw.json +71 -24
- package/dist/configs/components/slot.json +6 -2
- package/dist/configs/components/swiper.json +16 -6
- package/dist/configs/components/table.json +58 -16
- package/dist/configs/components/tabs.d.ts +1 -1
- package/dist/configs/components/tabs.js +1 -1
- package/dist/configs/components/text.d.ts +1 -1
- package/dist/configs/components/text.js +2 -2
- package/dist/configs/components/wd-ad.d.ts +1 -1
- package/dist/configs/components/wd-ad.js +1 -1
- package/dist/configs/components/wd-audio.d.ts +1 -1
- package/dist/configs/components/wd-audio.js +1 -1
- package/dist/configs/components/wd-bubble.d.ts +1 -1
- package/dist/configs/components/wd-bubble.js +1 -1
- package/dist/configs/components/wd-button.d.ts +1 -1
- package/dist/configs/components/wd-button.js +2 -11
- package/dist/configs/components/wd-calendar.d.ts +1 -1
- package/dist/configs/components/wd-calendar.js +2 -7
- package/dist/configs/components/wd-canvas.d.ts +1 -1
- package/dist/configs/components/wd-canvas.js +2 -5
- package/dist/configs/components/wd-card.d.ts +1 -1
- package/dist/configs/components/wd-card.js +1 -1
- package/dist/configs/components/wd-cascader.d.ts +1 -1
- package/dist/configs/components/wd-cascader.js +1 -1
- package/dist/configs/components/wd-checkbox.d.ts +1 -1
- package/dist/configs/components/wd-checkbox.js +3 -9
- package/dist/configs/components/wd-code-editor.d.ts +1 -1
- package/dist/configs/components/wd-code-editor.js +2 -10
- package/dist/configs/components/wd-date-range.d.ts +1 -1
- package/dist/configs/components/wd-date-range.js +1 -1
- package/dist/configs/components/wd-date.d.ts +1 -1
- package/dist/configs/components/wd-date.js +1 -1
- package/dist/configs/components/wd-department.d.ts +1 -1
- package/dist/configs/components/wd-department.js +1 -1
- package/dist/configs/components/wd-divider.d.ts +1 -1
- package/dist/configs/components/wd-divider.js +1 -1
- package/dist/configs/components/wd-form-arr.d.ts +1 -1
- package/dist/configs/components/wd-form-arr.js +4 -9
- package/dist/configs/components/wd-form-detail.d.ts +1 -1
- package/dist/configs/components/wd-form-detail.js +2 -2
- package/dist/configs/components/wd-form-obj.d.ts +1 -1
- package/dist/configs/components/wd-form-obj.js +3 -8
- package/dist/configs/components/wd-form.d.ts +1 -1
- package/dist/configs/components/wd-form.js +2 -2
- package/dist/configs/components/wd-icon.d.ts +1 -1
- package/dist/configs/components/wd-icon.js +1 -1
- package/dist/configs/components/wd-image.d.ts +1 -1
- package/dist/configs/components/wd-image.js +1 -1
- package/dist/configs/components/wd-input-email.d.ts +1 -1
- package/dist/configs/components/wd-input-email.js +2 -2
- package/dist/configs/components/wd-input-number.d.ts +1 -1
- package/dist/configs/components/wd-input-number.js +1 -1
- package/dist/configs/components/wd-input-phone.d.ts +1 -1
- package/dist/configs/components/wd-input-phone.js +3 -9
- package/dist/configs/components/wd-input-url.d.ts +1 -1
- package/dist/configs/components/wd-input-url.js +2 -2
- package/dist/configs/components/wd-input.d.ts +1 -1
- package/dist/configs/components/wd-input.js +2 -2
- package/dist/configs/components/wd-layout.d.ts +1 -1
- package/dist/configs/components/wd-layout.js +1 -1
- package/dist/configs/components/wd-link.d.ts +1 -1
- package/dist/configs/components/wd-link.js +2 -2
- package/dist/configs/components/wd-location.d.ts +1 -1
- package/dist/configs/components/wd-location.js +1 -1
- package/dist/configs/components/wd-markdown.d.ts +1 -1
- package/dist/configs/components/wd-markdown.js +1 -1
- package/dist/configs/components/wd-member.d.ts +1 -1
- package/dist/configs/components/wd-member.js +1 -1
- package/dist/configs/components/wd-menu-base-layout.d.ts +1 -1
- package/dist/configs/components/wd-menu-base-layout.js +1 -1
- package/dist/configs/components/wd-menu-horizontal-layout.d.ts +1 -1
- package/dist/configs/components/wd-menu-horizontal-layout.js +1 -1
- package/dist/configs/components/wd-menu-layout.d.ts +2 -2
- package/dist/configs/components/wd-menu-layout.js +2 -2
- package/dist/configs/components/wd-menu-list.d.ts +1 -1
- package/dist/configs/components/wd-menu-list.js +1 -1
- package/dist/configs/components/wd-menu-nav-layout.d.ts +1 -1
- package/dist/configs/components/wd-menu-nav-layout.js +1 -1
- package/dist/configs/components/wd-menu-nav-tab-layou.d.ts +1 -1
- package/dist/configs/components/wd-menu-nav-tab-layou.js +1 -1
- package/dist/configs/components/wd-menu-plant-layout.d.ts +1 -1
- package/dist/configs/components/wd-menu-plant-layout.js +1 -1
- package/dist/configs/components/wd-menu-tab-layout.d.ts +1 -1
- package/dist/configs/components/wd-menu-tab-layout.js +1 -1
- package/dist/configs/components/wd-menu-vertical-layout.d.ts +1 -1
- package/dist/configs/components/wd-menu-vertical-layout.js +1 -1
- package/dist/configs/components/wd-modal.d.ts +1 -1
- package/dist/configs/components/wd-modal.js +1 -1
- package/dist/configs/components/wd-official-account.d.ts +1 -1
- package/dist/configs/components/wd-official-account.js +1 -1
- package/dist/configs/components/wd-progress.d.ts +1 -1
- package/dist/configs/components/wd-progress.js +3 -11
- package/dist/configs/components/wd-radio.d.ts +1 -1
- package/dist/configs/components/wd-radio.js +3 -9
- package/dist/configs/components/wd-rating.d.ts +1 -1
- package/dist/configs/components/wd-rating.js +2 -2
- package/dist/configs/components/wd-region.d.ts +1 -1
- package/dist/configs/components/wd-region.js +1 -1
- package/dist/configs/components/wd-rich-text.d.ts +1 -1
- package/dist/configs/components/wd-rich-text.js +2 -10
- package/dist/configs/components/wd-select-multiple.d.ts +1 -1
- package/dist/configs/components/wd-select-multiple.js +1 -1
- package/dist/configs/components/wd-select.d.ts +1 -1
- package/dist/configs/components/wd-select.js +1 -1
- package/dist/configs/components/wd-side-tab.d.ts +1 -1
- package/dist/configs/components/wd-side-tab.js +1 -1
- package/dist/configs/components/wd-store-home.d.ts +1 -1
- package/dist/configs/components/wd-store-home.js +1 -1
- package/dist/configs/components/wd-store-product.d.ts +1 -1
- package/dist/configs/components/wd-store-product.js +1 -1
- package/dist/configs/components/wd-switch.d.ts +1 -1
- package/dist/configs/components/wd-switch.js +2 -2
- package/dist/configs/components/wd-tabbar.d.ts +1 -1
- package/dist/configs/components/wd-tabbar.js +1 -1
- package/dist/configs/components/wd-table.d.ts +1 -1
- package/dist/configs/components/wd-table.js +1 -1
- package/dist/configs/components/wd-tag-select.d.ts +1 -1
- package/dist/configs/components/wd-tag-select.js +2 -8
- package/dist/configs/components/wd-tag.d.ts +1 -1
- package/dist/configs/components/wd-tag.js +4 -14
- package/dist/configs/components/wd-text.d.ts +1 -1
- package/dist/configs/components/wd-text.js +2 -10
- package/dist/configs/components/wd-textarea.d.ts +1 -1
- package/dist/configs/components/wd-textarea.js +3 -16
- package/dist/configs/components/wd-time.d.ts +1 -1
- package/dist/configs/components/wd-time.js +1 -1
- package/dist/configs/components/wd-top-tab.d.ts +1 -1
- package/dist/configs/components/wd-top-tab.js +1 -1
- package/dist/configs/components/wd-tree.d.ts +1 -1
- package/dist/configs/components/wd-tree.js +1 -1
- package/dist/configs/components/wd-unified-link.d.ts +1 -1
- package/dist/configs/components/wd-unified-link.js +1 -1
- package/dist/configs/components/wd-upload-file.d.ts +1 -1
- package/dist/configs/components/wd-upload-file.js +1 -1
- package/dist/configs/components/wd-upload-image.d.ts +1 -1
- package/dist/configs/components/wd-upload-image.js +1 -1
- package/dist/configs/components/web-view.d.ts +1 -1
- package/dist/configs/components/web-view.js +1 -1
- package/dist/configs/components/wedaVideo.d.ts +1 -1
- package/dist/configs/components/wedaVideo.js +1 -1
- package/dist/configs/components/wxOpenApi/phone.d.ts +1 -1
- package/dist/configs/components/wxOpenApi/phone.js +1 -1
- package/dist/configs/components/wxOpenApi/phoneCode.d.ts +1 -1
- package/dist/configs/components/wxOpenApi/phoneCode.js +1 -1
- package/dist/configs/components/wxOpenApi/share.d.ts +1 -1
- package/dist/configs/components/wxOpenApi/share.js +1 -1
- package/dist/configs/components/wxOpenApi/userInfo.d.ts +1 -1
- package/dist/configs/components/wxOpenApi/userInfo.js +1 -1
- package/dist/configs/index.d.ts +218 -218
- package/dist/configs/type-utils/index.d.ts +1 -1
- package/dist/configs/type-utils/type-form.js +2 -2
- package/dist/onlineConfig.json +4 -4
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/wd-form-obj/base-form-obj.js +10 -31
- package/dist/web/components/wd-markdown/addClass.d.ts +1 -0
- package/dist/web/components/wd-markdown/addClass.js +78 -0
- package/dist/web/components/wd-markdown/github-markdown-light.css +11 -13
- package/dist/web/components/wd-markdown/wd-markdown.js +5 -4
- package/dist/web/components/wd-table/components/ExportFileModalByApi/index.d.ts +2 -2
- package/dist/web/components/wd-table/components/ExportFileModalByApi/index.js +7 -10
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
3
|
-
import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState
|
|
3
|
+
import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { useConfig } from '../../utils/config-context';
|
|
5
5
|
import { WdFormItem } from '../wd-form-item';
|
|
6
6
|
import { usePlatform } from '../../utils/platform';
|
|
7
7
|
import classNames from '../../utils/classnames';
|
|
8
|
-
import { FormObjContext, FormObjWidgetContext, useFormObjWidget
|
|
8
|
+
import { FormObjContext, FormObjWidgetContext, useFormObjWidget } from '../../utils/widget-api';
|
|
9
9
|
import { noop } from '../../utils/constant';
|
|
10
10
|
import lodashSet from 'lodash.set';
|
|
11
11
|
import lodashGet from 'lodash.get';
|
|
@@ -132,10 +132,7 @@ export const BaseFormObj = forwardRef(function BaseFormObj(props, ref) {
|
|
|
132
132
|
}
|
|
133
133
|
// 触发删除操作,则删除对应索引的值
|
|
134
134
|
if (params.type === 'remove') {
|
|
135
|
-
value = [
|
|
136
|
-
...value.slice(0, params.value),
|
|
137
|
-
...value.slice(params.value + 1),
|
|
138
|
-
];
|
|
135
|
+
value = [...value.slice(0, params.value), ...value.slice(params.value + 1)];
|
|
139
136
|
}
|
|
140
137
|
}
|
|
141
138
|
return value;
|
|
@@ -161,6 +158,9 @@ export const BaseFormObj = forwardRef(function BaseFormObj(props, ref) {
|
|
|
161
158
|
*/
|
|
162
159
|
const change = useCallback((params, { isUpdateParentForm = false, isUpdateChildValue = true } = {}) => {
|
|
163
160
|
var _a, _b, _c;
|
|
161
|
+
if (disabled || readOnly) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
164
|
let value = deepClone(params.value);
|
|
165
165
|
if (props.objType === 'arr') {
|
|
166
166
|
value = dealArrChange(params, objValue) || value;
|
|
@@ -173,8 +173,7 @@ export const BaseFormObj = forwardRef(function BaseFormObj(props, ref) {
|
|
|
173
173
|
else if (props.objType === 'obj') {
|
|
174
174
|
value = dealObjChange(params, objValue) || value;
|
|
175
175
|
}
|
|
176
|
-
if (isObjectEqual(value, objValue) ||
|
|
177
|
-
(value === null && isObjectEqual(initValue, objValue))) {
|
|
176
|
+
if (isObjectEqual(value, objValue) || (value === null && isObjectEqual(initValue, objValue))) {
|
|
178
177
|
return;
|
|
179
178
|
}
|
|
180
179
|
setObjValue(value || initValue);
|
|
@@ -200,15 +199,7 @@ export const BaseFormObj = forwardRef(function BaseFormObj(props, ref) {
|
|
|
200
199
|
triggerOnDataChange(value);
|
|
201
200
|
},
|
|
202
201
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
203
|
-
[
|
|
204
|
-
objValue,
|
|
205
|
-
updateChildValue,
|
|
206
|
-
name,
|
|
207
|
-
parentFormObj,
|
|
208
|
-
triggerOnDataChange,
|
|
209
|
-
parentForm,
|
|
210
|
-
props.objType,
|
|
211
|
-
]);
|
|
202
|
+
[objValue, updateChildValue, name, parentFormObj, triggerOnDataChange, parentForm, props.objType]);
|
|
212
203
|
const changeDebounce = useDebouncedCallback(useCallback((value, option) => {
|
|
213
204
|
change(value, option);
|
|
214
205
|
}, [change]), 300);
|
|
@@ -281,17 +272,7 @@ export const BaseFormObj = forwardRef(function BaseFormObj(props, ref) {
|
|
|
281
272
|
readOnly,
|
|
282
273
|
};
|
|
283
274
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
284
|
-
}, [
|
|
285
|
-
innerHandle,
|
|
286
|
-
props.label,
|
|
287
|
-
name,
|
|
288
|
-
objValue,
|
|
289
|
-
visible,
|
|
290
|
-
disabled,
|
|
291
|
-
readOnly,
|
|
292
|
-
change,
|
|
293
|
-
props.objType,
|
|
294
|
-
]);
|
|
275
|
+
}, [innerHandle, props.label, name, objValue, visible, disabled, readOnly, change, props.objType]);
|
|
295
276
|
const formObjWidgetContextProvider = useMemo(() => {
|
|
296
277
|
return {
|
|
297
278
|
formObjName: name,
|
|
@@ -326,9 +307,7 @@ export const BaseFormObj = forwardRef(function BaseFormObj(props, ref) {
|
|
|
326
307
|
* @returns
|
|
327
308
|
*/
|
|
328
309
|
addFormItem(childName, formItem) {
|
|
329
|
-
if (isNil(childName) ||
|
|
330
|
-
!formItem ||
|
|
331
|
-
(typeof childName === 'string' && childName.length === 0)) {
|
|
310
|
+
if (isNil(childName) || !formItem || (typeof childName === 'string' && childName.length === 0)) {
|
|
332
311
|
// childName 没设置或为空串的时候不受表单容器控制
|
|
333
312
|
console.warn(`组件 #${formItem === null || formItem === void 0 ? void 0 : formItem.id} 表单key(表单输入类组件 childName 属性)没设置或为空串的时候不受表单容器控制`);
|
|
334
313
|
return noop;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function addCustomClassPlugin(md: any): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// List of valid html blocks names, according to commonmark spec
|
|
2
|
+
// https://spec.commonmark.org/0.30/#html-blocks
|
|
3
|
+
const htmlTags = [
|
|
4
|
+
'address',
|
|
5
|
+
'article',
|
|
6
|
+
'aside',
|
|
7
|
+
'base',
|
|
8
|
+
'basefont',
|
|
9
|
+
'blockquote',
|
|
10
|
+
'body',
|
|
11
|
+
'caption',
|
|
12
|
+
'center',
|
|
13
|
+
'col',
|
|
14
|
+
'colgroup',
|
|
15
|
+
'dd',
|
|
16
|
+
'details',
|
|
17
|
+
'dialog',
|
|
18
|
+
'dir',
|
|
19
|
+
'div',
|
|
20
|
+
'dl',
|
|
21
|
+
'dt',
|
|
22
|
+
'fieldset',
|
|
23
|
+
'figcaption',
|
|
24
|
+
'figure',
|
|
25
|
+
'footer',
|
|
26
|
+
'form',
|
|
27
|
+
'frame',
|
|
28
|
+
'frameset',
|
|
29
|
+
'h1',
|
|
30
|
+
'h2',
|
|
31
|
+
'h3',
|
|
32
|
+
'h4',
|
|
33
|
+
'h5',
|
|
34
|
+
'h6',
|
|
35
|
+
'head',
|
|
36
|
+
'header',
|
|
37
|
+
'hr',
|
|
38
|
+
'html',
|
|
39
|
+
'iframe',
|
|
40
|
+
'legend',
|
|
41
|
+
'li',
|
|
42
|
+
'link',
|
|
43
|
+
'main',
|
|
44
|
+
'menu',
|
|
45
|
+
'menuitem',
|
|
46
|
+
'nav',
|
|
47
|
+
'noframes',
|
|
48
|
+
'ol',
|
|
49
|
+
'optgroup',
|
|
50
|
+
'option',
|
|
51
|
+
'p',
|
|
52
|
+
'param',
|
|
53
|
+
'search',
|
|
54
|
+
'section',
|
|
55
|
+
'summary',
|
|
56
|
+
'table',
|
|
57
|
+
'tbody',
|
|
58
|
+
'td',
|
|
59
|
+
'tfoot',
|
|
60
|
+
'th',
|
|
61
|
+
'thead',
|
|
62
|
+
'title',
|
|
63
|
+
'tr',
|
|
64
|
+
'track',
|
|
65
|
+
'ul',
|
|
66
|
+
];
|
|
67
|
+
export function addCustomClassPlugin(md) {
|
|
68
|
+
const addCustomClass = (state) => {
|
|
69
|
+
var _a;
|
|
70
|
+
(_a = state === null || state === void 0 ? void 0 : state.tokens) === null || _a === void 0 ? void 0 : _a.forEach((token) => {
|
|
71
|
+
if (htmlTags.includes(token.tag)) {
|
|
72
|
+
// 添加自定义类
|
|
73
|
+
token.attrJoin('class', token.tag);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
md.core.ruler.push('addCustomClass', addCustomClass);
|
|
78
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
margin: 0;
|
|
7
7
|
color: #1f2328;
|
|
8
8
|
background-color: #ffffff;
|
|
9
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
|
|
10
|
-
|
|
9
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif,
|
|
10
|
+
'Apple Color Emoji', 'Segoe UI Emoji';
|
|
11
11
|
font-size: 16px;
|
|
12
12
|
line-height: 1.5;
|
|
13
13
|
word-wrap: break-word;
|
|
@@ -257,8 +257,7 @@
|
|
|
257
257
|
.markdown-body kbd {
|
|
258
258
|
display: inline-block;
|
|
259
259
|
padding: 3px 5px;
|
|
260
|
-
font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
|
|
261
|
-
Liberation Mono, monospace;
|
|
260
|
+
font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
|
262
261
|
line-height: 10px;
|
|
263
262
|
color: #1f2328;
|
|
264
263
|
vertical-align: middle;
|
|
@@ -348,16 +347,14 @@
|
|
|
348
347
|
.markdown-body tt,
|
|
349
348
|
.markdown-body code,
|
|
350
349
|
.markdown-body samp {
|
|
351
|
-
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
|
|
352
|
-
Liberation Mono, monospace;
|
|
350
|
+
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
|
353
351
|
font-size: 12px;
|
|
354
352
|
}
|
|
355
353
|
|
|
356
354
|
.markdown-body pre {
|
|
357
355
|
margin-top: 0;
|
|
358
356
|
margin-bottom: 0;
|
|
359
|
-
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
|
|
360
|
-
Liberation Mono, monospace;
|
|
357
|
+
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
|
361
358
|
font-size: 12px;
|
|
362
359
|
word-wrap: normal;
|
|
363
360
|
}
|
|
@@ -591,11 +588,14 @@
|
|
|
591
588
|
background-color: #ffffff;
|
|
592
589
|
border-top: 1px solid #d0d7deb3;
|
|
593
590
|
}
|
|
594
|
-
|
|
595
|
-
.markdown-body table tr:nth-child(2n) {
|
|
591
|
+
.markdown-body .table .thead .tr {
|
|
596
592
|
background-color: #f6f8fa;
|
|
597
593
|
}
|
|
598
594
|
|
|
595
|
+
/* .markdown-body table tr:nth-child(2n) {
|
|
596
|
+
background-color: #f6f8fa;
|
|
597
|
+
} */
|
|
598
|
+
|
|
599
599
|
.markdown-body table img {
|
|
600
600
|
background-color: transparent;
|
|
601
601
|
}
|
|
@@ -1029,9 +1029,7 @@
|
|
|
1029
1029
|
}
|
|
1030
1030
|
|
|
1031
1031
|
.markdown-body .contains-task-list:hover .task-list-item-convert-container,
|
|
1032
|
-
.markdown-body
|
|
1033
|
-
.contains-task-list:focus-within
|
|
1034
|
-
.task-list-item-convert-container {
|
|
1032
|
+
.markdown-body .contains-task-list:focus-within .task-list-item-convert-container {
|
|
1035
1033
|
display: block;
|
|
1036
1034
|
width: auto;
|
|
1037
1035
|
height: 24px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
3
|
-
import { useEffect, useState, useCallback, forwardRef, useRef
|
|
3
|
+
import { useEffect, useState, useCallback, forwardRef, useRef } from 'react';
|
|
4
4
|
import MarkdownIt from 'markdown-it/dist/markdown-it.js';
|
|
5
5
|
import copy from 'markdown-it-code-copy';
|
|
6
6
|
import hljs from 'highlight.js';
|
|
@@ -11,6 +11,7 @@ import classNames from '../../utils/classnames';
|
|
|
11
11
|
import useDebouncedCallback from '../../utils/hooks/use-debounced-callback';
|
|
12
12
|
import { useImgTransform } from '../richTextView/useImgTransform';
|
|
13
13
|
import { getOnClick } from '../wd-unified-link/utils';
|
|
14
|
+
import { addCustomClassPlugin } from './addClass';
|
|
14
15
|
import './style';
|
|
15
16
|
export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options, className, style, id, events }, ref) {
|
|
16
17
|
const platform = usePlatform();
|
|
@@ -70,6 +71,7 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
70
71
|
},
|
|
71
72
|
...options,
|
|
72
73
|
});
|
|
74
|
+
md.use(addCustomClassPlugin);
|
|
73
75
|
md.use(copy);
|
|
74
76
|
onMarkdownReady(md);
|
|
75
77
|
}, [mdInstance, onMarkdownReady, destroy]), 500, {
|
|
@@ -97,8 +99,7 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
97
99
|
markdownRef.current.querySelectorAll('a').forEach((a) => {
|
|
98
100
|
const url = a.href;
|
|
99
101
|
// 若非同域 默认新页面打开
|
|
100
|
-
if (/https?:\/\//.test(url) &&
|
|
101
|
-
!url.startsWith(window.location.origin)) {
|
|
102
|
+
if (/https?:\/\//.test(url) && !url.startsWith(window.location.origin)) {
|
|
102
103
|
a.target = a.target || '_blank';
|
|
103
104
|
}
|
|
104
105
|
a.addEventListener('click', (e) => {
|
|
@@ -114,5 +115,5 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
114
115
|
updateMarkdownInstance: ({ markdownInstance }) => setMdInstance(markdownInstance),
|
|
115
116
|
};
|
|
116
117
|
}, [value, mdInstance], ref);
|
|
117
|
-
return (_jsx("div", { ref: markdownRef, className: cls, style: style, id: id, children: displayValue &&
|
|
118
|
+
return (_jsx("div", { ref: markdownRef, className: cls, style: style, id: id, children: displayValue && _jsx("div", { dangerouslySetInnerHTML: { __html: displayValue } }) }));
|
|
118
119
|
});
|
|
@@ -16,7 +16,7 @@ export declare const ExportFileModal: ({ fields, columns, isExportFileModalByApi
|
|
|
16
16
|
/**
|
|
17
17
|
* 表格导出方法
|
|
18
18
|
*/
|
|
19
|
-
export declare const exportHandle: ({ selectedKeys, records, enumOptions, datasourceTitle, columnSets, fields
|
|
19
|
+
export declare const exportHandle: ({ selectedKeys, records, enumOptions, datasourceTitle, columnSets, fields }: {
|
|
20
20
|
selectedKeys: any;
|
|
21
21
|
records: any;
|
|
22
22
|
enumOptions: any;
|
|
@@ -27,7 +27,7 @@ export declare const exportHandle: ({ selectedKeys, records, enumOptions, dataso
|
|
|
27
27
|
/**
|
|
28
28
|
* 后端表格导出方法
|
|
29
29
|
*/
|
|
30
|
-
export declare const exportHandleByApi: ({ isH5, setIsExportFileModalByApiVisible
|
|
30
|
+
export declare const exportHandleByApi: ({ isH5, setIsExportFileModalByApiVisible }: {
|
|
31
31
|
isH5: any;
|
|
32
32
|
setIsExportFileModalByApiVisible: any;
|
|
33
33
|
}) => void;
|
|
@@ -15,10 +15,10 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
|
|
|
15
15
|
if (field &&
|
|
16
16
|
(i === null || i === void 0 ? void 0 : i.isExport) &&
|
|
17
17
|
!(i === null || i === void 0 ? void 0 : i.isRelated) &&
|
|
18
|
-
(
|
|
19
|
-
(
|
|
20
|
-
(
|
|
21
|
-
(
|
|
18
|
+
(field === null || field === void 0 ? void 0 : field.format) !== 'many-many' &&
|
|
19
|
+
(field === null || field === void 0 ? void 0 : field.format) !== 'many-one' &&
|
|
20
|
+
(field === null || field === void 0 ? void 0 : field.format) !== 'one-many' &&
|
|
21
|
+
(field === null || field === void 0 ? void 0 : field.format) !== 'one-one') {
|
|
22
22
|
supportFields.push(field);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -36,10 +36,7 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
|
|
|
36
36
|
.filter((el) => {
|
|
37
37
|
const field = fields.find((i) => (i === null || i === void 0 ? void 0 : i.name) === (el === null || el === void 0 ? void 0 : el.key) && el.isRelated);
|
|
38
38
|
const format = field === null || field === void 0 ? void 0 : field.format;
|
|
39
|
-
return
|
|
40
|
-
el.isExport &&
|
|
41
|
-
format !== 'many-many' &&
|
|
42
|
-
format !== 'one-many');
|
|
39
|
+
return el.isRelated && el.isExport && format !== 'many-many' && format !== 'one-many';
|
|
43
40
|
})
|
|
44
41
|
.map((item) => {
|
|
45
42
|
return {
|
|
@@ -60,7 +57,7 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
|
|
|
60
57
|
/**
|
|
61
58
|
* 表格导出方法
|
|
62
59
|
*/
|
|
63
|
-
export const exportHandle = ({ selectedKeys, records, enumOptions, datasourceTitle, columnSets, fields
|
|
60
|
+
export const exportHandle = ({ selectedKeys, records, enumOptions, datasourceTitle, columnSets, fields }) => {
|
|
64
61
|
if (!selectedKeys.length) {
|
|
65
62
|
return alertErrorMessage({
|
|
66
63
|
message: '请选择需要导出的数据',
|
|
@@ -79,7 +76,7 @@ export const exportHandle = ({ selectedKeys, records, enumOptions, datasourceTit
|
|
|
79
76
|
/**
|
|
80
77
|
* 后端表格导出方法
|
|
81
78
|
*/
|
|
82
|
-
export const exportHandleByApi = ({ isH5, setIsExportFileModalByApiVisible
|
|
79
|
+
export const exportHandleByApi = ({ isH5, setIsExportFileModalByApiVisible }) => {
|
|
83
80
|
if (isH5) {
|
|
84
81
|
return alertErrorMessage({
|
|
85
82
|
message: '移动端暂不支持进行数据导出',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.7",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"description": "腾讯云微搭低代码组件库模板",
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@antv/g6": "^4.8.5",
|
|
88
|
-
"@cloudbase/weda-client": "^1.1.
|
|
88
|
+
"@cloudbase/weda-client": "^1.1.26",
|
|
89
89
|
"@codemirror/autocomplete": "^6.16.0",
|
|
90
90
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
91
91
|
"@codemirror/lang-json": "^6.0.1",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"@babel/preset-env": "^7.22.15",
|
|
148
148
|
"@babel/preset-react": "^7.22.15",
|
|
149
149
|
"@babel/preset-typescript": "^7.22.15",
|
|
150
|
-
"@cloudbase/cals": "^1.2.
|
|
150
|
+
"@cloudbase/cals": "^1.2.11",
|
|
151
151
|
"@cloudbase/lowcode-cli": "^0.22.1",
|
|
152
152
|
"@cloudbase/weda-cloud-sdk": "^1.0.97",
|
|
153
153
|
"@commitlint/cli": "^16.0.2",
|