@ditojs/admin 2.44.0 → 2.45.0

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": "@ditojs/admin",
3
- "version": "2.44.0",
3
+ "version": "2.45.0",
4
4
  "type": "module",
5
5
  "description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -39,8 +39,8 @@
39
39
  "not ie_mob > 0"
40
40
  ],
41
41
  "dependencies": {
42
- "@ditojs/ui": "^2.44.0",
43
- "@ditojs/utils": "^2.44.0",
42
+ "@ditojs/ui": "^2.45.0",
43
+ "@ditojs/utils": "^2.45.0",
44
44
  "@kyvg/vue3-notification": "^3.4.1",
45
45
  "@lk77/vue3-color": "^3.0.6",
46
46
  "@tiptap/core": "^2.11.5",
@@ -72,22 +72,22 @@
72
72
  "filesize": "^10.1.6",
73
73
  "filesize-parser": "^1.5.1",
74
74
  "focus-trap": "^7.6.4",
75
- "nanoid": "^5.1.3",
75
+ "nanoid": "^5.1.5",
76
76
  "sortablejs": "^1.15.6",
77
77
  "tinycolor2": "^1.6.0",
78
78
  "tippy.js": "^6.3.7",
79
79
  "tiptap-footnotes": "^2.0.3",
80
- "type-fest": "^4.37.0",
80
+ "type-fest": "^4.38.0",
81
81
  "vue": "^3.5.13",
82
82
  "vue-multiselect": "^3.2.0",
83
83
  "vue-router": "^4.5.0",
84
84
  "vue-upload-component": "^3.1.17"
85
85
  },
86
86
  "devDependencies": {
87
- "@ditojs/build": "^2.44.0",
87
+ "@ditojs/build": "^2.45.0",
88
88
  "typescript": "^5.8.2",
89
- "vite": "^6.2.1"
89
+ "vite": "^6.2.3"
90
90
  },
91
91
  "types": "types",
92
- "gitHead": "64f76ac9f74a8915bc02bfea79f0db125f3f4437"
92
+ "gitHead": "dfcb589d51438ee3d7ef0c34017cd7090e691653"
93
93
  }
@@ -76,9 +76,9 @@
76
76
  DitoDraggable(
77
77
  v-if="childrenSchema"
78
78
  v-show="opened"
79
- :modelValue="updateOrder(childrenSchema, childrenList)"
80
79
  :options="getDraggableOptions(true)"
81
80
  :draggable="childrenDraggable"
81
+ :modelValue="updateOrder(childrenSchema, childrenList)"
82
82
  @update:modelValue="value => (childrenList = value)"
83
83
  )
84
84
  DitoTreeItem(
@@ -160,15 +160,24 @@ export default DitoComponent.component('DitoTreeItem', {
160
160
 
161
161
  childrenList: {
162
162
  get() {
163
- const name = this.childrenSchema?.name
164
- return name && this.data[name]
163
+ const { name, orderKey } = this.childrenSchema ?? {}
164
+ const value = name && this.data[name]
165
+ // In order to fix reactivity for `updateOrder()` at root level of tree
166
+ // views, we need to access all order keys once, in order to track them
167
+ // for reactivity.
168
+ // TODO: Find a proper fix.
169
+ value?.map(child => child[orderKey])
170
+ return value
165
171
  },
166
172
 
167
173
  set(value) {
168
174
  const name = this.childrenSchema?.name
169
175
  if (name) {
170
176
  // eslint-disable-next-line vue/no-mutating-props
171
- this.data[name] = value
177
+ this.data[name] = this.updateOrder(
178
+ this.childrenSchema,
179
+ value
180
+ )
172
181
  }
173
182
  }
174
183
  },
@@ -202,27 +211,19 @@ export default DitoComponent.component('DitoTreeItem', {
202
211
  const { editPath } = this.container
203
212
  const childrenOpen = !this.path && childrenSchema.open
204
213
  // Build a children list with child meta information for the template.
205
- return this.updateOrder(
206
- childrenSchema,
207
- childrenList.map((data, index) => {
208
- const path = (
209
- childrenSchema.path &&
210
- `${this.path}/${childrenSchema.path}/${index}`
211
- )
212
- const open = (
213
- childrenOpen ||
214
- // Only count as "in edit path" when it's not the full edit path.
215
- editPath.startsWith(path) && path.length < editPath.length
216
- )
217
- const active = editPath === path
218
- return {
219
- data,
220
- path,
221
- open,
222
- active
223
- }
224
- })
225
- )
214
+ return childrenList.map((data, index) => {
215
+ const path = (
216
+ childrenSchema.path &&
217
+ `${this.path}/${childrenSchema.path}/${index}`
218
+ )
219
+ const open = (
220
+ childrenOpen ||
221
+ // Only count as "in edit path" when it's not the full edit path.
222
+ editPath.startsWith(path) && path.length < editPath.length
223
+ )
224
+ const active = editPath === path
225
+ return { data, path, open, active }
226
+ })
226
227
  }
227
228
  return []
228
229
  },
@@ -38,9 +38,9 @@
38
38
  )
39
39
  DitoDraggable(
40
40
  tag="tbody"
41
- :modelValue="updateOrder(sourceSchema, listData, paginationRange)"
42
41
  :options="getDraggableOptions()"
43
42
  :draggable="draggable"
43
+ :modelValue="updateOrder(sourceSchema, listData, paginationRange)"
44
44
  @update:modelValue="value => (listData = value)"
45
45
  )
46
46
  tr(