@thienvu18/designable-react-settings-form 2.0.1 → 2.0.2
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/esm/SchemaField.d.ts +5115 -1578
- package/esm/SchemaField.js +76 -41
- package/esm/SettingsForm.d.ts +4 -4
- package/esm/SettingsForm.js +99 -49
- package/esm/components/BackgroundStyleSetter/index.d.ts +4 -4
- package/esm/components/BackgroundStyleSetter/index.js +95 -42
- package/esm/components/BorderRadiusStyleSetter/index.d.ts +4 -4
- package/esm/components/BorderRadiusStyleSetter/index.js +13 -10
- package/esm/components/BorderStyleSetter/index.d.ts +5 -5
- package/esm/components/BorderStyleSetter/index.js +121 -68
- package/esm/components/BoxShadowStyleSetter/index.d.ts +6 -6
- package/esm/components/BoxShadowStyleSetter/index.js +72 -24
- package/esm/components/BoxStyleSetter/index.d.ts +7 -7
- package/esm/components/BoxStyleSetter/index.js +98 -46
- package/esm/components/CollapseItem/index.d.ts +6 -6
- package/esm/components/CollapseItem/index.js +35 -15
- package/esm/components/ColorInput/index.d.ts +5 -5
- package/esm/components/ColorInput/index.js +35 -17
- package/esm/components/ColorInput/styles.less +0 -5
- package/esm/components/CornerInput/index.d.ts +7 -7
- package/esm/components/CornerInput/index.js +50 -21
- package/esm/components/DisplayStyleSetter/index.d.ts +7 -7
- package/esm/components/DisplayStyleSetter/index.js +62 -33
- package/esm/components/DrawerSetter/index.d.ts +6 -6
- package/esm/components/DrawerSetter/index.js +82 -42
- package/esm/components/DrawerSetter/styles.less +2 -2
- package/esm/components/FlexStyleSetter/index.d.ts +5 -5
- package/esm/components/FlexStyleSetter/index.js +160 -110
- package/esm/components/FoldItem/index.d.ts +9 -7
- package/esm/components/FoldItem/index.js +80 -46
- package/esm/components/FontStyleSetter/index.d.ts +4 -4
- package/esm/components/FontStyleSetter/index.js +169 -85
- package/esm/components/ImageInput/index.d.ts +7 -7
- package/esm/components/ImageInput/index.js +59 -39
- package/esm/components/InputItems/index.d.ts +19 -17
- package/esm/components/InputItems/index.js +42 -16
- package/esm/components/MonacoInput/config.d.ts +1 -1
- package/esm/components/MonacoInput/config.js +40 -38
- package/esm/components/MonacoInput/format.d.ts +4 -1
- package/esm/components/MonacoInput/format.js +33 -29
- package/esm/components/MonacoInput/index.d.ts +13 -13
- package/esm/components/MonacoInput/index.js +298 -212
- package/esm/components/MonacoInput/themes/chrome.d.ts +44 -38
- package/esm/components/MonacoInput/themes/chrome.js +105 -105
- package/esm/components/MonacoInput/themes/monokai.d.ts +34 -30
- package/esm/components/MonacoInput/themes/monokai.js +139 -139
- package/esm/components/PolyInput/index.d.ts +17 -17
- package/esm/components/PolyInput/index.js +96 -66
- package/esm/components/PositionInput/index.d.ts +7 -7
- package/esm/components/PositionInput/index.js +48 -21
- package/esm/components/PositionInput/styles.less +0 -1
- package/esm/components/SizeInput/index.d.ts +6 -2
- package/esm/components/SizeInput/index.js +44 -46
- package/esm/components/SizeInput/styles.less +0 -1
- package/esm/components/ValueInput/index.d.ts +2 -2
- package/esm/components/ValueInput/index.js +89 -72
- package/esm/components/index.d.ts +20 -20
- package/esm/components/index.js +20 -20
- package/esm/effects/index.d.ts +2 -2
- package/esm/effects/index.js +2 -2
- package/esm/effects/useLocales.d.ts +2 -2
- package/esm/effects/useLocales.js +57 -59
- package/esm/effects/useSnapshot.d.ts +2 -2
- package/esm/effects/useSnapshot.js +9 -9
- package/esm/index.d.ts +5 -5
- package/esm/index.js +5 -5
- package/esm/locales/en-US.d.ts +12 -12
- package/esm/locales/en-US.js +10 -10
- package/esm/locales/index.d.ts +1 -1
- package/esm/locales/index.js +5 -5
- package/esm/locales/ko-KR.d.ts +12 -12
- package/esm/locales/ko-KR.js +10 -10
- package/esm/locales/zh-CN.d.ts +12 -12
- package/esm/locales/zh-CN.js +10 -10
- package/esm/registry.d.ts +2 -2
- package/esm/registry.js +11 -11
- package/esm/shared/context.d.ts +2 -2
- package/esm/shared/context.js +2 -2
- package/esm/shared/loadScript.d.ts +5 -5
- package/esm/shared/loadScript.js +27 -28
- package/esm/styles.less +5 -4
- package/esm/types.d.ts +8 -8
- package/esm/types.js +1 -1
- package/lib/SchemaField.d.ts +5115 -1578
- package/lib/SchemaField.js +44 -44
- package/lib/SettingsForm.d.ts +4 -4
- package/lib/SettingsForm.js +108 -55
- package/lib/components/BackgroundStyleSetter/index.d.ts +4 -4
- package/lib/components/BackgroundStyleSetter/index.js +106 -48
- package/lib/components/BorderRadiusStyleSetter/index.d.ts +4 -4
- package/lib/components/BorderRadiusStyleSetter/index.js +33 -14
- package/lib/components/BorderStyleSetter/index.d.ts +5 -5
- package/lib/components/BorderStyleSetter/index.js +138 -74
- package/lib/components/BoxShadowStyleSetter/index.d.ts +6 -6
- package/lib/components/BoxShadowStyleSetter/index.js +82 -30
- package/lib/components/BoxStyleSetter/index.d.ts +7 -7
- package/lib/components/BoxStyleSetter/index.js +122 -52
- package/lib/components/CollapseItem/index.d.ts +6 -6
- package/lib/components/CollapseItem/index.js +49 -21
- package/lib/components/ColorInput/index.d.ts +5 -5
- package/lib/components/ColorInput/index.js +39 -21
- package/lib/components/ColorInput/styles.less +0 -5
- package/lib/components/CornerInput/index.d.ts +7 -7
- package/lib/components/CornerInput/index.js +70 -28
- package/lib/components/DisplayStyleSetter/index.d.ts +7 -7
- package/lib/components/DisplayStyleSetter/index.js +75 -39
- package/lib/components/DrawerSetter/index.d.ts +6 -6
- package/lib/components/DrawerSetter/index.js +99 -48
- package/lib/components/DrawerSetter/styles.less +2 -2
- package/lib/components/FlexStyleSetter/index.d.ts +5 -5
- package/lib/components/FlexStyleSetter/index.js +208 -116
- package/lib/components/FoldItem/index.d.ts +9 -7
- package/lib/components/FoldItem/index.js +140 -72
- package/lib/components/FontStyleSetter/index.d.ts +4 -4
- package/lib/components/FontStyleSetter/index.js +216 -91
- package/lib/components/ImageInput/index.d.ts +7 -7
- package/lib/components/ImageInput/index.js +69 -47
- package/lib/components/InputItems/index.d.ts +19 -17
- package/lib/components/InputItems/index.js +101 -46
- package/lib/components/MonacoInput/config.d.ts +1 -1
- package/lib/components/MonacoInput/config.js +49 -45
- package/lib/components/MonacoInput/format.d.ts +4 -1
- package/lib/components/MonacoInput/format.js +38 -33
- package/lib/components/MonacoInput/index.d.ts +13 -13
- package/lib/components/MonacoInput/index.js +347 -241
- package/lib/components/MonacoInput/themes/chrome.d.ts +44 -38
- package/lib/components/MonacoInput/themes/chrome.js +107 -107
- package/lib/components/MonacoInput/themes/monokai.d.ts +34 -30
- package/lib/components/MonacoInput/themes/monokai.js +141 -141
- package/lib/components/PolyInput/index.d.ts +17 -17
- package/lib/components/PolyInput/index.js +151 -96
- package/lib/components/PositionInput/index.d.ts +7 -7
- package/lib/components/PositionInput/index.js +68 -28
- package/lib/components/PositionInput/styles.less +0 -1
- package/lib/components/SizeInput/index.d.ts +6 -2
- package/lib/components/SizeInput/index.js +47 -49
- package/lib/components/SizeInput/styles.less +0 -1
- package/lib/components/ValueInput/index.d.ts +2 -2
- package/lib/components/ValueInput/index.js +92 -75
- package/lib/components/index.d.ts +20 -20
- package/lib/components/index.js +52 -36
- package/lib/effects/index.d.ts +2 -2
- package/lib/effects/index.js +34 -18
- package/lib/effects/useLocales.d.ts +2 -2
- package/lib/effects/useLocales.js +67 -63
- package/lib/effects/useSnapshot.d.ts +2 -2
- package/lib/effects/useSnapshot.js +13 -13
- package/lib/index.d.ts +5 -5
- package/lib/index.js +37 -21
- package/lib/locales/en-US.d.ts +12 -12
- package/lib/locales/en-US.js +12 -12
- package/lib/locales/index.d.ts +1 -1
- package/lib/locales/index.js +16 -10
- package/lib/locales/ko-KR.d.ts +12 -12
- package/lib/locales/ko-KR.js +12 -12
- package/lib/locales/zh-CN.d.ts +12 -12
- package/lib/locales/zh-CN.js +12 -12
- package/lib/registry.d.ts +2 -2
- package/lib/registry.js +21 -19
- package/lib/shared/context.d.ts +2 -2
- package/lib/shared/context.js +5 -5
- package/lib/shared/loadScript.d.ts +5 -5
- package/lib/shared/loadScript.js +32 -32
- package/lib/styles.less +5 -4
- package/lib/types.d.ts +8 -8
- package/lib/types.js +2 -2
- package/package.json +4 -4
|
@@ -1,111 +1,161 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Radio } from '@thienvu18/formily-antd-v6'
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import './styles.less'
|
|
1
|
+
import { Field, observer, useField } from '@formily/react'
|
|
2
|
+
import { IconWidget, usePrefix } from '@thienvu18/designable-react'
|
|
3
|
+
import { Radio } from '@thienvu18/formily-antd-v6'
|
|
4
|
+
import cls from 'classnames'
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime'
|
|
6
|
+
import { InputItems } from '../InputItems'
|
|
7
|
+
import './styles.less'
|
|
8
8
|
export const FlexStyleSetter = observer((props) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
9
|
+
const field = useField()
|
|
10
|
+
const prefix = usePrefix('flex-style-setter')
|
|
11
|
+
return _jsx('div', {
|
|
12
|
+
className: cls(prefix, props.className),
|
|
13
|
+
style: props.style,
|
|
14
|
+
children: _jsxs(InputItems, {
|
|
15
|
+
vertical: true,
|
|
16
|
+
children: [
|
|
17
|
+
_jsx(Field, {
|
|
18
|
+
name: 'flexDirection',
|
|
19
|
+
basePath: field.address.parent(),
|
|
20
|
+
dataSource: [
|
|
21
|
+
{
|
|
22
|
+
label: _jsx(IconWidget, { infer: 'FlexDirectionRow' }),
|
|
23
|
+
value: 'row',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: _jsx(IconWidget, { infer: 'FlexDirectionColumn' }),
|
|
27
|
+
value: 'column',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
reactions: (field) => {
|
|
31
|
+
field.decorator[1].title = `Flex Direction : ${field.value || ''}`
|
|
32
|
+
},
|
|
33
|
+
decorator: [InputItems.Item],
|
|
34
|
+
component: [Radio.Group, { optionType: 'button' }],
|
|
35
|
+
}),
|
|
36
|
+
_jsx(Field, {
|
|
37
|
+
name: 'flexWrap',
|
|
38
|
+
basePath: field.address.parent(),
|
|
39
|
+
dataSource: [
|
|
40
|
+
{
|
|
41
|
+
label: _jsx(IconWidget, { infer: 'FlexNoWrap' }),
|
|
42
|
+
value: 'nowrap',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: _jsx(IconWidget, { infer: 'FlexWrap' }),
|
|
46
|
+
value: 'wrap',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
reactions: (field) => {
|
|
50
|
+
field.decorator[1].title = `Flex Wrap : ${field.value || ''}`
|
|
51
|
+
},
|
|
52
|
+
decorator: [InputItems.Item],
|
|
53
|
+
component: [Radio.Group, { optionType: 'button' }],
|
|
54
|
+
}),
|
|
55
|
+
_jsx(Field, {
|
|
56
|
+
name: 'alignContent',
|
|
57
|
+
basePath: field.address.parent(),
|
|
58
|
+
dataSource: [
|
|
59
|
+
{
|
|
60
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignContentCenter' }),
|
|
61
|
+
value: 'center',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignContentStart' }),
|
|
65
|
+
value: 'flex-start',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignContentEnd' }),
|
|
69
|
+
value: 'flex-end',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignContentSpaceAround' }),
|
|
73
|
+
value: 'space-around',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: _jsx(IconWidget, {
|
|
77
|
+
infer: 'FlexAlignContentSpaceBetween',
|
|
78
|
+
}),
|
|
79
|
+
value: 'space-between',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignContentStretch' }),
|
|
83
|
+
value: 'stretch',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
reactions: (field) => {
|
|
87
|
+
field.decorator[1].title = `Align Content : ${field.value || ''}`
|
|
88
|
+
},
|
|
89
|
+
decorator: [InputItems.Item],
|
|
90
|
+
component: [Radio.Group, { optionType: 'button' }],
|
|
91
|
+
}),
|
|
92
|
+
_jsx(Field, {
|
|
93
|
+
name: 'justifyContent',
|
|
94
|
+
basePath: field.address.parent(),
|
|
95
|
+
dataSource: [
|
|
96
|
+
{
|
|
97
|
+
label: _jsx(IconWidget, { infer: 'FlexJustifyCenter' }),
|
|
98
|
+
value: 'center',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: _jsx(IconWidget, { infer: 'FlexJustifyStart' }),
|
|
102
|
+
value: 'flex-start',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: _jsx(IconWidget, { infer: 'FlexJustifyEnd' }),
|
|
106
|
+
value: 'flex-end',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: _jsx(IconWidget, { infer: 'FlexJustifySpaceAround' }),
|
|
110
|
+
value: 'space-around',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: _jsx(IconWidget, { infer: 'FlexJustifySpaceBetween' }),
|
|
114
|
+
value: 'space-between',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: _jsx(IconWidget, { infer: 'FlexJustifySpaceEvenly' }),
|
|
118
|
+
value: 'space-evenly',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
reactions: (field) => {
|
|
122
|
+
field.decorator[1].title = `Justify Content : ${field.value || ''}`
|
|
123
|
+
},
|
|
124
|
+
decorator: [InputItems.Item],
|
|
125
|
+
component: [Radio.Group, { optionType: 'button' }],
|
|
126
|
+
}),
|
|
127
|
+
_jsx(Field, {
|
|
128
|
+
name: 'alignItems',
|
|
129
|
+
basePath: field.address.parent(),
|
|
130
|
+
dataSource: [
|
|
131
|
+
{
|
|
132
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignItemsCenter' }),
|
|
133
|
+
value: 'center',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignItemsStart' }),
|
|
137
|
+
value: 'flex-start',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignItemsEnd' }),
|
|
141
|
+
value: 'flex-end',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignItemsStretch' }),
|
|
145
|
+
value: 'stretch',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: _jsx(IconWidget, { infer: 'FlexAlignItemsBaseline' }),
|
|
149
|
+
value: 'baseline',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
reactions: (field) => {
|
|
153
|
+
field.decorator[1].title = `Align Items : ${field.value || ''}`
|
|
154
|
+
},
|
|
155
|
+
decorator: [InputItems.Item],
|
|
156
|
+
component: [Radio.Group, { optionType: 'button' }],
|
|
157
|
+
}),
|
|
158
|
+
],
|
|
159
|
+
}),
|
|
160
|
+
})
|
|
161
|
+
})
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import './styles.less'
|
|
4
|
-
export declare const FoldItem: React.FC<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import { IFormItemProps } from '@thienvu18/formily-antd-v6'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import './styles.less'
|
|
4
|
+
export declare const FoldItem: React.FC<
|
|
5
|
+
React.PropsWithChildren<IFormItemProps>
|
|
6
|
+
> & {
|
|
7
|
+
Base?: React.FC<React.PropsWithChildren<{}>>
|
|
8
|
+
Extra?: React.FC<React.PropsWithChildren<{}>>
|
|
9
|
+
}
|
|
@@ -1,49 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import './styles.less'
|
|
9
|
-
const ExpandedMap = new Map()
|
|
1
|
+
import { observer, useField } from '@formily/react'
|
|
2
|
+
import { observable } from '@formily/reactive'
|
|
3
|
+
import { IconWidget, usePrefix } from '@thienvu18/designable-react'
|
|
4
|
+
import { FormItem } from '@thienvu18/formily-antd-v6'
|
|
5
|
+
import cls from 'classnames'
|
|
6
|
+
import React, { Fragment, useMemo, useRef } from 'react'
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime'
|
|
8
|
+
import './styles.less'
|
|
9
|
+
const ExpandedMap = new Map()
|
|
10
10
|
export const FoldItem = observer(({ className, style, children, ...props }) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
11
|
+
const prefix = usePrefix('fold-item')
|
|
12
|
+
const field = useField()
|
|
13
|
+
const expand = useMemo(
|
|
14
|
+
() => observable.ref(ExpandedMap.get(field?.address?.toString() || '')),
|
|
15
|
+
[field?.address]
|
|
16
|
+
)
|
|
17
|
+
const slots = useRef({
|
|
18
|
+
base: null,
|
|
19
|
+
extra: null,
|
|
20
|
+
})
|
|
21
|
+
slots.current = { base: null, extra: null }
|
|
22
|
+
React.Children.forEach(children, (node) => {
|
|
23
|
+
if (React.isValidElement(node)) {
|
|
24
|
+
if (node?.type?.displayName === 'FoldItem.Base') {
|
|
25
|
+
slots.current.base = node.props?.children
|
|
26
|
+
}
|
|
27
|
+
if (node?.type?.displayName === 'FoldItem.Extra') {
|
|
28
|
+
slots.current.extra = node.props?.children
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
return _jsxs('div', {
|
|
33
|
+
className: cls(prefix, className),
|
|
34
|
+
style: style,
|
|
35
|
+
children: [
|
|
36
|
+
_jsx('div', {
|
|
37
|
+
className: prefix + '-base',
|
|
38
|
+
onClick: () => {
|
|
39
|
+
expand.value = !expand.value
|
|
40
|
+
if (field?.address) {
|
|
41
|
+
ExpandedMap.set(field.address.toString(), expand.value)
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
children: _jsx(FormItem.BaseItem, {
|
|
45
|
+
...props,
|
|
46
|
+
label: _jsxs('span', {
|
|
47
|
+
className: cls(prefix + '-title', {
|
|
48
|
+
expand: expand.value,
|
|
49
|
+
}),
|
|
50
|
+
children: [
|
|
51
|
+
slots.current.extra &&
|
|
52
|
+
_jsx(IconWidget, { infer: 'Expand', size: 10 }),
|
|
53
|
+
props.label,
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
children: _jsx('div', {
|
|
57
|
+
style: { width: '100%' },
|
|
58
|
+
onClick: (e) => {
|
|
59
|
+
e.stopPropagation()
|
|
60
|
+
},
|
|
61
|
+
children: slots.current.base,
|
|
62
|
+
}),
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
65
|
+
expand.value &&
|
|
66
|
+
slots.current.extra &&
|
|
67
|
+
_jsx('div', {
|
|
68
|
+
className: prefix + '-extra',
|
|
69
|
+
children: slots.current.extra,
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
72
|
+
})
|
|
73
|
+
})
|
|
40
74
|
const Base = () => {
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
Base.displayName = 'FoldItem.Base'
|
|
75
|
+
return _jsx(Fragment, {})
|
|
76
|
+
}
|
|
77
|
+
Base.displayName = 'FoldItem.Base'
|
|
44
78
|
const Extra = () => {
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
Extra.displayName = 'FoldItem.Extra'
|
|
48
|
-
FoldItem.Base = Base
|
|
49
|
-
FoldItem.Extra = Extra
|
|
79
|
+
return _jsx(Fragment, {})
|
|
80
|
+
}
|
|
81
|
+
Extra.displayName = 'FoldItem.Extra'
|
|
82
|
+
FoldItem.Base = Base
|
|
83
|
+
FoldItem.Extra = Extra
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
export interface IFontStyleSetterProps {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
className?: string
|
|
4
|
+
style?: React.CSSProperties
|
|
5
5
|
}
|
|
6
|
-
export declare const FontStyleSetter: React.FC<IFontStyleSetterProps
|
|
6
|
+
export declare const FontStyleSetter: React.FC<IFontStyleSetterProps>
|