@ditojs/admin 2.44.0 → 2.45.1

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.1",
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": "6de5398fb812c9cbc030761e3ef82cac9a030117"
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(
@@ -109,6 +109,7 @@ import { getNamedSchemas, hasFormSchema } from '../utils/schema.js'
109
109
  // @vue/component
110
110
  export default DitoComponent.component('DitoTreeItem', {
111
111
  mixins: [ItemMixin, SortableMixin],
112
+ emits: ['update:data'],
112
113
  inject: ['container'],
113
114
 
114
115
  props: {
@@ -167,8 +168,10 @@ export default DitoComponent.component('DitoTreeItem', {
167
168
  set(value) {
168
169
  const name = this.childrenSchema?.name
169
170
  if (name) {
171
+ this.updateOrder(this.childrenSchema, value)
170
172
  // eslint-disable-next-line vue/no-mutating-props
171
173
  this.data[name] = value
174
+ this.$emit('update:data', value)
172
175
  }
173
176
  }
174
177
  },
@@ -202,27 +205,19 @@ export default DitoComponent.component('DitoTreeItem', {
202
205
  const { editPath } = this.container
203
206
  const childrenOpen = !this.path && childrenSchema.open
204
207
  // 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
- )
208
+ return childrenList.map((data, index) => {
209
+ const path = (
210
+ childrenSchema.path &&
211
+ `${this.path}/${childrenSchema.path}/${index}`
212
+ )
213
+ const open = (
214
+ childrenOpen ||
215
+ // Only count as "in edit path" when it's not the full edit path.
216
+ editPath.startsWith(path) && path.length < editPath.length
217
+ )
218
+ const active = editPath === path
219
+ return { data, path, open, active }
220
+ })
226
221
  }
227
222
  return []
228
223
  },
@@ -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(
@@ -12,6 +12,7 @@
12
12
  :data="treeData"
13
13
  :draggable="draggable"
14
14
  :open="true"
15
+ @update:data="data => (value = data)"
15
16
  )
16
17
  .dito-tree-form-container(
17
18
  v-if="hasEditableForms"
package/src/utils/uid.js CHANGED
@@ -7,7 +7,7 @@ let uid = 0
7
7
  export function getUid(item, getItemId = null) {
8
8
  const raw = toRaw(item)
9
9
  let id = uidMap.get(raw)
10
- if (!id) {
10
+ if (!id && item) {
11
11
  id = getItemId?.(item) || `@${++uid}`
12
12
  uidMap.set(raw, id)
13
13
  }