@cloudbase/weda-ui 3.5.1 → 3.5.2

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.
Files changed (228) hide show
  1. package/README.md +3 -0
  2. package/dist/configs/components/button.d.ts +12 -12
  3. package/dist/configs/components/calendar.d.ts +26 -0
  4. package/dist/configs/components/calendar.js +80 -0
  5. package/dist/configs/components/carousel.json +1 -4
  6. package/dist/configs/components/chart/line.d.ts +28 -28
  7. package/dist/configs/components/common/form-input-required.d.ts +1 -1
  8. package/dist/configs/components/container.d.ts +1 -1
  9. package/dist/configs/components/customer-service.d.ts +10 -34
  10. package/dist/configs/components/customer-service.js +91 -92
  11. package/dist/configs/components/dataView.d.ts +21 -3
  12. package/dist/configs/components/dataView.js +165 -16
  13. package/dist/configs/components/echart.d.ts +4 -4
  14. package/dist/configs/components/form-checkbox.d.ts +18 -18
  15. package/dist/configs/components/form-checkbox.js +0 -4
  16. package/dist/configs/components/form-date.d.ts +14 -14
  17. package/dist/configs/components/form-date.js +0 -4
  18. package/dist/configs/components/form-depart-tree-select.d.ts +17 -14
  19. package/dist/configs/components/form-depart-tree-select.js +1 -4
  20. package/dist/configs/components/form-email.d.ts +10 -10
  21. package/dist/configs/components/form-email.js +0 -4
  22. package/dist/configs/components/form-image-uploader.d.ts +11 -8
  23. package/dist/configs/components/form-image-uploader.js +1 -4
  24. package/dist/configs/components/form-input.d.ts +16 -16
  25. package/dist/configs/components/form-input.js +0 -10
  26. package/dist/configs/components/form-location.d.ts +21 -12
  27. package/dist/configs/components/form-location.js +1 -4
  28. package/dist/configs/components/form-multi-region.d.ts +13 -10
  29. package/dist/configs/components/form-multi-region.js +1 -4
  30. package/dist/configs/components/form-phone.d.ts +10 -10
  31. package/dist/configs/components/form-phone.js +0 -4
  32. package/dist/configs/components/form-radio.d.ts +18 -18
  33. package/dist/configs/components/form-radio.js +0 -4
  34. package/dist/configs/components/form-region.d.ts +12 -12
  35. package/dist/configs/components/form-region.js +0 -4
  36. package/dist/configs/components/form-rich-text.d.ts +11 -8
  37. package/dist/configs/components/form-rich-text.js +1 -4
  38. package/dist/configs/components/form-select-multiple.d.ts +27 -24
  39. package/dist/configs/components/form-select-multiple.js +1 -4
  40. package/dist/configs/components/form-select.d.ts +27 -24
  41. package/dist/configs/components/form-select.js +1 -4
  42. package/dist/configs/components/form-switch.d.ts +6 -6
  43. package/dist/configs/components/form-switch.js +0 -4
  44. package/dist/configs/components/form-text-area.d.ts +10 -10
  45. package/dist/configs/components/form-text-area.js +0 -4
  46. package/dist/configs/components/form-time.d.ts +17 -14
  47. package/dist/configs/components/form-time.js +1 -4
  48. package/dist/configs/components/form-upload-file.d.ts +13 -10
  49. package/dist/configs/components/form-upload-file.js +1 -4
  50. package/dist/configs/components/form-url.d.ts +10 -10
  51. package/dist/configs/components/form-url.js +0 -4
  52. package/dist/configs/components/form-user-tree-select.d.ts +19 -16
  53. package/dist/configs/components/form-user-tree-select.js +1 -4
  54. package/dist/configs/components/formdetail.json +0 -4
  55. package/dist/configs/components/grid/col.d.ts +2 -4
  56. package/dist/configs/components/grid/grid.d.ts +2 -4
  57. package/dist/configs/components/grid/row.d.ts +2 -3
  58. package/dist/configs/components/image.d.ts +4 -4
  59. package/dist/configs/components/link.d.ts +8 -8
  60. package/dist/configs/components/listView.d.ts +78 -33
  61. package/dist/configs/components/listView.js +258 -51
  62. package/dist/configs/components/lottery.d.ts +67 -0
  63. package/dist/configs/components/lottery.js +178 -0
  64. package/dist/configs/components/modal.d.ts +2 -2
  65. package/dist/configs/components/qr_code.d.ts +11 -11
  66. package/dist/configs/components/repeater.d.ts +10 -91
  67. package/dist/configs/components/repeater.js +75 -87
  68. package/dist/configs/components/tabs.d.ts +4 -4
  69. package/dist/configs/components/text.d.ts +2 -2
  70. package/dist/configs/components/wd-bubble.d.ts +3 -8
  71. package/dist/configs/components/wd-button.d.ts +22 -34
  72. package/dist/configs/components/wd-card.d.ts +10 -10
  73. package/dist/configs/components/wd-card.js +10 -5
  74. package/dist/configs/components/wd-checkbox.d.ts +36 -81
  75. package/dist/configs/components/wd-date-range.d.ts +87 -131
  76. package/dist/configs/components/wd-date.d.ts +88 -132
  77. package/dist/configs/components/wd-date.js +1 -1
  78. package/dist/configs/components/wd-divider.d.ts +2 -2
  79. package/dist/configs/components/wd-form-detail.d.ts +9 -9
  80. package/dist/configs/components/wd-form.d.ts +54 -82
  81. package/dist/configs/components/wd-form.js +1 -1
  82. package/dist/configs/components/wd-icon.d.ts +8 -9
  83. package/dist/configs/components/wd-image-upload.d.ts +5 -5
  84. package/dist/configs/components/wd-image.d.ts +8 -12
  85. package/dist/configs/components/wd-input-email.d.ts +88 -156
  86. package/dist/configs/components/wd-input-number.d.ts +38 -179
  87. package/dist/configs/components/wd-input-number.js +1 -1
  88. package/dist/configs/components/wd-input-phone.d.ts +86 -156
  89. package/dist/configs/components/wd-input-url.d.ts +88 -156
  90. package/dist/configs/components/wd-input.d.ts +120 -164
  91. package/dist/configs/components/wd-layout.d.ts +1 -5
  92. package/dist/configs/components/wd-link.d.ts +14 -26
  93. package/dist/configs/components/wd-modal.d.ts +12 -8
  94. package/dist/configs/components/wd-modal.js +14 -14
  95. package/dist/configs/components/wd-official-account.d.ts +3 -5
  96. package/dist/configs/components/wd-official-account.js +3 -5
  97. package/dist/configs/components/wd-radio.d.ts +35 -80
  98. package/dist/configs/components/wd-switch.d.ts +21 -67
  99. package/dist/configs/components/wd-table.d.ts +95 -132
  100. package/dist/configs/components/wd-table.js +61 -17
  101. package/dist/configs/components/wd-text.d.ts +8 -8
  102. package/dist/configs/components/wd-textarea.d.ts +64 -110
  103. package/dist/configs/components/wd-time.d.ts +89 -133
  104. package/dist/configs/components/wd-tree.d.ts +243 -281
  105. package/dist/configs/components/wd-tree.js +1 -1
  106. package/dist/configs/components/web-view.d.ts +30 -10
  107. package/dist/configs/components/web-view.js +34 -33
  108. package/dist/configs/components/wedaVideo.d.ts +30 -0
  109. package/dist/configs/components/wedaVideo.js +98 -0
  110. package/dist/configs/components/wxOpenApi/phone.d.ts +6 -6
  111. package/dist/configs/components/wxOpenApi/phoneCode.d.ts +6 -62
  112. package/dist/configs/components/wxOpenApi/phoneCode.js +62 -70
  113. package/dist/configs/components/wxOpenApi/share.d.ts +12 -12
  114. package/dist/configs/components/wxOpenApi/userInfo.d.ts +7 -7
  115. package/dist/configs/index.d.ts +2515 -4367
  116. package/dist/configs/index.js +3 -3
  117. package/dist/configs/type-utils/error.d.ts +3 -3
  118. package/dist/configs/type-utils/index.d.ts +6 -6
  119. package/dist/configs/type-utils/index.js +2 -5
  120. package/dist/configs/type-utils/type-form.d.ts +95 -101
  121. package/dist/index.js +1 -1
  122. package/dist/style/index.scss +1 -1
  123. package/dist/web/components/chart/common/echarts.js +0 -1
  124. package/dist/web/components/customer-service/customer-service.js +1 -1
  125. package/dist/web/components/dataView/index.js +1 -1
  126. package/dist/web/components/echart/echart.js +22 -6
  127. package/dist/web/components/flow/common/components/index.js +1 -0
  128. package/dist/web/components/flow/common/hooks/index.js +1 -0
  129. package/dist/web/components/flow/common/index.js +1 -0
  130. package/dist/web/components/flow/modules/operations/components/index.js +1 -0
  131. package/dist/web/components/flow/modules/operations/components/user-select/index.js +1 -0
  132. package/dist/web/components/flow/modules/operations/config/index.js +1 -0
  133. package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/index.js +1 -0
  134. package/dist/web/components/flow/process/constants.js +1 -3
  135. package/dist/web/components/flow-graph/graph.js +0 -1
  136. package/dist/web/components/form/checkbox/index.js +2 -2
  137. package/dist/web/components/form/enumSelect/MultipleSelect.js +1 -1
  138. package/dist/web/components/form/enumSelect/NormalSelect.js +1 -1
  139. package/dist/web/components/form/input/index.js +1 -1
  140. package/dist/web/components/form/location/components/LocationPC/location.PC.js +2 -2
  141. package/dist/web/components/form/radio/index.js +1 -1
  142. package/dist/web/components/form/select/dropdown-select/h5.js +5 -5
  143. package/dist/web/components/form/select/dropdown-select/pc.js +25 -28
  144. package/dist/web/components/form/select/dropdown-select/ui.d.ts +1 -1
  145. package/dist/web/components/form/select/dropdown-select/ui.js +5 -5
  146. package/dist/web/components/form/select/h5.js +10 -6
  147. package/dist/web/components/form/select/index.js +4 -2
  148. package/dist/web/components/form/selectMultiple/h5.js +1 -1
  149. package/dist/web/components/form/selectMultiple/index.js +1 -1
  150. package/dist/web/components/form/uploader/index.js +0 -1
  151. package/dist/web/components/form/uploader/uploader.pc.js +0 -1
  152. package/dist/web/components/form/uploaderFile/index.js +0 -1
  153. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +6 -4
  154. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +6 -4
  155. package/dist/web/components/form/userOrgSelect/common/fetch-data-service.d.ts +1 -1
  156. package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +19 -3
  157. package/dist/web/components/form/userOrgSelect/common/types.d.ts +2 -1
  158. package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +1 -3
  159. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.d.ts +1 -1
  160. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +2 -2
  161. package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +0 -1
  162. package/dist/web/components/form-date/index.d.ts +1 -1
  163. package/dist/web/components/form-depart-tree-select/index.d.ts +1 -1
  164. package/dist/web/components/form-email/index.d.ts +2 -2
  165. package/dist/web/components/form-input/index.d.ts +2 -2
  166. package/dist/web/components/form-input-hooks/index.js +12 -13
  167. package/dist/web/components/form-multi-region/index.d.ts +1 -1
  168. package/dist/web/components/form-phone/index.d.ts +1 -1
  169. package/dist/web/components/form-region/index.d.ts +1 -1
  170. package/dist/web/components/form-select/index.d.ts +1 -1
  171. package/dist/web/components/form-select-multiple/index.d.ts +1 -1
  172. package/dist/web/components/form-text-area/index.d.ts +2 -2
  173. package/dist/web/components/form-time/index.d.ts +1 -1
  174. package/dist/web/components/form-url/index.d.ts +2 -2
  175. package/dist/web/components/form-user-tree-select/index.d.ts +1 -1
  176. package/dist/web/components/form-user-tree-select/index.js +3 -2
  177. package/dist/web/components/listView/index.js +81 -14
  178. package/dist/web/components/listView/interface.d.ts +7 -1
  179. package/dist/web/components/lottery/index.d.ts +22 -14
  180. package/dist/web/components/lottery/index.js +1 -2
  181. package/dist/web/components/navigationBar/horizontalMenu.js +0 -1
  182. package/dist/web/components/phone/index.js +1 -1
  183. package/dist/web/components/richText/index.js +3 -2
  184. package/dist/web/components/share/index.js +1 -1
  185. package/dist/web/components/table/UserDepartment/utils.js +0 -2
  186. package/dist/web/components/wd-card/wd-card.js +1 -1
  187. package/dist/web/components/wd-checkbox-list/checkboxList.js +1 -1
  188. package/dist/web/components/wd-date/elements/Calendar.h5.js +1 -2
  189. package/dist/web/components/wd-department-select/h5.js +0 -1
  190. package/dist/web/components/wd-form/hooks/use-remote-value.js +20 -8
  191. package/dist/web/components/wd-form/index.d.ts +7 -7
  192. package/dist/web/components/wd-form/index.js +12 -10
  193. package/dist/web/components/wd-input/wd-input.d.ts +43 -43
  194. package/dist/web/components/wd-input-email/wd-input-email.d.ts +39 -39
  195. package/dist/web/components/wd-input-number/number.js +0 -1
  196. package/dist/web/components/wd-input-number/wd-input-number.js +10 -6
  197. package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +43 -43
  198. package/dist/web/components/wd-input-url/wd-input-url.d.ts +39 -39
  199. package/dist/web/components/wd-member-select/h5.js +0 -1
  200. package/dist/web/components/wd-modal/wd-modal.js +8 -3
  201. package/dist/web/components/wd-official-account/index.js +1 -1
  202. package/dist/web/components/wd-radio-list/wd-radio-list.js +2 -2
  203. package/dist/web/components/wd-table/components/FieldRender/UserDepartment/utils.js +0 -2
  204. package/dist/web/components/wd-table/components/FieldRender/index.d.ts +1 -1
  205. package/dist/web/components/wd-table/components/FieldRender/index.js +9 -6
  206. package/dist/web/components/wd-table/components/ModalTable/index.js +0 -3
  207. package/dist/web/components/wd-table/components/Table/index.js +4 -0
  208. package/dist/web/components/wd-table/hooks/useAuthFields.d.ts +1 -1
  209. package/dist/web/components/wd-table/hooks/useAuthFields.js +18 -4
  210. package/dist/web/components/wd-table/utils/index.js +5 -4
  211. package/dist/web/components/wd-table/wd-table.js +41 -19
  212. package/dist/web/components/wd-tree/utils.js +0 -2
  213. package/dist/web/components/wd-tree/wd-tree.js +0 -1
  214. package/dist/web/components/wd-upload-image/wd-upload-image.js +0 -1
  215. package/dist/web/components/web-view/web-view.d.ts +23 -6
  216. package/dist/web/index.js +1 -0
  217. package/dist/web/utils/constant.js +0 -1
  218. package/dist/web/utils/hooks/useFormLegacy.d.ts +1 -1
  219. package/dist/web/utils/hooks/useFormLegacy.js +9 -3
  220. package/dist/web/utils/moment.js +1 -3
  221. package/dist/web/utils/platform.js +0 -3
  222. package/dist/web/utils/widget-api/index.d.ts +1 -1
  223. package/dist/web/utils/widget-api/index.js +19 -22
  224. package/dist/web/weda-ui.css +6 -0
  225. package/package.json +13 -6
  226. package/dist/configs/components/calendar.json +0 -83
  227. package/dist/configs/components/lottery.json +0 -166
  228. package/dist/configs/components/wedaVideo.json +0 -101
@@ -84,6 +84,8 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
84
84
  const isExpression = dataSourceType === DataSourceType.Expression;
85
85
  // 数据源类型是否是模型
86
86
  const isModel = dataSourceType === DataSourceType.DataModel;
87
+ // 数据源类型是否是apis
88
+ const isApis = dataSourceType === DataSourceType.CustomConnector;
87
89
  const { enabledFieldNames, isNewData, selectedViewIds } = bindMetadata;
88
90
  const datasource = isModel
89
91
  ? bindMetadata.datasource
@@ -114,6 +116,10 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
114
116
  // 移动端操作按钮弹窗
115
117
  const [isMobileOptionVisible, setIsMobileOptionVisible] = useState(false);
116
118
  const modalRef = useRef(null);
119
+ const dataRef = useRef({
120
+ dataSourceData: [],
121
+ tableRecords: [],
122
+ });
117
123
  const { enumOptions } = useEnumContext();
118
124
  const dataSourceAPI = useMemo(() => new DataSource(dbName), [dbName]); // datasource 方法-模型
119
125
  // 插槽属性
@@ -126,8 +132,8 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
126
132
  // 行点击出参
127
133
  const [rowData, setRowData] = useState({});
128
134
  // 搜索和分页参数
129
- let initPageIndex = isModel ? defaultPageIndex : connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.pageNo;
130
- let initPageSize = isModel ? defaultPageSize : connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.pageSize;
135
+ let initPageIndex = isModel || isExpression ? defaultPageIndex : connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.pageNo;
136
+ let initPageSize = isModel || isExpression ? defaultPageSize : connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.pageSize;
131
137
  initPageIndex = parseInt(initPageIndex);
132
138
  initPageSize = parseInt(initPageSize);
133
139
  const [queryParams, setQueryParams] = useState({
@@ -139,7 +145,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
139
145
  orderType,
140
146
  });
141
147
  // 过滤权限字段
142
- const { authFields, fieldsLoading } = useAuthFields(dbName, dbFieldNames, isNewData, isModel, connectorMethod, isNoDataSourceBind);
148
+ const { authFields, fieldsLoading, isError: fieldsError, } = useAuthFields(dbName, dbFieldNames, isNewData, isModel, connectorMethod, isNoDataSourceBind, isExpression, isApis);
143
149
  // 视图
144
150
  const { viewFieldsData, viewFields, viewLoading } = useViewFields({
145
151
  selectedView,
@@ -170,7 +176,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
170
176
  if (isMock || (isInIde() && isNoDataSourceBind)) {
171
177
  return Mock.columns;
172
178
  }
173
- if (fieldsLoading || isNoDataSourceBind) {
179
+ if (isNoDataSourceBind || (!isExpression && fieldsLoading)) {
174
180
  return [];
175
181
  }
176
182
  let baseColumns = getTableColumns({
@@ -221,6 +227,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
221
227
  }, [
222
228
  isMock,
223
229
  isNoDataSourceBind,
230
+ isExpression,
224
231
  fieldsLoading,
225
232
  fields,
226
233
  columnSets,
@@ -277,13 +284,16 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
277
284
  }
278
285
  };
279
286
  // 1.绑定数据源时请求返回的联合加载状态2.绑定表达式时,无加载状态
280
- const isTableLoading = isExpression
281
- ? false
282
- : !isNoDataSourceBind &&
283
- (tableLoading ||
284
- fieldsLoading ||
285
- !fields.length ||
286
- (viewLoading && isViewTable));
287
+ const getLoadingStatus = () => {
288
+ if (isExpression || isNoDataSourceBind) {
289
+ return false;
290
+ }
291
+ if (isModel) {
292
+ return tableLoading || fieldsLoading || (viewLoading && isViewTable);
293
+ }
294
+ return tableLoading || fieldsLoading;
295
+ };
296
+ const isTableLoading = getLoadingStatus();
287
297
  // 表格数据
288
298
  const mapTableData = () => {
289
299
  if (isMock || (isInIde() && isNoDataSourceBind)) {
@@ -318,6 +328,17 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
318
328
  setSelectedKeys([]);
319
329
  setSelectedRecords([]);
320
330
  }, [_recordKey]);
331
+ useEffect(() => {
332
+ var _a, _b;
333
+ if (isExpression &&
334
+ Array.isArray(dataSourceData) &&
335
+ !isObjectEqual((_a = dataRef === null || dataRef === void 0 ? void 0 : dataRef.current) === null || _a === void 0 ? void 0 : _a.dataSourceData, dataSourceData)) {
336
+ dataRef.current.dataSourceData = dataSourceData || [];
337
+ }
338
+ if (!isObjectEqual((_b = dataRef === null || dataRef === void 0 ? void 0 : dataRef.current) === null || _b === void 0 ? void 0 : _b.tableRecords, tableRecords)) {
339
+ dataRef.current.tableRecords = tableRecords || [];
340
+ }
341
+ }, [dataSourceData, tableRecords, isExpression]);
321
342
  const beforeModalDestroy = () => {
322
343
  // 重新加载数据
323
344
  refreshTable();
@@ -475,7 +496,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
475
496
  }
476
497
  },
477
498
  // 当前页数据
478
- records: tableRecords,
499
+ records: dataRef.current.tableRecords,
479
500
  // 当前总数
480
501
  total: total,
481
502
  pageNo: query.pageNo,
@@ -487,7 +508,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
487
508
  columnSets,
488
509
  defaultPageSize,
489
510
  defaultPageIndex,
490
- dataSourceData,
511
+ dataSourceData: dataRef.current.dataSourceData,
491
512
  sort: supportManyRelated
492
513
  ? query.orderBy
493
514
  : [{ orderBy: query.orderBy, orderType: query.orderType }],
@@ -502,7 +523,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
502
523
  isH5,
503
524
  isModel,
504
525
  selectedKeys,
505
- tableRecords === null || tableRecords === void 0 ? void 0 : tableRecords.length,
526
+ dataRef.current.tableRecords,
506
527
  total,
507
528
  query.pageNo,
508
529
  query.pageSize,
@@ -511,7 +532,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
511
532
  bindMetadata,
512
533
  defaultPageSize,
513
534
  defaultPageIndex,
514
- dataSourceData,
535
+ dataRef.current.dataSourceData,
515
536
  selectedRecords,
516
537
  query === null || query === void 0 ? void 0 : query.orderBy,
517
538
  query === null || query === void 0 ? void 0 : query.orderType,
@@ -547,7 +568,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
547
568
  query.pageSize,
548
569
  ]);
549
570
  useEffect(() => {
550
- if (isModel) {
571
+ if (isModel || isExpression) {
551
572
  setQueryParams((queryParams) => ({
552
573
  ...queryParams,
553
574
  searchValues: (queryParams === null || queryParams === void 0 ? void 0 : queryParams.searchValues) || [],
@@ -567,8 +588,6 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
567
588
  }));
568
589
  }
569
590
  }, [
570
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
571
- // eslint-disable-next-line react-hooks/exhaustive-deps
572
591
  defaultPageIndex,
573
592
  defaultPageSize,
574
593
  connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.pageSize,
@@ -578,6 +597,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
578
597
  orderType,
579
598
  connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.orderBy,
580
599
  connectorParams === null || connectorParams === void 0 ? void 0 : connectorParams.orderType,
600
+ isExpression,
581
601
  ]);
582
602
  useEffect(() => {
583
603
  if (isH5) {
@@ -647,6 +667,8 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
647
667
  }
648
668
  events === null || events === void 0 ? void 0 : events.onFilterChange({ searchValues });
649
669
  };
670
+ const errorStatus = isError || fieldsError;
671
+ const errorMsg = isError ? errorObj : fieldsError;
650
672
  return (_jsx(ConfigProvider, { classPrefix: classPrefix, children: _jsx(EnumHoc, { fields: authFields, children: _jsxs("div", { className: classNames(wrapClassList, className), style: style, id: id, children: [hasFilterButton && (_jsx(FilterFieldsPanel, { openMobileFilter: openMobileFilter, setOpenMobileFilter: setOpenMobileFilter, filterFields: filterFieldsData, fetchData: onFilterChange })), _jsxs("div", { className: `${classPrefix}-table-container`, children: [!isH5 && !isNoDataSourceBind && (_jsxs("div", { className: `${classPrefix}-table-wrap-toolbar`, children: [enableGlobalButton && (_jsx("div", { className: `${classPrefix}-table-wrap-toolbar__col ${classPrefix}-table-wrap-toolbar__col-start`, children: _jsx(GlobalButton, { classPrefix: classPrefix, slots: slots === null || slots === void 0 ? void 0 : slots.globalButton }) })), (enableRefreshBtn || enableTableHeightSizeBtn) && (_jsx("div", { className: `${classPrefix}-table-wrap-toolbar__col ${classPrefix}-table-wrap-toolbar__col-end`, children: _jsx(ToolBar, { hasFilterButton: hasFilterButton, total: total, refreshTable: onRefreshBtnClick, setTableHightSize: setTableHightSize, currentSize: tableHightSize, setOpenMobileFilter: () => {
651
673
  setOpenMobileFilter(true);
652
674
  }, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination }) }))] })), isH5 &&
@@ -655,7 +677,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
655
677
  enableTableHeightSizeBtn ||
656
678
  hasFilterButton) && (_jsx(ToolBar, { hasFilterButton: hasFilterButton, total: total, refreshTable: onRefreshBtnClick, setTableHightSize: setTableHightSize, currentSize: tableHightSize, setOpenMobileFilter: () => {
657
679
  setOpenMobileFilter(true);
658
- }, 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, isError: isError, errorObj: errorObj }), 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, { 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: {
680
+ }, 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, isError: errorStatus, errorObj: errorMsg }), 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, { 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: {
659
681
  close: () => {
660
682
  setIsMobileOptionVisible(false);
661
683
  },
@@ -1,5 +1,3 @@
1
- /* eslint-disable max-lines */
2
- /* eslint-disable @typescript-eslint/no-magic-numbers */
3
1
  import { deepClone } from '../../utils/tool';
4
2
  const TREE_INFO_GOT = [
5
3
  { key: 'value', infoKey: 'selected', alias: 'selected' },
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /* eslint-disable max-lines */
3
2
  import { forwardRef, useImperativeHandle, useEffect, useState, useCallback, } from 'react';
4
3
  import classNames from '../../utils/classnames';
5
4
  import { useConfig } from '../../utils/config-context';
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /* eslint-disable max-lines */
3
2
  import * as React from 'react';
4
3
  import classNames from '../../utils/classnames';
5
4
  import { useConfig } from '../../utils/config-context';
@@ -1,9 +1,26 @@
1
1
  import React from 'react';
2
- import type { Except } from 'type-fest';
3
2
  import type { CommonPropsType } from '../../types';
4
- import type { DataType } from '../../../configs/components/web-view';
3
+ import type { DataType, EventsType } from '../../../configs/components/web-view';
5
4
  import './style';
6
- export declare const WebView: React.ForwardRefExoticComponent<WdWebViewProps & React.RefAttributes<unknown>>;
7
- export interface WdWebViewProps extends CommonPropsType, Except<DataType, 'link'> {
8
- link?: DataType['link'];
9
- }
5
+ export declare const WebView: React.ForwardRefExoticComponent<CommonPropsType & import("type-fest").Simplify<{
6
+ link: string;
7
+ }> & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
8
+ readonly name: "load";
9
+ readonly title: "网页加载成功";
10
+ readonly detail: import("@sinclair/typebox").TObject<{
11
+ src: import("@sinclair/typebox").TString;
12
+ }>;
13
+ }, {
14
+ readonly name: "error";
15
+ readonly title: "网页加载失败";
16
+ readonly detail: import("@sinclair/typebox").TObject<{
17
+ src: import("@sinclair/typebox").TString;
18
+ }>;
19
+ }, {
20
+ readonly name: "message";
21
+ readonly title: "接收网页消息";
22
+ readonly detail: import("@sinclair/typebox").TObject<{
23
+ data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
24
+ }>;
25
+ }]>> & React.RefAttributes<unknown>>;
26
+ export type WdWebViewProps = CommonPropsType & DataType & EventsType;
package/dist/web/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as components from './components';
2
2
  import * as actions from './actions';
3
+ // eslint-disable-next-line rulesdir/no-export-all
3
4
  export * from './components';
4
5
  export { isH5Platform, usePlatform } from './utils/platform';
5
6
  export default { components, actions };
@@ -38,7 +38,6 @@ export const REL_DICT = {
38
38
  };
39
39
  export const emptyObject = {};
40
40
  export const emptyArray = [];
41
- // eslint-disable-next-line @typescript-eslint/no-empty-function
42
41
  export const noop = (() => { });
43
42
  // 内置字段
44
43
  export const SystemDefaultFields = [
@@ -31,7 +31,7 @@ export declare const convertYearMonthToWeeks: (year: any, month: any, range?: an
31
31
  month: any;
32
32
  }[][];
33
33
  export declare const getFullDay: (v: any) => string;
34
- export declare const convertDateItemToValue: (param: IDate) => any;
34
+ export declare const convertDateItemToValue: (param: IDate, fixMonth?: boolean) => any;
35
35
  export declare const convertValueToDateItem: (v: any) => IDate;
36
36
  export declare const getYMD: (item: IDate) => string;
37
37
  export declare const getExistValue: (value: any, options: IOption[]) => any;
@@ -216,10 +216,16 @@ export const convertYearMonthToWeeks = (year, month, range) => {
216
216
  // 补齐月天前面的 0
217
217
  export const getFullDay = (v) => (v < 10 ? `0${v}` : `${v}`);
218
218
  // IDate 对象转 value
219
- export const convertDateItemToValue = (param) => {
219
+ export const convertDateItemToValue = (param, fixMonth = true) => {
220
+ var _a, _b;
220
221
  const { year, month, day, hour, minute, second, millisecond } = param;
221
- const value = new Date(year, month, day, hour, minute, second, millisecond);
222
- return isNaN(value) ? null : value.valueOf();
222
+ const current = new Date(year, month, day, hour, minute, second, millisecond);
223
+ const currentValue = isNaN(current) ? null : current.valueOf();
224
+ if (!fixMonth || currentValue == null)
225
+ return currentValue;
226
+ const { day: maxDay } = convertValueToDateItem((_b = (_a = moment({ year, month })).endOf) === null || _b === void 0 ? void 0 : _b.call(_a, 'month'));
227
+ const maxValue = convertDateItemToValue({ ...param, day: maxDay }, false);
228
+ return currentValue > maxValue ? maxValue : currentValue;
223
229
  };
224
230
  // value 转 IDate 对象
225
231
  export const convertValueToDateItem = (v) => {
@@ -9,13 +9,11 @@ export const getDayNow = (mode = '') => {
9
9
  case 'day':
10
10
  return moment().startOf('day');
11
11
  case 'datetimeMinute':
12
- return moment().startOf('minute');
13
12
  case 'minute':
14
13
  return moment().startOf('minute');
15
14
  case 'second':
16
- return moment().startOf('second');
17
15
  case 'datetime':
18
- return moment();
16
+ return moment().startOf('second');
19
17
  default:
20
18
  return moment();
21
19
  }
@@ -154,7 +154,6 @@ export const isWXIDE = () => /wechatideplugin/i.test(navigator.userAgent);
154
154
  export const resolveStaticResourceUrl = (path) => {
155
155
  var _a, _b;
156
156
  try {
157
- // eslint-disable-next-line no-unsafe-optional-chaining
158
157
  const resourceUrl = (_b = (_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.__internal__) === null || _b === void 0 ? void 0 : _b.resolveStaticResourceUrl(path);
159
158
  return resourceUrl;
160
159
  }
@@ -284,7 +283,6 @@ export function alertErrorMessage({ message, duration = 3000, icon = 'none' }) {
284
283
  */
285
284
  export const navigateToModelPage = (action, params = {}) => {
286
285
  var _a, _b;
287
- // eslint-disable-next-line prefer-const
288
286
  let { id, dbName } = params;
289
287
  // 没有指定数据库标识
290
288
  if (!dbName) {
@@ -330,7 +328,6 @@ export const filterInvalidFormValue = (formValues, formFieldsEntityList) => {
330
328
  const fieldValue = formValues === null || formValues === void 0 ? void 0 : formValues[fieldName];
331
329
  const isEffectiveFieldValue = !filterRules(fieldValue, fieldEntity).includes(true);
332
330
  if (isEffectiveFieldValue) {
333
- // eslint-disable-next-line no-param-reassign
334
331
  newFormValue[fieldName] = fieldValue;
335
332
  }
336
333
  return newFormValue;
@@ -1,5 +1,5 @@
1
1
  import type { IWidget } from '../../types';
2
2
  export declare function getParentForm($node: IWidget): IWidget | null;
3
3
  export declare function useWedaAppContext(): {
4
- ready: boolean;
4
+ ready: any;
5
5
  };
@@ -1,7 +1,8 @@
1
- import { useContext, useEffect, useMemo, useState,
1
+ import { useContext, useEffect, useMemo,
2
2
  // useEffect,
3
3
  // useState,
4
4
  } from 'react';
5
+ import useSWR from 'swr';
5
6
  // 查找父表单容器
6
7
  export function getParentForm($node) {
7
8
  let cur = $node;
@@ -23,29 +24,25 @@ function ensureForm(comp) {
23
24
  return false;
24
25
  }
25
26
  export function useWedaAppContext() {
26
- // const [ctx, setCtx] = useState<{ ready?: boolean }>({});
27
- // useEffect(() => {
28
- // // eslint-disable-next-line rulesdir/no-timer
29
- // const id = setTimeout(() => {
30
- // setCtx({ ready: true });
31
- // }, 1000);
32
- // return () => {
33
- // clearTimeout(id);
34
- // };
35
- // });
36
- // return ctx;
37
27
  const { ready } = useContext(window.WedaAppContext || {}) || {};
38
- const [finalReady, setFinalReady] = useState(false);
28
+ // return { ready };
29
+ // 共享单例
30
+ const { data: finalReady, mutate: setFinalReady } = useSWR('~@~ready~@~', null, {
31
+ refreshWhenOffline: false,
32
+ fallbackData: false,
33
+ });
39
34
  useEffect(() => {
40
- // eslint-disable-next-line rulesdir/no-timer
41
- const id = setTimeout(() => {
42
- setFinalReady(ready);
43
- }, 0);
44
- return () => {
45
- if (id) {
46
- clearTimeout(id);
47
- }
48
- };
35
+ if (ready) {
36
+ // eslint-disable-next-line rulesdir/no-timer
37
+ const id = setTimeout(() => {
38
+ setFinalReady(ready);
39
+ }, 10);
40
+ return () => {
41
+ if (id) {
42
+ clearTimeout(id);
43
+ }
44
+ };
45
+ }
49
46
  }, [ready]);
50
47
  return useMemo(() => {
51
48
  return { ready: finalReady };
@@ -460,3 +460,9 @@ body .weda-ui {
460
460
  .wa-comp-CLOUDBASE_STANDARD-Media.lcap-media .weda-ui.lcap-media__left {
461
461
  margin: 0;
462
462
  }
463
+
464
+ /* 页头/页脚 */
465
+ .wa-comp-CLOUDBASE_STANDARD-Footer.lcap-footer.fixed,
466
+ .wa-comp-CLOUDBASE_STANDARD-Header.lcap-header.fixed {
467
+ z-index: 1;
468
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",
@@ -53,7 +53,7 @@
53
53
  "pretest:all": "rimraf .nyc_output || true",
54
54
  "storybook": "start-storybook -p 6006",
55
55
  "build-storybook": "build-storybook",
56
- "lint": "eslint --ext .js,.jsx,.ts,.tsx .",
56
+ "lint": "eslint --cache --cache-strategy content --report-unused-disable-directives --max-warnings 175 --ext .js,.jsx,.ts,.tsx .",
57
57
  "lint:fix": "npm run lint -- --fix",
58
58
  "prepare": "husky install || true",
59
59
  "postprepare": "npm run build-mp",
@@ -81,7 +81,7 @@
81
81
  "@antv/g6": "^4.8.5",
82
82
  "@loadable/component": "^5.15.2",
83
83
  "@react-hookz/web": "^23.0.0",
84
- "@sinclair/typebox": "^0.25.3",
84
+ "@sinclair/typebox": "^0.29.6",
85
85
  "@storybook/addons": "^6.5.16",
86
86
  "@tcwd/style-wedatheme": "^1.0.4",
87
87
  "@use-gesture/react": "^10.2.14",
@@ -91,6 +91,7 @@
91
91
  "destr": "^2.0.0",
92
92
  "echarts": "^5.3.0",
93
93
  "echarts-for-react": "^3.0.2",
94
+ "eslint-plugin-compat": "^4.1.4",
94
95
  "jsonexport": "3.2.0",
95
96
  "kedao": "^0.1.24",
96
97
  "lodash.get": "^4.4.2",
@@ -124,7 +125,7 @@
124
125
  "@babel/preset-env": "^7.18.6",
125
126
  "@babel/preset-react": "^7.18.6",
126
127
  "@babel/preset-typescript": "^7.18.6",
127
- "@cloudbase/cals": "^0.5.1-beta.8",
128
+ "@cloudbase/cals": "^0.5.19",
128
129
  "@cloudbase/lowcode-cli": "^0.18.3",
129
130
  "@cloudbase/weda-client": "^0.2.45",
130
131
  "@cloudbase/weda-cloud-sdk": "^1.0.26",
@@ -190,10 +191,10 @@
190
191
  "identity-obj-proxy": "^3.0.0",
191
192
  "is-builtin-module": "^3.2.0",
192
193
  "jest": "^27.5.1",
194
+ "jest_workaround": "0.1.14",
193
195
  "jest-canvas-mock": "^2.4.0",
194
196
  "jest-environment-jsdom": "^27",
195
197
  "jest-preview": "^0.2.6",
196
- "jest_workaround": "0.1.14",
197
198
  "json-schema-to-ts": "^2.5.5",
198
199
  "make-fetch-happen": "^11.0.1",
199
200
  "markdown-to-jsx": "^7.2.1",
@@ -215,6 +216,7 @@
215
216
  "rimraf": "^3.0.2",
216
217
  "sass": "^1.56.1",
217
218
  "size-limit": "^7.0.8",
219
+ "stable-hash": "^0.0.3",
218
220
  "start-server-and-test": "^1.14.0",
219
221
  "storybook-addon-sass-postcss": "^0.1.3",
220
222
  "storybook-addon-swc": "^1.1.9",
@@ -257,5 +259,10 @@
257
259
  "extends": "@istanbuljs/nyc-config-typescript",
258
260
  "excludeAfterRemap": false,
259
261
  "report-dir": "cypress-coverage"
260
- }
262
+ },
263
+ "browserslist": [
264
+ "chrome >= 67",
265
+ "iOS >= 12",
266
+ "safari >= 12"
267
+ ]
261
268
  }
@@ -1,83 +0,0 @@
1
- {
2
- "$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
3
- "data": {
4
- "properties": {
5
- "initValue": {
6
- "type": "string",
7
- "title": "日历展示时间",
8
- "x-category": "基础属性",
9
- "x-index": 1,
10
- "description": "已选中效果展示的日期"
11
- },
12
- "configData": {
13
- "type": "array",
14
- "title": "展示配置",
15
- "x-category": "基础属性",
16
- "description": "可设置多个不同日期的特殊显示效果",
17
- "x-index": 2,
18
- "items": {
19
- "type": "object",
20
- "properties": {
21
- "matchDate": {
22
- "title": "对应日期",
23
- "type": "date"
24
- },
25
- "disabled": {
26
- "title": "是否置灰",
27
- "type": "string",
28
- "enum": [
29
- {
30
- "label": "是",
31
- "value": "true"
32
- },
33
- {
34
- "label": "否",
35
- "value": "false"
36
- }
37
- ]
38
- },
39
- "marked": {
40
- "title": "打点标记",
41
- "type": "string",
42
- "enum": [
43
- {
44
- "label": "红色",
45
- "value": "#E34D59"
46
- },
47
- {
48
- "label": "绿色",
49
- "value": "#00A870"
50
- },
51
- {
52
- "label": "橙色",
53
- "value": "#ED7B2F"
54
- }
55
- ]
56
- }
57
- }
58
- },
59
- "default": []
60
- },
61
- "initVisible": {
62
- "type": "boolean",
63
- "default": true,
64
- "title": "时间控制器",
65
- "x-category": "基础属性",
66
- "x-index": 3,
67
- "description": "显示切换年月的操作按钮"
68
- }
69
- }
70
- },
71
- "meta": {
72
- "name": "Calendar",
73
- "title": "日历",
74
- "description": "用于日历展示,例如考勤数据展示、日程展示。",
75
- "category": "展示",
76
- "icon": "../icons/Calendar.svg",
77
- "categoryOrder": 400,
78
- "componentOrder": 340
79
- },
80
- "configMeta": {
81
- "docsUrl": "https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/show/Calendar"
82
- }
83
- }