@gm-pc/react 1.24.4 → 1.24.7-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-pc/react",
3
- "version": "1.24.4",
3
+ "version": "1.24.7-beta.4",
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.24.4",
27
+ "@gm-pc/locales": "^1.24.7-beta.4",
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": "56daac5e693c42568aa9a53c8d102968968b0ad6"
51
+ "gitHead": "f28f6b44fed374655b89e612c4d47502f083bdf7"
52
52
  }
@@ -80,7 +80,11 @@ const Button: FC<ButtonProps> = ({
80
80
  disabled={loadFlag || disabled}
81
81
  onClick={handleClick}
82
82
  >
83
- {loadFlag && <Loading size='1em' />}
83
+ {loadFlag && (
84
+ <div style={{ marginRight: 4 }}>
85
+ <Loading size='1em' type={type} />
86
+ </div>
87
+ )}
84
88
  {children}
85
89
  </Tag>
86
90
  )
@@ -1,7 +1,7 @@
1
1
  .gm-btn {
2
2
  height: 30px;
3
3
  border-radius: 2px;
4
- display: inline-block;
4
+ display: inline-flex;
5
5
  text-align: center;
6
6
  vertical-align: middle;
7
7
  cursor: pointer;
@@ -11,6 +11,8 @@
11
11
  font-size: 12px;
12
12
  line-height: 30px;
13
13
  user-select: none;
14
+ flex-direction: row;
15
+ align-items: center;
14
16
 
15
17
  &.gm-btn-default {
16
18
  .gmBtnVariants(var(--gm-color-default), white, white);
@@ -10,6 +10,7 @@ import { Button } from '../button'
10
10
  interface InnerProps extends ConfirmProps {
11
11
  resolve: any
12
12
  reject: any
13
+ confirmLoading?: boolean
13
14
  }
14
15
 
15
16
  const Inner: FC<InnerProps> = ({
@@ -20,6 +21,7 @@ const Inner: FC<InnerProps> = ({
20
21
  read,
21
22
  resolve,
22
23
  reject,
24
+ confirmLoading,
23
25
  }) => {
24
26
  const [checked, setChecked] = useState<boolean>(false)
25
27
 
@@ -41,6 +43,7 @@ const Inner: FC<InnerProps> = ({
41
43
  resolve()
42
44
  Dialog.hide()
43
45
  },
46
+ loading: confirmLoading,
44
47
  disabled: read ? !checked : false,
45
48
  },
46
49
  ]
@@ -28,6 +28,7 @@ const Dialog: FC<DialogProps> & DialogStatic = ({
28
28
  <Flex justifyEnd className='gm-dialog-buttons gm-margin-top-10'>
29
29
  {_.map(buttons, (btn) => (
30
30
  <Button
31
+ loading={btn.loading}
31
32
  key={btn.text}
32
33
  type={btn.btnType}
33
34
  disabled={btn.disabled}
@@ -11,6 +11,7 @@ interface DialogButtonProps {
11
11
  onClick(event?: Event): void
12
12
  btnType?: ButtonType
13
13
  disabled?: boolean
14
+ loading?: boolean
14
15
  }
15
16
 
16
17
  interface DialogProps extends ConfigProviderProps {
@@ -41,6 +42,7 @@ interface ConfirmProps extends SpecificDialogProps {
41
42
  onValidate?: (value: string) => boolean | void
42
43
  /** 阅读提示 */
43
44
  read?: boolean | string
45
+ confirmLoading?: boolean
44
46
  }
45
47
 
46
48
  interface PromptProps extends ConfirmProps, ConfigProviderProps {
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from 'react'
2
2
  import { LoadingProps } from './types'
3
3
 
4
- const Loading: FC<LoadingProps> = ({ size = '1em' }) => {
4
+ const Loading: FC<LoadingProps> = ({ size = '1em', type = 'default' }) => {
5
5
  return (
6
6
  <svg
7
7
  className='gm-loading'
@@ -11,7 +11,14 @@ const Loading: FC<LoadingProps> = ({ size = '1em' }) => {
11
11
  }}
12
12
  viewBox='0 0 50 50'
13
13
  >
14
- <circle className='gm-loading-path' cx='25' cy='25' r='20' fill='none' />
14
+ <circle
15
+ className='gm-loading-path'
16
+ cx='25'
17
+ cy='25'
18
+ r='20'
19
+ fill='none'
20
+ stroke={type === 'default' ? '#0363ff' : '#fff'}
21
+ />
15
22
  </svg>
16
23
  )
17
24
  }
@@ -6,7 +6,7 @@
6
6
  stroke-dasharray: 90, 150;
7
7
  stroke-dashoffset: 0;
8
8
  stroke-width: 2;
9
- stroke: var(--gm-color-primary);
9
+ // stroke: var(--gm-color-primary);
10
10
  stroke-linecap: round;
11
11
  }
12
12
  }
@@ -2,6 +2,7 @@ import { HTMLAttributes, ReactNode } from 'react'
2
2
 
3
3
  interface LoadingProps {
4
4
  size?: string
5
+ type: any
5
6
  }
6
7
 
7
8
  interface LoadingChunkProps extends HTMLAttributes<HTMLDivElement> {
@@ -14,6 +14,7 @@ type ButtonMap = {
14
14
  text: string
15
15
  onClick(): void
16
16
  disabled?: boolean
17
+ loading?: boolean
17
18
  }
18
19
  }
19
20
 
@@ -27,6 +28,7 @@ export interface PopupContentConfirmProps extends HTMLAttributes<HTMLDivElement>
27
28
  read?: boolean | string
28
29
  className?: string
29
30
  style?: CSSProperties
31
+ loading?: boolean
30
32
  }
31
33
 
32
34
  const PopupContentConfirm: FC<PopupContentConfirmProps> = ({
@@ -38,6 +40,7 @@ const PopupContentConfirm: FC<PopupContentConfirmProps> = ({
38
40
  read,
39
41
  className,
40
42
  children,
43
+ loading,
41
44
  ...rest
42
45
  }) => {
43
46
  const [checked, setChecked] = useState<boolean>(false)
@@ -51,6 +54,7 @@ const PopupContentConfirm: FC<PopupContentConfirmProps> = ({
51
54
  onClick() {
52
55
  onSave && onSave()
53
56
  },
57
+ loading: loading,
54
58
  },
55
59
  delete: {
56
60
  text: getLocale('删除'),
@@ -58,6 +62,7 @@ const PopupContentConfirm: FC<PopupContentConfirmProps> = ({
58
62
  onClick() {
59
63
  onDelete && onDelete()
60
64
  },
65
+ loading: loading,
61
66
  disabled: read ? !checked : false,
62
67
  },
63
68
  }
@@ -88,6 +93,7 @@ const PopupContentConfirm: FC<PopupContentConfirmProps> = ({
88
93
  onClick={() => {
89
94
  buttonMap[type].onClick()
90
95
  }}
96
+ loading={loading}
91
97
  disabled={buttonMap[type].disabled}
92
98
  >
93
99
  {buttonMap[type].text}