@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.
- package/README.md +27 -5
- package/es/app.d.ts +1 -0
- package/es/app.js +3 -0
- package/es/components/Actions/index.d.ts +26 -0
- package/es/components/Actions/index.js +169 -0
- package/es/components/Actions/index.less +67 -0
- package/es/components/BaseTable/Actions.d.ts +9 -0
- package/es/components/BaseTable/Actions.js +136 -0
- package/es/components/BaseTable/BaseTableContext.d.ts +7 -0
- package/es/components/BaseTable/BaseTableContext.js +7 -0
- package/es/components/BaseTable/ResizeHeaderCell.d.ts +8 -0
- package/es/components/BaseTable/ResizeHeaderCell.js +130 -0
- package/es/components/BaseTable/VirtualBody.d.ts +8 -0
- package/es/components/BaseTable/VirtualBody.js +163 -0
- package/es/components/BaseTable/empty.png +0 -0
- package/es/components/BaseTable/index.d.ts +9 -0
- package/es/components/BaseTable/index.js +482 -0
- package/es/components/BaseTable/index.less +189 -0
- package/es/components/BaseTable/typings.d.ts +48 -0
- package/es/components/BaseTable/utils.d.ts +4 -0
- package/es/components/BaseTable/utils.js +26 -0
- package/es/components/ColorPicker/index.d.ts +13 -0
- package/es/components/ColorPicker/index.js +114 -0
- package/es/components/ColorPicker/index.less +47 -0
- package/es/components/DataGrid/Actions.d.ts +9 -0
- package/es/components/DataGrid/Actions.js +119 -0
- package/es/components/DataGrid/CellRenderer.d.ts +4 -0
- package/es/components/DataGrid/CellRenderer.js +68 -0
- package/es/components/DataGrid/GridContext.d.ts +4 -0
- package/es/components/DataGrid/GridContext.js +4 -0
- package/es/components/DataGrid/HeaderRenderer.d.ts +6 -0
- package/es/components/DataGrid/HeaderRenderer.js +93 -0
- package/es/components/DataGrid/cell-editors/Custom.d.ts +9 -0
- package/es/components/DataGrid/cell-editors/Custom.js +105 -0
- package/es/components/DataGrid/cell-editors/Date.d.ts +8 -0
- package/es/components/DataGrid/cell-editors/Date.js +78 -0
- package/es/components/DataGrid/cell-editors/Number.d.ts +9 -0
- package/es/components/DataGrid/cell-editors/Number.js +86 -0
- package/es/components/DataGrid/cell-editors/Select.d.ts +7 -0
- package/es/components/DataGrid/cell-editors/Select.js +70 -0
- package/es/components/DataGrid/cell-editors/Text.d.ts +5 -0
- package/es/components/DataGrid/cell-editors/Text.js +60 -0
- package/es/components/DataGrid/cell-editors/Wrapper.d.ts +4 -0
- package/es/components/DataGrid/cell-editors/Wrapper.js +7 -0
- package/es/components/DataGrid/cell-editors/utils.d.ts +1 -0
- package/es/components/DataGrid/cell-editors/utils.js +2 -0
- package/es/components/DataGrid/empty.png +0 -0
- package/es/components/DataGrid/hooks.d.ts +2 -0
- package/es/components/DataGrid/hooks.js +45 -0
- package/es/components/DataGrid/index.d.ts +77 -0
- package/es/components/DataGrid/index.js +1051 -0
- package/es/components/DataGrid/index.less +304 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.d.ts +57 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.js +378 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.d.ts +120 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.js +1160 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.d.ts +7 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.js +137 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.d.ts +5 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.js +60 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.d.ts +10 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.js +199 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.d.ts +13 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.js +175 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.d.ts +21 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.js +330 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.d.ts +7 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.js +75 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.d.ts +15 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.js +15 -0
- package/es/components/DataGrid/modules/client-side-row-model/index.d.ts +1 -0
- package/es/components/DataGrid/modules/client-side-row-model/index.js +1 -0
- package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.d.ts +62 -0
- package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.js +923 -0
- package/es/components/DataGrid/modules/clipboard/clipboardModule.d.ts +7 -0
- package/es/components/DataGrid/modules/clipboard/clipboardModule.js +8 -0
- package/es/components/DataGrid/modules/clipboard/index.d.ts +1 -0
- package/es/components/DataGrid/modules/clipboard/index.js +1 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +32 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +100 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +51 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +320 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +20 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +247 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +9 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +93 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +32 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +186 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +49 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +546 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +26 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +264 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +32 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +151 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +43 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +369 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +62 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +475 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +24 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +322 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.d.ts +24 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.js +24 -0
- package/es/components/DataGrid/modules/column-tool-panel/index.d.ts +2 -0
- package/es/components/DataGrid/modules/column-tool-panel/index.js +3 -0
- package/es/components/DataGrid/modules/menu/index.d.ts +1 -0
- package/es/components/DataGrid/modules/menu/index.js +1 -0
- package/es/components/DataGrid/modules/menu/menu/contextMenu.d.ts +26 -0
- package/es/components/DataGrid/modules/menu/menu/contextMenu.js +329 -0
- package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.d.ts +85 -0
- package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.js +639 -0
- package/es/components/DataGrid/modules/menu/menu/menuItemMapper.d.ts +15 -0
- package/es/components/DataGrid/modules/menu/menu/menuItemMapper.js +565 -0
- package/es/components/DataGrid/modules/menu/menuModule.d.ts +8 -0
- package/es/components/DataGrid/modules/menu/menuModule.js +8 -0
- package/es/components/DataGrid/modules/row-grouping/index.d.ts +4 -0
- package/es/components/DataGrid/modules/row-grouping/index.js +4 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +23 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.js +303 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +20 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.js +326 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.d.ts +10 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.js +71 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +75 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +618 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +40 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +460 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +11 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +108 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +17 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +170 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +15 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +133 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +15 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +133 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +9 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +175 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.d.ts +47 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.js +814 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +24 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.js +478 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.d.ts +19 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.js +219 -0
- package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.d.ts +16 -0
- package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.js +16 -0
- package/es/components/DataGrid/modules/server-side-row-model/index.d.ts +1 -0
- package/es/components/DataGrid/modules/server-side-row-model/index.js +1 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.d.ts +47 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.js +444 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.d.ts +92 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.js +510 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.d.ts +9 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.js +115 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.d.ts +9 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.js +114 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.d.ts +5 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.js +68 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.d.ts +13 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.js +194 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.d.ts +7 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.js +63 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.d.ts +88 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.js +572 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.d.ts +108 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.js +876 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.d.ts +102 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.js +918 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.d.ts +12 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.js +141 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.d.ts +35 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.js +154 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.d.ts +23 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.js +210 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.d.ts +18 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.js +18 -0
- package/es/components/DataGrid/modules/side-bar/index.d.ts +2 -0
- package/es/components/DataGrid/modules/side-bar/index.js +2 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +11 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.js +280 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +19 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.js +132 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +16 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.js +108 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +18 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.js +115 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.d.ts +29 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.js +353 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +17 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.js +128 -0
- package/es/components/DataGrid/modules/side-bar/sideBarModule.d.ts +19 -0
- package/es/components/DataGrid/modules/side-bar/sideBarModule.js +19 -0
- package/es/components/DataGrid/typings.d.ts +138 -0
- package/es/components/DataGrid/typings.js +1 -0
- package/es/components/DataGrid/utils.d.ts +43 -0
- package/es/components/DataGrid/utils.js +242 -0
- package/es/components/Dropdown/index.d.ts +15 -0
- package/es/components/Dropdown/index.js +55 -0
- package/es/components/Dropdown/index.less +13 -0
- package/es/components/DurationPicker/index.d.ts +26 -0
- package/es/components/DurationPicker/index.js +204 -0
- package/es/components/DurationPicker/index.less +61 -0
- package/es/components/EditableTable/EditableCell.d.ts +12 -0
- package/es/components/EditableTable/EditableCell.js +41 -0
- package/es/components/EditableTable/EditableTableFormItem.d.ts +6 -0
- package/es/components/EditableTable/EditableTableFormItem.js +47 -0
- package/es/components/EditableTable/Table.d.ts +6 -0
- package/es/components/EditableTable/Table.js +362 -0
- package/es/components/EditableTable/index.d.ts +9 -0
- package/es/components/EditableTable/index.js +8 -0
- package/es/components/EditableTable/index.less +29 -0
- package/es/components/EditableTable/typings.d.ts +90 -0
- package/es/components/EditableTable/util.d.ts +25 -0
- package/es/components/EditableTable/util.js +399 -0
- package/es/components/Filter/index.d.ts +15 -0
- package/es/components/Filter/index.js +644 -0
- package/es/components/Filter/index.less +82 -0
- package/es/components/Filter/typings.d.ts +35 -0
- package/es/components/FormLayout/index.d.ts +32 -0
- package/es/components/FormLayout/index.js +41 -0
- package/es/components/FormLayout/index.less +109 -0
- package/es/components/Icons/BigTip/error.png +0 -0
- package/es/components/Icons/BigTip/index.d.ts +6 -0
- package/es/components/Icons/BigTip/index.js +46 -0
- package/es/components/Icons/BigTip/info.png +0 -0
- package/es/components/Icons/BigTip/success.png +0 -0
- package/es/components/Icons/BigTip/warning.png +0 -0
- package/es/components/Icons/Calendar.d.ts +5 -0
- package/es/components/Icons/Calendar.js +43 -0
- package/es/components/Icons/Close.d.ts +5 -0
- package/es/components/Icons/Close.js +25 -0
- package/es/components/Icons/CollapseUp.d.ts +5 -0
- package/es/components/Icons/CollapseUp.js +27 -0
- package/es/components/Icons/DarkSearch.d.ts +5 -0
- package/es/components/Icons/DarkSearch.js +34 -0
- package/es/components/Icons/Down.d.ts +5 -0
- package/es/components/Icons/Down.js +31 -0
- package/es/components/Icons/Empty.d.ts +3 -0
- package/es/components/Icons/Empty.js +267 -0
- package/es/components/Icons/LookUp.d.ts +5 -0
- package/es/components/Icons/LookUp.js +70 -0
- package/es/components/Icons/More.d.ts +5 -0
- package/es/components/Icons/More.js +40 -0
- package/es/components/Icons/Search.d.ts +5 -0
- package/es/components/Icons/Search.js +31 -0
- package/es/components/Icons/Tip.d.ts +6 -0
- package/es/components/Icons/Tip.js +165 -0
- package/es/components/Icons/index.d.ts +25 -0
- package/es/components/Icons/index.js +25 -0
- package/es/components/Layout/index.d.ts +41 -0
- package/es/components/Layout/index.js +173 -0
- package/es/components/Layout/index.less +136 -0
- package/es/components/PageLoading/index.d.ts +5 -0
- package/es/components/PageLoading/index.js +15 -0
- package/es/components/PageLoading/index.less +8 -0
- package/es/components/Popup/index.d.ts +39 -0
- package/es/components/Popup/index.js +223 -0
- package/es/components/Popup/index.less +12 -0
- package/es/components/Portal/index.d.ts +17 -0
- package/es/components/Portal/index.js +141 -0
- package/es/components/Section/TabBar.d.ts +12 -0
- package/es/components/Section/TabBar.js +51 -0
- package/es/components/Section/index.d.ts +54 -0
- package/es/components/Section/index.js +96 -0
- package/es/components/Section/index.less +130 -0
- package/es/components/SelectView/index.d.ts +47 -0
- package/es/components/SelectView/index.js +244 -0
- package/es/components/SelectView/index.less +60 -0
- package/es/components/SiderTree/TreeNodeTitle.d.ts +9 -0
- package/es/components/SiderTree/TreeNodeTitle.js +107 -0
- package/es/components/SiderTree/empty.png +0 -0
- package/es/components/SiderTree/index.d.ts +37 -0
- package/es/components/SiderTree/index.js +217 -0
- package/es/components/SiderTree/index.less +222 -0
- package/es/components/SiderTree/typings.d.ts +19 -0
- package/es/components/SymbolIcon/index.d.ts +8 -0
- package/es/components/SymbolIcon/index.js +32 -0
- package/es/components/SymbolIcon/index.less +7 -0
- package/es/components/TabBar/index.d.ts +14 -0
- package/es/components/TabBar/index.js +52 -0
- package/es/components/TabBar/index.less +31 -0
- package/es/components/Table/index.d.ts +3 -0
- package/es/components/Table/index.js +242 -0
- package/es/components/Table/typings.d.ts +25 -0
- package/es/components/Table/utils.d.ts +2 -0
- package/es/components/Table/utils.js +3 -0
- package/es/components/utils.d.ts +3 -0
- package/es/components/utils.js +20 -0
- package/es/constants.d.ts +1 -0
- package/es/constants.js +1 -0
- package/es/{useBatchOperator → hooks/useBatchOperator}/index.d.ts +2 -2
- package/es/{useBatchOperator → hooks/useBatchOperator}/index.js +120 -57
- package/es/{usePageTrack → hooks/usePageTrack}/index.d.ts +0 -0
- package/es/{usePageTrack → hooks/usePageTrack}/index.js +0 -0
- package/es/index.d.ts +33 -6
- package/es/index.js +30 -6
- package/es/index.less +25 -1
- package/es/init.d.ts +3 -0
- package/es/init.js +153 -0
- package/es/layouts/BasicLayout/components/Main.d.ts +10 -0
- package/es/layouts/BasicLayout/components/Main.js +390 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.d.ts +11 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.js +104 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.less +59 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.d.ts +10 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.js +667 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.less +445 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.d.ts +6 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.js +72 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.less +30 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.d.ts +10 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.js +116 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.less +155 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/WaterMark/index.d.ts +6 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/WaterMark/index.js +70 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.d.ts +28 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.js +78 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.less +97 -0
- package/es/layouts/BasicLayout/components/MainFramework/typings.d.ts +10 -0
- package/es/layouts/BasicLayout/index.d.ts +3 -0
- package/es/layouts/BasicLayout/index.js +98 -0
- package/es/layouts/BasicLayout/typings.d.ts +82 -0
- package/es/layouts/BlankLayout/index.d.ts +5 -0
- package/es/layouts/BlankLayout/index.js +5 -0
- package/es/layouts/Breadcrumb/index.d.ts +6 -0
- package/es/layouts/Breadcrumb/index.js +75 -0
- package/es/layouts/MicroLayout/index.d.ts +10 -0
- package/es/layouts/MicroLayout/index.js +105 -0
- package/es/layouts/MicroLayout/typings.d.ts +25 -0
- package/es/layouts/components/CachableRoute.d.ts +2 -0
- package/es/layouts/components/CachableRoute.js +38 -0
- package/es/layouts/components/RouteTab.d.ts +20 -0
- package/es/layouts/components/RouteTab.js +40 -0
- package/es/layouts/components/Switch.d.ts +2 -0
- package/es/layouts/components/Switch.js +63 -0
- package/es/layouts/index.d.ts +4 -0
- package/es/layouts/index.js +4 -0
- package/es/layouts/typings.d.ts +29 -0
- package/es/layouts/utils.d.ts +23 -0
- package/es/layouts/utils.js +175 -0
- package/es/styles/overrides.less +191 -0
- package/es/styles/theme.less +9 -0
- package/es/styles/utils.less +110 -0
- package/package.json +75 -22
- package/es/subject.d.ts +0 -12
- package/es/subject.js +0 -30
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
.@{prefixCls}-nav-tabs-layout {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-grow: 1;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
align-items: flex-end;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
overflow-x: hidden;
|
|
9
|
+
|
|
10
|
+
&-icon {
|
|
11
|
+
align-self: center;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.@{prefixCls}-nav-tabs {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-wrap: nowrap;
|
|
19
|
+
align-items: flex-end;
|
|
20
|
+
padding: 7px 16px 0;
|
|
21
|
+
overflow-x: hidden;
|
|
22
|
+
|
|
23
|
+
&::before {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
z-index: 4;
|
|
28
|
+
display: block;
|
|
29
|
+
width: 16px;
|
|
30
|
+
height: 100%;
|
|
31
|
+
background-color: #fff;
|
|
32
|
+
border-bottom-right-radius: 10px;
|
|
33
|
+
content: '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&::after {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
z-index: 4;
|
|
41
|
+
display: block;
|
|
42
|
+
width: 16px;
|
|
43
|
+
height: 100%;
|
|
44
|
+
background-color: #fff;
|
|
45
|
+
border-bottom-left-radius: 10px;
|
|
46
|
+
content: '';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.@{prefixCls}-nav-tab {
|
|
51
|
+
position: relative;
|
|
52
|
+
box-sizing: content-box;
|
|
53
|
+
min-width: 66px;
|
|
54
|
+
max-width: 120px;
|
|
55
|
+
height: 43px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
|
|
58
|
+
&::before {
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 15px;
|
|
61
|
+
left: 0;
|
|
62
|
+
z-index: 5;
|
|
63
|
+
display: block;
|
|
64
|
+
width: 1px;
|
|
65
|
+
height: 12px;
|
|
66
|
+
background-color: #c4c4c4;
|
|
67
|
+
opacity: 0.2;
|
|
68
|
+
content: '';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&::after {
|
|
72
|
+
position: absolute;
|
|
73
|
+
right: -10px;
|
|
74
|
+
bottom: 0;
|
|
75
|
+
left: -10px;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
display: block;
|
|
78
|
+
height: 10px;
|
|
79
|
+
background-color: #fff;
|
|
80
|
+
transition: background-color 0.2s;
|
|
81
|
+
content: '';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&-title {
|
|
85
|
+
position: relative;
|
|
86
|
+
z-index: 4;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding: 7px 12px 14px;
|
|
90
|
+
background-color: #fff;
|
|
91
|
+
border-radius: 10px;
|
|
92
|
+
transition: background-color 0.2s;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:hover:not(&-active) &-title,
|
|
96
|
+
&:hover:not(&-active)::after {
|
|
97
|
+
background-color: #f9f9f9;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&-active &-title,
|
|
101
|
+
&-active::after {
|
|
102
|
+
background-color: #f2f2f2;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:hover::after {
|
|
106
|
+
z-index: 2;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-active::after {
|
|
110
|
+
z-index: 3;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&-active::before,
|
|
114
|
+
&-active + &::before,
|
|
115
|
+
&:hover::before,
|
|
116
|
+
&:hover + &::before {
|
|
117
|
+
opacity: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&-active &-inner {
|
|
121
|
+
opacity: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&-inner {
|
|
125
|
+
flex: 1;
|
|
126
|
+
min-width: 28px;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
color: #333;
|
|
129
|
+
font-size: 14px;
|
|
130
|
+
line-height: 22px;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
text-overflow: ellipsis;
|
|
133
|
+
opacity: 0.7;
|
|
134
|
+
|
|
135
|
+
&::after {
|
|
136
|
+
display: inline-block;
|
|
137
|
+
width: 16px;
|
|
138
|
+
content: ' ';
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&-close {
|
|
143
|
+
width: 14px;
|
|
144
|
+
height: 14px;
|
|
145
|
+
color: #c4c4c4;
|
|
146
|
+
line-height: 14px;
|
|
147
|
+
text-align: center;
|
|
148
|
+
border-radius: 50%;
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
color: #f2f2f2;
|
|
152
|
+
background-color: #c1c1c1;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
|
|
5
|
+
function createImgBase(options) {
|
|
6
|
+
var canvas = document.createElement('canvas');
|
|
7
|
+
var ratio = window.devicePixelRatio;
|
|
8
|
+
canvas.width = options.width * ratio;
|
|
9
|
+
canvas.height = options.height * ratio;
|
|
10
|
+
var ctx = canvas.getContext('2d');
|
|
11
|
+
|
|
12
|
+
if (ctx) {
|
|
13
|
+
ctx.font = "".concat(options.fontSize * ratio, "px ").concat(options.fontFamily);
|
|
14
|
+
ctx.fillStyle = options.color;
|
|
15
|
+
ctx.rotate(options.rotateDegree);
|
|
16
|
+
ctx.textAlign = 'center';
|
|
17
|
+
ctx.fillText(options.content, canvas.width / 2, canvas.height / 2);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return canvas.toDataURL('image/png');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function genWaterMark(_ref) {
|
|
24
|
+
var className = _ref.className,
|
|
25
|
+
_ref$width = _ref.width,
|
|
26
|
+
width = _ref$width === void 0 ? 225 : _ref$width,
|
|
27
|
+
_ref$height = _ref.height,
|
|
28
|
+
height = _ref$height === void 0 ? 225 : _ref$height,
|
|
29
|
+
_ref$content = _ref.content,
|
|
30
|
+
content = _ref$content === void 0 ? '水印' : _ref$content,
|
|
31
|
+
_ref$fontFamily = _ref.fontFamily,
|
|
32
|
+
fontFamily = _ref$fontFamily === void 0 ? '"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", 微软雅黑, Arial, sans-serif' : _ref$fontFamily,
|
|
33
|
+
_ref$fontSize = _ref.fontSize,
|
|
34
|
+
fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,
|
|
35
|
+
_ref$color = _ref.color,
|
|
36
|
+
color = _ref$color === void 0 ? 'rgba(156, 162, 169, 0.1)' : _ref$color,
|
|
37
|
+
_ref$rotate = _ref.rotate,
|
|
38
|
+
rotate = _ref$rotate === void 0 ? -24 : _ref$rotate;
|
|
39
|
+
var option = {
|
|
40
|
+
width: width,
|
|
41
|
+
height: height,
|
|
42
|
+
content: content,
|
|
43
|
+
fontSize: fontSize,
|
|
44
|
+
fontFamily: fontFamily,
|
|
45
|
+
color: color,
|
|
46
|
+
rotateDegree: rotate * Math.PI / 180
|
|
47
|
+
}; // 为了实现交错水印的效果,此处生成两张位置不同的水印 固定相对位置
|
|
48
|
+
|
|
49
|
+
var dataUri = createImgBase(option);
|
|
50
|
+
return ".".concat(className, " {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10000;\n background-repeat: repeat;\n background-image: url(").concat(dataUri, "), url(").concat(dataUri, ");\n background-size: ").concat(option.width, "px ").concat(option.height, "px;\n background-position: ").concat(width / 2, "px ").concat(height / 2, "px, 0 0;\n pointer-events: none;\n }");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default function WaterMark(props) {
|
|
54
|
+
var waterMark = props.waterMark;
|
|
55
|
+
var ref = useRef(null);
|
|
56
|
+
var name = 'EVudqS';
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
if (waterMark && ref.current !== null) {
|
|
59
|
+
ref.current.innerHTML = genWaterMark({
|
|
60
|
+
className: name,
|
|
61
|
+
content: waterMark
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}, [waterMark]);
|
|
65
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("style", {
|
|
66
|
+
ref: ref
|
|
67
|
+
}), document.head), /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: name
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import type { MenuFavorites, MenuItem } from './typings';
|
|
3
|
+
interface Props<T> {
|
|
4
|
+
title: string | ReactNode;
|
|
5
|
+
logo?: string | false | ReactElement;
|
|
6
|
+
active: number;
|
|
7
|
+
tabs: T[];
|
|
8
|
+
onTabClick: (index: number) => void;
|
|
9
|
+
onTabClose: (index: number) => void;
|
|
10
|
+
onRefresh: () => void;
|
|
11
|
+
onCloseOther: () => void;
|
|
12
|
+
onCloseAll: () => void;
|
|
13
|
+
menus?: MenuItem[];
|
|
14
|
+
onMenuClick?: (menu: MenuItem) => void;
|
|
15
|
+
renderMenu?: () => ReactNode;
|
|
16
|
+
favorites?: MenuFavorites;
|
|
17
|
+
onFavoritesChange?: (value: MenuFavorites) => void;
|
|
18
|
+
right?: ReactNode;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
waterMark?: string;
|
|
23
|
+
}
|
|
24
|
+
export default function MainFramework<TabType extends {
|
|
25
|
+
title: string;
|
|
26
|
+
closable?: boolean;
|
|
27
|
+
}>(props: Props<TabType>): JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import TabBar from "./components/TabBar";
|
|
4
|
+
import Menu from "./components/Menu";
|
|
5
|
+
import { PREFIX_CLS as prefixCls } from "../../../../constants";
|
|
6
|
+
import RefreshButton from "./components/RefreshButton";
|
|
7
|
+
import WaterMark from "./components/WaterMark";
|
|
8
|
+
export default function MainFramework(props) {
|
|
9
|
+
var className = props.className,
|
|
10
|
+
tabs = props.tabs,
|
|
11
|
+
active = props.active,
|
|
12
|
+
children = props.children,
|
|
13
|
+
right = props.right,
|
|
14
|
+
_props$menus = props.menus,
|
|
15
|
+
menus = _props$menus === void 0 ? [] : _props$menus,
|
|
16
|
+
onTabClick = props.onTabClick,
|
|
17
|
+
onMenuClick = props.onMenuClick,
|
|
18
|
+
onTabClose = props.onTabClose,
|
|
19
|
+
onRefresh = props.onRefresh,
|
|
20
|
+
onCloseOther = props.onCloseOther,
|
|
21
|
+
onCloseAll = props.onCloseAll,
|
|
22
|
+
logo = props.logo,
|
|
23
|
+
title = props.title,
|
|
24
|
+
favorites = props.favorites,
|
|
25
|
+
onFavoritesChange = props.onFavoritesChange,
|
|
26
|
+
renderMenu = props.renderMenu,
|
|
27
|
+
style = props.style,
|
|
28
|
+
waterMark = props.waterMark;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: classNames("".concat(prefixCls, "-main"), className),
|
|
31
|
+
style: style
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(prefixCls, "-nav")
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "".concat(prefixCls, "-nav-left")
|
|
36
|
+
}, logo !== false && /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: "".concat(prefixCls, "-nav-logo")
|
|
38
|
+
}, typeof logo === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
39
|
+
src: logo
|
|
40
|
+
}) : logo || /*#__PURE__*/React.createElement("svg", {
|
|
41
|
+
width: "15",
|
|
42
|
+
height: "22",
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
44
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
45
|
+
fill: "currentColor",
|
|
46
|
+
fillRule: "nonzero"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
d: "M3.403 10.313c.194-.163.393-.324.6-.481 1.47-1.123 2.592-2.339 3.333-3.622a7.805 7.805 0 0 0 1.101-4.036L8.427.966C8.159.657 7.906.335 7.67 0c-.26.384-.544.752-.849 1.103a15.52 15.52 0 0 1-2.336 2.165C2.853 4.514 1.67 5.858.938 7.28c.563 1.06 1.391 2.073 2.461 3.027M3.602 12.008a17.318 17.318 0 0 1-.835-.711C1.782 10.4.99 9.44.402 8.437a8.004 8.004 0 0 0 .362 5.91c.677 1.448 1.812 2.814 3.375 4.053.502.398.981.828 1.434 1.288v-.264a8.913 8.913 0 0 1 .99-4.146c-.687-1.157-1.683-2.256-2.96-3.276M11.025 12.036c-1.482 1.092-2.611 2.27-3.355 3.51a7.355 7.355 0 0 0-1.107 3.91l.008 1.173c.272.298.528.61.764.933.263-.372.549-.73.856-1.07a15.398 15.398 0 0 1 2.346-2.098c2.984-2.196 4.486-4.693 4.463-7.42a7.134 7.134 0 0 0-.489-2.537c-.802 1.278-1.971 2.484-3.486 3.597M11.353 9.828c.186.156.371.317.553.485.945-.983 1.668-2.02 2.156-3.096-.675-1.429-1.765-2.778-3.239-4.01-.496-.411-.968-.856-1.414-1.332v.268a9.617 9.617 0 0 1-.972 4.298c.68 1.201 1.661 2.34 2.917 3.387"
|
|
49
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: "".concat(prefixCls, "-nav-title")
|
|
51
|
+
}, title, waterMark && /*#__PURE__*/React.createElement(WaterMark, {
|
|
52
|
+
waterMark: waterMark
|
|
53
|
+
}))), /*#__PURE__*/React.createElement(TabBar, {
|
|
54
|
+
tabs: tabs,
|
|
55
|
+
active: active,
|
|
56
|
+
onClick: onTabClick,
|
|
57
|
+
onClose: onTabClose
|
|
58
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "".concat(prefixCls, "-nav-right")
|
|
60
|
+
}, /*#__PURE__*/React.createElement(RefreshButton, {
|
|
61
|
+
onRefresh: onRefresh,
|
|
62
|
+
onCloseAll: onCloseAll,
|
|
63
|
+
onCloseOther: onCloseOther
|
|
64
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "".concat(prefixCls, "-nav-divider")
|
|
66
|
+
}), right)), /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "".concat(prefixCls, "-body")
|
|
68
|
+
}, renderMenu ? /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "".concat(prefixCls, "-menu")
|
|
70
|
+
}, renderMenu()) : /*#__PURE__*/React.createElement(Menu, {
|
|
71
|
+
data: menus,
|
|
72
|
+
onClick: onMenuClick,
|
|
73
|
+
favorites: favorites,
|
|
74
|
+
onFavoritesChange: onFavoritesChange
|
|
75
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "".concat(prefixCls, "-content")
|
|
77
|
+
}, children)));
|
|
78
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@import './components/Menu/index.less';
|
|
2
|
+
@import './components/TabBar/index.less';
|
|
3
|
+
@import './components/DropMenu/index.less';
|
|
4
|
+
@import './components/RefreshButton/index.less';
|
|
5
|
+
|
|
6
|
+
.@{prefixCls}-main {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
width: 100vw;
|
|
10
|
+
min-width: 768px;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
background: #f2f2f2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.@{prefixCls}-nav {
|
|
16
|
+
position: relative;
|
|
17
|
+
z-index: 4;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: nowrap;
|
|
20
|
+
align-items: center;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 50px;
|
|
24
|
+
padding: 0 16px;
|
|
25
|
+
background: #ffff;
|
|
26
|
+
|
|
27
|
+
&-logo {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
height: 24px;
|
|
32
|
+
margin-right: 8px;
|
|
33
|
+
color: .primary(1) [];
|
|
34
|
+
|
|
35
|
+
& > img {
|
|
36
|
+
display: block;
|
|
37
|
+
height: 24px;
|
|
38
|
+
margin: 0 auto;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&-title {
|
|
43
|
+
color: #000;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-left,
|
|
49
|
+
&-right {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-left {
|
|
55
|
+
flex: 0 0 184px;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-right {
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
flex-wrap: nowrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-divider {
|
|
65
|
+
width: 1px;
|
|
66
|
+
height: 14px;
|
|
67
|
+
margin: 0 9px;
|
|
68
|
+
background: #c4c4c4;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.@{prefixCls}-body {
|
|
73
|
+
position: relative;
|
|
74
|
+
display: flex;
|
|
75
|
+
flex: 1;
|
|
76
|
+
min-height: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.@{prefixCls}-content {
|
|
80
|
+
position: relative;
|
|
81
|
+
z-index: 1;
|
|
82
|
+
flex: 1;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
|
|
85
|
+
&-loading {
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 0;
|
|
88
|
+
left: 0;
|
|
89
|
+
z-index: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
& > div {
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 100%;
|
|
95
|
+
overflow: auto;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
import { useHistory } from 'react-router-dom';
|
|
15
|
+
import { useRequest } from '@lemon-fe/hooks';
|
|
16
|
+
import PageLoading from "../../components/PageLoading";
|
|
17
|
+
import Main from "./components/Main";
|
|
18
|
+
export default function BasicLayout(props) {
|
|
19
|
+
var title = props.title,
|
|
20
|
+
logo = props.logo,
|
|
21
|
+
menus = props.menus,
|
|
22
|
+
routes = props.routes,
|
|
23
|
+
right = props.right,
|
|
24
|
+
auth = props.auth,
|
|
25
|
+
authorities = props.authorities,
|
|
26
|
+
topTabs = props.topTabs,
|
|
27
|
+
waterMark = props.waterMark;
|
|
28
|
+
|
|
29
|
+
var _useState = useState(!!auth),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
loading = _useState2[0],
|
|
32
|
+
setLoading = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var history = useHistory();
|
|
35
|
+
|
|
36
|
+
var _useRequest = useRequest(function () {
|
|
37
|
+
if (auth) {
|
|
38
|
+
return auth.check();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return Promise.resolve();
|
|
42
|
+
}, {
|
|
43
|
+
onSuccess: function onSuccess(res) {
|
|
44
|
+
if ((auth === null || auth === void 0 ? void 0 : auth.onSuccess) !== undefined) {
|
|
45
|
+
auth.onSuccess(res);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
setLoading(false);
|
|
49
|
+
},
|
|
50
|
+
onError: function onError(err) {
|
|
51
|
+
if ((auth === null || auth === void 0 ? void 0 : auth.onFail) !== undefined) {
|
|
52
|
+
auth.onFail(err);
|
|
53
|
+
} else if ((auth === null || auth === void 0 ? void 0 : auth.redirectURL) !== undefined) {
|
|
54
|
+
if (/^(?:http|https):\/\//.test(auth.redirectURL)) {
|
|
55
|
+
var url = new URL(auth.redirectURL);
|
|
56
|
+
var search = new URLSearchParams(url.search);
|
|
57
|
+
search.set('redirect', encodeURIComponent(window.location.href));
|
|
58
|
+
url.search = search.toString();
|
|
59
|
+
window.location.href = url.toString();
|
|
60
|
+
} else {
|
|
61
|
+
var result = /([^?]*)(\?.*)?/.exec(auth.redirectURL);
|
|
62
|
+
|
|
63
|
+
if (result !== null) {
|
|
64
|
+
var pathname = result[1];
|
|
65
|
+
|
|
66
|
+
var _search = new URLSearchParams(result[2]);
|
|
67
|
+
|
|
68
|
+
_search.set('redirect', encodeURIComponent(window.location.href));
|
|
69
|
+
|
|
70
|
+
history.replace("".concat(pathname, "?").concat(_search.toString()));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
request = _useRequest.run;
|
|
77
|
+
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
if (auth) {
|
|
80
|
+
request();
|
|
81
|
+
}
|
|
82
|
+
}, []);
|
|
83
|
+
|
|
84
|
+
if (loading) {
|
|
85
|
+
return /*#__PURE__*/React.createElement(PageLoading, null);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return /*#__PURE__*/React.createElement(Main, {
|
|
89
|
+
waterMark: waterMark,
|
|
90
|
+
logo: logo,
|
|
91
|
+
authorities: authorities,
|
|
92
|
+
routes: routes,
|
|
93
|
+
title: title,
|
|
94
|
+
menus: menus,
|
|
95
|
+
right: right,
|
|
96
|
+
topTabs: topTabs
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { FunctionComponent, ReactElement, ReactNode, ReactText } from 'react';
|
|
2
|
+
import type { match, useLocation } from 'react-router';
|
|
3
|
+
import type { Location, IRoute } from '../typings';
|
|
4
|
+
|
|
5
|
+
export interface MenuItem {
|
|
6
|
+
name: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
children?: MenuItem[];
|
|
9
|
+
icon?: string | ReactElement;
|
|
10
|
+
authority?: ReactText[] | ReactText;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type MenuFavorites = { name: string; path?: string }[];
|
|
14
|
+
|
|
15
|
+
export interface BasicLayoutProps<AuthResponse = unknown> {
|
|
16
|
+
/**
|
|
17
|
+
* @description 应用左上角标题
|
|
18
|
+
*/
|
|
19
|
+
title: string | ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* @description 应用左上角logo
|
|
22
|
+
*/
|
|
23
|
+
logo?: string | false | ReactElement;
|
|
24
|
+
/**
|
|
25
|
+
* @description 菜单配置项,最多支持三级
|
|
26
|
+
*/
|
|
27
|
+
menus: MenuItem[];
|
|
28
|
+
/**
|
|
29
|
+
* @description 不传入routes的情况下,渲染的内容
|
|
30
|
+
*/
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* @description 左上角显示的内容
|
|
34
|
+
*/
|
|
35
|
+
right?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* @description 路由配置
|
|
38
|
+
*/
|
|
39
|
+
routes?: IRoute[];
|
|
40
|
+
/**
|
|
41
|
+
* @description 用户包含的所有权限
|
|
42
|
+
*/
|
|
43
|
+
authorities?: ReactText[];
|
|
44
|
+
/**
|
|
45
|
+
* @description 自动登录校验过程, 可以在其中校验用户凭证是否有效,并且设置全局的用户信息
|
|
46
|
+
*/
|
|
47
|
+
auth?: {
|
|
48
|
+
redirectURL?: string;
|
|
49
|
+
check: () => Promise<AuthResponse>;
|
|
50
|
+
onFail?: (err: Error) => void;
|
|
51
|
+
onSuccess?: (res: AuthResponse) => void;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @description 置顶得路由,一般来说是主页
|
|
55
|
+
*/
|
|
56
|
+
topTabs?: {
|
|
57
|
+
title: string;
|
|
58
|
+
path: string;
|
|
59
|
+
}[];
|
|
60
|
+
/**
|
|
61
|
+
* @description 收藏夹 如果不传则内部实现
|
|
62
|
+
*/
|
|
63
|
+
favorites?: MenuFavorites;
|
|
64
|
+
/**
|
|
65
|
+
* @description 收藏夹变更
|
|
66
|
+
*/
|
|
67
|
+
onFavoritesChange?: (value: MenuFavorites) => void;
|
|
68
|
+
/**
|
|
69
|
+
* @description 水印文字
|
|
70
|
+
*/
|
|
71
|
+
waterMark?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type TabType = {
|
|
75
|
+
rootPath: string;
|
|
76
|
+
route: IRoute;
|
|
77
|
+
match: match;
|
|
78
|
+
location: Location;
|
|
79
|
+
title: string;
|
|
80
|
+
closable?: boolean;
|
|
81
|
+
refreshCount?: number;
|
|
82
|
+
};
|