@cloudbase/weda-ui 3.4.3 → 3.4.4

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 (263) hide show
  1. package/dist/configs/components/chart/bar.json +4 -0
  2. package/dist/configs/components/chart/line.js +14 -10
  3. package/dist/configs/components/chart/pie.json +4 -0
  4. package/dist/configs/components/dataView.js +507 -0
  5. package/dist/configs/components/form/location.json +2 -1
  6. package/dist/configs/components/form/userTreeSelect.json +55 -0
  7. package/dist/configs/components/formdetail.json +12 -2
  8. package/dist/configs/components/grid/col.js +125 -0
  9. package/dist/configs/components/grid/grid.js +131 -0
  10. package/dist/configs/components/grid/row.js +143 -0
  11. package/dist/configs/components/image.js +11 -1
  12. package/dist/configs/components/link.js +11 -1
  13. package/dist/configs/components/listView.js +988 -0
  14. package/dist/configs/components/navigationBar.json +9 -1
  15. package/dist/configs/components/repeater-item.json +17 -0
  16. package/dist/configs/components/repeater.js +125 -0
  17. package/dist/configs/components/table.json +67 -24
  18. package/dist/configs/components/text.js +12 -1
  19. package/dist/configs/components/wd-bubble.js +204 -0
  20. package/dist/configs/components/wd-button.js +417 -0
  21. package/dist/configs/components/wd-divider.js +89 -0
  22. package/dist/configs/components/wd-icon.js +126 -0
  23. package/dist/configs/components/wd-image.js +164 -0
  24. package/dist/configs/components/wd-link.js +234 -0
  25. package/dist/configs/components/wd-table.js +59 -0
  26. package/dist/configs/components/wd-text.js +142 -0
  27. package/dist/configs/components/wxOpenApi/phone.js +2 -2
  28. package/dist/configs/components/wxOpenApi/phoneCode.js +2 -2
  29. package/dist/configs/index.js +34 -3
  30. package/dist/configs/type-utils/index.js +4 -1
  31. package/dist/docs/common/componentList.js +144 -0
  32. package/dist/docs/common/components/classes-view.js +34 -0
  33. package/dist/docs/common/components/event-view.js +46 -0
  34. package/dist/docs/common/components/json-schema-view.js +18 -0
  35. package/dist/docs/common/components/methods-view.js +32 -0
  36. package/dist/docs/common/components/properties-view.js +45 -0
  37. package/dist/docs/common/format.js +60 -35
  38. package/dist/docs/common/helper.js +1 -0
  39. package/dist/docs/common/tableView.js +61 -50
  40. package/dist/enum/index.js +521 -0
  41. package/dist/index.js +1 -1
  42. package/dist/style/index.scss +1 -0
  43. package/dist/web/actions/showMessage/index.css +0 -3
  44. package/dist/web/actions/showMessage/index.js +1 -1
  45. package/dist/web/actions/showModal/index.css +0 -3
  46. package/dist/web/components/button/index.css +2 -5
  47. package/dist/web/components/button/index.js +3 -3
  48. package/dist/web/components/calendar/index.css +29 -32
  49. package/dist/web/components/calendar/index.js +37 -35
  50. package/dist/web/components/carousel/index.css +11 -14
  51. package/dist/web/components/carousel/index.js +3 -1
  52. package/dist/web/components/chart/common/core/eChartBar.js +10 -2
  53. package/dist/web/components/chart/common/core/eChartLine.js +16 -8
  54. package/dist/web/components/chart/common/core/eChartPie.js +2 -1
  55. package/dist/web/components/chart/statisticsCard/index.css +12 -15
  56. package/dist/web/components/chart/statisticsCard/index.js +6 -1
  57. package/dist/web/components/dataView/index.js +3 -3
  58. package/dist/web/components/emptyContent/index.css +26 -0
  59. package/dist/web/components/emptyContent/index.js +46 -0
  60. package/dist/web/components/flow/components/FlowModuleText/index.css +1 -4
  61. package/dist/web/components/flow/components/FlowUserSelect/index.css +29 -32
  62. package/dist/web/components/flow/components/HighlightTextarea/index.css +5 -8
  63. package/dist/web/components/flow/components/UserSelectModel/UserSelect.js +5 -2
  64. package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.css +1 -4
  65. package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.js +8 -5
  66. package/dist/web/components/flow/components/WedaUserTransfer/index.css +0 -3
  67. package/dist/web/components/flow/frame/getCommonFlowData.js +3 -1
  68. package/dist/web/components/flow/frame/index.js +18 -1
  69. package/dist/web/components/flow/frame/types.js +6 -0
  70. package/dist/web/components/flow/frame/utils.js +20 -11
  71. package/dist/web/components/flow/modules/basic/Basic.css +3 -6
  72. package/dist/web/components/flow/modules/basic/BasicMobile.css +9 -12
  73. package/dist/web/components/flow/modules/chart/Chart.js +2 -2
  74. package/dist/web/components/flow/modules/chart/index.css +23 -26
  75. package/dist/web/components/flow/modules/chart/isString.js +5 -0
  76. package/dist/web/components/flow/modules/control/ApprovalDrawer.css +44 -47
  77. package/dist/web/components/flow/modules/control/ApprovalPopup.css +34 -37
  78. package/dist/web/components/flow/modules/control/ApprovalPopup.js +10 -6
  79. package/dist/web/components/flow/modules/control/Control.css +7 -10
  80. package/dist/web/components/flow/modules/control/Control.js +4 -1
  81. package/dist/web/components/flow/modules/control/ControlMobile.css +10 -13
  82. package/dist/web/components/flow/modules/control/FlowTaskInfoModal.css +0 -3
  83. package/dist/web/components/flow/modules/control/provider/useControlModel.js +18 -5
  84. package/dist/web/components/flow/modules/layout/index.css +0 -3
  85. package/dist/web/components/flow/modules/process/Process.js +1 -1
  86. package/dist/web/components/flow/modules/process/ProcessMobile.js +1 -1
  87. package/dist/web/components/flow/modules/process/index.css +49 -43
  88. package/dist/web/components/form/form/index.css +2 -5
  89. package/dist/web/components/form/form/index.js +48 -4
  90. package/dist/web/components/form/formcell/index.css +29 -17
  91. package/dist/web/components/form/input/index.css +5 -8
  92. package/dist/web/components/form/input/index.js +11 -0
  93. package/dist/web/components/form/location/common/mapChoose.css +88 -91
  94. package/dist/web/components/form/location/common/selectModal.css +10 -13
  95. package/dist/web/components/form/location/components/LocationH5/index.css +17 -20
  96. package/dist/web/components/form/location/components/LocationH5/location.h5.js +2 -3
  97. package/dist/web/components/form/location/components/LocationH5/location.module.css +0 -3
  98. package/dist/web/components/form/location/components/LocationPC/index.css +10 -13
  99. package/dist/web/components/form/location/components/LocationPC/location.PC.js +2 -3
  100. package/dist/web/components/form/location/index.css +0 -3
  101. package/dist/web/components/form/radio/index.css +0 -3
  102. package/dist/web/components/form/select/allTimePicker/calendar.css +15 -18
  103. package/dist/web/components/form/select/allTimePicker/index.css +53 -27
  104. package/dist/web/components/form/select/dropdown-select/h5.js +22 -11
  105. package/dist/web/components/form/select/dropdown-select/index.css +28 -28
  106. package/dist/web/components/form/select/dropdown-select/index.js +37 -4
  107. package/dist/web/components/form/select/dropdown-select/pc.js +57 -17
  108. package/dist/web/components/form/select/dropdown-select/ui.js +5 -2
  109. package/dist/web/components/form/select/index.css +12 -8
  110. package/dist/web/components/form/select/index.js +2 -2
  111. package/dist/web/components/form/select/status/index.css +10 -13
  112. package/dist/web/components/form/switch/switch.module.css +0 -3
  113. package/dist/web/components/form/textarea/index.css +1 -4
  114. package/dist/web/components/form/tips/index.css +11 -2
  115. package/dist/web/components/form/uploader/index.css +14 -17
  116. package/dist/web/components/form/uploaderFile/index.css +61 -64
  117. package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +120 -38
  118. package/dist/web/components/form/userOrgSelect/common/utils.js +89 -1
  119. package/dist/web/components/form/userOrgSelect/component/depart-breadcrumb.js +15 -0
  120. package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +63 -0
  121. package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +96 -0
  122. package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +69 -0
  123. package/dist/web/components/form/userOrgSelect/{user-select-pc → component}/error-tips.js +0 -0
  124. package/dist/web/components/form/userOrgSelect/component/index.css +323 -0
  125. package/dist/web/components/form/userOrgSelect/component/input-tags.js +21 -0
  126. package/dist/web/components/form/userOrgSelect/component/modal-search-h5.js +25 -0
  127. package/dist/web/components/form/userOrgSelect/component/modal-search.js +11 -0
  128. package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +201 -0
  129. package/dist/web/components/form/userOrgSelect/component/org-tree-h5.js +19 -0
  130. package/dist/web/components/form/userOrgSelect/component/org-tree.js +33 -0
  131. package/dist/web/components/form/userOrgSelect/component/selected-list-h5.js +44 -0
  132. package/dist/web/components/form/userOrgSelect/component/selected-list.js +15 -0
  133. package/dist/web/components/form/userOrgSelect/component/user-org-list.js +55 -0
  134. package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +151 -0
  135. package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-list-h5.js +107 -0
  136. package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.js +50 -0
  137. package/dist/web/components/form/userOrgSelect/component/user-select-pc/error-tips.js +11 -0
  138. package/dist/web/components/form/userOrgSelect/{user-select-pc → component/user-select-pc}/model-user-list.js +9 -9
  139. package/dist/web/components/form/userOrgSelect/component/user-select-pc/org-tree.js +10 -0
  140. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +75 -0
  141. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +65 -0
  142. package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +1160 -0
  143. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +54 -87
  144. package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +30 -35
  145. package/dist/web/components/form/userOrgSelect/hooks/use-views-data.js +48 -0
  146. package/dist/web/components/formdetail/index.css +34 -31
  147. package/dist/web/components/formdetail/index.js +12 -3
  148. package/dist/web/components/graphicCard/index.css +15 -18
  149. package/dist/web/components/grid/_utils.css +67 -0
  150. package/dist/web/components/grid/col.js +33 -0
  151. package/dist/web/components/grid/grid.css +1185 -0
  152. package/dist/web/components/grid/grid.js +19 -0
  153. package/dist/web/components/grid/row.js +14 -0
  154. package/dist/web/components/image/image.js +9 -1
  155. package/dist/web/components/image/index.css +2 -5
  156. package/dist/web/components/index.js +17 -3
  157. package/dist/web/components/link/index.css +0 -3
  158. package/dist/web/components/listView/index.css +21 -23
  159. package/dist/web/components/listView/index.js +171 -34
  160. package/dist/web/components/lottery/index.css +72 -75
  161. package/dist/web/components/modal/h5.css +19 -21
  162. package/dist/web/components/modal/modal.h5.js +11 -10
  163. package/dist/web/components/navLayout/index.css +14 -139
  164. package/dist/web/components/navigationBar/common.js +5 -4
  165. package/dist/web/components/navigationBar/h5Menu.js +12 -10
  166. package/dist/web/components/navigationBar/horizontalMenu.js +42 -35
  167. package/dist/web/components/navigationBar/index.css +130 -86
  168. package/dist/web/components/navigationBar/index.js +6 -4
  169. package/dist/web/components/navigationBar/verticalMenu.js +13 -9
  170. package/dist/web/components/pageLayout/PageContent/index.css +7 -10
  171. package/dist/web/components/pageLayout/index.css +0 -3
  172. package/dist/web/components/pageLayout/index.js +2 -1
  173. package/dist/web/components/repeater/index.js +17 -0
  174. package/dist/web/components/repeater-item/index.js +9 -0
  175. package/dist/web/components/richText/index.css +5 -8
  176. package/dist/web/components/richText/index.js +4 -2
  177. package/dist/web/components/richText/richtext.module.css +1 -4
  178. package/dist/web/components/richTextView/index.css +7 -10
  179. package/dist/web/components/swiper/index.css +10 -13
  180. package/dist/web/components/swiper/index.js +19 -5
  181. package/dist/web/components/table/BaseTable.js +352 -283
  182. package/dist/web/components/table/ExportFileModalByApi/index.css +9 -0
  183. package/dist/web/components/table/ExportFileModalByApi/index.js +150 -0
  184. package/dist/web/components/table/FieldRender.js +25 -18
  185. package/dist/web/components/table/FilterFields.js +17 -11
  186. package/dist/web/components/table/Form/Location.css +2 -5
  187. package/dist/web/components/table/ImportFileModal/csvTemplate.json +65 -6
  188. package/dist/web/components/table/ImportFileModalByApi/index.css +130 -0
  189. package/dist/web/components/table/ImportFileModalByApi/index.js +321 -0
  190. package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +115 -0
  191. package/dist/web/components/table/InOrOutRecordModeal.js +139 -0
  192. package/dist/web/components/table/SelectableBlock/index.css +0 -2
  193. package/dist/web/components/table/UserDepartment/viewCell.css +3 -6
  194. package/dist/web/components/table/baseTable.css +579 -0
  195. package/dist/web/components/table/hooks/useImportingStatus.js +69 -0
  196. package/dist/web/components/table/hooks/useInOutFieldsRecords.js +23 -0
  197. package/dist/web/components/table/index.css +275 -508
  198. package/dist/web/components/table/index.js +6 -4
  199. package/dist/web/components/tabs/index.css +19 -18
  200. package/dist/web/components/tabs/tabs.h5.js +7 -16
  201. package/dist/web/components/text/index.css +6 -9
  202. package/dist/web/components/uploaderFileView/index.css +0 -3
  203. package/dist/web/components/uploaderView/index.css +5 -8
  204. package/dist/web/components/wd-bubble/index.js +3 -17
  205. package/dist/web/components/wd-bubble/wd-bubble.js +17 -0
  206. package/dist/web/components/wd-button/convert-legacy-props.js +14 -0
  207. package/dist/web/components/wd-button/index.js +3 -0
  208. package/dist/web/components/wd-button/wd-button.js +89 -0
  209. package/dist/web/components/wd-config-provider/index.js +1 -0
  210. package/dist/web/components/wd-config-provider/wd-config-context.js +5 -0
  211. package/dist/web/components/wd-config-provider/wd-config-provider.js +12 -0
  212. package/dist/web/components/wd-divider/index.js +3 -0
  213. package/dist/web/components/wd-divider/wd-divider.js +29 -0
  214. package/dist/web/components/wd-icon/convert-legacy-props.js +14 -0
  215. package/dist/web/components/wd-icon/index.js +3 -0
  216. package/dist/web/components/wd-icon/wd-icon.js +63 -0
  217. package/dist/web/components/wd-image/image.js +171 -0
  218. package/dist/web/components/wd-image/index.js +82 -0
  219. package/dist/web/components/wd-link/index.js +3 -0
  220. package/dist/web/components/wd-link/wd-link.js +105 -0
  221. package/dist/web/components/wd-table/index.js +3 -0
  222. package/dist/web/components/wd-table/wd-table.js +24 -0
  223. package/dist/web/components/wd-text/convert-legacy-props.js +14 -0
  224. package/dist/web/components/wd-text/index.js +3 -0
  225. package/dist/web/components/wd-text/wd-text.js +91 -0
  226. package/dist/web/components/wedaVideo/index.css +2 -5
  227. package/dist/web/components/wedaVideo/index.js +8 -6
  228. package/dist/web/index.js +1 -1
  229. package/dist/web/utils/config-context/index.js +1 -0
  230. package/dist/web/utils/config-context/use-config.js +9 -0
  231. package/dist/web/utils/constant.js +1 -0
  232. package/dist/web/utils/datasource.js +19 -7
  233. package/dist/web/utils/file.js +22 -0
  234. package/dist/web/utils/hooks/CreatePortal.js +6 -0
  235. package/dist/web/utils/hooks/EnumHoc.js +23 -3
  236. package/dist/web/utils/hooks/context.js +5 -1
  237. package/dist/web/utils/platform.js +31 -11
  238. package/dist/web/utils/pollingInterface.js +61 -0
  239. package/dist/web/utils/tcb.js +16 -0
  240. package/dist/web/utils/tool.js +88 -0
  241. package/dist/web/utils/widget-api/index.js +18 -0
  242. package/dist/web/weda-ui.css +128 -4
  243. package/package.json +50 -32
  244. package/dist/configs/components/dataView.json +0 -305
  245. package/dist/configs/components/listView.json +0 -515
  246. package/dist/configs/components/wd-bubble.json +0 -170
  247. package/dist/web/components/form/userOrgSelect/comTool.js +0 -102
  248. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +0 -155
  249. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +0 -17
  250. package/dist/web/components/form/userOrgSelect/getUserService.js +0 -165
  251. package/dist/web/components/form/userOrgSelect/index.js +0 -17
  252. package/dist/web/components/form/userOrgSelect/user-select-pc/index.css +0 -216
  253. package/dist/web/components/form/userOrgSelect/user-select-pc/index.js +0 -195
  254. package/dist/web/components/form/userOrgSelect/user-select-pc/org-tree.js +0 -15
  255. package/dist/web/components/form/userOrgSelect/user-select-pc/search-user.js +0 -80
  256. package/dist/web/components/form/userOrgSelect/user-select-pc/selected-user-list.js +0 -12
  257. package/dist/web/components/form/userOrgSelect/user-select-pc/user-model.js +0 -36
  258. package/dist/web/components/form/userOrgSelect/userOrgSelect.css +0 -824
  259. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +0 -302
  260. package/dist/web/components/form/userOrgSelect/utils.js +0 -95
  261. package/dist/web/components/table/ImportFileModal/index.css +0 -263
  262. package/dist/web/components/wd-bubble/index.css +0 -21
  263. package/dist/web/utils/hooks/useRequest.js +0 -25
@@ -3,9 +3,11 @@ import { ConfigProvider } from 'tea-component';
3
3
  import { PageContent, PageNullDb } from '../pageLayout/PageContent';
4
4
  import { BaseTable } from './BaseTable';
5
5
  import { getAuthFields } from '../../utils/datasource';
6
+ import classNames from '../../utils/classnames';
6
7
  import { TABLE_BUTTONS, TABLE_SETTINGS, TABLE_SLOT_PREFIX, GLOBAL_BUTTON, } from '../../utils/constant';
7
8
  import { EnumHoc } from '../../utils/hooks/EnumHoc';
8
9
  import { alertErrorMessage } from '../../utils/platform';
10
+ import './index.css';
9
11
  /**
10
12
  * 列表组件
11
13
  */
@@ -37,7 +39,7 @@ export default React.forwardRef(function ModelTable(props, ref) {
37
39
  fixedEnd = '', // 冻结本列至尾列
38
40
  enableCellCustomOption, // 是否显示插槽操作列
39
41
  enableGlobalButton, // 是否显示插槽全局按钮
40
- ...rest } = props;
42
+ className, emptyText, ...rest } = props;
41
43
  const isModel = dataSourceType !== 'custom-connector';
42
44
  const { datasource, enabledFieldNames, selectedViewIds: selectedView, isNewData, } = isModel ? bindMetadata : bindConnectMetadata;
43
45
  const { outParams } = connectorMethod;
@@ -98,12 +100,12 @@ export default React.forwardRef(function ModelTable(props, ref) {
98
100
  };
99
101
  // 1、编辑器内未绑定数据源时返回
100
102
  if ((isModel && !dbName) || (!isModel && !(connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name))) {
101
- return React.createElement(PageNullDb, { ...rest });
103
+ return (React.createElement(PageNullDb, { ...rest, className: classNames('weda-table', className) }));
102
104
  }
103
105
  // 2、正常返回
104
106
  return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
105
107
  React.createElement(EnumHoc, { fields: showFields },
106
- React.createElement(PageContent, { ...rest, loading: getFieldsLoading },
107
- React.createElement(BaseTable, { filterType: filterType, filterFields: getFilterFields(filterFields), actionColumn: true, tableAction: true, enableCellCustomOption: enableCellCustomOption, enableGlobalButton: enableGlobalButton, dbName: dbName, fields: showFields, connectorParams: connectorParams, isOrderBy: isOrderBy, isModel: isModel, tableSearch: !!isModel, connectorMethod: connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name, compId: compId, buttons: buttons, settings: settings, selectableBlockEvents: selectableBlockEvents, selectedView: getSelectedView(selectedView), columnSets: columnSets, slots: slots, rowColor: rowColor, events: events, onSelectConfirm: undefined, onSelectCancel: undefined, defaultSearchValue: undefined, outerRef: ref, where: where, orderBy: orderBy, orderType: orderType, fixedFront: fixedFront, fixedEnd: fixedEnd })))));
108
+ React.createElement(PageContent, { ...rest, className: classNames('weda-table', className), loading: getFieldsLoading },
109
+ React.createElement(BaseTable, { filterType: filterType, filterFields: getFilterFields(filterFields), actionColumn: true, tableAction: true, enableCellCustomOption: enableCellCustomOption, enableGlobalButton: enableGlobalButton, dbName: dbName, fields: showFields, connectorParams: connectorParams, isOrderBy: isOrderBy, isModel: isModel, tableSearch: !!isModel, connectorMethod: connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name, compId: compId, buttons: buttons, settings: settings, selectableBlockEvents: selectableBlockEvents, selectedView: getSelectedView(selectedView), columnSets: columnSets, slots: slots, rowColor: rowColor, events: events, onSelectConfirm: undefined, onSelectCancel: undefined, defaultSearchValue: undefined, outerRef: ref, where: where, orderBy: orderBy, orderType: orderType, fixedFront: fixedFront, fixedEnd: fixedEnd, emptyText: emptyText })))));
108
110
  });
109
111
  export { BaseTable };
@@ -2,17 +2,17 @@
2
2
  width: 100%;
3
3
  }
4
4
  .weda-tabs__panel {
5
- min-height: 3.57143rem;
5
+ min-height: 50px;
6
6
  }
7
7
  .weda-tabs__nav {
8
8
  width: 100%;
9
- height: 3.21429rem;
9
+ height: 45px;
10
10
  display: flex;
11
11
  align-items: center;
12
12
  background-color: #fff;
13
13
  position: relative;
14
14
  white-space: nowrap;
15
- border-bottom: 0.07143rem solid #eee;
15
+ border-bottom: 1px solid #eee;
16
16
  overflow-x: auto;
17
17
  scrollbar-width: none;
18
18
  /* firefox */
@@ -25,6 +25,7 @@
25
25
  height: 0;
26
26
  color: transparent;
27
27
  }
28
+
28
29
  .weda-tabs__nav-cell {
29
30
  flex-basis: 0;
30
31
  flex-grow: 1;
@@ -32,11 +33,12 @@
32
33
  font-size: 1em;
33
34
  color: #000;
34
35
  box-sizing: border-box;
35
- padding: 0 1.14286rem;
36
+ padding: 0 16px;
36
37
  display: inline-flex;
37
38
  align-items: center;
38
39
  justify-content: center;
39
- min-width: 20%;
40
+ min-width: unset;
41
+ position: relative;
40
42
  }
41
43
  .weda-tabs__nav-cell.active {
42
44
  color: #0052d9;
@@ -45,23 +47,22 @@
45
47
  flex-basis: auto;
46
48
  flex-shrink: 0;
47
49
  flex-grow: 0;
48
- width: 20%;
50
+ width: unset;
49
51
  }
50
- .weda-tabs__nav-sticky {
52
+
53
+ .weda-tabs__nav-cell::after {
54
+ display: block;
51
55
  position: absolute;
56
+ content: '';
52
57
  bottom: 0;
53
58
  left: 0;
54
- transition: transform 0.3s ease;
55
- padding: 0 1.14286rem;
56
- box-sizing: border-box;
57
- min-width: 20%;
59
+ width: 0;
60
+ border-bottom: 2px solid transparent;
58
61
  }
59
- .weda-tabs__nav-sticky::after {
60
- display: block;
61
- content: '';
62
+
63
+ .weda-tabs__nav-cell.active::after {
62
64
  width: 100%;
63
- border-top: 0.14286rem solid #0052d9;
65
+ border-bottom-color: #0052d9;
66
+ transition: border-color 0.15s ease-in-out, width 0.15s ease-in-out,
67
+ height 0.15s ease-in-out;
64
68
  }
65
-
66
- /*# sourceURL=webpack://./src/web/components/tabs/index.css */
67
- /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy93ZWIvY29tcG9uZW50cy90YWJzL2luZGV4LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLFdBQVc7QUFDYjtBQUNBO0VBQ0Usc0JBQXNCO0FBQ3hCO0FBQ0E7RUFDRSxXQUFXO0VBQ1gsa0JBQWtCO0VBQ2xCLGFBQWE7RUFDYixtQkFBbUI7RUFDbkIsc0JBQXNCO0VBQ3RCLGtCQUFrQjtFQUNsQixtQkFBbUI7RUFDbkIsb0NBQW9DO0VBQ3BDLGdCQUFnQjtFQUNoQixxQkFBcUI7RUFDckIsWUFBWTtFQUNaLHdCQUF3QjtFQUN4QixXQUFXO0FBQ2I7QUFDQTtFQUNF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ZHRoOiAxMDAlO1xuICBib3JkZXItdG9wOiAwLjE0Mjg2cmVtIHNvbGlkICMwMDUyZDk7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 */
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from 'react';
1
+ import React from 'react';
2
2
  import './index.css';
3
3
  import classNames from '../../utils/classnames';
4
4
  import { useSyncValue } from '../../utils/hooks/useSyncValue';
@@ -9,13 +9,6 @@ import { useLoopRenderDetect } from '../common/use-loop-render-detect';
9
9
  export default function TabsH5({ tabs = emptyArray, selectedIndex, events, className, style, isMultipleSlot = true, ...restProps }) {
10
10
  useLoopRenderDetect();
11
11
  const [currentIndex, setCurrentIndex] = useSyncValue(typeof selectedIndex === 'string' ? parseInt(selectedIndex) : selectedIndex);
12
- const stickyStyle = useMemo(() => {
13
- const length = tabs.length;
14
- return {
15
- width: `${(1 / length) * 100}%`,
16
- transform: `translate3d( ${currentIndex * 100}%, 0, 0)`,
17
- };
18
- }, [tabs, currentIndex]);
19
12
  const eventRef = useSyncedRef(events);
20
13
  useCustomCompareEffect(() => {
21
14
  var _a, _b;
@@ -28,14 +21,12 @@ export default function TabsH5({ tabs = emptyArray, selectedIndex, events, class
28
21
  return (React.createElement("div", { "data-testid": "tabs", className: classNames('weda-tabs weda-ui', {
29
22
  [className]: className,
30
23
  }), style: style },
31
- React.createElement("div", { className: "weda-tabs__nav" }, tabs === null || tabs === void 0 ? void 0 :
32
- tabs.map(({ name, title }, index) => (React.createElement("div", { className: classNames('weda-tabs__nav-cell', {
33
- active: currentIndex === index,
34
- scroll: currentIndex > 5,
35
- }), key: name || index, onClick: () => {
36
- setCurrentIndex(index);
37
- } }, title))),
38
- React.createElement("div", { className: "weda-tabs__nav-sticky", style: stickyStyle })),
24
+ React.createElement("div", { className: "weda-tabs__nav" }, tabs === null || tabs === void 0 ? void 0 : tabs.map(({ name, title }, index) => (React.createElement("div", { className: classNames('weda-tabs__nav-cell', {
25
+ active: currentIndex === index,
26
+ scroll: currentIndex > 5,
27
+ }), key: name || index, onClick: () => {
28
+ setCurrentIndex(index);
29
+ } }, title)))),
39
30
  React.createElement("div", { className: classNames({
40
31
  'weda-tabs__panel': true,
41
32
  }) }, isMultipleSlot
@@ -8,23 +8,20 @@
8
8
  white-space: pre-line; */
9
9
  }
10
10
  .weda-text.level_1 {
11
- font-size: 4.57143rem !important;
11
+ font-size: 64px !important;
12
12
  }
13
13
  .weda-text.level_2 {
14
- font-size: 4rem !important;
14
+ font-size: 56px !important;
15
15
  }
16
16
  .weda-text.level_3 {
17
- font-size: 3.42857rem !important;
17
+ font-size: 48px !important;
18
18
  }
19
19
  .weda-text.level_4 {
20
- font-size: 2.85714rem !important;
20
+ font-size: 40px !important;
21
21
  }
22
22
  .weda-text.level_5 {
23
- font-size: 2.28571rem !important;
23
+ font-size: 32px !important;
24
24
  }
25
25
  .weda-text.level_6 {
26
- font-size: 1.71429rem !important;
26
+ font-size: 24px !important;
27
27
  }
28
-
29
- /*# sourceURL=webpack://./src/web/components/text/index.css */
30
- /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy93ZWIvY29tcG9uZW50cy90ZXh0L2luZGV4LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHVCQUF1QjtFQUN2QixnQkFBZ0I7RUFDaEIsb0JBQW9CO0VBQ3BCLDRCQUE0QjtFQUM1QixxQkFBcUI7RUFDckI7MEJBQ3dCO0FBQzFCO0FBQ0E7RUFDRSxnQ0FBZ0M7QUFDbEM7QUFDQTtFQUNFLDBCQUEwQjtBQUM1QjtBQUNBO0VBQ0UsZ0NBQWdDO0FBQ2xDO0FBQ0E7RUFDRSxnQ0FBZ0M7QUFDbEM7QUFDQTtFQUNFLGdDQUFnQztBQUNsQztBQUNBO0VBQ0UsZ0NBQWdDO0FBQ2xDIiwic291cmNlc0NvbnRlbnQiOlsiLndlZGEtdGV4dCB7XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBvdmVyZmxvdzogaGlkZGVuO1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgLXdlYmtpdC1ib3gtb3JpZW50OiB2ZXJ0aWNhbDtcbiAgd29yZC1icmVhazogYnJlYWstYWxsO1xuICAvKiAtd2Via2l0LWxpbmUtY2xhbXA6IDE7XG4gIHdoaXRlLXNwYWNlOiBwcmUtbGluZTsgKi9cbn1cbi53ZWRhLXRleHQubGV2ZWxfMSB7XG4gIGZvbnQtc2l6ZTogNC41NzE0M3JlbSAhaW1wb3J0YW50O1xufVxuLndlZGEtdGV4dC5sZXZlbF8yIHtcbiAgZm9udC1zaXplOiA0cmVtICFpbXBvcnRhbnQ7XG59XG4ud2VkYS10ZXh0LmxldmVsXzMge1xuICBmb250LXNpemU6IDMuNDI4NTdyZW0gIWltcG9ydGFudDtcbn1cbi53ZWRhLXRleHQubGV2ZWxfNCB7XG4gIGZvbnQtc2l6ZTogMi44NTcxNHJlbSAhaW1wb3J0YW50O1xufVxuLndlZGEtdGV4dC5sZXZlbF81IHtcbiAgZm9udC1zaXplOiAyLjI4NTcxcmVtICFpbXBvcnRhbnQ7XG59XG4ud2VkYS10ZXh0LmxldmVsXzYge1xuICBmb250LXNpemU6IDEuNzE0MjlyZW0gIWltcG9ydGFudDtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0= */
@@ -9,6 +9,3 @@ a.weda-uploader-file-view__single {
9
9
  a.weda-uploader-file-view__single:hover {
10
10
  text-decoration: underline;
11
11
  }
12
-
13
- /*# sourceURL=webpack://./src/web/components/uploaderFileView/index.css */
14
- /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy93ZWIvY29tcG9uZW50cy91cGxvYWRlckZpbGVWaWV3L2luZGV4LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHFCQUFxQjtFQUNyQixzQkFBc0I7RUFDdEIsbUJBQW1CO0VBQ25CLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsZUFBZTtBQUNqQjtBQUNBO0VBQ0UsMEJBQTBCO0FBQzVCIiwic291cmNlc0NvbnRlbnQiOlsiYS53ZWRhLXVwbG9hZGVyLWZpbGUtdmlld19fc2luZ2xlIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO1xuICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICBvdmVyZmxvdzogaGlkZGVuO1xuICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbiAgbWF4LXdpZHRoOiAxMDAlO1xufVxuYS53ZWRhLXVwbG9hZGVyLWZpbGUtdmlld19fc2luZ2xlOmhvdmVyIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiB1bmRlcmxpbmU7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 */
@@ -9,10 +9,10 @@
9
9
  }
10
10
 
11
11
  .g-uploader-view .g-uploader-view__image-box {
12
- height: 7.14286rem;
13
- width: 7.14286rem;
14
- margin-right: 0.57143rem;
15
- margin-bottom: 0.57143rem;
12
+ height: 100px;
13
+ width: 100px;
14
+ margin-right: 8px;
15
+ margin-bottom: 8px;
16
16
  background: #f2f2f2;
17
17
  display: flex;
18
18
  align-items: center;
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  .g-uploader-view .g-uploader-view__empty {
23
- padding: 0.57143rem;
23
+ padding: 8px;
24
24
  background-image: url('https://main.qcloudimg.com/raw/c85c9a875e9754545ee19f20438b2caa.svg');
25
25
  }
26
26
 
@@ -29,6 +29,3 @@
29
29
  height: auto;
30
30
  max-height: 100%;
31
31
  }
32
-
33
- /*# sourceURL=webpack://./src/web/components/uploaderView/index.css */
34
- /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIj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2VtcHR5IHtcbiAgcGFkZGluZzogMC41NzE0M3JlbTtcbiAgYmFja2dyb3VuZC1pbWFnZTogdXJsKCdodHRwczovL21haW4ucWNsb3VkaW1nLmNvbS9yYXcvYzg1YzlhODc1ZTk3NTQ1NDVlZTE5ZjIwNDM4YjJjYWEuc3ZnJyk7XG59XG5cbi5nLXVwbG9hZGVyLXZpZXcgLmctdXBsb2FkZXItdmlld19faW1hZ2Uge1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiBhdXRvO1xuICBtYXgtaGVpZ2h0OiAxMDAlO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ== */
@@ -1,17 +1,3 @@
1
- import * as React from 'react';
2
- import { Bubble, ConfigProvider } from 'tea-component';
3
- import './index.css';
4
- import classNames from '../../utils/classnames';
5
- import { isInIde } from '../../utils/platform';
6
- export default function WdBubble({ trigger, placement, promptTheme, arrowPointAtCenter, openDelay, closeDelay, bubbleContent, bubbleChildren, events, id, style, className, }) {
7
- return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
8
- React.createElement("div", { className: classNames('wd-bubble', className), id: id, style: style }, isInIde() ? (React.createElement(Bubble, { content: React.createElement("div", { className: 'wd-bubble-content', style: isInIde() ? { minWidth: '140px' } : { minWidth: '0px' } }, bubbleContent), visible: true }, bubbleChildren)) : (React.createElement(Bubble, { content: bubbleContent, error: promptTheme === 'error', dark: promptTheme === 'dark', trigger: trigger, placement: placement, arrowPointAtCenter: arrowPointAtCenter, openDelay: Number(openDelay), closeDelay: Number(closeDelay), onVisibleChange: (visible) => {
9
- if (visible) {
10
- events === null || events === void 0 ? void 0 : events.open();
11
- }
12
- else {
13
- events === null || events === void 0 ? void 0 : events.close();
14
- }
15
- } },
16
- React.createElement("span", { className: 'wd-bubble-child' }, bubbleChildren))))));
17
- }
1
+ import { WdBubble } from './wd-bubble';
2
+ export { WdBubble } from './wd-bubble';
3
+ export default WdBubble;
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { Bubble, ConfigProvider } from 'tea-component';
3
+ import classNames from '../../utils/classnames';
4
+ import { isInIde, usePlatform } from '../../utils/platform';
5
+ export const WdBubble = ({ trigger, placement, promptTheme, arrowPointAtCenter, openDelay, closeDelay, bubbleContent, bubbleChildren, events, id, style, className, }) => {
6
+ const platform = usePlatform();
7
+ return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
8
+ React.createElement("div", { className: classNames('wd-bubble', className, platform === 'h5' ? 'wd-h5-bubble' : 'wd-pc-bubble'), id: id, style: style }, isInIde() ? (React.createElement(Bubble, { content: bubbleContent && (React.createElement("div", { className: 'wd-bubble-content', style: { minWidth: '140px' } }, bubbleContent)), visible: true }, bubbleChildren)) : (React.createElement(Bubble, { content: bubbleContent, error: promptTheme === 'error', dark: promptTheme === 'dark', trigger: trigger, placement: placement, arrowPointAtCenter: arrowPointAtCenter, openDelay: Number(openDelay), closeDelay: Number(closeDelay), onVisibleChange: (visible) => {
9
+ if (visible) {
10
+ events === null || events === void 0 ? void 0 : events.open();
11
+ }
12
+ else {
13
+ events === null || events === void 0 ? void 0 : events.close();
14
+ }
15
+ } },
16
+ React.createElement("span", { className: 'wd-bubble-child' }, bubbleChildren))))));
17
+ };
@@ -0,0 +1,14 @@
1
+ const PROPS_VALUE_MAP = {
2
+ size: {
3
+ default: 'md',
4
+ mini: 'sm',
5
+ large: 'lg',
6
+ },
7
+ theme: {
8
+ default: 'primary',
9
+ warn: 'warning',
10
+ },
11
+ };
12
+ export const convertLegacyProps = (key, prop) => {
13
+ return PROPS_VALUE_MAP[key][prop];
14
+ };
@@ -0,0 +1,3 @@
1
+ import { WdButton } from './wd-button';
2
+ export { WdButton } from './wd-button';
3
+ export default WdButton;
@@ -0,0 +1,89 @@
1
+ import * as React from 'react';
2
+ import classNames from '../../utils/classnames';
3
+ import { emptyObject } from '../../utils/constant';
4
+ import { useConfig } from '../../utils/config-context';
5
+ import { getParentForm } from '../../utils/widget-api';
6
+ import { convertLegacyProps } from './convert-legacy-props';
7
+ import { textToString, usePlatform } from '../../utils/platform';
8
+ import { convertLegacyEnum } from '../../utils/tool';
9
+ import { WD_BUTTON_THEME, WD_BUTTON_VARIANT, WD_BUTTON_SIZE, WD_BUTTON_ICON_TYPE, WD_BUTTON_ICON_POSITION, WD_BUTTON_TYPE, } from '../../../enum';
10
+ import { WdIcon } from '../index';
11
+ export const WdButton = ({ text, size: _size = 'md', theme: _theme = 'secondary', variant: _variant = 'base', iconType: _iconType = 'none', iconSource = 'inner', icon: _icon, iconSrc, iconPosition: _iconPosition = 'before', block, formType: _formType, disabled, events = emptyObject, className, style, id, loading,
12
+ // 组件 widget 实例,后续可能会更改接口
13
+ $node, ...props }) => {
14
+ const platform = usePlatform();
15
+ // 兼容旧版组件的属性值
16
+ let size = convertLegacyProps('size', _size) || _size;
17
+ let theme = convertLegacyProps('theme', _theme) || _theme;
18
+ const icon = loading ? 'td:loading' : _icon;
19
+ let iconType = _iconType === 'none' && loading ? 'text-with-icon' : _iconType;
20
+ // 枚举转换
21
+ theme = convertLegacyEnum(theme, WD_BUTTON_THEME);
22
+ size = convertLegacyEnum(size, WD_BUTTON_SIZE);
23
+ iconType = convertLegacyEnum(iconType, WD_BUTTON_ICON_TYPE);
24
+ const variant = convertLegacyEnum(_variant, WD_BUTTON_VARIANT);
25
+ const iconPosition = convertLegacyEnum(_iconPosition, WD_BUTTON_ICON_POSITION);
26
+ const formType = convertLegacyEnum(_formType, WD_BUTTON_TYPE);
27
+ // 样式
28
+ const { classPrefix } = useConfig();
29
+ const compClassName = `${classPrefix}-btn`;
30
+ // 响应式css api
31
+ const platformCss = `${classPrefix}-${platform}-btn`;
32
+ const classes = {
33
+ [`${classPrefix}-btn`]: true,
34
+ // 颜色
35
+ [`${compClassName}--${theme}`]: !!theme,
36
+ // 类型
37
+ [`${compClassName}--${variant}`]: !!variant,
38
+ // 大小
39
+ [`${compClassName}--${size}`]: !!size,
40
+ // 禁用
41
+ 'is-disabled': disabled,
42
+ // 占满
43
+ [`${compClassName}--block`]: block,
44
+ // 是否是纯图标
45
+ [`${compClassName}--icon`]: iconType === 'icon-only',
46
+ [platformCss]: true,
47
+ };
48
+ // 方法
49
+ const onClick = (e) => {
50
+ var _a;
51
+ let parentForm;
52
+ switch (formType) {
53
+ case 'submit':
54
+ // 调用父级表单容器的提交
55
+ parentForm = getParentForm($node);
56
+ parentForm === null || parentForm === void 0 ? void 0 : parentForm.submit();
57
+ break;
58
+ case 'reset':
59
+ // 调用父级表单容器的重置
60
+ parentForm = getParentForm($node);
61
+ parentForm === null || parentForm === void 0 ? void 0 : parentForm.reset();
62
+ break;
63
+ default:
64
+ (_a = events === null || events === void 0 ? void 0 : events.tap) === null || _a === void 0 ? void 0 : _a.call(events, {}, { originEvent: e });
65
+ }
66
+ };
67
+ const propsStartWithOn = React.useMemo(() => {
68
+ return Object.keys(props).reduce((acc, cur) => {
69
+ if (cur.startsWith('on')) {
70
+ acc[cur] = props[cur];
71
+ }
72
+ return acc;
73
+ }, {});
74
+ }, [props]);
75
+ const Icon = () => {
76
+ // icon样式
77
+ const iconCls = classNames({
78
+ [`${classPrefix}-btn__icon`]: true,
79
+ [`${classPrefix}-btn__before-icon`]: iconType === 'text-with-icon' && _iconPosition === 'before',
80
+ [`${classPrefix}-btn__after-icon`]: iconType === 'text-with-icon' && _iconPosition === 'after',
81
+ [`${classPrefix}-icon--inherit`]: (style === null || style === void 0 ? void 0 : style.fontSize) && iconSource === 'inner',
82
+ });
83
+ return icon || iconSrc ? (React.createElement(WdIcon, { className: iconCls, size: 'sm', name: icon, src: iconSrc, type: iconSource })) : null;
84
+ };
85
+ return (React.createElement("button", { className: classNames(classes, className), disabled: disabled, type: formType, style: style, id: id, ...propsStartWithOn, onClick: onClick },
86
+ iconPosition === 'before' && iconType === 'text-with-icon' && React.createElement(Icon, null),
87
+ iconType === 'icon-only' ? (React.createElement(Icon, null)) : (React.createElement("span", { className: `${classPrefix}-btn__text` }, textToString(text))),
88
+ iconPosition === 'after' && iconType === 'text-with-icon' && React.createElement(Icon, null)));
89
+ };
@@ -0,0 +1 @@
1
+ export { ConfigProvider } from './wd-config-provider';
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+ export const DEFAULT_CLASS_PREFIX = typeof WD_CLASS_PREFIX !== 'undefined' ? WD_CLASS_PREFIX : 'wd';
3
+ export const WdConfigContext = createContext({
4
+ classPrefix: DEFAULT_CLASS_PREFIX,
5
+ });
@@ -0,0 +1,12 @@
1
+ import React, { useEffect } from 'react';
2
+ import { WdConfigContext } from './wd-config-context';
3
+ const configStore = {};
4
+ export function ConfigProvider({ children, ...configProps }) {
5
+ useEffect(() => {
6
+ Object.assign(configStore, { ...configProps, ...configStore });
7
+ // eslint-disable-next-line react-hooks/exhaustive-deps
8
+ }, [configProps.classPrefix]);
9
+ // props 优先级高于全局配置
10
+ const config = Object.assign({}, configStore, configProps);
11
+ return (React.createElement(WdConfigContext.Provider, { value: config }, children));
12
+ }
@@ -0,0 +1,3 @@
1
+ import { WdDivider } from './wd-divider';
2
+ export { WdDivider } from './wd-divider';
3
+ export default WdDivider;
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import classNames from '../../utils/classnames';
3
+ import { useConfig } from '../../utils/config-context';
4
+ import { usePlatform } from '../../utils/platform';
5
+ import { convertLegacyEnum } from '../../utils/tool';
6
+ import { WD_DIVIDER_TYPE } from '../../../enum';
7
+ export const WdDivider = ({ className, style, id, type: _type = 'solid',
8
+ // diriction = 'horizontal',
9
+ ...props }) => {
10
+ const platform = usePlatform();
11
+ // 兼容旧版组件的属性值
12
+ const { classPrefix } = useConfig();
13
+ const compClassName = `${classPrefix}-divider`;
14
+ // 枚举转换
15
+ const type = convertLegacyEnum(_type, WD_DIVIDER_TYPE);
16
+ // 类名
17
+ const classList = [compClassName];
18
+ type && classList.push(`${compClassName}--${type}`);
19
+ // diriction && classList.push(`${btnClassName}-${diriction}`);
20
+ // 用户定义的className
21
+ classList.push(className);
22
+ if (platform === 'h5') {
23
+ classList.push('wd-h5-divider');
24
+ }
25
+ else {
26
+ classList.push('wd-pc-divider');
27
+ }
28
+ return (React.createElement("div", { "data-testid": "wd-divider-test", className: classNames(...classList), style: style, id: id, ...props }));
29
+ };
@@ -0,0 +1,14 @@
1
+ const PROPS_VALUE_MAP = {
2
+ size: {
3
+ default: 'md',
4
+ mini: 'sm',
5
+ large: 'lg',
6
+ },
7
+ theme: {
8
+ default: 'primary',
9
+ warn: 'warning',
10
+ },
11
+ };
12
+ export const convertLegacyProps = (key, prop) => {
13
+ return PROPS_VALUE_MAP[key][prop];
14
+ };
@@ -0,0 +1,3 @@
1
+ import { WdIcon } from './wd-icon';
2
+ export { WdIcon } from './wd-icon';
3
+ export default WdIcon;
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+ import classNames from '../../utils/classnames';
3
+ import { emptyObject } from '../../utils/constant';
4
+ import { useConfig } from '../../utils/config-context';
5
+ import { usePlatform } from '../../utils/platform';
6
+ import { convertLegacyEnum } from '../../utils/tool';
7
+ import { WD_ICON_TYPE, WD_ICON_SIZE } from '../../../enum';
8
+ export const WdIcon = ({ type: _type = 'inner', name, src, size: _size, events = emptyObject, className, style: _style, id, color: _color, ...props }) => {
9
+ const platform = usePlatform();
10
+ // 兼容旧版组件的属性值 size/color
11
+ const remdiff = 2;
12
+ const iconNumSize = !isNaN(Number(_size))
13
+ ? `${Number(_size) / remdiff}px`
14
+ : '';
15
+ const fontSize = iconNumSize && _type === 'inner' ? { fontSize: iconNumSize } : {};
16
+ const width = iconNumSize && _type === 'custom' ? { width: iconNumSize } : {};
17
+ const height = iconNumSize && _type === 'custom' ? { height: iconNumSize } : {};
18
+ const color = _color ? { color: _color } : {};
19
+ const style = { ...fontSize, ...width, ...height, ...color, ..._style };
20
+ // 枚举转换
21
+ const type = convertLegacyEnum(_type, WD_ICON_TYPE);
22
+ const size = convertLegacyEnum(_size, WD_ICON_SIZE);
23
+ // 样式
24
+ const { classPrefix } = useConfig();
25
+ const compClassName = `${classPrefix}-icon`;
26
+ const isTdIcon = /td/.test(name) && type === 'inner';
27
+ const isLegacyIcon = !isTdIcon && type === 'inner';
28
+ const iconName = name === null || name === void 0 ? void 0 : name.split(':')[1];
29
+ // 响应式css api
30
+ const platformCss = `${classPrefix}-${platform}-icon`;
31
+ const classes = {
32
+ [`${classPrefix}-icon`]: true,
33
+ // 旧版图标
34
+ 'wd-lcap-icon': isLegacyIcon,
35
+ [`wd-lcap-icon-${name}`]: isLegacyIcon && name,
36
+ // TDesign 图标
37
+ 't-icon': isTdIcon,
38
+ [`t-icon-${iconName}`]: isTdIcon && iconName,
39
+ // 尺寸
40
+ [`${compClassName}--${size}`]: !!size,
41
+ [platformCss]: true,
42
+ };
43
+ const onClick = (e) => {
44
+ var _a;
45
+ (_a = events === null || events === void 0 ? void 0 : events.tap) === null || _a === void 0 ? void 0 : _a.call(events, {}, { originEvent: e });
46
+ };
47
+ const propsStartWithOn = React.useMemo(() => {
48
+ return Object.keys(props).reduce((acc, cur) => {
49
+ if (cur.startsWith('on') || cur === 'data-testid') {
50
+ acc[cur] = props[cur];
51
+ }
52
+ return acc;
53
+ }, {});
54
+ }, [props]);
55
+ if (type === 'inner') {
56
+ return (React.createElement("i", { className: classNames(classes, className), style: style, id: id, onClick: onClick, ...propsStartWithOn }));
57
+ }
58
+ else {
59
+ return (React.createElement("img", { className: classNames(classes, className), style: style, id: id, src: src
60
+ ? src
61
+ : 'https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg', onClick: onClick, ...propsStartWithOn }));
62
+ }
63
+ };