@cloudbase/weda-ui 3.20.6 → 3.21.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.
@@ -72,6 +72,7 @@ exeditor-toolbar-table-panel {
72
72
  .weda-richtext-container {
73
73
  z-index: 2 !important;
74
74
  height: 100%;
75
+ background-color: #fff;
75
76
  }
76
77
 
77
78
  .weda-richtext-container.ex-fullscreen {
@@ -108,9 +109,7 @@ exeditor-toolbar-table-panel {
108
109
  }
109
110
 
110
111
  .weda-richText.weda-richText-web-not-vertical > :last-child {
111
- width: calc(
112
- 100% - var(--wd-form-item-label-width) - var(--wd-form-item-label-mr)
113
- ) !important;
112
+ width: calc(100% - var(--wd-form-item-label-width) - var(--wd-form-item-label-mr)) !important;
114
113
  max-width: inherit;
115
114
  }
116
115
 
@@ -137,3 +136,239 @@ exeditor-link-modal {
137
136
  background-color: inherit;
138
137
  width: 100%;
139
138
  }
139
+
140
+ .exeditor-toolbar[data-theme='basic'] {
141
+ --exeditor-toolbar-color: var(--exeditor-basic-toolbar-color, #555);
142
+ display: flex;
143
+ flex-wrap: wrap;
144
+ align-items: center;
145
+ padding: var(--exeditor-toolbar-padding, 15px);
146
+ color: var(--exeditor-toolbar-color, #555);
147
+ background: var(--exeditor-toolbar-background, #fcfcfc);
148
+ }
149
+ .exeditor-toolbar[data-theme='basic'][data-in='popover'] {
150
+ box-sizing: border-box;
151
+ display: none;
152
+ position: absolute;
153
+ left: 0;
154
+ top: 0;
155
+ max-width: 100%;
156
+ padding: 5px;
157
+ border-radius: 4px;
158
+ box-shadow: 0 0 10px 5px rgb(0 0 0 / 6%);
159
+ }
160
+ .exeditor-toolbar--multiline[data-theme='basic'] {
161
+ flex-direction: column;
162
+ align-items: flex-start;
163
+ }
164
+ .exeditor-toolbar--multiline[data-theme='basic'] > .exeditor-toolbar__row {
165
+ display: flex;
166
+ flex-wrap: wrap;
167
+ align-items: center;
168
+ }
169
+ .exeditor-toolbar[data-theme='basic'] [data-toolbar-item-of] {
170
+ flex-basis: 0;
171
+ margin: 0 var(--exeditor-basic-toolbar-button-margin, 5px);
172
+ white-space: nowrap;
173
+ }
174
+
175
+ .ExEditor-basic::after {
176
+ content: '';
177
+ display: block;
178
+ clear: both;
179
+ }
180
+ .ExEditor-basic {
181
+ box-sizing: border-box;
182
+ min-height: var(--exeditor-editor-min-height, 100px);
183
+ background: var(--exeditor-editor-background, #fff);
184
+ padding: var(--exeditor-editor-padding, 20px);
185
+ outline: none;
186
+ white-space: pre-wrap;
187
+ --exeditor-hr-color: var(--exeditor-basic-hr-color, #e7e7e7);
188
+ --exeditor-link-color: var(--exeditor-basic-link-color, #0052ff);
189
+ --exeditor-selected-outline: var(--exeditor-basic-selected-outline, 2px solid #68cef8);
190
+ --exeditor-selected-background: var(--exeditor-basic-selected-background, rgba(24, 144, 255, 0.3));
191
+ --exeditor-selected-cell-background: var(--exeditor-basic-selected-cell-background, rgba(24, 144, 255, 0.15));
192
+ --exeditor-formula-vertical-align: var(--exeditor-basic-formula-vertical-align, middle);
193
+ }
194
+ .ExEditor-basic a:any-link {
195
+ color: var(--exeditor-link-color);
196
+ text-decoration: underline;
197
+ }
198
+ .ExEditor-basic h1 {
199
+ font-size: 2em;
200
+ }
201
+ .ExEditor-basic p {
202
+ line-height: 26px;
203
+ min-height: 1em;
204
+ }
205
+ .ExEditor-basic blockquote {
206
+ background: #00000008;
207
+ border-left: 6px solid #ccc;
208
+ margin: 1.5em 10px;
209
+ padding: 0.5em 10px;
210
+ }
211
+ .ExEditor-basic pre {
212
+ padding: 6px;
213
+ background: #efefef;
214
+ overflow: auto;
215
+ }
216
+ .ExEditor-basic p,
217
+ .ExEditor-basic pre {
218
+ margin-top: 15px;
219
+ margin-bottom: 15px;
220
+ }
221
+ .ExEditor-basic hr {
222
+ border-width: 2px 0 0 0;
223
+ border-style: solid;
224
+ border-color: var(--exeditor-hr-color);
225
+ margin-top: 1.5em;
226
+ margin-bottom: 1.5em;
227
+ }
228
+ .ExEditor-basic img[data-formula] {
229
+ vertical-align: var(--exeditor-formula-vertical-align);
230
+ }
231
+ .ExEditor-basic video {
232
+ display: block;
233
+ margin: 1em auto;
234
+ }
235
+ .ExEditor-basic video[data-inline] {
236
+ display: inline-block;
237
+ margin: 0;
238
+ }
239
+ .ExEditor-basic video:not([data-inline]) {
240
+ width: auto;
241
+ height: auto;
242
+ max-width: 100%;
243
+ }
244
+ .ExEditor-basic audio {
245
+ display: block;
246
+ margin: 1em auto;
247
+ }
248
+ .ExEditor-basic audio[data-inline] {
249
+ display: inline-block;
250
+ margin: 0 2px;
251
+ }
252
+ .ExEditor-basic.ProseMirror-focused .excore-selected-node:not(.no-outline) {
253
+ outline: var(--exeditor-selected-outline);
254
+ }
255
+ .ExEditor-basic.ProseMirror-focused .excore-in-selection {
256
+ background: var(--exeditor-selected-background);
257
+ box-shadow: 0 0 0 2px var(--exeditor-selected-background);
258
+ }
259
+ .ExEditor-basic .tableWrapper {
260
+ margin: 20px 0;
261
+ padding: 0;
262
+ overflow-x: auto;
263
+ }
264
+ .ExEditor-basic table {
265
+ table-layout: fixed;
266
+ min-width: fit-content;
267
+ border-collapse: collapse;
268
+ margin: 0;
269
+ overflow: hidden;
270
+ }
271
+ .ExEditor-basic table th,
272
+ .ExEditor-basic table td {
273
+ box-sizing: border-box;
274
+ position: relative;
275
+ min-width: 70px;
276
+ padding: 0px 5px;
277
+ border: 2px solid #dcdcdc;
278
+ vertical-align: top;
279
+ background-clip: padding-box;
280
+ }
281
+ .ExEditor-basic table th {
282
+ font-weight: bold;
283
+ background-color: #f3f3f3;
284
+ }
285
+ .ExEditor-basic table td {
286
+ background-color: white;
287
+ }
288
+ .ExEditor-basic table th > p,
289
+ .ExEditor-basic table td > p {
290
+ min-height: 1em;
291
+ }
292
+ .ExEditor-basic table .selectedCell::after {
293
+ z-index: 2;
294
+ position: absolute;
295
+ content: '';
296
+ left: 0;
297
+ right: 0;
298
+ top: 0;
299
+ bottom: 0;
300
+ background: var(--exeditor-selected-cell-background);
301
+ pointer-events: none;
302
+ }
303
+ .ExEditor-basic.resize-cursor {
304
+ cursor: col-resize;
305
+ }
306
+ .ExEditor-basic.resize-cursor.vert {
307
+ cursor: nw-resize;
308
+ cursor: row-resize;
309
+ }
310
+ .ExEditor-basic table .column-resize-handle {
311
+ position: absolute;
312
+ right: -2px;
313
+ top: 0;
314
+ bottom: -2px;
315
+ width: 4px;
316
+ background-color: #adf;
317
+ pointer-events: none;
318
+ }
319
+ .ExEditor-basic table .row-resize-handle {
320
+ position: absolute;
321
+ bottom: -2px;
322
+ left: 0;
323
+ right: 0;
324
+ height: 4px;
325
+ z-index: 20;
326
+ background-color: #adf;
327
+ pointer-events: none;
328
+ }
329
+
330
+ .ExEditor-basic ol {
331
+ --ol-start: 1;
332
+ --ol-list-style-type: decimal;
333
+ list-style-type: none;
334
+ counter-reset: olCounter calc(var(--ol-start, 1) - 1);
335
+ position: relative;
336
+ }
337
+ .ExEditor-basic ol > li > :first-child::before {
338
+ content: counter(olCounter, var(--ol-list-style-type)) '. ';
339
+ counter-increment: olCounter;
340
+ font-variant-numeric: tabular-nums;
341
+ position: absolute;
342
+ transform: translate(-100%, 0);
343
+ }
344
+
345
+ .ExEditor-basic ul {
346
+ --ul-list-style-type: circle;
347
+ list-style-type: none;
348
+ position: relative;
349
+ }
350
+ .ExEditor-basic ul.nonUnicode-list-style-type > li > :first-child::before {
351
+ content: var(--ul-list-style-type) ' ';
352
+ font-variant-numeric: tabular-nums;
353
+ position: absolute;
354
+ transform: translate(-100%, 0.05em) scale(0.5);
355
+ }
356
+ .ExEditor-basic ul.unicode-list-style-type > li > :first-child::before {
357
+ content: var(--ul-list-style-type) ' ';
358
+ font-variant-numeric: tabular-nums;
359
+ position: absolute;
360
+ transform: translate(-100%, 0) scale(0.8);
361
+ }
362
+
363
+ .ExEditor-basic ul[data-type='todo'] {
364
+ padding-left: calc(2em + 10px);
365
+ }
366
+ .ExEditor-basic ul[data-type='todo'] > li > :first-child::before {
367
+ content: '';
368
+ }
369
+ .ExEditor-basic ul[data-type='todo'] > li > input[type='checkbox'] {
370
+ position: absolute;
371
+ left: 1em;
372
+ margin-top: 6px;
373
+ margin-right: 10px;
374
+ }
@@ -1,24 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { CommonPropsType } from '../../types';
3
+ import type { DataType } from '../../../configs/components/swiper';
3
4
  import './style';
4
- export interface PropsType extends CommonPropsType {
5
- /**
6
- * 是否启用指示点
7
- */
8
- indicatorDots: boolean;
9
- /**
10
- * 是否自动切换
11
- */
12
- autoplay: boolean;
13
- /**
14
- * 当前索引值
15
- */
16
- current: number;
17
- interval: number;
18
- duration: number;
19
- circular: boolean;
20
- vertical: boolean;
21
- indicatorColor: string;
22
- indicatorActiveColor: string;
5
+ export interface SwiperPropsType extends CommonPropsType, DataType {
23
6
  }
24
- export default function Swiper({ children, className, style, autoplay, circular, vertical, indicatorDots, indicatorColor, indicatorActiveColor, duration, interval, current, events, id, }: PropsType): JSX.Element;
7
+ export default function Swiper({ children, className, style, autoplay, circular, vertical, indicatorDots, indicatorColor, indicatorActiveColor, duration, interval, current, events, id, loop, }: SwiperPropsType): JSX.Element;
@@ -8,7 +8,7 @@ import useDebouncedCallback from '../../utils/hooks/use-debounced-callback';
8
8
  import { emptyObject, noop } from '../../utils/constant';
9
9
  import './style';
10
10
  import { useSyncValue } from '../../utils/hooks/useSyncValue';
11
- export default function Swiper({ children, className, style, autoplay = true, circular = true, vertical = false, indicatorDots, indicatorColor = 'rgba(200, 200, 200, 0.9)', indicatorActiveColor = 'rgba(0, 0, 0, 0.9)', duration = 500, interval = 5000, current = 0, events = emptyObject, id, }) {
11
+ export default function Swiper({ children, className, style, autoplay = true, circular = true, vertical = false, indicatorDots, indicatorColor = 'rgba(200, 200, 200, 0.9)', indicatorActiveColor = 'rgba(0, 0, 0, 0.9)', duration = 500, interval = 5000, current = 0, events = emptyObject, id, loop = true, }) {
12
12
  const originChildrenRef = useRef(null);
13
13
  const [realChildren, setRealChildren] = useState(children);
14
14
  const itemCount = React.Children.count(realChildren);
@@ -18,12 +18,20 @@ export default function Swiper({ children, className, style, autoplay = true, ci
18
18
  const [height, setHeight] = useState(0);
19
19
  const { change = () => { } } = events;
20
20
  useEffect(() => {
21
+ /**
22
+ * Transforms DOM children elements into React elements by accessing their internal React fiber.
23
+ *
24
+ * This implementation detail function maps each child element to its corresponding React element
25
+ * by finding the React fiber instance attached to the DOM node and recreating the React element
26
+ * with its original type and props. The resulting React elements are stored in state via `setRealChildren`.
27
+ *
28
+ * Note: This relies on React's internal properties which may change between versions.
29
+ */
21
30
  const callback = () => {
22
31
  var _a;
23
32
  const realChildren = Array.from(((_a = originChildrenRef === null || originChildrenRef === void 0 ? void 0 : originChildrenRef.current) === null || _a === void 0 ? void 0 : _a.children) || []).map((elem) => {
24
33
  const reactFiberProp = Object.keys(elem).find((prop) => {
25
- return (prop.startsWith('__reactInternalInstance') ||
26
- prop.startsWith('__reactFiber'));
34
+ return prop.startsWith('__reactInternalInstance') || prop.startsWith('__reactFiber');
27
35
  });
28
36
  const reactFiber = elem[reactFiberProp];
29
37
  const reactElem = React.createElement(reactFiber.elementType, reactFiber.pendingProps);
@@ -66,10 +74,10 @@ export default function Swiper({ children, className, style, autoplay = true, ci
66
74
  });
67
75
  const setIndex = (index) => {
68
76
  if (index >= itemCount) {
69
- index = 0;
77
+ index = loop ? 0 : currentIndex;
70
78
  }
71
79
  if (index < 0) {
72
- index = itemCount - 1;
80
+ index = loop ? itemCount - 1 : currentIndex;
73
81
  }
74
82
  setCurrentIndex(index);
75
83
  };
@@ -89,9 +97,7 @@ export default function Swiper({ children, className, style, autoplay = true, ci
89
97
  // eslint-disable-next-line rulesdir/no-timer
90
98
  timeout = setTimeout(() => {
91
99
  setSwipeStyle({
92
- transform: vertical
93
- ? `translate3d(0, -0%, 0)`
94
- : `translate3d(-0%, 0, 0)`,
100
+ transform: vertical ? `translate3d(0, -0%, 0)` : `translate3d(-0%, 0, 0)`,
95
101
  transitionDuration: `${duration}ms`,
96
102
  transitionProperty: 'transform',
97
103
  });
@@ -106,16 +112,12 @@ export default function Swiper({ children, className, style, autoplay = true, ci
106
112
  if (to === length - 1 && cur === 0) {
107
113
  circular &&
108
114
  setSwipeStyle({
109
- transform: vertical
110
- ? `translate3d(0, -${to * 100}%, 0)`
111
- : `translate3d(-${to * 100}%, 0, 0)`,
115
+ transform: vertical ? `translate3d(0, -${to * 100}%, 0)` : `translate3d(-${to * 100}%, 0, 0)`,
112
116
  });
113
117
  // eslint-disable-next-line rulesdir/no-timer
114
118
  timeout = setTimeout(() => {
115
119
  setSwipeStyle({
116
- transform: vertical
117
- ? `translate3d(0, -${to * 100}%, 0)`
118
- : `translate3d(-${to * 100}%, 0, 0)`,
120
+ transform: vertical ? `translate3d(0, -${to * 100}%, 0)` : `translate3d(-${to * 100}%, 0, 0)`,
119
121
  transitionDuration: `${duration}ms`,
120
122
  });
121
123
  }, 50);
@@ -126,9 +128,7 @@ export default function Swiper({ children, className, style, autoplay = true, ci
126
128
  };
127
129
  }
128
130
  const style = {
129
- transform: vertical
130
- ? `translate3d(0, -${to * 100}%, 0)`
131
- : `translate3d(-${to * 100}%, 0, 0)`,
131
+ transform: vertical ? `translate3d(0, -${to * 100}%, 0)` : `translate3d(-${to * 100}%, 0, 0)`,
132
132
  };
133
133
  if (to !== cur) {
134
134
  style.transitionDuration = `${duration}ms`;
@@ -140,6 +140,8 @@ export default function Swiper({ children, className, style, autoplay = true, ci
140
140
  }
141
141
  };
142
142
  };
143
+ const showLeftBtn = loop || (!loop && currentIndex !== 0);
144
+ const showRightBtn = loop || (!loop && currentIndex + 1 !== itemCount);
143
145
  return (_jsxs("div", { className: classNames('g-swiper weda-ui', className, {
144
146
  vertical: vertical,
145
147
  }), style: { height: height ? height : 'auto', ...style }, ref: outerWrapRef, id: id, children: [_jsx("div", { ref: originChildrenRef, style: { display: 'none' }, children: children }), itemCount > 0 ? (
@@ -161,13 +163,13 @@ export default function Swiper({ children, className, style, autoplay = true, ci
161
163
  setIndex(i);
162
164
  e.preventDefault();
163
165
  }, "data-index": i }));
164
- }) })) : (false), _jsx("a", { href: "#", className: "g-swiper__turn-pre", onClick: (ev) => {
166
+ }) })) : (false), showLeftBtn && (_jsx("a", { href: "#", className: "g-swiper__turn-pre", onClick: (ev) => {
165
167
  ev.preventDefault();
166
168
  setIndex(currentIndex - 1);
167
- }, children: "\u4E0A\u4E00\u9875" }), _jsx("a", { href: "#", className: "g-swiper__turn-next", onClick: (ev) => {
169
+ }, children: "\u4E0A\u4E00\u9875" })), showRightBtn && (_jsx("a", { href: "#", className: "g-swiper__turn-next", onClick: (ev) => {
168
170
  ev.preventDefault();
169
171
  setIndex(currentIndex + 1);
170
- }, children: "\u4E0B\u4E00\u9875" })] }));
172
+ }, children: "\u4E0B\u4E00\u9875" }))] }));
171
173
  }
172
174
  const SwiperItem = ({ height, setHeight, children, currentIndex, index, useless }) => {
173
175
  const firstChildRef = useRef(null);
@@ -20,6 +20,7 @@ import { WdForm as FormUi } from './wd-form';
20
20
  import EmptyContent from '../statusContent';
21
21
  import { deepClone } from '../../utils/tool';
22
22
  import isObjectEqual from '../../utils/isObjectEqual';
23
+ import { convertMethodParam } from '../../utils/hooks/useFormLegacy';
23
24
  import '../style';
24
25
  import { getErrorObjectFromValidateResult } from './form-utils';
25
26
  import { isNil } from '../../utils/lodash';
@@ -392,7 +393,8 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
392
393
  };
393
394
  },
394
395
  submitParams,
395
- setValue(value, opts = { notMerge: false }) {
396
+ setValue(val, opts = { notMerge: false }) {
397
+ const value = convertMethodParam(val);
396
398
  // notMerge 默认false,表示与之前的表单值合并
397
399
  if (opts.notMerge) {
398
400
  setValueDebounce(value);
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useState, useMemo, useImperativeHandle, forwardRef, } from 'react';
2
+ import { useEffect, useState, useMemo, useImperativeHandle, forwardRef } from 'react';
3
3
  import { ConfigProvider } from 'tea-component';
4
4
  import { Table } from './../../components';
5
5
  import classNames from '../../../../utils/classnames';
@@ -126,9 +126,7 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
126
126
  if ((isTableLoading && !isH5) || isNoDataSourceBind) {
127
127
  return [];
128
128
  }
129
- if (isTableLoading &&
130
- isH5 &&
131
- (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) === _defaultPageIndex) {
129
+ if (isTableLoading && isH5 && (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) === _defaultPageIndex) {
132
130
  return [];
133
131
  }
134
132
  return tableData;
@@ -153,15 +151,7 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
153
151
  showRelationWithTag: false,
154
152
  });
155
153
  return baseColumns === null || baseColumns === void 0 ? void 0 : baseColumns.map((i) => ({ ...i, isSort: true }));
156
- }, [
157
- isNoDataSourceBind,
158
- fieldsLoading,
159
- fields,
160
- columnSets,
161
- fixedFront,
162
- fixedEnd,
163
- isH5,
164
- ]);
154
+ }, [isNoDataSourceBind, fieldsLoading, fields, columnSets, fixedFront, fixedEnd, isH5]);
165
155
  // 可排序字段
166
156
  const sortColumns = getSortColumns({ fields, columnSets: columns });
167
157
  // 事件属性
@@ -221,7 +211,7 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
221
211
  const renderTable = () => {
222
212
  return (_jsx(Table, { events: events, emptyText: emptyText, isH5: isH5, isNoDataSourceBind: isNoDataSourceBind, className: `${tableClassList} modal-table`, recordKey: recordKey, currentSize: tableHightSize, defaultPageIndex: defaultPageIndex, defaultPageSize: defaultPageSize, sortColumns: sortColumns, enablePagination: !isH5 && enablePagination, columnSelectType: columnSelectType, columns: columns, records: tableRecords, sort: queryParams.sort, selectedKeys: [], onSelectChange: () => { }, isError: false, isLoading: isTableLoading, rowColor: rowColor, queryParams: queryParams, total: total, setColumns: undefined, onQueryChange: (query) => {
223
213
  setQueryParams({ ...queryParams, ...query });
224
- }, rowClick: () => { }, cellClick: () => { }, errorObj: errorObj }));
214
+ }, rowClick: () => { }, cellClick: () => { }, errorObj: errorObj, bottomTip: undefined }));
225
215
  };
226
216
  return (_jsx(ConfigProvider, { classPrefix: classPrefix, children: _jsx(EnumHoc, { fields: authFields, children: _jsx("div", { className: classNames(wrapClassList, className), style: style, id: id, children: renderTable() }) }) }));
227
217
  });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare const BaseTableCom: ({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, }: {
2
+ export declare const BaseTableCom: ({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, bottomTip, enableBottomTipSlot, }: {
3
3
  events: any;
4
4
  recordKey: any;
5
5
  className: any;
@@ -28,8 +28,10 @@ export declare const BaseTableCom: ({ events, recordKey, className, columns, set
28
28
  isH5: any;
29
29
  emptyText: any;
30
30
  __innerSlot?: React.ReactNode;
31
+ bottomTip: any;
32
+ enableBottomTipSlot?: boolean;
31
33
  }) => JSX.Element;
32
- export declare const BaseTable: React.MemoExoticComponent<({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, }: {
34
+ export declare const BaseTable: React.MemoExoticComponent<({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, bottomTip, enableBottomTipSlot, }: {
33
35
  events: any;
34
36
  recordKey: any;
35
37
  className: any;
@@ -58,4 +60,6 @@ export declare const BaseTable: React.MemoExoticComponent<({ events, recordKey,
58
60
  isH5: any;
59
61
  emptyText: any;
60
62
  __innerSlot?: React.ReactNode;
63
+ bottomTip: any;
64
+ enableBottomTipSlot?: boolean;
61
65
  }) => JSX.Element>;
@@ -34,7 +34,7 @@ const renderStatus = ({ isH5, status, isNoDataSourceBind, _emptyText, errorObj,
34
34
  // eslint-disable-next-line complexity
35
35
  export const BaseTableCom = ({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total = defaultTotal,
36
36
  // refreshTable,
37
- onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot = (_jsx(_Fragment, {})), }) => {
37
+ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot = (_jsx(_Fragment, {})), bottomTip, enableBottomTipSlot = false, }) => {
38
38
  var _a;
39
39
  const inEditor = isInIde();
40
40
  const tableRef = useRef(null);
@@ -162,16 +162,19 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
162
162
  const showLoadingBottomTip = isLoading && (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) !== pageIndexSpan;
163
163
  const showAllDataBottomTip = (records === null || records === void 0 ? void 0 : records.length) === total && !isLoading && (records === null || records === void 0 ? void 0 : records.length) > miniPageSize;
164
164
  const bottomTipCompRender = () => {
165
- if (!isH5) {
166
- return false;
165
+ const shouldShowBottomTip = enableBottomTipSlot && !showStatus;
166
+ if (isH5) {
167
+ if (showLoadingBottomTip) {
168
+ return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx("div", { className: `${classPrefix}-h5-table-loading-wrap ${classPrefix}-h5-table-loading-${currentSize}`, children: _jsx(LoadingTip, { className: "adaptation-table__loading", loadingText: '数据加载中,请稍候...' }) }) }));
169
+ }
170
+ if (!enableBottomTipSlot && showAllDataBottomTip) {
171
+ return (_jsx("div", { className: `${classPrefix}-h5-table-loading-wrap ${classPrefix}-h5-table-loading-${currentSize}`, children: _jsx("span", { children: "\u5DF2\u52A0\u8F7D\u5168\u90E8\u6570\u636E" }) }));
172
+ }
167
173
  }
168
- if (showLoadingBottomTip) {
169
- return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx("div", { className: `${classPrefix}-h5-table-loading-wrap ${classPrefix}-h5-table-loading-${currentSize}`, children: _jsx(LoadingTip, { className: "adaptation-table__loading", loadingText: '数据加载中,请稍候...' }) }) }));
174
+ if (shouldShowBottomTip) {
175
+ return _jsx(_Fragment, { children: bottomTip });
170
176
  }
171
- if (showAllDataBottomTip) {
172
- return (_jsx("div", { className: `${classPrefix}-h5-table-loading-wrap ${classPrefix}-h5-table-loading-${currentSize}`, children: _jsx("span", { children: "\u5DF2\u52A0\u8F7D\u5168\u90E8\u6570\u636E" }) }));
173
- }
174
- return false;
177
+ return null;
175
178
  };
176
179
  const resetPadding = () => {
177
180
  var _a, _b;
@@ -15,6 +15,7 @@ export interface WdTableProps extends CommonPropsType, DataType {
15
15
  isMock?: boolean;
16
16
  multipleSelect: boolean;
17
17
  mockEmpty?: boolean;
18
+ row__bottom__slot?: React.ReactNode;
18
19
  __innerSlot?: React.ReactNode;
19
20
  }
20
21
  type TCompRef = {
@@ -74,7 +74,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
74
74
  isSupportMultipleSort = false, // 是否支持多字段排序
75
75
  sorter, // 排序规则
76
76
  __innerSlot, enableRelationTag = true, // 关联关系字段是否开启关联标签
77
- ...props } = tableProps;
77
+ enableBottomTipSlot = false, row__bottom__slot, ...props } = tableProps;
78
78
  const wList = convertWhere(props, supportManyRelated); // 查询参数
79
79
  const { classPrefix } = useConfig();
80
80
  const platform = usePlatform();
@@ -735,7 +735,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
735
735
  setOpenMobileFilter(true);
736
736
  }, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination }) }))] })), isH5 && (enablePagination || enableRefreshBtn || enableTableHeightSizeBtn || hasFilterButton) && (_jsx(ToolBar, { hasFilterButton: hasFilterButton, total: total, refreshTable: onRefreshBtnClick, setTableHightSize: setTableHightSize, currentSize: tableHightSize, setOpenMobileFilter: () => {
737
737
  setOpenMobileFilter(true);
738
- }, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination })), _jsx(Table, { events: events, emptyText: emptyText, isH5: isH5, isNoDataSourceBind: isNoDataSourceBind, className: tableClassList, recordKey: recordKey, currentSize: tableHightSize, defaultPageIndex: defaultPageIndex, defaultPageSize: defaultPageSize, sortColumns: sortColumns, enablePagination: !isH5 && enablePagination, columnSelectType: columnSelectType, columns: columns, setColumns: setColumns, records: tableRecords, sort: queryParams.sort, selectedKeys: selectedKeys, onSelectChange: onSelectChange, isLoading: isTableLoading, rowColor: rowColor, queryParams: queryParams, total: total, onQueryChange: onQueryChange, rowClick: rowClick, cellClick: cellClick, isError: errorStatus, errorObj: errorMsg, __innerSlot: __innerSlot }), isH5 && enableGlobalButton && !isNoDataSourceBind && (_jsx("div", { className: `${classPrefix}-h5-table-wrap-footer`, children: _jsx(GlobalButton, { classPrefix: classPrefix, slots: slots === null || slots === void 0 ? void 0 : slots.globalButton }) }))] }), _jsx(ImportFileModal, { columnSets: columnSets, dbName: dbName, datasourceTitle: datasourceTitle, fields: fields, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, isImportFileModalByApiVisible: isImportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, refresh: refreshTable, supportManyRelated: supportManyRelated }), _jsx(ExportFileModal, { whereList: wList, fields: fields, columns: mapColumKey(columns), isExportFileModalByApiVisible: isExportFileModalByApiVisible, selectedKeys: selectedKeys, dbName: dbName, query: query, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, supportManyRelated: supportManyRelated }), _jsx(InOrOutRecordModal, { dbName: dbName, isInOrOutRecordModalVisible: isInOrOutRecordModalVisible, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible }), isH5 && (_jsx(Modal, { overlayClassName: `${classPrefix}-h5-table-overlay`, className: `${classPrefix}-h5-table-option-modal-wrap`, disableCloseIcon: true, title: "\u64CD\u4F5C", visible: isMobileOptionVisible, outerRef: modalRef, events: {
738
+ }, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination })), _jsx(Table, { events: events, emptyText: emptyText, isH5: isH5, isNoDataSourceBind: isNoDataSourceBind, className: tableClassList, recordKey: recordKey, currentSize: tableHightSize, defaultPageIndex: defaultPageIndex, defaultPageSize: defaultPageSize, sortColumns: sortColumns, enablePagination: !isH5 && enablePagination, columnSelectType: columnSelectType, columns: columns, setColumns: setColumns, records: tableRecords, sort: queryParams.sort, selectedKeys: selectedKeys, onSelectChange: onSelectChange, isLoading: isTableLoading, rowColor: rowColor, queryParams: queryParams, total: total, onQueryChange: onQueryChange, rowClick: rowClick, cellClick: cellClick, isError: errorStatus, errorObj: errorMsg, __innerSlot: __innerSlot, bottomTip: row__bottom__slot, enableBottomTipSlot: enableBottomTipSlot }), isH5 && enableGlobalButton && !isNoDataSourceBind && (_jsx("div", { className: `${classPrefix}-h5-table-wrap-footer`, children: _jsx(GlobalButton, { classPrefix: classPrefix, slots: slots === null || slots === void 0 ? void 0 : slots.globalButton }) }))] }), _jsx(ImportFileModal, { columnSets: columnSets, dbName: dbName, datasourceTitle: datasourceTitle, fields: fields, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, isImportFileModalByApiVisible: isImportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, refresh: refreshTable, supportManyRelated: supportManyRelated }), _jsx(ExportFileModal, { whereList: wList, fields: fields, columns: mapColumKey(columns), isExportFileModalByApiVisible: isExportFileModalByApiVisible, selectedKeys: selectedKeys, dbName: dbName, query: query, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, supportManyRelated: supportManyRelated }), _jsx(InOrOutRecordModal, { dbName: dbName, isInOrOutRecordModalVisible: isInOrOutRecordModalVisible, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible }), isH5 && (_jsx(Modal, { overlayClassName: `${classPrefix}-h5-table-overlay`, className: `${classPrefix}-h5-table-option-modal-wrap`, disableCloseIcon: true, title: "\u64CD\u4F5C", visible: isMobileOptionVisible, outerRef: modalRef, events: {
739
739
  close: () => {
740
740
  setIsMobileOptionVisible(false);
741
741
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.20.6",
3
+ "version": "3.21.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",