@ditojs/admin 2.71.1 → 2.73.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/dist/dito-admin.css +1 -1
- package/dist/dito-admin.es.js +2647 -2495
- package/dist/dito-admin.umd.js +5 -5
- package/package.json +33 -33
- package/src/DitoContext.js +8 -0
- package/src/components/DitoAccount.vue +1 -1
- package/src/components/DitoAffix.vue +56 -0
- package/src/components/DitoAffixes.vue +82 -0
- package/src/components/DitoClipboard.vue +3 -3
- package/src/components/DitoContainer.vue +24 -16
- package/src/components/DitoCreateButton.vue +7 -12
- package/src/components/DitoDialog.vue +1 -1
- package/src/components/DitoEditButtons.vue +3 -3
- package/src/components/DitoForm.vue +3 -6
- package/src/components/DitoHeader.vue +0 -13
- package/src/components/DitoLabel.vue +24 -42
- package/src/components/DitoMenu.vue +30 -34
- package/src/components/DitoPagination.vue +1 -1
- package/src/components/DitoPane.vue +10 -8
- package/src/components/DitoPanel.vue +2 -2
- package/src/components/DitoSchema.vue +5 -2
- package/src/components/DitoSchemaInlined.vue +1 -1
- package/src/components/DitoScopes.vue +1 -1
- package/src/components/DitoTableHead.vue +3 -3
- package/src/components/DitoTabs.vue +5 -5
- package/src/components/DitoTrail.vue +23 -18
- package/src/components/DitoTreeItem.vue +8 -8
- package/src/components/index.js +2 -1
- package/src/mixins/DitoMixin.js +1 -1
- package/src/mixins/EmitterMixin.js +13 -7
- package/src/mixins/SortableMixin.js +1 -1
- package/src/styles/_button.scss +99 -98
- package/src/styles/_layout.scss +14 -12
- package/src/styles/_pulldown.scss +17 -15
- package/src/styles/_table.scss +23 -22
- package/src/types/DitoTypeButton.vue +62 -19
- package/src/types/DitoTypeCheckboxes.vue +1 -1
- package/src/types/DitoTypeColor.vue +16 -10
- package/src/types/DitoTypeDate.vue +21 -7
- package/src/types/DitoTypeList.vue +9 -9
- package/src/types/DitoTypeMarkup.vue +8 -7
- package/src/types/DitoTypeMultiselect.vue +2 -2
- package/src/types/DitoTypeNumber.vue +15 -5
- package/src/types/DitoTypeRadio.vue +1 -1
- package/src/types/DitoTypeSelect.vue +7 -7
- package/src/types/DitoTypeSlider.vue +3 -3
- package/src/types/DitoTypeSwitch.vue +3 -3
- package/src/types/DitoTypeText.vue +15 -5
- package/src/types/DitoTypeTextarea.vue +2 -2
- package/src/types/DitoTypeUpload.vue +7 -7
- package/src/utils/schema.js +4 -1
- package/src/components/DitoElement.vue +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.73.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",
|
|
@@ -42,41 +42,41 @@
|
|
|
42
42
|
"not ie_mob > 0"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ditojs/ui": "^2.
|
|
46
|
-
"@ditojs/utils": "^2.
|
|
45
|
+
"@ditojs/ui": "^2.73.0",
|
|
46
|
+
"@ditojs/utils": "^2.73.0",
|
|
47
47
|
"@kyvg/vue3-notification": "^3.4.2",
|
|
48
48
|
"@lk77/vue3-color": "^3.0.6",
|
|
49
|
-
"@tiptap/core": "^3.
|
|
50
|
-
"@tiptap/extension-blockquote": "^3.
|
|
51
|
-
"@tiptap/extension-bold": "^3.
|
|
52
|
-
"@tiptap/extension-bullet-list": "^3.
|
|
53
|
-
"@tiptap/extension-code": "^3.
|
|
54
|
-
"@tiptap/extension-code-block": "^3.
|
|
55
|
-
"@tiptap/extension-document": "^3.
|
|
56
|
-
"@tiptap/extension-hard-break": "^3.
|
|
57
|
-
"@tiptap/extension-heading": "^3.
|
|
58
|
-
"@tiptap/extension-history": "^3.
|
|
59
|
-
"@tiptap/extension-horizontal-rule": "^3.
|
|
60
|
-
"@tiptap/extension-italic": "^3.
|
|
61
|
-
"@tiptap/extension-link": "^3.
|
|
62
|
-
"@tiptap/extension-list": "^3.
|
|
63
|
-
"@tiptap/extension-list-item": "^3.
|
|
64
|
-
"@tiptap/extension-ordered-list": "^3.
|
|
65
|
-
"@tiptap/extension-paragraph": "^3.
|
|
66
|
-
"@tiptap/extension-strike": "^3.
|
|
67
|
-
"@tiptap/extension-subscript": "^3.
|
|
68
|
-
"@tiptap/extension-superscript": "^3.
|
|
69
|
-
"@tiptap/extension-text": "^3.
|
|
70
|
-
"@tiptap/extension-text-style": "^3.
|
|
71
|
-
"@tiptap/extension-underline": "^3.
|
|
72
|
-
"@tiptap/extensions": "^3.
|
|
73
|
-
"@tiptap/pm": "^3.
|
|
74
|
-
"@tiptap/vue-3": "^3.
|
|
49
|
+
"@tiptap/core": "^3.15.3",
|
|
50
|
+
"@tiptap/extension-blockquote": "^3.15.3",
|
|
51
|
+
"@tiptap/extension-bold": "^3.15.3",
|
|
52
|
+
"@tiptap/extension-bullet-list": "^3.15.3",
|
|
53
|
+
"@tiptap/extension-code": "^3.15.3",
|
|
54
|
+
"@tiptap/extension-code-block": "^3.15.3",
|
|
55
|
+
"@tiptap/extension-document": "^3.15.3",
|
|
56
|
+
"@tiptap/extension-hard-break": "^3.15.3",
|
|
57
|
+
"@tiptap/extension-heading": "^3.15.3",
|
|
58
|
+
"@tiptap/extension-history": "^3.15.3",
|
|
59
|
+
"@tiptap/extension-horizontal-rule": "^3.15.3",
|
|
60
|
+
"@tiptap/extension-italic": "^3.15.3",
|
|
61
|
+
"@tiptap/extension-link": "^3.15.3",
|
|
62
|
+
"@tiptap/extension-list": "^3.15.3",
|
|
63
|
+
"@tiptap/extension-list-item": "^3.15.3",
|
|
64
|
+
"@tiptap/extension-ordered-list": "^3.15.3",
|
|
65
|
+
"@tiptap/extension-paragraph": "^3.15.3",
|
|
66
|
+
"@tiptap/extension-strike": "^3.15.3",
|
|
67
|
+
"@tiptap/extension-subscript": "^3.15.3",
|
|
68
|
+
"@tiptap/extension-superscript": "^3.15.3",
|
|
69
|
+
"@tiptap/extension-text": "^3.15.3",
|
|
70
|
+
"@tiptap/extension-text-style": "^3.15.3",
|
|
71
|
+
"@tiptap/extension-underline": "^3.15.3",
|
|
72
|
+
"@tiptap/extensions": "^3.15.3",
|
|
73
|
+
"@tiptap/pm": "^3.15.3",
|
|
74
|
+
"@tiptap/vue-3": "^3.15.3",
|
|
75
75
|
"@vueuse/integrations": "^14.1.0",
|
|
76
76
|
"codeflask": "^1.4.1",
|
|
77
77
|
"filesize": "^11.0.13",
|
|
78
78
|
"filesize-parser": "^1.5.1",
|
|
79
|
-
"focus-trap": "^7.7.
|
|
79
|
+
"focus-trap": "^7.7.1",
|
|
80
80
|
"nanoid": "^5.1.6",
|
|
81
81
|
"sortablejs": "^1.15.6",
|
|
82
82
|
"tinycolor2": "^1.6.0",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"vue-upload-component": "^3.1.17"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@ditojs/build": "^2.
|
|
92
|
+
"@ditojs/build": "^2.73.0",
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
|
-
"vite": "^7.3.
|
|
94
|
+
"vite": "^7.3.1"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "0afe5ac938419c584db685cddcbd8974ee000d7e"
|
|
97
97
|
}
|
package/src/DitoContext.js
CHANGED
|
@@ -276,6 +276,14 @@ export default class DitoContext {
|
|
|
276
276
|
return get(this, 'wasNotified', false)
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
get isRunning() {
|
|
280
|
+
return get(this, 'isRunning', false)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
set isRunning(value) {
|
|
284
|
+
set(this, 'isRunning', value)
|
|
285
|
+
}
|
|
286
|
+
|
|
279
287
|
// Helper Methods
|
|
280
288
|
|
|
281
289
|
get request() {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
component(
|
|
3
|
+
v-if="item.type === 'text'"
|
|
4
|
+
:is="item.as || 'span'"
|
|
5
|
+
) {{ item.text }}
|
|
6
|
+
component(
|
|
7
|
+
v-else-if="item.type === 'html'"
|
|
8
|
+
:is="item.as || 'span'"
|
|
9
|
+
v-html="item.html"
|
|
10
|
+
)
|
|
11
|
+
DitoSpinner(
|
|
12
|
+
v-else-if="item.type === 'spinner'"
|
|
13
|
+
:size="item.size"
|
|
14
|
+
:color="item.color"
|
|
15
|
+
)
|
|
16
|
+
DitoIcon(
|
|
17
|
+
v-else-if="item.type === 'icon'"
|
|
18
|
+
:name="item.name"
|
|
19
|
+
:disabled="item.disabled"
|
|
20
|
+
)
|
|
21
|
+
component(
|
|
22
|
+
v-else-if="item.type === 'component'"
|
|
23
|
+
:is="item.component"
|
|
24
|
+
v-bind="item.props"
|
|
25
|
+
)
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import DitoComponent from '../DitoComponent.js'
|
|
30
|
+
import DitoSpinner from './DitoSpinner.vue'
|
|
31
|
+
import { DitoIcon } from '@ditojs/ui/src'
|
|
32
|
+
|
|
33
|
+
export default DitoComponent.component('DitoAffix', {
|
|
34
|
+
components: { DitoSpinner, DitoIcon },
|
|
35
|
+
|
|
36
|
+
props: {
|
|
37
|
+
item: { type: Object, required: true },
|
|
38
|
+
parentContext: { type: Object, required: true }
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
computed: {
|
|
42
|
+
// Override DitoMixin's context with the parent's context
|
|
43
|
+
context() {
|
|
44
|
+
return this.parentContext
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style lang="scss">
|
|
51
|
+
.dito-affix {
|
|
52
|
+
&--text {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.dito-affixes(
|
|
3
|
+
v-if="visibleItems.length > 0"
|
|
4
|
+
)
|
|
5
|
+
DitoAffix.dito-affix(
|
|
6
|
+
v-for="(item, index) in visibleItems"
|
|
7
|
+
:key="index"
|
|
8
|
+
:class="[`dito-affix--${item.type}`, item.class]"
|
|
9
|
+
:style="item.style"
|
|
10
|
+
:item="item"
|
|
11
|
+
:parentContext="parentContext"
|
|
12
|
+
)
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import DitoComponent from '../DitoComponent.js'
|
|
17
|
+
import DitoAffix from './DitoAffix.vue'
|
|
18
|
+
import { asArray, isString } from '@ditojs/utils'
|
|
19
|
+
import { shouldRenderSchema } from '../utils/schema.js'
|
|
20
|
+
|
|
21
|
+
export default DitoComponent.component('DitoAffixes', {
|
|
22
|
+
components: { DitoAffix },
|
|
23
|
+
|
|
24
|
+
props: {
|
|
25
|
+
items: { type: [String, Object, Array], default: null },
|
|
26
|
+
parentContext: { type: Object, required: true }
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
computed: {
|
|
30
|
+
// Override DitoMixin's context with the parent's context
|
|
31
|
+
context() {
|
|
32
|
+
return this.parentContext
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
processedItems() {
|
|
36
|
+
return asArray(this.items)
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.map(item =>
|
|
39
|
+
isString(item)
|
|
40
|
+
? { type: 'text', text: item }
|
|
41
|
+
: item.type
|
|
42
|
+
? item
|
|
43
|
+
: item.text != null
|
|
44
|
+
? { type: 'text', ...item }
|
|
45
|
+
: item.html != null
|
|
46
|
+
? { type: 'html', ...item }
|
|
47
|
+
: item
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
visibleItems() {
|
|
52
|
+
return this.processedItems.filter(item =>
|
|
53
|
+
shouldRenderSchema(item, this.context)
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang="scss">
|
|
61
|
+
@import '../styles/_imports';
|
|
62
|
+
|
|
63
|
+
.dito-affixes {
|
|
64
|
+
@include user-select(none);
|
|
65
|
+
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: $input-padding-hor;
|
|
69
|
+
|
|
70
|
+
@at-root .dito-input & {
|
|
71
|
+
color: $color-grey;
|
|
72
|
+
|
|
73
|
+
.dito-icon--disabled {
|
|
74
|
+
color: $color-light;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@at-root .dito-input:focus-within & {
|
|
79
|
+
color: $color-active;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.dito-clipboard.dito-buttons.dito-buttons
|
|
2
|
+
.dito-clipboard.dito-buttons.dito-buttons--round(
|
|
3
3
|
v-if="clipboard"
|
|
4
4
|
)
|
|
5
|
-
button.dito-button.dito-button
|
|
5
|
+
button.dito-button.dito-button--copy(
|
|
6
6
|
ref="copyData"
|
|
7
7
|
type="button"
|
|
8
8
|
title="Copy Data"
|
|
9
9
|
:disabled="!copyEnabled"
|
|
10
10
|
@click="onCopy"
|
|
11
11
|
)
|
|
12
|
-
button.dito-button.dito-button
|
|
12
|
+
button.dito-button.dito-button--paste(
|
|
13
13
|
type="button"
|
|
14
14
|
title="Paste Data"
|
|
15
15
|
:disabled="!pasteEnabled"
|
|
@@ -69,6 +69,7 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
69
69
|
single: { type: Boolean, default: false },
|
|
70
70
|
nested: { type: Boolean, default: true },
|
|
71
71
|
disabled: { type: Boolean, required: true },
|
|
72
|
+
compact: { type: Boolean, default: false },
|
|
72
73
|
generateLabels: { type: Boolean, default: false },
|
|
73
74
|
verticalLabels: { type: Boolean, default: false },
|
|
74
75
|
accumulatedBasis: { type: Number, default: null }
|
|
@@ -191,8 +192,9 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
191
192
|
const prefix = 'dito-container'
|
|
192
193
|
return {
|
|
193
194
|
[`${prefix}--single`]: this.single,
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
[`${prefix}--disabled`]: this.componentDisabled,
|
|
196
|
+
[`${prefix}--has-errors`]: !!this.errors,
|
|
197
|
+
[`${prefix}--compact`]: this.compact,
|
|
196
198
|
[`${prefix}--label-vertical`]: this.verticalLabels,
|
|
197
199
|
[`${prefix}--omit-spacing`]: omitSpacing(this.schema),
|
|
198
200
|
...(isString(classes) ? { [classes]: true } : classes)
|
|
@@ -214,23 +216,15 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
214
216
|
|
|
215
217
|
componentClasses() {
|
|
216
218
|
return {
|
|
217
|
-
'dito-single': this.single,
|
|
218
|
-
...this.
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
layoutClasses() {
|
|
223
|
-
return {
|
|
224
|
-
'dito-width-fill': this.width === 'fill' || this.flexBasis !== 'auto',
|
|
225
|
-
'dito-width-grow': this.flexGrow,
|
|
226
|
-
'dito-width-shrink': this.flexShrink
|
|
219
|
+
'dito-component--single': this.single,
|
|
220
|
+
...this.getLayoutClasses('dito-component')
|
|
227
221
|
}
|
|
228
222
|
},
|
|
229
223
|
|
|
230
224
|
labelClasses() {
|
|
231
225
|
return {
|
|
232
226
|
'dito-label--visible': this.isLabel,
|
|
233
|
-
...this.
|
|
227
|
+
...this.getLayoutClasses('dito-label')
|
|
234
228
|
}
|
|
235
229
|
},
|
|
236
230
|
|
|
@@ -246,6 +240,14 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
246
240
|
},
|
|
247
241
|
|
|
248
242
|
methods: {
|
|
243
|
+
getLayoutClasses(prefix) {
|
|
244
|
+
return {
|
|
245
|
+
[`${prefix}--fill`]: this.width === 'fill' || this.flexBasis !== 'auto',
|
|
246
|
+
[`${prefix}--grow`]: this.flexGrow,
|
|
247
|
+
[`${prefix}--shrink`]: this.flexShrink
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
|
|
249
251
|
onErrors(errors) {
|
|
250
252
|
this.errors = errors
|
|
251
253
|
}
|
|
@@ -319,6 +321,14 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
323
|
|
|
324
|
+
&--compact:not(&--label-vertical) {
|
|
325
|
+
// Display labels in compact schema as inline-blocks, to allow compact
|
|
326
|
+
// layouts with `width: 'auto'` elements:
|
|
327
|
+
display: flex;
|
|
328
|
+
flex-flow: row wrap;
|
|
329
|
+
align-items: center;
|
|
330
|
+
}
|
|
331
|
+
|
|
322
332
|
&--omit-spacing {
|
|
323
333
|
padding: 0;
|
|
324
334
|
|
|
@@ -328,12 +338,10 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
328
338
|
}
|
|
329
339
|
}
|
|
330
340
|
|
|
331
|
-
// NOTE: This is not nested inside `.dito-container` so that other
|
|
332
|
-
// type components can override `.dito-width-fill` class (filter precedence).
|
|
333
341
|
.dito-component {
|
|
334
342
|
position: relative;
|
|
335
343
|
|
|
336
|
-
|
|
344
|
+
&--fill {
|
|
337
345
|
width: 100%;
|
|
338
346
|
|
|
339
347
|
&.dito-checkbox,
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
v-bind="getButtonAttributes(verb)"
|
|
17
17
|
@mousedown.stop="onPulldownMouseDown()"
|
|
18
18
|
) {{ text }}
|
|
19
|
-
ul.dito-pulldown(:class="{ 'dito-open': pulldown.open }")
|
|
19
|
+
ul.dito-pulldown(:class="{ 'dito-pulldown--open': pulldown.open }")
|
|
20
20
|
li(
|
|
21
21
|
v-for="(form, type) in creatableForms"
|
|
22
|
+
v-show="shouldShowSchema(form)"
|
|
22
23
|
)
|
|
23
|
-
a(
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
a.dito-pulldown__item(
|
|
25
|
+
:class=`{
|
|
26
|
+
'dito-pulldown__item--disabled': shouldDisableSchema(form)
|
|
27
|
+
}`
|
|
26
28
|
@mousedown.stop="onPulldownMouseDown(type)"
|
|
27
29
|
@mouseup="onPulldownMouseUp(type)"
|
|
28
30
|
) {{ getLabel(form) }}
|
|
@@ -113,13 +115,6 @@ export default DitoComponent.component('DitoCreateButton', {
|
|
|
113
115
|
}
|
|
114
116
|
},
|
|
115
117
|
|
|
116
|
-
getFormClass(form, type) {
|
|
117
|
-
return {
|
|
118
|
-
[`dito-type-${type}`]: true,
|
|
119
|
-
'dito-disabled': this.shouldDisableSchema(form)
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
118
|
onPulldownSelect(type) {
|
|
124
119
|
this.createItem(this.forms[type], type)
|
|
125
120
|
this.setPulldownOpen(false)
|
|
@@ -135,7 +130,7 @@ export default DitoComponent.component('DitoCreateButton', {
|
|
|
135
130
|
.dito-pulldown {
|
|
136
131
|
right: 0;
|
|
137
132
|
|
|
138
|
-
.dito-buttons
|
|
133
|
+
.dito-buttons--sticky & {
|
|
139
134
|
top: unset;
|
|
140
135
|
right: unset;
|
|
141
136
|
bottom: 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
//- Set `@click.stop` to prevent click events from bubbling to dito-label.
|
|
3
|
-
DitoButtons.dito-edit-buttons.dito-buttons
|
|
3
|
+
DitoButtons.dito-edit-buttons.dito-buttons--round(
|
|
4
4
|
:buttons="buttons"
|
|
5
5
|
:dataPath="dataPath"
|
|
6
6
|
:data="data"
|
|
@@ -12,12 +12,12 @@ DitoButtons.dito-edit-buttons.dito-buttons-round(
|
|
|
12
12
|
//- Firefox doesn't like <button> here, so use <a> instead:
|
|
13
13
|
a.dito-button(
|
|
14
14
|
v-if="draggable"
|
|
15
|
-
:class="{ 'dito-disabled': isDraggableDisabled }"
|
|
15
|
+
:class="{ 'dito-button--disabled': isDraggableDisabled }"
|
|
16
16
|
v-bind="getButtonAttributes(verbs.drag)"
|
|
17
17
|
)
|
|
18
18
|
RouterLink.dito-button(
|
|
19
19
|
v-if="editable"
|
|
20
|
-
:class="{ 'dito-disabled': isEditableDisabled }"
|
|
20
|
+
:class="{ 'dito-button--disabled': isEditableDisabled }"
|
|
21
21
|
:to="editPath ? { path: editPath } : {}"
|
|
22
22
|
v-bind="getButtonAttributes(verbs.edit)"
|
|
23
23
|
)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.dito-form.dito-scroll-parent(
|
|
3
|
-
:class="{ 'dito-form-nested': isNestedRoute }"
|
|
4
|
-
:data-resource="sourceSchema.path"
|
|
5
|
-
)
|
|
2
|
+
.dito-form.dito-scroll-parent(:data-resource="sourceSchema.path")
|
|
6
3
|
//- Only render a router-view here if this isn't the last data route and not a
|
|
7
4
|
//- nested form route, which will appear elsewhere in its own view.
|
|
8
5
|
RouterView(
|
|
@@ -37,8 +34,8 @@
|
|
|
37
34
|
generateLabels
|
|
38
35
|
)
|
|
39
36
|
template(#buttons)
|
|
40
|
-
DitoButtons.dito-buttons
|
|
41
|
-
:class="{ 'dito-buttons
|
|
37
|
+
DitoButtons.dito-buttons--round.dito-buttons--large.dito-buttons--main(
|
|
38
|
+
:class="{ 'dito-buttons--sticky': !isNestedRoute }"
|
|
42
39
|
:buttons="buttonSchemas"
|
|
43
40
|
:dataPath="dataPath"
|
|
44
41
|
:data="data"
|
|
@@ -62,19 +62,6 @@ export default DitoComponent.component('DitoHeader', {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.dito-dirty {
|
|
66
|
-
&::after {
|
|
67
|
-
content: '';
|
|
68
|
-
display: inline-block;
|
|
69
|
-
background-color: $color-white;
|
|
70
|
-
width: 8px;
|
|
71
|
-
height: 8px;
|
|
72
|
-
margin: 2px;
|
|
73
|
-
margin-left: 0.5em;
|
|
74
|
-
border-radius: 100%;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
65
|
&__teleport {
|
|
79
66
|
// Align the teleported schema headers on top of to the header menu.
|
|
80
67
|
position: absolute;
|
|
@@ -3,38 +3,28 @@ component.dito-label(
|
|
|
3
3
|
v-if="text || collapsible"
|
|
4
4
|
:is="as"
|
|
5
5
|
v-bind="attributes"
|
|
6
|
-
:class="{ 'dito-active': isActive }"
|
|
6
|
+
:class="{ 'dito-label--active': isActive }"
|
|
7
7
|
)
|
|
8
8
|
.dito-chevron(
|
|
9
9
|
v-if="collapsible"
|
|
10
|
-
:class="{ 'dito-open': !collapsed }"
|
|
10
|
+
:class="{ 'dito-chevron--open': !collapsed }"
|
|
11
11
|
)
|
|
12
12
|
.dito-label__inner(
|
|
13
13
|
v-if="text || prefixes.length > 0 || suffixes.length > 0"
|
|
14
14
|
)
|
|
15
|
-
.dito-label__prefix(
|
|
16
|
-
|
|
15
|
+
DitoAffixes.dito-label__prefix(
|
|
16
|
+
:items="prefixes"
|
|
17
|
+
:parentContext="context"
|
|
17
18
|
)
|
|
18
|
-
DitoElement(
|
|
19
|
-
v-for="(prefix, index) of prefixes"
|
|
20
|
-
:key="`prefix-${index}`"
|
|
21
|
-
as="span"
|
|
22
|
-
:content="prefix"
|
|
23
|
-
)
|
|
24
19
|
label(
|
|
25
20
|
v-if="text"
|
|
26
21
|
:for="dataPath"
|
|
27
22
|
v-html="text"
|
|
28
23
|
)
|
|
29
|
-
.dito-label__suffix(
|
|
30
|
-
|
|
24
|
+
DitoAffixes.dito-label__suffix(
|
|
25
|
+
:items="suffixes"
|
|
26
|
+
:parentContext="context"
|
|
31
27
|
)
|
|
32
|
-
DitoElement(
|
|
33
|
-
v-for="(suffix, index) of suffixes"
|
|
34
|
-
:key="`suffix-${index}`"
|
|
35
|
-
as="span"
|
|
36
|
-
:content="suffix"
|
|
37
|
-
)
|
|
38
28
|
.dito-info(
|
|
39
29
|
v-if="info"
|
|
40
30
|
:data-info="info"
|
|
@@ -43,10 +33,13 @@ component.dito-label(
|
|
|
43
33
|
|
|
44
34
|
<script>
|
|
45
35
|
import DitoComponent from '../DitoComponent.js'
|
|
36
|
+
import DitoAffixes from './DitoAffixes.vue'
|
|
46
37
|
import { isObject, asArray } from '@ditojs/utils'
|
|
47
38
|
|
|
48
39
|
// @vue/component
|
|
49
40
|
export default DitoComponent.component('DitoLabel', {
|
|
41
|
+
components: { DitoAffixes },
|
|
42
|
+
|
|
50
43
|
emits: ['open'],
|
|
51
44
|
|
|
52
45
|
props: {
|
|
@@ -59,7 +52,7 @@ export default DitoComponent.component('DitoLabel', {
|
|
|
59
52
|
|
|
60
53
|
computed: {
|
|
61
54
|
as() {
|
|
62
|
-
return this.collapsible ? '
|
|
55
|
+
return this.collapsible ? 'button' : 'div'
|
|
63
56
|
},
|
|
64
57
|
|
|
65
58
|
text() {
|
|
@@ -194,7 +187,7 @@ export default DitoComponent.component('DitoLabel', {
|
|
|
194
187
|
padding: var(--label-padding);
|
|
195
188
|
}
|
|
196
189
|
|
|
197
|
-
|
|
190
|
+
&--fill {
|
|
198
191
|
width: 100%;
|
|
199
192
|
|
|
200
193
|
// In order for ellipsis to work on labels without affecting other layout,
|
|
@@ -219,32 +212,21 @@ export default DitoComponent.component('DitoLabel', {
|
|
|
219
212
|
.dito-info {
|
|
220
213
|
margin-left: 0.35em;
|
|
221
214
|
}
|
|
222
|
-
}
|
|
223
215
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
}
|
|
216
|
+
@at-root button#{&} {
|
|
217
|
+
border: 0;
|
|
218
|
+
padding: 0;
|
|
219
|
+
text-align: start;
|
|
230
220
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
221
|
+
&:hover {
|
|
222
|
+
.dito-chevron {
|
|
223
|
+
color: $color-darker;
|
|
224
|
+
}
|
|
234
225
|
}
|
|
235
|
-
// Display labels in compact schema as inline-blocks, to allow compact
|
|
236
|
-
// layouts with `width: 'auto'` elements:
|
|
237
|
-
// TODO: Find a better way to control this behavior.
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
226
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
> .dito-container:not(.dito-container--label-vertical) {
|
|
245
|
-
display: flex;
|
|
246
|
-
flex-flow: row wrap;
|
|
247
|
-
align-items: center;
|
|
227
|
+
&:focus:not(:active, &--active) {
|
|
228
|
+
.dito-chevron {
|
|
229
|
+
-webkit-text-stroke: $border-width $color-active;
|
|
248
230
|
}
|
|
249
231
|
}
|
|
250
232
|
}
|