@robsun/create-keystone-app 0.2.1 → 0.2.3
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
|
@@ -54,29 +54,37 @@ export function ExampleItemsPage() {
|
|
|
54
54
|
|
|
55
55
|
const openCreate = useCallback(() => {
|
|
56
56
|
setEditingItem(null)
|
|
57
|
-
form.resetFields()
|
|
58
|
-
form.setFieldsValue({ status: 'active' })
|
|
59
57
|
setModalOpen(true)
|
|
60
|
-
}, [
|
|
58
|
+
}, [])
|
|
61
59
|
|
|
62
60
|
const openEdit = useCallback(
|
|
63
61
|
(item: ExampleItem) => {
|
|
64
62
|
setEditingItem(item)
|
|
65
|
-
form.setFieldsValue({
|
|
66
|
-
title: item.title,
|
|
67
|
-
description: item.description,
|
|
68
|
-
status: item.status,
|
|
69
|
-
})
|
|
70
63
|
setModalOpen(true)
|
|
71
64
|
},
|
|
72
|
-
[
|
|
65
|
+
[]
|
|
73
66
|
)
|
|
74
67
|
|
|
75
68
|
const closeModal = useCallback(() => {
|
|
76
69
|
setModalOpen(false)
|
|
77
70
|
setEditingItem(null)
|
|
71
|
+
}, [])
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!modalOpen) {
|
|
75
|
+
return
|
|
76
|
+
}
|
|
78
77
|
form.resetFields()
|
|
79
|
-
|
|
78
|
+
if (editingItem) {
|
|
79
|
+
form.setFieldsValue({
|
|
80
|
+
title: editingItem.title,
|
|
81
|
+
description: editingItem.description,
|
|
82
|
+
status: editingItem.status,
|
|
83
|
+
})
|
|
84
|
+
} else {
|
|
85
|
+
form.setFieldsValue({ status: 'active' })
|
|
86
|
+
}
|
|
87
|
+
}, [editingItem, form, modalOpen])
|
|
80
88
|
|
|
81
89
|
const handleSubmit = useCallback(async () => {
|
|
82
90
|
let values: ExampleItemFormValues
|
|
@@ -184,7 +192,7 @@ export function ExampleItemsPage() {
|
|
|
184
192
|
</Space>
|
|
185
193
|
}
|
|
186
194
|
>
|
|
187
|
-
<Space
|
|
195
|
+
<Space orientation="vertical" size="middle" style={{ width: '100%' }}>
|
|
188
196
|
<Typography.Text type="secondary">
|
|
189
197
|
This page demonstrates a full CRUD workflow wired to the Example module API.
|
|
190
198
|
</Typography.Text>
|
|
@@ -204,7 +212,7 @@ export function ExampleItemsPage() {
|
|
|
204
212
|
onOk={handleSubmit}
|
|
205
213
|
confirmLoading={saving}
|
|
206
214
|
okText={editingItem ? 'Save' : 'Create'}
|
|
207
|
-
|
|
215
|
+
destroyOnHidden
|
|
208
216
|
>
|
|
209
217
|
<Form form={form} layout="vertical" initialValues={{ status: 'active' }}>
|
|
210
218
|
<Form.Item
|
package/template/pnpm-lock.yaml
CHANGED
|
@@ -27,8 +27,8 @@ importers:
|
|
|
27
27
|
specifier: ^6.1.0
|
|
28
28
|
version: 6.1.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
|
29
29
|
'@robsun/keystone-web-core':
|
|
30
|
-
specifier: 0.1.
|
|
31
|
-
version: 0.1.
|
|
30
|
+
specifier: 0.1.8
|
|
31
|
+
version: 0.1.8(@ant-design/icons@6.1.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(@types/react@19.2.7)(antd@6.1.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react-router-dom@7.11.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3)(use-sync-external-store@1.6.0(react@19.2.3))(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
|
32
32
|
antd:
|
|
33
33
|
specifier: ^6.0.1
|
|
34
34
|
version: 6.1.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
|
@@ -924,7 +924,7 @@ packages:
|
|
|
924
924
|
react: '>=16.9.0'
|
|
925
925
|
react-dom: '>=16.9.0'
|
|
926
926
|
|
|
927
|
-
'@robsun/keystone-web-core@0.1.
|
|
927
|
+
'@robsun/keystone-web-core@0.1.8':
|
|
928
928
|
resolution: {integrity: sha512-r6Qfs1LxTZBv6GVIf5s6LREuTl/lskq8L3Y9YynUFKvL1tuZ3h3sThxPvvP7VQbBZn5As/XUv16kpqqVXX1HvQ==}
|
|
929
929
|
peerDependencies:
|
|
930
930
|
'@ant-design/icons': ^6.1.0
|
|
@@ -3744,7 +3744,7 @@ snapshots:
|
|
|
3744
3744
|
react: 19.2.3
|
|
3745
3745
|
react-dom: 19.2.3(react@19.2.3)
|
|
3746
3746
|
|
|
3747
|
-
'@robsun/keystone-web-core@0.1.
|
|
3747
|
+
'@robsun/keystone-web-core@0.1.8(@ant-design/icons@6.1.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(@types/react@19.2.7)(antd@6.1.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react-router-dom@7.11.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3)(use-sync-external-store@1.6.0(react@19.2.3))(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
|
3748
3748
|
dependencies:
|
|
3749
3749
|
'@ant-design/icons': 6.1.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
|
3750
3750
|
'@vitejs/plugin-react': 5.1.2(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
|
@@ -6027,3 +6027,4 @@ snapshots:
|
|
|
6027
6027
|
use-sync-external-store: 1.6.0(react@19.2.3)
|
|
6028
6028
|
|
|
6029
6029
|
zwitch@2.0.4: {}
|
|
6030
|
+
|