@lemon-fe/kits 0.1.136 → 1.0.0-0

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 (344) hide show
  1. package/README.md +27 -5
  2. package/es/app.d.ts +1 -0
  3. package/es/app.js +3 -0
  4. package/es/components/Actions/index.d.ts +26 -0
  5. package/es/components/Actions/index.js +169 -0
  6. package/es/components/Actions/index.less +67 -0
  7. package/es/components/BaseTable/Actions.d.ts +9 -0
  8. package/es/components/BaseTable/Actions.js +136 -0
  9. package/es/components/BaseTable/BaseTableContext.d.ts +7 -0
  10. package/es/components/BaseTable/BaseTableContext.js +7 -0
  11. package/es/components/BaseTable/ResizeHeaderCell.d.ts +8 -0
  12. package/es/components/BaseTable/ResizeHeaderCell.js +130 -0
  13. package/es/components/BaseTable/VirtualBody.d.ts +8 -0
  14. package/es/components/BaseTable/VirtualBody.js +163 -0
  15. package/es/components/BaseTable/empty.png +0 -0
  16. package/es/components/BaseTable/index.d.ts +9 -0
  17. package/es/components/BaseTable/index.js +482 -0
  18. package/es/components/BaseTable/index.less +189 -0
  19. package/es/components/BaseTable/typings.d.ts +48 -0
  20. package/es/components/BaseTable/utils.d.ts +4 -0
  21. package/es/components/BaseTable/utils.js +26 -0
  22. package/es/components/ColorPicker/index.d.ts +13 -0
  23. package/es/components/ColorPicker/index.js +114 -0
  24. package/es/components/ColorPicker/index.less +47 -0
  25. package/es/components/DataGrid/Actions.d.ts +9 -0
  26. package/es/components/DataGrid/Actions.js +119 -0
  27. package/es/components/DataGrid/CellRenderer.d.ts +4 -0
  28. package/es/components/DataGrid/CellRenderer.js +68 -0
  29. package/es/components/DataGrid/GridContext.d.ts +4 -0
  30. package/es/components/DataGrid/GridContext.js +4 -0
  31. package/es/components/DataGrid/HeaderRenderer.d.ts +6 -0
  32. package/es/components/DataGrid/HeaderRenderer.js +93 -0
  33. package/es/components/DataGrid/cell-editors/Custom.d.ts +9 -0
  34. package/es/components/DataGrid/cell-editors/Custom.js +105 -0
  35. package/es/components/DataGrid/cell-editors/Date.d.ts +8 -0
  36. package/es/components/DataGrid/cell-editors/Date.js +78 -0
  37. package/es/components/DataGrid/cell-editors/Number.d.ts +9 -0
  38. package/es/components/DataGrid/cell-editors/Number.js +86 -0
  39. package/es/components/DataGrid/cell-editors/Select.d.ts +7 -0
  40. package/es/components/DataGrid/cell-editors/Select.js +70 -0
  41. package/es/components/DataGrid/cell-editors/Text.d.ts +5 -0
  42. package/es/components/DataGrid/cell-editors/Text.js +60 -0
  43. package/es/components/DataGrid/cell-editors/Wrapper.d.ts +4 -0
  44. package/es/components/DataGrid/cell-editors/Wrapper.js +7 -0
  45. package/es/components/DataGrid/cell-editors/utils.d.ts +1 -0
  46. package/es/components/DataGrid/cell-editors/utils.js +2 -0
  47. package/es/components/DataGrid/empty.png +0 -0
  48. package/es/components/DataGrid/hooks.d.ts +2 -0
  49. package/es/components/DataGrid/hooks.js +45 -0
  50. package/es/components/DataGrid/index.d.ts +77 -0
  51. package/es/components/DataGrid/index.js +1051 -0
  52. package/es/components/DataGrid/index.less +304 -0
  53. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.d.ts +57 -0
  54. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.js +378 -0
  55. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.d.ts +120 -0
  56. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.js +1160 -0
  57. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.d.ts +7 -0
  58. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.js +137 -0
  59. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.d.ts +5 -0
  60. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.js +60 -0
  61. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.d.ts +10 -0
  62. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.js +199 -0
  63. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.d.ts +13 -0
  64. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.js +175 -0
  65. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.d.ts +21 -0
  66. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.js +330 -0
  67. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.d.ts +7 -0
  68. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.js +75 -0
  69. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.d.ts +15 -0
  70. package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.js +15 -0
  71. package/es/components/DataGrid/modules/client-side-row-model/index.d.ts +1 -0
  72. package/es/components/DataGrid/modules/client-side-row-model/index.js +1 -0
  73. package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.d.ts +62 -0
  74. package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.js +923 -0
  75. package/es/components/DataGrid/modules/clipboard/clipboardModule.d.ts +7 -0
  76. package/es/components/DataGrid/modules/clipboard/clipboardModule.js +8 -0
  77. package/es/components/DataGrid/modules/clipboard/index.d.ts +1 -0
  78. package/es/components/DataGrid/modules/clipboard/index.js +1 -0
  79. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +32 -0
  80. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +100 -0
  81. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +51 -0
  82. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +320 -0
  83. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +20 -0
  84. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +247 -0
  85. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +9 -0
  86. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +93 -0
  87. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +32 -0
  88. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +186 -0
  89. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +49 -0
  90. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +546 -0
  91. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +26 -0
  92. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +264 -0
  93. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +32 -0
  94. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +151 -0
  95. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +43 -0
  96. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +369 -0
  97. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +62 -0
  98. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +475 -0
  99. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +24 -0
  100. package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +322 -0
  101. package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.d.ts +24 -0
  102. package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.js +24 -0
  103. package/es/components/DataGrid/modules/column-tool-panel/index.d.ts +2 -0
  104. package/es/components/DataGrid/modules/column-tool-panel/index.js +3 -0
  105. package/es/components/DataGrid/modules/menu/index.d.ts +1 -0
  106. package/es/components/DataGrid/modules/menu/index.js +1 -0
  107. package/es/components/DataGrid/modules/menu/menu/contextMenu.d.ts +26 -0
  108. package/es/components/DataGrid/modules/menu/menu/contextMenu.js +329 -0
  109. package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.d.ts +85 -0
  110. package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.js +639 -0
  111. package/es/components/DataGrid/modules/menu/menu/menuItemMapper.d.ts +15 -0
  112. package/es/components/DataGrid/modules/menu/menu/menuItemMapper.js +565 -0
  113. package/es/components/DataGrid/modules/menu/menuModule.d.ts +8 -0
  114. package/es/components/DataGrid/modules/menu/menuModule.js +8 -0
  115. package/es/components/DataGrid/modules/row-grouping/index.d.ts +4 -0
  116. package/es/components/DataGrid/modules/row-grouping/index.js +4 -0
  117. package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +23 -0
  118. package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.js +303 -0
  119. package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +20 -0
  120. package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.js +326 -0
  121. package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.d.ts +10 -0
  122. package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.js +71 -0
  123. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +75 -0
  124. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +618 -0
  125. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +40 -0
  126. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +460 -0
  127. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +11 -0
  128. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +108 -0
  129. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +17 -0
  130. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +170 -0
  131. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +15 -0
  132. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +133 -0
  133. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +15 -0
  134. package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +133 -0
  135. package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +9 -0
  136. package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +175 -0
  137. package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.d.ts +47 -0
  138. package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.js +814 -0
  139. package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +24 -0
  140. package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.js +478 -0
  141. package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.d.ts +19 -0
  142. package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.js +219 -0
  143. package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.d.ts +16 -0
  144. package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.js +16 -0
  145. package/es/components/DataGrid/modules/server-side-row-model/index.d.ts +1 -0
  146. package/es/components/DataGrid/modules/server-side-row-model/index.js +1 -0
  147. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.d.ts +47 -0
  148. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.js +444 -0
  149. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.d.ts +92 -0
  150. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.js +510 -0
  151. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.d.ts +9 -0
  152. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.js +115 -0
  153. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.d.ts +9 -0
  154. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.js +114 -0
  155. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.d.ts +5 -0
  156. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.js +68 -0
  157. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.d.ts +13 -0
  158. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.js +194 -0
  159. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.d.ts +7 -0
  160. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.js +63 -0
  161. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.d.ts +88 -0
  162. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.js +572 -0
  163. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.d.ts +108 -0
  164. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.js +876 -0
  165. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.d.ts +102 -0
  166. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.js +918 -0
  167. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.d.ts +12 -0
  168. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.js +141 -0
  169. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.d.ts +35 -0
  170. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.js +154 -0
  171. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.d.ts +23 -0
  172. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.js +210 -0
  173. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.d.ts +18 -0
  174. package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.js +18 -0
  175. package/es/components/DataGrid/modules/side-bar/index.d.ts +2 -0
  176. package/es/components/DataGrid/modules/side-bar/index.js +2 -0
  177. package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +11 -0
  178. package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.js +280 -0
  179. package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +19 -0
  180. package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.js +132 -0
  181. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +16 -0
  182. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.js +108 -0
  183. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +18 -0
  184. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.js +115 -0
  185. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.d.ts +29 -0
  186. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.js +353 -0
  187. package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +17 -0
  188. package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.js +128 -0
  189. package/es/components/DataGrid/modules/side-bar/sideBarModule.d.ts +19 -0
  190. package/es/components/DataGrid/modules/side-bar/sideBarModule.js +19 -0
  191. package/es/components/DataGrid/typings.d.ts +138 -0
  192. package/es/components/DataGrid/typings.js +1 -0
  193. package/es/components/DataGrid/utils.d.ts +43 -0
  194. package/es/components/DataGrid/utils.js +242 -0
  195. package/es/components/Dropdown/index.d.ts +15 -0
  196. package/es/components/Dropdown/index.js +55 -0
  197. package/es/components/Dropdown/index.less +13 -0
  198. package/es/components/DurationPicker/index.d.ts +26 -0
  199. package/es/components/DurationPicker/index.js +204 -0
  200. package/es/components/DurationPicker/index.less +61 -0
  201. package/es/components/EditableTable/EditableCell.d.ts +12 -0
  202. package/es/components/EditableTable/EditableCell.js +41 -0
  203. package/es/components/EditableTable/EditableTableFormItem.d.ts +6 -0
  204. package/es/components/EditableTable/EditableTableFormItem.js +47 -0
  205. package/es/components/EditableTable/Table.d.ts +6 -0
  206. package/es/components/EditableTable/Table.js +362 -0
  207. package/es/components/EditableTable/index.d.ts +9 -0
  208. package/es/components/EditableTable/index.js +8 -0
  209. package/es/components/EditableTable/index.less +29 -0
  210. package/es/components/EditableTable/typings.d.ts +90 -0
  211. package/es/components/EditableTable/util.d.ts +25 -0
  212. package/es/components/EditableTable/util.js +399 -0
  213. package/es/components/Filter/index.d.ts +15 -0
  214. package/es/components/Filter/index.js +644 -0
  215. package/es/components/Filter/index.less +82 -0
  216. package/es/components/Filter/typings.d.ts +35 -0
  217. package/es/components/FormLayout/index.d.ts +32 -0
  218. package/es/components/FormLayout/index.js +41 -0
  219. package/es/components/FormLayout/index.less +109 -0
  220. package/es/components/Icons/BigTip/error.png +0 -0
  221. package/es/components/Icons/BigTip/index.d.ts +6 -0
  222. package/es/components/Icons/BigTip/index.js +46 -0
  223. package/es/components/Icons/BigTip/info.png +0 -0
  224. package/es/components/Icons/BigTip/success.png +0 -0
  225. package/es/components/Icons/BigTip/warning.png +0 -0
  226. package/es/components/Icons/Calendar.d.ts +5 -0
  227. package/es/components/Icons/Calendar.js +43 -0
  228. package/es/components/Icons/Close.d.ts +5 -0
  229. package/es/components/Icons/Close.js +25 -0
  230. package/es/components/Icons/CollapseUp.d.ts +5 -0
  231. package/es/components/Icons/CollapseUp.js +27 -0
  232. package/es/components/Icons/DarkSearch.d.ts +5 -0
  233. package/es/components/Icons/DarkSearch.js +34 -0
  234. package/es/components/Icons/Down.d.ts +5 -0
  235. package/es/components/Icons/Down.js +31 -0
  236. package/es/components/Icons/Empty.d.ts +3 -0
  237. package/es/components/Icons/Empty.js +267 -0
  238. package/es/components/Icons/LookUp.d.ts +5 -0
  239. package/es/components/Icons/LookUp.js +70 -0
  240. package/es/components/Icons/More.d.ts +5 -0
  241. package/es/components/Icons/More.js +40 -0
  242. package/es/components/Icons/Search.d.ts +5 -0
  243. package/es/components/Icons/Search.js +31 -0
  244. package/es/components/Icons/Tip.d.ts +6 -0
  245. package/es/components/Icons/Tip.js +165 -0
  246. package/es/components/Icons/index.d.ts +25 -0
  247. package/es/components/Icons/index.js +25 -0
  248. package/es/components/Layout/index.d.ts +41 -0
  249. package/es/components/Layout/index.js +173 -0
  250. package/es/components/Layout/index.less +136 -0
  251. package/es/components/PageLoading/index.d.ts +5 -0
  252. package/es/components/PageLoading/index.js +15 -0
  253. package/es/components/PageLoading/index.less +8 -0
  254. package/es/components/Popup/index.d.ts +39 -0
  255. package/es/components/Popup/index.js +223 -0
  256. package/es/components/Popup/index.less +12 -0
  257. package/es/components/Portal/index.d.ts +17 -0
  258. package/es/components/Portal/index.js +141 -0
  259. package/es/components/Section/TabBar.d.ts +12 -0
  260. package/es/components/Section/TabBar.js +51 -0
  261. package/es/components/Section/index.d.ts +54 -0
  262. package/es/components/Section/index.js +96 -0
  263. package/es/components/Section/index.less +130 -0
  264. package/es/components/SelectView/index.d.ts +47 -0
  265. package/es/components/SelectView/index.js +244 -0
  266. package/es/components/SelectView/index.less +60 -0
  267. package/es/components/SiderTree/TreeNodeTitle.d.ts +9 -0
  268. package/es/components/SiderTree/TreeNodeTitle.js +107 -0
  269. package/es/components/SiderTree/empty.png +0 -0
  270. package/es/components/SiderTree/index.d.ts +37 -0
  271. package/es/components/SiderTree/index.js +217 -0
  272. package/es/components/SiderTree/index.less +222 -0
  273. package/es/components/SiderTree/typings.d.ts +19 -0
  274. package/es/components/SymbolIcon/index.d.ts +8 -0
  275. package/es/components/SymbolIcon/index.js +32 -0
  276. package/es/components/SymbolIcon/index.less +7 -0
  277. package/es/components/TabBar/index.d.ts +14 -0
  278. package/es/components/TabBar/index.js +52 -0
  279. package/es/components/TabBar/index.less +31 -0
  280. package/es/components/Table/index.d.ts +3 -0
  281. package/es/components/Table/index.js +242 -0
  282. package/es/components/Table/typings.d.ts +25 -0
  283. package/es/components/Table/utils.d.ts +2 -0
  284. package/es/components/Table/utils.js +3 -0
  285. package/es/components/utils.d.ts +3 -0
  286. package/es/components/utils.js +20 -0
  287. package/es/constants.d.ts +1 -0
  288. package/es/constants.js +1 -0
  289. package/es/{useBatchOperator → hooks/useBatchOperator}/index.d.ts +2 -2
  290. package/es/{useBatchOperator → hooks/useBatchOperator}/index.js +120 -57
  291. package/es/{usePageTrack → hooks/usePageTrack}/index.d.ts +0 -0
  292. package/es/{usePageTrack → hooks/usePageTrack}/index.js +0 -0
  293. package/es/index.d.ts +33 -6
  294. package/es/index.js +30 -6
  295. package/es/index.less +25 -1
  296. package/es/init.d.ts +3 -0
  297. package/es/init.js +153 -0
  298. package/es/layouts/BasicLayout/components/Main.d.ts +10 -0
  299. package/es/layouts/BasicLayout/components/Main.js +390 -0
  300. package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.d.ts +11 -0
  301. package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.js +104 -0
  302. package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.less +59 -0
  303. package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.d.ts +10 -0
  304. package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.js +667 -0
  305. package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.less +445 -0
  306. package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.d.ts +6 -0
  307. package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.js +72 -0
  308. package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.less +30 -0
  309. package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.d.ts +10 -0
  310. package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.js +116 -0
  311. package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.less +155 -0
  312. package/es/layouts/BasicLayout/components/MainFramework/components/WaterMark/index.d.ts +6 -0
  313. package/es/layouts/BasicLayout/components/MainFramework/components/WaterMark/index.js +70 -0
  314. package/es/layouts/BasicLayout/components/MainFramework/index.d.ts +28 -0
  315. package/es/layouts/BasicLayout/components/MainFramework/index.js +78 -0
  316. package/es/layouts/BasicLayout/components/MainFramework/index.less +97 -0
  317. package/es/layouts/BasicLayout/components/MainFramework/typings.d.ts +10 -0
  318. package/es/layouts/BasicLayout/index.d.ts +3 -0
  319. package/es/layouts/BasicLayout/index.js +98 -0
  320. package/es/layouts/BasicLayout/typings.d.ts +82 -0
  321. package/es/layouts/BlankLayout/index.d.ts +5 -0
  322. package/es/layouts/BlankLayout/index.js +5 -0
  323. package/es/layouts/Breadcrumb/index.d.ts +6 -0
  324. package/es/layouts/Breadcrumb/index.js +75 -0
  325. package/es/layouts/MicroLayout/index.d.ts +10 -0
  326. package/es/layouts/MicroLayout/index.js +105 -0
  327. package/es/layouts/MicroLayout/typings.d.ts +25 -0
  328. package/es/layouts/components/CachableRoute.d.ts +2 -0
  329. package/es/layouts/components/CachableRoute.js +38 -0
  330. package/es/layouts/components/RouteTab.d.ts +20 -0
  331. package/es/layouts/components/RouteTab.js +40 -0
  332. package/es/layouts/components/Switch.d.ts +2 -0
  333. package/es/layouts/components/Switch.js +63 -0
  334. package/es/layouts/index.d.ts +4 -0
  335. package/es/layouts/index.js +4 -0
  336. package/es/layouts/typings.d.ts +29 -0
  337. package/es/layouts/utils.d.ts +23 -0
  338. package/es/layouts/utils.js +175 -0
  339. package/es/styles/overrides.less +191 -0
  340. package/es/styles/theme.less +9 -0
  341. package/es/styles/utils.less +110 -0
  342. package/package.json +75 -22
  343. package/es/subject.d.ts +0 -12
  344. package/es/subject.js +0 -30
package/es/init.js ADDED
@@ -0,0 +1,153 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
+
9
+ import React from 'react';
10
+ import { message, Modal, Select, ConfigProvider, Result, Button, version, DatePicker, Cascader, TreeSelect } from 'antd';
11
+ import { config } from '@lemon-fe/hooks';
12
+ import PageLoading from "./components/PageLoading";
13
+ import Icons from "./components/Icons";
14
+ var Tip = Icons.Tip,
15
+ Down = Icons.Down,
16
+ BigTip = Icons.BigTip,
17
+ Close = Icons.Close;
18
+ export default function init() {
19
+ var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
20
+
21
+ // 添加站长统计
22
+ if (opts.enableCNZZ) {
23
+ var _node = document.createElement('script');
24
+
25
+ _node.innerHTML = "\n var _czc = _czc || [];\n window._czc&&window._czc.push(['_setAutoPageview', false]);\n ";
26
+ document.body.appendChild(_node);
27
+ _node = document.createElement('script');
28
+
29
+ if (typeof opts.enableCNZZ === 'string') {
30
+ _node.src = opts.enableCNZZ;
31
+ } else {
32
+ _node.src = '//v1.cnzz.com/z_stat.php?id=1280732258&web_id=1280732258';
33
+ }
34
+
35
+ document.body.appendChild(_node);
36
+ }
37
+
38
+ var types = ['success', 'error', 'warning', 'info'];
39
+ types.forEach(function (item) {
40
+ var msgAPI = message[item].bind(message);
41
+ var modalAPI = Modal[item].bind(Modal);
42
+
43
+ message[item] = function () {
44
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
45
+ args[_key] = arguments[_key];
46
+ }
47
+
48
+ var args0 = args[0],
49
+ args1 = args[1],
50
+ args2 = args[2];
51
+
52
+ if (args.length === 1 && _typeof(args0) === 'object' && ! /*#__PURE__*/React.isValidElement(args0)) {
53
+ return msgAPI(_objectSpread({
54
+ icon: /*#__PURE__*/React.createElement(Tip, {
55
+ type: item
56
+ })
57
+ }, args0));
58
+ }
59
+
60
+ return msgAPI({
61
+ content: args0,
62
+ duration: args1,
63
+ onClose: args2,
64
+ icon: /*#__PURE__*/React.createElement(Tip, {
65
+ type: item
66
+ })
67
+ });
68
+ };
69
+
70
+ Modal[item] = function () {
71
+ return modalAPI(_objectSpread({
72
+ icon: /*#__PURE__*/React.createElement(BigTip, {
73
+ type: item
74
+ }),
75
+ title: '提示'
76
+ }, arguments.length <= 0 ? undefined : arguments[0]));
77
+ };
78
+ });
79
+ var modalConfirm = Modal.confirm.bind(Modal);
80
+
81
+ Modal.confirm = function () {
82
+ return modalConfirm(_objectSpread({
83
+ icon: /*#__PURE__*/React.createElement(BigTip, {
84
+ type: "info"
85
+ }),
86
+ title: '提示'
87
+ }, arguments.length <= 0 ? undefined : arguments[0]));
88
+ };
89
+
90
+ Modal.defaultProps = _objectSpread(_objectSpread({}, Modal.defaultProps), {}, {
91
+ closeIcon: /*#__PURE__*/React.createElement(Close, null)
92
+ });
93
+ var node = /*#__PURE__*/React.createElement(Down, {
94
+ style: {
95
+ marginRight: -1,
96
+ pointerEvents: 'none'
97
+ }
98
+ }); //@ts-ignore
99
+
100
+ Select.defaultProps = {
101
+ suffixIcon: version >= '4.18.9' ? node : function () {
102
+ return node;
103
+ }
104
+ }; //@ts-ignore
105
+
106
+ TreeSelect.defaultProps = {
107
+ suffixIcon: version >= '4.18.9' ? node : function () {
108
+ return node;
109
+ }
110
+ }; //@ts-ignore
111
+
112
+ Cascader.defaultProps = {
113
+ suffixIcon: node
114
+ };
115
+ DatePicker.RangePicker.defaultProps = {
116
+ suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
117
+ };
118
+ DatePicker.defaultProps = {
119
+ suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
120
+ };
121
+ config({
122
+ showToast: function showToast() {
123
+ return message.loading('请稍等', 0);
124
+ },
125
+ cancelToast: function cancelToast(hide) {
126
+ hide();
127
+ },
128
+ showLoading: function showLoading() {
129
+ return /*#__PURE__*/React.createElement(PageLoading, null);
130
+ },
131
+ showError: function showError(err) {
132
+ message.error(err.message);
133
+ },
134
+ setPrimaryColor: function setPrimaryColor(color) {
135
+ ConfigProvider.config({
136
+ theme: {
137
+ primaryColor: color
138
+ }
139
+ });
140
+ },
141
+ errorResult: function errorResult(err, refresh) {
142
+ return /*#__PURE__*/React.createElement(Result, {
143
+ status: "500",
144
+ title: "500",
145
+ subTitle: err.message,
146
+ extra: /*#__PURE__*/React.createElement(Button, {
147
+ type: "primary",
148
+ onClick: refresh
149
+ }, "\u91CD\u65B0\u52A0\u8F7D")
150
+ });
151
+ }
152
+ });
153
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { BasicLayoutProps } from '../typings';
3
+ declare type Props = Omit<BasicLayoutProps, 'auth'>;
4
+ declare global {
5
+ interface Window {
6
+ _czc?: any[];
7
+ }
8
+ }
9
+ export default function Main(props: Props): JSX.Element;
10
+ export {};
@@ -0,0 +1,390 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16
+
17
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
18
+
19
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+
21
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22
+
23
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24
+
25
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
+
27
+ import React, { useState, useMemo, useEffect, useRef } from 'react';
28
+ import { Modal } from 'antd';
29
+ import { useHistory, useLocation, matchPath, useRouteMatch } from 'react-router';
30
+ import moment from 'moment';
31
+ import MainFramework from "./MainFramework";
32
+ import RouteTab from "../../components/RouteTab";
33
+
34
+ function mapTree(tree, childrenKey, mapper) {
35
+ var traverse = function traverse(nodes) {
36
+ var result = [];
37
+ nodes.forEach(function (node) {
38
+ var children;
39
+
40
+ if (node[childrenKey] !== undefined) {
41
+ children = traverse(node[childrenKey]);
42
+ }
43
+
44
+ mapper(_objectSpread(_objectSpread({}, node), {}, _defineProperty({}, childrenKey, children)), result);
45
+ });
46
+ return result;
47
+ };
48
+
49
+ return traverse(tree);
50
+ }
51
+
52
+ export default function Main(props) {
53
+ var logo = props.logo,
54
+ title = props.title,
55
+ _props$routes = props.routes,
56
+ routes = _props$routes === void 0 ? [] : _props$routes,
57
+ menusProp = props.menus,
58
+ right = props.right,
59
+ authorities = props.authorities,
60
+ topTabs = props.topTabs,
61
+ favoritesProp = props.favorites,
62
+ onFavoritesChangeProp = props.onFavoritesChange,
63
+ waterMark = props.waterMark;
64
+ var defaultFavorites = useMemo(function () {
65
+ return JSON.parse(window.localStorage.getItem('MENU_FAVORITES') || '[]');
66
+ }, []);
67
+ var mAuths = useMemo(function () {
68
+ return new Set(authorities);
69
+ }, [authorities]);
70
+
71
+ var _useMemo = useMemo(function () {
72
+ var pathMap = new Map();
73
+
74
+ if (authorities === undefined) {
75
+ return [menusProp, pathMap];
76
+ }
77
+
78
+ var mMenus = mapTree(menusProp, 'children', function (node, result) {
79
+ if (!node.path && (!node.children || node.children.length <= 0)) {
80
+ return;
81
+ }
82
+
83
+ if (node.authority !== undefined) {
84
+ var flag = false;
85
+
86
+ if (node.path) {
87
+ pathMap.set(node.path, node.authority);
88
+ }
89
+
90
+ if (Array.isArray(node.authority)) {
91
+ for (var i = 0; i < node.authority.length; i += 1) {
92
+ if (mAuths.has(node.authority[i])) {
93
+ flag = true;
94
+ break;
95
+ }
96
+ }
97
+ } else if (mAuths.has(node.authority)) {
98
+ flag = true;
99
+ }
100
+
101
+ if (flag) {
102
+ result.push(node);
103
+ }
104
+
105
+ return;
106
+ }
107
+
108
+ result.push(node);
109
+ });
110
+ return [mMenus, pathMap];
111
+ }, [menusProp,, mAuths]),
112
+ _useMemo2 = _slicedToArray(_useMemo, 2),
113
+ menus = _useMemo2[0],
114
+ pathAuthorities = _useMemo2[1];
115
+
116
+ var history = useHistory();
117
+ var location = useLocation();
118
+ var topMatch = useRouteMatch();
119
+
120
+ var _useState = useState(defaultFavorites),
121
+ _useState2 = _slicedToArray(_useState, 2),
122
+ favorites = _useState2[0],
123
+ setFavorites = _useState2[1];
124
+
125
+ useEffect(function () {
126
+ if (favorites !== defaultFavorites) {
127
+ window.localStorage.setItem('MENU_FAVORITES', JSON.stringify(favorites));
128
+ }
129
+ }, [favorites]);
130
+
131
+ var handleFavoritesChange = function handleFavoritesChange(items) {
132
+ if (onFavoritesChangeProp) {
133
+ onFavoritesChangeProp(items);
134
+ } else {
135
+ setFavorites(items);
136
+ }
137
+ };
138
+
139
+ var defaultTabs = useMemo(function () {
140
+ if (topTabs) {
141
+ return topTabs.map(function (tab) {
142
+ return {
143
+ title: tab.title,
144
+ location: {
145
+ pathname: tab.path,
146
+ search: '',
147
+ hash: ''
148
+ },
149
+ rootPath: tab.path,
150
+ route: {
151
+ title: tab.title,
152
+ path: tab.path,
153
+ component: ''
154
+ },
155
+ closable: false
156
+ };
157
+ });
158
+ }
159
+
160
+ return [];
161
+ }, []);
162
+
163
+ var _useState3 = useState({
164
+ active: -1,
165
+ tabs: defaultTabs
166
+ }),
167
+ _useState4 = _slicedToArray(_useState3, 2),
168
+ state = _useState4[0],
169
+ setState = _useState4[1];
170
+
171
+ var prevUrl = useRef('');
172
+ useEffect(function () {
173
+ setState(function (prev) {
174
+ var match = null;
175
+ var mRoute = null;
176
+
177
+ for (var i = 0; i < routes.length; i += 1) {
178
+ var route = routes[i];
179
+
180
+ if (route.component !== undefined) {
181
+ match = route.path ? matchPath(location.pathname, {
182
+ path: route.path,
183
+ exact: route.exact,
184
+ strict: route.strict,
185
+ sensitive: route.sensitive
186
+ }) : topMatch;
187
+
188
+ if (match !== null) {
189
+ mRoute = route;
190
+ break;
191
+ }
192
+ }
193
+ }
194
+
195
+ if (match !== null && mRoute !== null) {
196
+ if (mRoute.redirect) {
197
+ history.push(mRoute.redirect);
198
+ return prev;
199
+ }
200
+
201
+ var _tabs = _toConsumableArray(prev.tabs);
202
+
203
+ var active = prev.active;
204
+ var tab = {
205
+ rootPath: match.path,
206
+ title: mRoute.title || '',
207
+ route: mRoute,
208
+ match: match,
209
+ location: location
210
+ };
211
+
212
+ var index = _tabs.findIndex(function (item) {
213
+ return item.rootPath === tab.rootPath;
214
+ });
215
+
216
+ if (index >= 0) {
217
+ tab.closable = _tabs[index].closable;
218
+ tab.refreshCount = _tabs[index].refreshCount;
219
+ _tabs[index] = tab;
220
+ active = index;
221
+ } else {
222
+ _tabs.push(tab);
223
+
224
+ if (_tabs.length > 10) {
225
+ var len = defaultTabs.length;
226
+ _tabs = [].concat(_toConsumableArray(_tabs.slice(0, len)), _toConsumableArray(_tabs.slice(len - 10)));
227
+ var key = 'TAB_NO_TIP_DATE';
228
+ var date = localStorage.getItem(key);
229
+ var today = moment().format('YYYY-MM-DD');
230
+
231
+ if (date === null || date !== today) {
232
+ Modal.confirm({
233
+ title: '提示',
234
+ content: '当前打开页签已达10个, 为不影响浏览器性能, 已为您关闭最早打开的页签',
235
+ cancelText: '今日不再提醒',
236
+ okText: '我知道啦',
237
+ onCancel: function onCancel() {
238
+ localStorage.setItem(key, today);
239
+ }
240
+ });
241
+ }
242
+ }
243
+
244
+ active = _tabs.length - 1;
245
+ }
246
+
247
+ return {
248
+ tabs: _tabs,
249
+ active: active
250
+ };
251
+ }
252
+
253
+ return prev;
254
+ });
255
+ }, [location]);
256
+ useEffect(function () {
257
+ var tab = state.tabs[state.active];
258
+
259
+ if (window._czc && tab !== undefined) {
260
+ window._czc.push(['_trackPageview', window.location.pathname, prevUrl.current]);
261
+
262
+ window._czc.push(['_trackEvent', '页面访问', title, tab.title]);
263
+ }
264
+
265
+ prevUrl.current = window.location.pathname;
266
+ }, [state]);
267
+
268
+ var handleClick = function handleClick(index) {
269
+ if (state.active !== index) {
270
+ var tab = state.tabs[index];
271
+
272
+ if (tab !== undefined) {
273
+ history.push(tab.location);
274
+ }
275
+ }
276
+ };
277
+
278
+ var handleClose = function handleClose(index) {
279
+ var next = _objectSpread(_objectSpread({}, state), {}, {
280
+ tabs: _toConsumableArray(state.tabs)
281
+ });
282
+
283
+ next.tabs.splice(index, 1);
284
+
285
+ if (index <= state.active) {
286
+ next.active -= 1;
287
+
288
+ if (next.active < 0 && next.tabs.length > 0) {
289
+ next.active = 0;
290
+ }
291
+ }
292
+
293
+ var tab = next.tabs[next.active];
294
+ setState(next);
295
+
296
+ if (tab !== undefined && tab.location.pathname !== state.tabs[state.active].location.pathname) {
297
+ history.push(tab.location);
298
+ }
299
+ };
300
+
301
+ var handleMenuClick = function handleMenuClick(menu) {
302
+ if (menu.path) {
303
+ if (/^(?:https?:)?\/\//.test(menu.path)) {
304
+ window.open(menu.path);
305
+ } else if (menu.path !== location.pathname) {
306
+ history.push(menu.path);
307
+ }
308
+ }
309
+ };
310
+
311
+ var handleRefreshCurrent = function handleRefreshCurrent() {
312
+ setState(function (prev) {
313
+ var newTabs = prev.tabs.length > 0 ? prev.tabs.map(function (i, index) {
314
+ return _objectSpread(_objectSpread({}, i), {}, {
315
+ refreshCount: index === state.active ? (i.refreshCount || 0) + 1 : i.refreshCount
316
+ });
317
+ }) : prev.tabs;
318
+ return _objectSpread(_objectSpread({}, prev), {}, {
319
+ tabs: newTabs
320
+ });
321
+ });
322
+ };
323
+
324
+ var handleCloseOtherTabs = function handleCloseOtherTabs() {
325
+ setState(function (prev) {
326
+ var activeTab = -1;
327
+ var newTabs = [];
328
+ prev.tabs.forEach(function (tab, index) {
329
+ if (index === prev.active) {
330
+ activeTab = newTabs.length;
331
+ newTabs.push(tab);
332
+ } else if (tab.closable === false) {
333
+ newTabs.push(tab);
334
+ }
335
+ });
336
+ return {
337
+ active: activeTab,
338
+ tabs: newTabs
339
+ };
340
+ });
341
+ };
342
+
343
+ var handleCloseAllTabs = function handleCloseAllTabs() {
344
+ setState({
345
+ active: defaultTabs.length > 0 ? 0 : -1,
346
+ tabs: defaultTabs
347
+ });
348
+
349
+ if (defaultTabs.length > 0) {
350
+ history.push(defaultTabs[0].location);
351
+ }
352
+ };
353
+
354
+ return /*#__PURE__*/React.createElement(MainFramework, {
355
+ menus: menus,
356
+ tabs: state.tabs,
357
+ active: state.active,
358
+ onTabClick: handleClick,
359
+ onMenuClick: handleMenuClick,
360
+ onTabClose: handleClose,
361
+ onRefresh: handleRefreshCurrent,
362
+ onCloseAll: handleCloseAllTabs,
363
+ onCloseOther: handleCloseOtherTabs,
364
+ title: title,
365
+ right: right,
366
+ logo: logo,
367
+ favorites: favoritesProp || favorites,
368
+ onFavoritesChange: handleFavoritesChange,
369
+ waterMark: waterMark
370
+ }, state.tabs.map(function (tab, index) {
371
+ var route = tab.route,
372
+ refreshCount = tab.refreshCount;
373
+ var key = !!route.path && refreshCount !== undefined ? refreshCount + '_' + route.path : route.path;
374
+ return /*#__PURE__*/React.createElement("div", {
375
+ key: key,
376
+ style: state.active === index ? undefined : {
377
+ display: 'none'
378
+ }
379
+ }, /*#__PURE__*/React.createElement(RouteTab, {
380
+ authorities: mAuths,
381
+ route: route,
382
+ routes: routes,
383
+ history: history,
384
+ match: tab.match,
385
+ index: index,
386
+ location: tab.location,
387
+ pathAuthorities: pathAuthorities
388
+ }));
389
+ }));
390
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export default function DropMenu<T extends {
3
+ title: string;
4
+ closable?: boolean;
5
+ }>(props: {
6
+ tabs: T[];
7
+ active: number;
8
+ visible?: boolean;
9
+ onClick: (active: number) => void;
10
+ onClose: (active: number) => void;
11
+ }): JSX.Element;
@@ -0,0 +1,104 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
+
11
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+
15
+ import React, { useState } from 'react';
16
+ import classNames from 'classnames';
17
+ import { PREFIX_CLS as prefixCls } from "../../../../../../constants";
18
+ import { Popover } from 'antd';
19
+ export default function DropMenu(props) {
20
+ var tabs = props.tabs,
21
+ active = props.active,
22
+ _props$visible = props.visible,
23
+ visible = _props$visible === void 0 ? false : _props$visible,
24
+ onClick = props.onClick,
25
+ onClose = props.onClose;
26
+
27
+ var _useState = useState(false),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ popVisible = _useState2[0],
30
+ setPopVisible = _useState2[1];
31
+
32
+ var handleClose = function handleClose(e, index) {
33
+ e.stopPropagation();
34
+ onClose(index);
35
+ };
36
+
37
+ var handleClick = function handleClick(index) {
38
+ onClick(index);
39
+ setPopVisible(false);
40
+ };
41
+
42
+ return /*#__PURE__*/React.createElement(Popover, {
43
+ open: popVisible,
44
+ onOpenChange: setPopVisible,
45
+ overlayClassName: "".concat(prefixCls, "-nav-menu-pop"),
46
+ trigger: "click",
47
+ placement: "bottomRight",
48
+ content: /*#__PURE__*/React.createElement("div", {
49
+ className: "".concat(prefixCls, "-nav-menu-tabs")
50
+ }, tabs.map(function (item, index) {
51
+ var key = item.title;
52
+ return /*#__PURE__*/React.createElement("div", {
53
+ className: classNames("".concat(prefixCls, "-nav-menu-tab"), _defineProperty({}, "".concat(prefixCls, "-nav-menu-tab-active"), index === active)),
54
+ onClick: function onClick() {
55
+ return handleClick(index);
56
+ },
57
+ key: key
58
+ }, item.title, item.closable !== false && /*#__PURE__*/React.createElement("div", {
59
+ className: "".concat(prefixCls, "-nav-menu-tab-close"),
60
+ onClick: function onClick(e) {
61
+ return handleClose(e, index);
62
+ }
63
+ }, /*#__PURE__*/React.createElement("svg", {
64
+ width: "14",
65
+ height: "14",
66
+ xmlns: "http://www.w3.org/2000/svg"
67
+ }, /*#__PURE__*/React.createElement("g", {
68
+ fill: "none",
69
+ fillRule: "evenodd"
70
+ }, /*#__PURE__*/React.createElement("g", {
71
+ fill: "currentColor"
72
+ }, /*#__PURE__*/React.createElement("g", {
73
+ fillRule: "nonzero"
74
+ }, /*#__PURE__*/React.createElement("path", {
75
+ d: "M7.74992318,2.75006802 L7.74992318,11.250068 C7.74992318,11.6642816 7.41413675,12.000068 6.99992318,12.000068 C6.58570962,12.000068 6.24992318,11.6642816 6.24992318,11.250068 L6.24992318,2.75006802 C6.24992318,2.33585446 6.58570962,2.00006802 6.99992318,2.00006802 C7.41413675,2.00006802 7.74992318,2.33585446 7.74992318,2.75006802 Z",
76
+ transform: "translate(-367.000000, -21.000000) translate(367.000000, 21.000000) translate(6.999923, 7.000068) rotate(45.000000) translate(-6.999923, -7.000068)"
77
+ }), /*#__PURE__*/React.createElement("path", {
78
+ d: "M7.74994595,2.75007682 L7.74994595,11.2500768 C7.74994595,11.6642904 7.41415952,12.0000768 6.99994595,12.0000768 C6.58573239,12.0000768 6.24994595,11.6642904 6.24994595,11.2500768 L6.24994595,2.75007682 C6.24994595,2.33586325 6.58573239,2.00007682 6.99994595,2.00007682 C7.41415952,2.00007682 7.74994595,2.33586325 7.74994595,2.75007682 Z",
79
+ transform: "translate(-367.000000, -21.000000) translate(367.000000, 21.000000) translate(6.999946, 7.000077) rotate(-45.000000) translate(-6.999946, -7.000077)"
80
+ })))))));
81
+ }))
82
+ }, /*#__PURE__*/React.createElement("div", {
83
+ className: classNames("".concat(prefixCls, "-nav-menu-drop-icon"), _defineProperty({}, "".concat(prefixCls, "-nav-menu-drop-icon-active"), popVisible)),
84
+ style: visible ? {
85
+ visibility: 'visible'
86
+ } : {
87
+ visibility: 'hidden'
88
+ }
89
+ }, /*#__PURE__*/React.createElement("svg", {
90
+ width: "20",
91
+ height: "20",
92
+ viewBox: "0 0 20 20",
93
+ xmlns: "http://www.w3.org/2000/svg"
94
+ }, /*#__PURE__*/React.createElement("path", {
95
+ d: "M5.757 7.757 10 12l4.243-4.243",
96
+ stroke: "currentColor",
97
+ strokeWidth: "1.5",
98
+ strokeLinecap: "round",
99
+ strokeLinejoin: "round",
100
+ strokeDasharray: "0,0",
101
+ fill: "none",
102
+ fillRule: "evenodd"
103
+ }))));
104
+ }