@gm-pc/react 1.12.2 → 1.12.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-pc/react",
3
- "version": "1.12.2",
3
+ "version": "1.12.3",
4
4
  "description": "观麦前端基础组件库",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-pc#readme",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@gm-common/hooks": "^2.10.0",
26
26
  "@gm-common/tool": "^2.10.0",
27
- "@gm-pc/locales": "^1.12.2",
27
+ "@gm-pc/locales": "^1.12.3",
28
28
  "big.js": "^6.0.1",
29
29
  "classnames": "^2.2.5",
30
30
  "lodash": "^4.17.19",
@@ -48,5 +48,5 @@
48
48
  "react-router-dom": "^5.2.0",
49
49
  "react-window": "^1.8.5"
50
50
  },
51
- "gitHead": "a0a3ede3418e89a520831e4e90fc7b39fbd72d0a"
51
+ "gitHead": "6d41c2327367cc74256512fdf7bc247419ad0afa"
52
52
  }
@@ -169,7 +169,7 @@ const VBrowserContainer: FC<{ className?: string }> = observer(
169
169
 
170
170
  <div
171
171
  className={classNames('v-browser-tabs-right tw-font-sm tw-px-2.5', {
172
- disabled: state.scrollWidth - state.width - state.scrollLeft === 0,
172
+ disabled: state.scrollWidth - state.width - state.scrollLeft < 1,
173
173
  'tw-hidden': state.width === state.scrollWidth,
174
174
  })}
175
175
  // onClick={(e) => {
@@ -105,6 +105,7 @@
105
105
  );
106
106
  overflow: auto;
107
107
  background-color: white;
108
+ position: relative;
108
109
  }
109
110
 
110
111
  &.hiding-tabs {
@@ -2,6 +2,7 @@
2
2
  import { get } from 'lodash'
3
3
  import { observer } from 'mobx-react'
4
4
  import React, { createRef, FC, useContext, useEffect } from 'react'
5
+ import { NProgress } from '../../n_progress'
5
6
  import BrowserContext from '../context/browser'
6
7
  import { CacheItem } from '../types'
7
8
  import { pages } from '../v_browser'
@@ -32,21 +33,28 @@ const WindowWrapper: FC<WindowWrapperProps> = ({ path }) => {
32
33
  // 创建缓存
33
34
  const page = pages.find((p) => p.path === path)
34
35
  if (!page) throw new Error('[VBrowser] page not found: ' + path)
35
- page.loader().then((module) => {
36
- const Component = module.default
37
- const vNode = (
38
- <div
39
- className='v-browser-window-content'
40
- data-vbrowser-window={path}
41
- ref={createRef()}
42
- >
43
- <Component />
44
- </div>
45
- ) as CacheItem['vNode']
46
- browser['_setCache'](path, { vNode })
47
- browser['_fire']('show', w!)
48
- return null
49
- })
36
+
37
+ NProgress.start()
38
+ page
39
+ .loader()
40
+ .then((module) => {
41
+ const Component = module.default
42
+ const vNode = (
43
+ <div
44
+ className='v-browser-window-content'
45
+ data-vbrowser-window={path}
46
+ ref={createRef()}
47
+ >
48
+ <Component />
49
+ </div>
50
+ ) as CacheItem['vNode']
51
+ browser['_setCache'](path, { vNode })
52
+ browser['_fire']('show', w!)
53
+ return null
54
+ })
55
+ .finally(() => {
56
+ NProgress.done()
57
+ })
50
58
  return
51
59
  }
52
60
 
@@ -172,7 +172,7 @@ class VBrowser implements VBrowser {
172
172
  const originWindows = this.windows.slice()
173
173
  const activeWindow = this.activeWindow
174
174
  this.windows.splice(i, 1)
175
- delete this._cache[i]
175
+ delete this._cache[originWindows[i].path]
176
176
  if (this.activeIndex === i) {
177
177
  const left = originWindows.slice(0, i).reverse()[0]
178
178
  const right = originWindows.slice(i + 1, originWindows.length)[0]