@wzyjs/components 0.2.57 → 0.2.59
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 +2 -2
- package/src/DragSort/index.tsx +1 -1
- package/src/EnumTag/index.tsx +24 -0
- package/src/GroupLayout/index.tsx +1 -1
- package/src/Markdown/index.tsx +1 -1
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.59",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/react-grid-layout": "^1.3.5",
|
|
44
44
|
"@types/react-syntax-highlighter": "^15.5.5"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "0a6dc9df2da5a0b573de1eb5fd24f09b262228a2",
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
}
|
package/src/DragSort/index.tsx
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Tag } from 'app/src/components'
|
|
4
|
+
|
|
5
|
+
type EnumTagProps = {
|
|
6
|
+
value: string
|
|
7
|
+
map: Map<string, { label: string; value: string; extra?: { color?: string } }>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const EnumTag = (props: EnumTagProps) => {
|
|
11
|
+
const { value, map } = props
|
|
12
|
+
|
|
13
|
+
const enumItem = map.get(value)
|
|
14
|
+
|
|
15
|
+
if (!enumItem) {
|
|
16
|
+
return <Tag>{value}</Tag>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Tag color={enumItem.extra?.color}>
|
|
21
|
+
{enumItem.label}
|
|
22
|
+
</Tag>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -3,7 +3,7 @@ import { CSSProperties, ReactNode } from 'react'
|
|
|
3
3
|
import GridLayout, { Layout } from 'react-grid-layout'
|
|
4
4
|
import 'react-grid-layout/css/styles.css'
|
|
5
5
|
|
|
6
|
-
export { Layout as GridLayoutItem } from 'react-grid-layout'
|
|
6
|
+
export type { Layout as GridLayoutItem } from 'react-grid-layout'
|
|
7
7
|
|
|
8
8
|
interface GridLayoutProps<I> {
|
|
9
9
|
layout: I[]
|
package/src/Markdown/index.tsx
CHANGED
|
@@ -36,7 +36,7 @@ export const Markdown = (props: MarkdownProps) => {
|
|
|
36
36
|
|
|
37
37
|
lines.forEach((line) => {
|
|
38
38
|
const match = line.match(/^(#{2,4})\s+(.+)$/)
|
|
39
|
-
if (match) {
|
|
39
|
+
if (match && match[1] && match[2]) {
|
|
40
40
|
const level = match[1].length
|
|
41
41
|
const text = match[2].trim()
|
|
42
42
|
const id = text
|