@ditojs/admin 2.6.9 → 2.6.10
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/dist/dito-admin.es.js +1493 -1476
- package/dist/dito-admin.umd.js +6 -6
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/components/DitoContainer.vue +38 -5
- package/src/components/DitoForm.vue +16 -11
- package/src/components/DitoHeader.vue +1 -1
- package/src/components/DitoLabel.vue +2 -2
- package/src/components/DitoPane.vue +1 -16
- package/src/components/DitoPanel.vue +9 -9
- package/src/components/DitoPanels.vue +2 -2
- package/src/components/DitoSchema.vue +45 -74
- package/src/components/DitoSchemaInlined.vue +2 -4
- package/src/components/DitoSidebar.vue +1 -0
- package/src/components/DitoTreeItem.vue +2 -1
- package/src/mixins/DitoMixin.js +7 -0
- package/src/mixins/ItemMixin.js +8 -0
- package/src/mixins/SortableMixin.js +0 -4
- package/src/mixins/SourceMixin.js +15 -10
- package/src/mixins/TypeMixin.js +5 -4
- package/src/types/DitoTypeList.vue +17 -22
- package/src/types/DitoTypeUpload.vue +2 -2
- package/src/utils/filter.js +4 -4
- package/src/utils/schema.js +2 -2
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
DitoDraggable(
|
|
40
40
|
tag="tbody"
|
|
41
41
|
:modelValue="updateOrder(sourceSchema, listData, paginationRange)"
|
|
42
|
-
:options="getSortableOptions(
|
|
42
|
+
:options="getSortableOptions()"
|
|
43
43
|
:draggable="draggable"
|
|
44
44
|
@update:modelValue="value => (listData = value)"
|
|
45
45
|
)
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
:dataPath="getDataPath(index)"
|
|
79
79
|
:data="item"
|
|
80
80
|
:meta="nestedMeta"
|
|
81
|
-
:store="
|
|
81
|
+
:store="getItemStore(schema, item, index)"
|
|
82
82
|
:disabled="disabled || isLoading"
|
|
83
83
|
:collapsed="collapsed"
|
|
84
84
|
:collapsible="collapsible"
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
:dataPath="getDataPath(index)"
|
|
116
116
|
:data="item"
|
|
117
117
|
:meta="nestedMeta"
|
|
118
|
-
:store="
|
|
118
|
+
:store="getItemStore(schema, item, index)"
|
|
119
119
|
@delete="deleteItem(item, index)"
|
|
120
120
|
)
|
|
121
121
|
//- Render create buttons inside table when not in a single component view:
|
|
@@ -161,6 +161,7 @@ import {
|
|
|
161
161
|
import { createFiltersPanel } from '../utils/filter.js'
|
|
162
162
|
import { appendDataPath } from '../utils/data.js'
|
|
163
163
|
import { pickBy, equals, hyphenate } from '@ditojs/utils'
|
|
164
|
+
import { computed } from 'vue'
|
|
164
165
|
|
|
165
166
|
// @vue/component
|
|
166
167
|
export default DitoTypeComponent.register('list', {
|
|
@@ -171,28 +172,22 @@ export default DitoTypeComponent.register('list', {
|
|
|
171
172
|
return type
|
|
172
173
|
},
|
|
173
174
|
|
|
174
|
-
getPanelSchema(api, schema, dataPath,
|
|
175
|
+
getPanelSchema(api, schema, dataPath, component) {
|
|
175
176
|
const { filters } = schema
|
|
176
177
|
// See if this list component wants to display a filter panel, and if so,
|
|
177
178
|
// create the panel schema for it through `getFiltersPanel()`.
|
|
178
179
|
if (filters) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
return createFiltersPanel(
|
|
181
|
+
api,
|
|
182
|
+
filters,
|
|
183
|
+
dataPath,
|
|
184
|
+
// Pass a computed value to get / set the query, see getFiltersPanel()
|
|
185
|
+
computed({
|
|
186
|
+
get() {
|
|
187
|
+
return component.query
|
|
188
|
+
},
|
|
187
189
|
|
|
188
|
-
|
|
189
|
-
// Create a simple proxy to get / set the query, see getFiltersPanel()
|
|
190
|
-
get query() {
|
|
191
|
-
return getListComponent()?.query
|
|
192
|
-
},
|
|
193
|
-
set query(query) {
|
|
194
|
-
const component = getListComponent()
|
|
195
|
-
if (component) {
|
|
190
|
+
set(query) {
|
|
196
191
|
// Filter out undefined values for comparing with equals()
|
|
197
192
|
const filter = obj => pickBy(obj, value => value !== undefined)
|
|
198
193
|
if (!equals(filter(query), filter(component.query))) {
|
|
@@ -200,8 +195,8 @@ export default DitoTypeComponent.register('list', {
|
|
|
200
195
|
component.loadData(false)
|
|
201
196
|
}
|
|
202
197
|
}
|
|
203
|
-
}
|
|
204
|
-
|
|
198
|
+
})
|
|
199
|
+
)
|
|
205
200
|
}
|
|
206
201
|
},
|
|
207
202
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
DitoDraggable(
|
|
36
36
|
v-model="files"
|
|
37
37
|
tag="tbody"
|
|
38
|
-
:options="getSortableOptions(
|
|
38
|
+
:options="getSortableOptions()"
|
|
39
39
|
:draggable="draggable"
|
|
40
40
|
)
|
|
41
41
|
template(
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
)
|
|
44
44
|
tr(
|
|
45
45
|
v-for="(file, index) in files"
|
|
46
|
-
:key="file.
|
|
46
|
+
:key="file.name"
|
|
47
47
|
)
|
|
48
48
|
td(
|
|
49
49
|
v-if="render"
|
package/src/utils/filter.js
CHANGED
|
@@ -63,7 +63,7 @@ export const filterComponents = {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export function createFiltersPanel(api, filters, dataPath,
|
|
66
|
+
export function createFiltersPanel(api, filters, dataPath, query) {
|
|
67
67
|
const { sticky, ...filterSchemas } = filters
|
|
68
68
|
const panel = {
|
|
69
69
|
type: 'panel',
|
|
@@ -80,7 +80,7 @@ export function createFiltersPanel(api, filters, dataPath, proxy) {
|
|
|
80
80
|
data() {
|
|
81
81
|
return parseFiltersData(
|
|
82
82
|
panel,
|
|
83
|
-
|
|
83
|
+
query.value
|
|
84
84
|
)
|
|
85
85
|
},
|
|
86
86
|
|
|
@@ -106,8 +106,8 @@ export function createFiltersPanel(api, filters, dataPath, proxy) {
|
|
|
106
106
|
|
|
107
107
|
methods: {
|
|
108
108
|
applyFilters() {
|
|
109
|
-
|
|
110
|
-
...
|
|
109
|
+
query.value = {
|
|
110
|
+
...query.value,
|
|
111
111
|
filter: this.filters,
|
|
112
112
|
// Clear pagination when applying or clearing filters:
|
|
113
113
|
page: undefined
|
package/src/utils/schema.js
CHANGED
|
@@ -1030,14 +1030,14 @@ export function getAllPanelEntries(
|
|
|
1030
1030
|
api,
|
|
1031
1031
|
schema,
|
|
1032
1032
|
dataPath = null,
|
|
1033
|
-
|
|
1033
|
+
component = null,
|
|
1034
1034
|
tabComponent = null
|
|
1035
1035
|
) {
|
|
1036
1036
|
const panelSchema = getTypeOptions(schema)?.getPanelSchema?.(
|
|
1037
1037
|
api,
|
|
1038
1038
|
schema,
|
|
1039
1039
|
dataPath,
|
|
1040
|
-
|
|
1040
|
+
component
|
|
1041
1041
|
)
|
|
1042
1042
|
const panelEntries = panelSchema
|
|
1043
1043
|
? [getPanelEntry(panelSchema, dataPath, tabComponent)]
|