@ditojs/admin 2.5.1 → 2.6.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.es.js +1380 -1374
- package/dist/dito-admin.umd.js +6 -6
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/src/DitoTypeComponent.js +0 -1
- package/src/components/DitoAccount.vue +1 -0
- package/src/components/DitoContainer.vue +15 -36
- package/src/components/DitoDialog.vue +3 -1
- package/src/components/DitoHeader.vue +11 -14
- package/src/components/DitoNavigation.vue +40 -0
- package/src/components/DitoPane.vue +64 -37
- package/src/components/DitoPanels.vue +3 -2
- package/src/components/DitoRoot.vue +37 -13
- package/src/components/DitoSchema.vue +21 -16
- package/src/components/DitoSchemaInlined.vue +1 -3
- package/src/components/DitoSidebar.vue +6 -24
- package/src/components/DitoView.vue +1 -0
- package/src/components/index.js +2 -1
- package/src/mixins/TextMixin.js +1 -1
- package/src/mixins/TypeMixin.js +6 -12
- package/src/styles/_layout.scss +11 -14
- package/src/styles/_scroll.scss +1 -2
- package/src/styles/_settings.scss +5 -1
- package/src/styles/_tippy.scss +1 -0
- package/src/types/DitoTypeButton.vue +8 -17
- package/src/types/DitoTypeCode.vue +0 -1
- package/src/types/DitoTypeColor.vue +0 -13
- package/src/types/DitoTypeComponent.vue +0 -1
- package/src/types/DitoTypeLabel.vue +1 -2
- package/src/types/DitoTypeList.vue +0 -1
- package/src/types/DitoTypeMarkup.vue +14 -16
- package/src/types/DitoTypeMultiselect.vue +2 -0
- package/src/types/DitoTypeObject.vue +0 -2
- package/src/types/DitoTypePanel.vue +0 -1
- package/src/types/DitoTypeSection.vue +0 -1
- package/src/types/DitoTypeTextarea.vue +0 -1
- package/src/types/DitoTypeTreeList.vue +0 -2
- package/src/types/DitoTypeUpload.vue +0 -2
- package/src/utils/options.js +0 -1
- package/src/utils/schema.js +10 -4
package/src/mixins/TypeMixin.js
CHANGED
|
@@ -249,22 +249,16 @@ export default {
|
|
|
249
249
|
|
|
250
250
|
// @overridable
|
|
251
251
|
focusElement() {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
} else {
|
|
256
|
-
element.$el?.focus?.()
|
|
257
|
-
}
|
|
252
|
+
let { element = this } = this.$refs
|
|
253
|
+
element = element.focus ? element : element.$el
|
|
254
|
+
element?.focus?.()
|
|
258
255
|
},
|
|
259
256
|
|
|
260
257
|
// @overridable
|
|
261
258
|
blurElement() {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
} else {
|
|
266
|
-
element.$el?.blur?.()
|
|
267
|
-
}
|
|
259
|
+
let { element = this } = this.$refs
|
|
260
|
+
element = element.blur ? element : element.$el
|
|
261
|
+
element?.blur?.()
|
|
268
262
|
},
|
|
269
263
|
|
|
270
264
|
async focusSchema() {
|
package/src/styles/_layout.scss
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
display: table;
|
|
1
|
+
.dito-layout-vertical,
|
|
2
|
+
.dito-layout-horizontal {
|
|
3
|
+
display: flex;
|
|
5
4
|
|
|
6
5
|
> * {
|
|
7
|
-
|
|
6
|
+
flex: 1;
|
|
7
|
+
display: flex;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.dito-layout-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
> * {
|
|
15
|
-
display: table-cell;
|
|
11
|
+
.dito-layout-vertical {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
15
|
+
.dito-layout-horizontal {
|
|
16
|
+
> *:not(:first-child) {
|
|
17
|
+
padding-left: $form-spacing;
|
|
21
18
|
}
|
|
22
19
|
}
|
package/src/styles/_scroll.scss
CHANGED
|
@@ -34,11 +34,15 @@ $pulldown-padding: $pulldown-padding-ver $pulldown-padding-hor;
|
|
|
34
34
|
|
|
35
35
|
// Content
|
|
36
36
|
$content-width: 900px;
|
|
37
|
-
$content-
|
|
37
|
+
$content-width-wide: 1400px;
|
|
38
38
|
$content-padding: 16px;
|
|
39
39
|
$content-padding-half: calc($content-padding / 2);
|
|
40
40
|
$content-color-background: $color-lightest;
|
|
41
41
|
|
|
42
|
+
// Sidebar
|
|
43
|
+
$sidebar-max-width: 360px;
|
|
44
|
+
$sidebar-min-width: 200px;
|
|
45
|
+
|
|
42
46
|
// Form
|
|
43
47
|
$form-spacing: $input-padding-hor;
|
|
44
48
|
$form-spacing-half: calc($form-spacing / 2);
|
package/src/styles/_tippy.scss
CHANGED
|
@@ -7,18 +7,13 @@ button.dito-button(
|
|
|
7
7
|
:class="buttonClass"
|
|
8
8
|
v-bind="attributes"
|
|
9
9
|
)
|
|
10
|
-
|
|
11
|
-
v-if="
|
|
12
|
-
)
|
|
13
|
-
.dito-button__text
|
|
14
|
-
span {{ text }}
|
|
15
|
-
.dito-info(
|
|
16
|
-
v-if="!label && info"
|
|
17
|
-
:data-info="info"
|
|
18
|
-
)
|
|
19
|
-
template(
|
|
20
|
-
v-else
|
|
10
|
+
.dito-button__text(
|
|
11
|
+
v-if="text"
|
|
21
12
|
) {{ text }}
|
|
13
|
+
.dito-info(
|
|
14
|
+
v-if="!label && info"
|
|
15
|
+
:data-info="info"
|
|
16
|
+
)
|
|
22
17
|
</template>
|
|
23
18
|
|
|
24
19
|
<script>
|
|
@@ -99,13 +94,9 @@ export default DitoTypeComponent.register(
|
|
|
99
94
|
$self: &;
|
|
100
95
|
|
|
101
96
|
&__text {
|
|
102
|
-
|
|
103
|
-
min-width: min-content;
|
|
104
|
-
height: calc(1em * var(--line-height));
|
|
97
|
+
@include ellipsis;
|
|
105
98
|
|
|
106
|
-
|
|
107
|
-
@include ellipsis;
|
|
108
|
-
}
|
|
99
|
+
height: calc(1em * var(--line-height));
|
|
109
100
|
}
|
|
110
101
|
}
|
|
111
102
|
</style>
|
|
@@ -143,19 +143,6 @@ export default DitoTypeComponent.register('color', {
|
|
|
143
143
|
'#00000000'
|
|
144
144
|
]
|
|
145
145
|
})
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
watch: {
|
|
149
|
-
focused(focused) {
|
|
150
|
-
if (!focused && this.convertedHexValue) {
|
|
151
|
-
const color = tinycolor(`#${this.convertedHexValue}`)
|
|
152
|
-
if (color?.isValid()) {
|
|
153
|
-
this.value = color.toString(this.colorFormat)
|
|
154
|
-
// TODO: Emit 'input' here instead, and 'change' in blur, like others.
|
|
155
|
-
this.onChange()
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
146
|
}
|
|
160
147
|
})
|
|
161
148
|
</script>
|
|
@@ -22,7 +22,6 @@ export default DitoTypeComponent.register('component', {
|
|
|
22
22
|
// Override the standard `defaultValue: null` to not set any data for custom
|
|
23
23
|
// components, unless they provide a default value.
|
|
24
24
|
defaultValue: () => undefined, // Callback to override `defaultValue: null`
|
|
25
|
-
keepAligned: false,
|
|
26
25
|
ignoreMissingValue: schema => !('default' in schema),
|
|
27
26
|
|
|
28
27
|
async processSchema(api, schema) {
|
|
@@ -167,7 +167,6 @@ import { pickBy, equals, hyphenate } from '@ditojs/utils'
|
|
|
167
167
|
// @vue/component
|
|
168
168
|
export default DitoTypeComponent.register('list', {
|
|
169
169
|
mixins: [SourceMixin, SortableMixin],
|
|
170
|
-
keepAligned: false,
|
|
171
170
|
|
|
172
171
|
getSourceType(type) {
|
|
173
172
|
// No need for transformation here. See TypeTreeList for details.
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.dito-markup(:id="dataPath")
|
|
3
|
-
.dito-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
.dito-buttons.dito-buttons-toolbar(
|
|
4
|
+
v-if="groupedButtons.length > 0"
|
|
5
|
+
)
|
|
6
|
+
.dito-button-group(
|
|
7
|
+
v-for="buttons in groupedButtons"
|
|
6
8
|
)
|
|
7
|
-
.dito-button
|
|
8
|
-
v-for="
|
|
9
|
+
button.dito-button(
|
|
10
|
+
v-for="{ name, icon, isActive, onClick } in buttons"
|
|
11
|
+
:key="name"
|
|
12
|
+
:class="{ 'dito-active': isActive }"
|
|
13
|
+
@click="onClick"
|
|
9
14
|
)
|
|
10
|
-
|
|
11
|
-
v-for="{ name, icon, isActive, onClick } in buttons"
|
|
12
|
-
:key="name"
|
|
13
|
-
:class="{ 'dito-active': isActive }"
|
|
14
|
-
@click="onClick"
|
|
15
|
-
)
|
|
16
|
-
Icon(:name="icon")
|
|
15
|
+
Icon(:name="icon")
|
|
17
16
|
EditorContent.dito-markup-editor(
|
|
18
17
|
ref="editor"
|
|
19
18
|
:editor="editor"
|
|
@@ -76,8 +75,6 @@ export default DitoTypeComponent.register('markup', {
|
|
|
76
75
|
Icon
|
|
77
76
|
},
|
|
78
77
|
|
|
79
|
-
keepAligned: false,
|
|
80
|
-
|
|
81
78
|
data() {
|
|
82
79
|
return {
|
|
83
80
|
editor: null,
|
|
@@ -317,7 +314,7 @@ export default DitoTypeComponent.register('markup', {
|
|
|
317
314
|
}
|
|
318
315
|
}
|
|
319
316
|
editor.commands.setLink({ href, title })
|
|
320
|
-
} else {
|
|
317
|
+
} else if (attributes === null) {
|
|
321
318
|
editor.commands.unsetLink()
|
|
322
319
|
}
|
|
323
320
|
},
|
|
@@ -522,13 +519,14 @@ const LinkWithTitle = Link.extend({
|
|
|
522
519
|
|
|
523
520
|
.dito-markup-editor {
|
|
524
521
|
overflow-y: scroll;
|
|
522
|
+
margin-top: $input-padding-ver;
|
|
525
523
|
// Move padding "inside" editor to correctly position scrollbar
|
|
526
524
|
margin-right: -$input-padding-hor;
|
|
527
525
|
padding-right: $input-padding-hor;
|
|
528
526
|
}
|
|
529
527
|
|
|
530
528
|
.dito-buttons-toolbar {
|
|
531
|
-
margin:
|
|
529
|
+
margin: 0;
|
|
532
530
|
}
|
|
533
531
|
|
|
534
532
|
h1,
|
|
@@ -63,8 +63,6 @@ import { resolveSchemaComponent } from '../utils/schema.js'
|
|
|
63
63
|
export default DitoTypeComponent.register('object', {
|
|
64
64
|
mixins: [SourceMixin],
|
|
65
65
|
|
|
66
|
-
keepAligned: false,
|
|
67
|
-
|
|
68
66
|
getSourceType(type) {
|
|
69
67
|
// No need for transformation here. See TypeTreeList for details.
|
|
70
68
|
return type
|
package/src/utils/options.js
CHANGED
package/src/utils/schema.js
CHANGED
|
@@ -510,12 +510,18 @@ export function isNested(schema) {
|
|
|
510
510
|
return !!(schema.nested || getTypeOptions(schema)?.defaultNested === true)
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
export function
|
|
514
|
-
|
|
513
|
+
export function hasLabel(schema, generateLabels) {
|
|
514
|
+
const { label } = schema
|
|
515
|
+
return (
|
|
516
|
+
label !== false && (
|
|
517
|
+
!!label ||
|
|
518
|
+
generateLabels && getTypeOptions(schema)?.generateLabel
|
|
519
|
+
)
|
|
520
|
+
)
|
|
515
521
|
}
|
|
516
522
|
|
|
517
|
-
export function
|
|
518
|
-
return !!getTypeOptions(schema)?.
|
|
523
|
+
export function omitPadding(schema) {
|
|
524
|
+
return !!getTypeOptions(schema)?.omitPadding
|
|
519
525
|
}
|
|
520
526
|
|
|
521
527
|
export function getSchemaValue(
|