@wzyjs/uis 0.3.18 → 0.3.22

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": "@wzyjs/uis",
3
- "version": "0.3.18",
3
+ "version": "0.3.22",
4
4
  "description": "description",
5
5
  "author": "wzy",
6
6
  "sideEffects": false,
@@ -42,7 +42,7 @@
42
42
  "@wzyjs/utils": "^0.2.37",
43
43
  "antd": "^6.0.0"
44
44
  },
45
- "gitHead": "10e941a36df74182a45c73e7e074fc0c5ed5b669",
45
+ "gitHead": "d907b39d210477ad9099299fa736f68c11f2735b",
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  }
@@ -212,13 +212,13 @@ export const UploadImage = (props: UploadImageProps) => {
212
212
  const imageNode = (
213
213
  <div
214
214
  className='rounded border overflow-hidden relative group bg-white'
215
- style={{ maxWidth: 200, maxHeight: 200 }}
215
+ style={{ maxWidth: 200 }}
216
216
  >
217
217
  <img
218
218
  src={image}
219
219
  alt={`图片 ${index + 1}`}
220
220
  className='object-contain'
221
- style={{ maxWidth: '100%', maxHeight: '100%', display: 'block' }}
221
+ style={{ maxWidth: '100%', height: 'auto', display: 'block' }}
222
222
  />
223
223
  <Button
224
224
  type='text'
@@ -252,8 +252,8 @@ export const UploadImage = (props: UploadImageProps) => {
252
252
  src={image}
253
253
  alt={`预览图片 ${index + 1}`}
254
254
  style={{
255
- maxWidth: '200px',
256
- maxHeight: '200px',
255
+ maxWidth: '400px',
256
+ height: 'auto',
257
257
  objectFit: 'contain',
258
258
  }}
259
259
  />
@@ -279,7 +279,7 @@ export const UploadImage = (props: UploadImageProps) => {
279
279
  style={{ width: '50px', height: '50px' }}
280
280
  >
281
281
  <PlusOutlined style={{ fontSize: '24px', color: '#8c8c8c' }} />
282
- <Typography.Text type='secondary' className='mt-1'>上传</Typography.Text>
282
+ <Typography.Text type='secondary' className='m-2'>上传</Typography.Text>
283
283
  </div>
284
284
  )}
285
285
 
@@ -292,7 +292,7 @@ export const UploadImage = (props: UploadImageProps) => {
292
292
  onClick={handlePasteButton}
293
293
  >
294
294
  <PlusOutlined style={{ fontSize: '24px', color: '#8c8c8c' }} />
295
- <Typography.Text type='secondary' className='mt-1'>粘贴</Typography.Text>
295
+ <Typography.Text type='secondary' className='m-2'>粘贴</Typography.Text>
296
296
  </div>
297
297
  )}
298
298
  </Space>
package/src/antd/index.ts CHANGED
@@ -38,7 +38,8 @@ export type {
38
38
  ProFormProps,
39
39
  ProColumns,
40
40
  ProLayoutProps,
41
- ProFormInstance
41
+ ProFormInstance,
42
+ ActionType,
42
43
  } from '@ant-design/pro-components'
43
44
 
44
45
  export * from './pro'
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React, { useState, ReactNode } from 'react'
4
4
 
5
- import { Button, ButtonProps, message } from 'antd'
5
+ import { App, Button, ButtonProps } from 'antd'
6
6
  import { CheckOutlined } from '@ant-design/icons'
7
7
 
8
8
  import { copy, readClipboard } from '@wzyjs/utils/web'
@@ -15,6 +15,7 @@ export interface CopyProps extends ButtonProps {
15
15
 
16
16
  export const Copy = (props: CopyProps) => {
17
17
  const [icon, setIcon] = useState<ReactNode>(null)
18
+ const { message } = App.useApp()
18
19
 
19
20
  const [value, setValue] = useControllableValue<string>(props, {
20
21
  defaultValue: props.value,
@@ -27,7 +27,7 @@ export const Drawer = (props: DrawerProps) => {
27
27
  title={btnProps?.children}
28
28
  open={open}
29
29
  onClose={() => setOpen(false)}
30
- destroyOnClose
30
+ destroyOnHidden
31
31
  {..._.omit(props, ['children', 'btnProps'])}
32
32
  >
33
33
  {children}
@@ -15,6 +15,14 @@ export const useList = ({ list }: UseTabsStateParams) => {
15
15
  return tabs.activeKey ?? tabs.items?.[0]?.key
16
16
  })
17
17
 
18
+ // 同步外部传入的 activeKey
19
+ useEffect(() => {
20
+ const tabs = list?.toolbar?.tabs as any
21
+ if (tabs && tabs.activeKey !== undefined && tabs.activeKey !== activeTabKey) {
22
+ setTabActiveKey(tabs.activeKey)
23
+ }
24
+ }, [list?.toolbar?.tabs])
25
+
18
26
  // 当 Tab 变化时,将最新的类型通过 onChangeQuery 回传给父组件
19
27
  useEffect(() => {
20
28
  if (activeTabKey !== undefined) {
@@ -33,7 +41,10 @@ export const useList = ({ list }: UseTabsStateParams) => {
33
41
  const enhancedTabs = {
34
42
  ...originalTabs,
35
43
  activeKey: activeTabKey,
36
- onChange: setTabActiveKey,
44
+ onChange: (key: string) => {
45
+ setTabActiveKey(key)
46
+ originalTabs.onChange?.(key)
47
+ },
37
48
  }
38
49
 
39
50
  return {
@@ -1,8 +1,5 @@
1
1
  import React from 'react'
2
2
  import { AutoComplete, Button, Space } from 'antd'
3
- import { type Option } from '@wzyjs/types'
4
-
5
- export * from './utils'
6
3
 
7
4
  interface DynamicSelectProps {
8
5
  value?: string[]
@@ -1,5 +1,3 @@
1
- import type { Option } from '@wzyjs/types'
2
-
3
1
  export const transformOptions = (data: string[][]): Option[] => {
4
2
  const result: Option[] = []
5
3
 
@@ -24,7 +22,7 @@ export const transformOptions = (data: string[][]): Option[] => {
24
22
 
25
23
  parentNode = currentNode
26
24
  } else {
27
- currentNode = parentNode?.children?.find(c => c.value === currentValue)
25
+ currentNode = parentNode?.children?.find((c: Option) => c.value === currentValue)
28
26
 
29
27
  if (!currentNode) {
30
28
  currentNode = {
@@ -37,7 +37,6 @@ const ComponentMap = {
37
37
  'Typography.Link': Typography.Link,
38
38
  Steps,
39
39
  Tabs,
40
- 'Tabs.TabPane': Tabs.TabPane,
41
40
  Collapse,
42
41
  'Collapse.Panel': Collapse.Panel,
43
42
  Description: Descriptions,