@cloudbase/weda-ui 3.11.7 → 3.11.10

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.
@@ -88,8 +88,8 @@ export const Echart = forwardRef(function Echart(props, ref) {
88
88
  * 单击
89
89
  */
90
90
  const click = useCallback((...args) => {
91
- var _a;
92
- (_a = props.events) === null || _a === void 0 ? void 0 : _a.click(...args);
91
+ var _a, _b;
92
+ (_b = (_a = props.events) === null || _a === void 0 ? void 0 : _a.click) === null || _b === void 0 ? void 0 : _b.call(_a, ...args);
93
93
  }, [props.events]);
94
94
  /**
95
95
  * 双击
@@ -17,6 +17,7 @@ const formatWithRelation = [
17
17
  ...SINGLE_FOREIGN_FORMATS,
18
18
  'x-enum',
19
19
  'one-many',
20
+ 'many-many',
20
21
  ];
21
22
  export function isFormatWithRelation(format) {
22
23
  return formatWithRelation.includes(format);
@@ -86,7 +86,7 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
86
86
  const [editorHeight, setEditorHeight] = React.useState(0);
87
87
  const [syncedValue] = useSyncValue(xss(value, getWhitelist()));
88
88
  const [currentMap, setCurrentMap] = React.useState({});
89
- const [currentCursor, setCurrentCursor] = React.useState(0);
89
+ const [currentCursor, setCurrentCursor] = React.useState(undefined);
90
90
  const [toolbar, setToolbar] = React.useState(platform === 'h5' ? toolbarArrayH5.join(' ') : toolbarPC);
91
91
  const ref = React.useRef({});
92
92
  const editorDomRef = React.useRef(null);
@@ -158,14 +158,14 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
158
158
  loadEditorPromise = new Promise((resolve) => {
159
159
  const script = document.createElement('script');
160
160
  script.src =
161
- 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/richtext/3.9.1/exeditor3.min.js';
161
+ 'https://comp-public-replace-1303824488-cos.weda.tencent.com/richtext/3.9.1/exeditor3.min.js';
162
162
  script.onload = () => {
163
163
  resolve('');
164
164
  };
165
165
  document.body.appendChild(script);
166
166
  const link = document.createElement('link');
167
167
  link.setAttribute('rel', 'stylesheet');
168
- link.setAttribute('href', 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/richtext/3.9.1/exeditor3.min.css');
168
+ link.setAttribute('href', 'https://comp-public-replace-1303824488-cos.weda.tencent.com/richtext/3.9.1/exeditor3.min.css');
169
169
  const head = document.getElementsByTagName('head');
170
170
  if (head.length) {
171
171
  head[0].appendChild(link);
@@ -314,7 +314,9 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
314
314
  ref.current.editor.setHTML(tempValue);
315
315
  }
316
316
  window.setTimeout(() => {
317
- ref.current.editor.selection(currentCursor, currentCursor);
317
+ if (currentCursor) {
318
+ ref.current.editor.selection(currentCursor, currentCursor);
319
+ }
318
320
  }, 0);
319
321
  }
320
322
  }, [syncedValue, ref.current.editor]);
@@ -110,3 +110,7 @@
110
110
  .weda-RichTextView i {
111
111
  font-style: italic;
112
112
  }
113
+
114
+ .weda-RichTextView p {
115
+ min-height: 1em;
116
+ }
@@ -141,7 +141,7 @@ function SelectH5(props) {
141
141
  }, children: _jsx(OptionList, { onScrollBottom: onScrollBottom, options: customOptions, inputFocus: inputFocus, currentSelected: currentSelected, optionClick: optionClick, bottomTips: bottomTips }) }), footer] })) })] })] }));
142
142
  }
143
143
  export function SelectUI(props) {
144
- const { placeholder, size, disabled, onChange, onSearch, searchable, options, value, footer, overlayClassName, onOpen, onScrollBottom, tips, bottomTips, mode, format, readOnly, setAllOption, listHeight, listWidth, popupContainer, searchPlaceholder = '搜索选项', } = props;
144
+ const { placeholder, size, disabled, onChange, onSearch, searchable, options = [], value, footer, overlayClassName, onOpen, onScrollBottom, tips, bottomTips, mode, format, readOnly, setAllOption, listHeight, listWidth, popupContainer, searchPlaceholder = '搜索选项', } = props;
145
145
  const platform = usePlatform();
146
146
  const [currentOption] = useSyncValue((options === null || options === void 0 ? void 0 : options.map(({ label, value }) => ({ label, value }))) || [], isObjectEqual);
147
147
  // 更新option,从而更新最新的选项值
@@ -81,33 +81,33 @@ export const WdText = forwardRef(function WdText({ className, style, id, level:
81
81
  case 'title-1':
82
82
  return (_jsx("h1", { className: classNames(classes, className), style: inlineStyle, id: id,
83
83
  //@ts-expect-error contentEditable type def sucks
84
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
84
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
85
85
  case 'title-2':
86
86
  return (_jsx("h2", { className: classNames(classes, className), style: inlineStyle, id: id,
87
87
  //@ts-expect-error contentEditable type def sucks
88
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
88
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
89
89
  case 'title-3':
90
90
  return (_jsx("h3", { className: classNames(classes, className), style: inlineStyle, id: id,
91
91
  //@ts-expect-error contentEditable type def sucks
92
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
92
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
93
93
  case 'title-4':
94
94
  return (_jsx("h4", { className: classNames(classes, className), style: inlineStyle, id: id,
95
95
  //@ts-expect-error contentEditable type def sucks
96
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
96
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
97
97
  case 'title-5':
98
98
  return (_jsx("h5", { className: classNames(classes, className), style: inlineStyle, id: id,
99
99
  //@ts-expect-error contentEditable type def sucks
100
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
100
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
101
101
  case 'title-6':
102
102
  case 'title-7':
103
103
  case 'title-8':
104
104
  case 'title-9':
105
105
  return (_jsx("h6", { className: classNames(classes, className), style: inlineStyle, id: id,
106
106
  //@ts-expect-error contentEditable type def sucks
107
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
107
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
108
108
  default:
109
109
  return (_jsx("p", { className: classNames(classes, className), style: inlineStyle, id: id,
110
110
  //@ts-expect-error contentEditable type def sucks
111
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
111
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
112
112
  }
113
113
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.11.7",
3
+ "version": "3.11.10",
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.9",
88
+ "@cloudbase/weda-client": "^1.1.11",
89
89
  "@codemirror/autocomplete": "^6.16.0",
90
90
  "@codemirror/lang-javascript": "^6.2.2",
91
91
  "@codemirror/lang-json": "^6.0.1",
@@ -148,7 +148,7 @@
148
148
  "@babel/preset-react": "^7.22.15",
149
149
  "@babel/preset-typescript": "^7.22.15",
150
150
  "@cloudbase/cals": "^1.2.5",
151
- "@cloudbase/lowcode-cli": "^0.21.13",
151
+ "@cloudbase/lowcode-cli": "^0.21.14",
152
152
  "@cloudbase/weda-cloud-sdk": "^1.0.87",
153
153
  "@commitlint/cli": "^16.0.2",
154
154
  "@commitlint/config-conventional": "^17.7.0",