Skip to content

Commit 1185418

Browse files
committed
fix: change default modal style
1 parent 2520ea9 commit 1185418

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

demo.ipynb

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": null,
12+
"execution_count": 42,
1313
"metadata": {
1414
"tags": []
1515
},
@@ -153,22 +153,51 @@
153153
" \"show_modal\": True, \n",
154154
" \"ok_label\": \"OK\",\n",
155155
" \"cancel_label\": \"Cancel\", \n",
156-
" \"form_props\": {\"labelCol\": 6, \"wrapperCol\": 16},\n",
157-
" \"modal_props\": {\"title\": \"Title\"}\n",
156+
" \"form_props\": {\"labelCol\": 8, \"wrapperCol\": 16, \"labelWrap\": False},\n",
157+
" \"modal_props\": {\"title\": \"Title\", \"width\": \"540px\"}\n",
158158
"}, default_value={'example1': \"C:\\\\\"})"
159159
]
160160
},
161161
{
162162
"cell_type": "code",
163-
"execution_count": null,
163+
"execution_count": 43,
164164
"metadata": {
165165
"tags": []
166166
},
167-
"outputs": [],
167+
"outputs": [
168+
{
169+
"name": "stdout",
170+
"output_type": "stream",
171+
"text": [
172+
"{'data': {'example1': 'C:\\\\'}}\n"
173+
]
174+
},
175+
{
176+
"data": {
177+
"application/vnd.jupyter.widget-view+json": {
178+
"model_id": "789b870589654361be833b9870aa99ee",
179+
"version_major": 2,
180+
"version_minor": 0
181+
},
182+
"text/plain": [
183+
"Formily(event_content={'event': '', 'argv': {}}, files=[{'name': '.git', 'isDir': True}, {'name': '.github', '…"
184+
]
185+
},
186+
"metadata": {},
187+
"output_type": "display_data"
188+
}
189+
],
168190
"source": [
169191
"print(example.value)\n",
170192
"example.display()"
171193
]
194+
},
195+
{
196+
"cell_type": "code",
197+
"execution_count": null,
198+
"metadata": {},
199+
"outputs": [],
200+
"source": []
172201
}
173202
],
174203
"metadata": {

vendor/formily/src/component/Formily.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ const defaultModalProps: ModalProps = {
104104
maskClosable: false,
105105
centered: true,
106106
closeIcon: null,
107-
width: "60vw",
108-
style: { maxWidth: "700px" },
109-
styles: { body: { maxHeight: "70vh", overflowY: "auto" } },
107+
// width: "60vw",
108+
style: { maxWidth: "70vh", minWidth: "500px" },
109+
styles: { body: { maxHeight: "70vh", overflowY: "auto" }, header: {marginBottom: "24px"} },
110110
};
111111

112112
const Formily: React.FC = () => {
@@ -168,7 +168,7 @@ const Formily: React.FC = () => {
168168
open={online}
169169
footer={
170170
<>
171-
<Divider />
171+
<Divider style={{marginTop: "0", marginBottom: "16px"}} />
172172
<Space>
173173
<Button type="primary" {...ok_props} onClick={() => form.submit(handleOK)}>
174174
{ok_label}

0 commit comments

Comments
 (0)