@ditojs/admin 2.0.5 → 2.1.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/dist/dito-admin.es.js +1511 -1435
- package/dist/dito-admin.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +31 -31
- package/src/DitoAdmin.js +66 -31
- package/src/DitoComponent.js +4 -1
- package/src/DitoContext.js +13 -5
- package/src/{TypeComponent.js → DitoTypeComponent.js} +8 -5
- package/src/components/DitoAccount.vue +20 -19
- package/src/components/DitoButtons.vue +14 -12
- package/src/components/DitoClipboard.vue +16 -8
- package/src/components/DitoContainer.vue +56 -43
- package/src/components/DitoCreateButton.vue +20 -15
- package/src/components/DitoDialog.vue +69 -48
- package/src/components/DitoEditButtons.vue +16 -14
- package/src/components/DitoElement.vue +2 -3
- package/src/components/DitoErrors.vue +18 -13
- package/src/components/DitoForm.vue +41 -24
- package/src/components/DitoFormNested.vue +12 -10
- package/src/components/DitoHeader.vue +103 -69
- package/src/components/DitoLabel.vue +108 -81
- package/src/components/DitoMenu.vue +52 -36
- package/src/components/DitoPagination.vue +9 -7
- package/src/components/DitoPane.vue +53 -45
- package/src/components/DitoPanel.vue +62 -42
- package/src/components/DitoPanels.vue +11 -10
- package/src/components/DitoRoot.vue +57 -46
- package/src/components/DitoSchema.vue +179 -131
- package/src/components/DitoSchemaInlined.vue +39 -28
- package/src/components/DitoScopes.vue +41 -31
- package/src/components/DitoSpinner.vue +31 -40
- package/src/components/DitoTableCell.vue +9 -9
- package/src/components/DitoTableHead.vue +52 -37
- package/src/components/DitoTabs.vue +39 -29
- package/src/components/DitoTreeItem.vue +140 -86
- package/src/components/DitoVNode.vue +1 -1
- package/src/components/DitoView.vue +13 -11
- package/src/mixins/DataMixin.js +11 -9
- package/src/mixins/DitoMixin.js +47 -25
- package/src/mixins/EmitterMixin.js +2 -1
- package/src/mixins/ItemMixin.js +15 -10
- package/src/mixins/LoadingMixin.js +2 -1
- package/src/mixins/NumberMixin.js +15 -10
- package/src/mixins/OptionsMixin.js +24 -12
- package/src/mixins/ResourceMixin.js +42 -34
- package/src/mixins/RouteMixin.js +8 -8
- package/src/mixins/SortableMixin.js +1 -1
- package/src/mixins/SourceMixin.js +68 -34
- package/src/mixins/TypeMixin.js +5 -4
- package/src/mixins/ValidationMixin.js +3 -0
- package/src/styles/_base.scss +17 -0
- package/src/styles/_button.scss +212 -0
- package/src/styles/_imports.scss +2 -0
- package/src/styles/_layout.scss +22 -0
- package/src/styles/_notifications.scss +54 -0
- package/src/styles/_pulldown.scss +39 -0
- package/src/styles/_scroll.scss +15 -0
- package/src/styles/_settings.scss +68 -0
- package/src/styles/_sortable.scss +13 -0
- package/src/styles/_table.scss +224 -0
- package/src/styles/style.scss +9 -0
- package/src/types/DitoTypeButton.vue +72 -0
- package/src/types/{TypeCheckbox.vue → DitoTypeCheckbox.vue} +12 -11
- package/src/types/{TypeCheckboxes.vue → DitoTypeCheckboxes.vue} +21 -15
- package/src/types/{TypeCode.vue → DitoTypeCode.vue} +46 -34
- package/src/types/{TypeColor.vue → DitoTypeColor.vue} +71 -52
- package/src/types/{TypeComponent.vue → DitoTypeComponent.vue} +2 -2
- package/src/types/DitoTypeComputed.vue +54 -0
- package/src/types/DitoTypeDate.vue +64 -0
- package/src/types/DitoTypeLabel.vue +23 -0
- package/src/types/{TypeList.vue → DitoTypeList.vue} +83 -61
- package/src/types/{TypeMarkup.vue → DitoTypeMarkup.vue} +172 -122
- package/src/types/DitoTypeMultiselect.vue +434 -0
- package/src/types/DitoTypeNumber.vue +46 -0
- package/src/types/{TypeObject.vue → DitoTypeObject.vue} +41 -26
- package/src/types/{TypePanel.vue → DitoTypePanel.vue} +2 -2
- package/src/types/{TypeProgress.vue → DitoTypeProgress.vue} +4 -6
- package/src/types/{TypeRadio.vue → DitoTypeRadio.vue} +17 -13
- package/src/types/{TypeSection.vue → DitoTypeSection.vue} +17 -17
- package/src/types/{TypeSelect.vue → DitoTypeSelect.vue} +39 -35
- package/src/types/{TypeSlider.vue → DitoTypeSlider.vue} +29 -23
- package/src/types/{TypeSwitch.vue → DitoTypeSwitch.vue} +15 -13
- package/src/types/DitoTypeText.vue +77 -0
- package/src/types/{TypeTextarea.vue → DitoTypeTextarea.vue} +17 -14
- package/src/types/DitoTypeTreeList.vue +191 -0
- package/src/types/{TypeUpload.vue → DitoTypeUpload.vue} +92 -65
- package/src/types/index.js +26 -26
- package/src/utils/SchemaGraph.js +21 -13
- package/src/utils/accessor.js +17 -9
- package/src/utils/data.js +4 -1
- package/src/utils/filter.js +8 -10
- package/src/utils/options.js +3 -3
- package/src/utils/resource.js +12 -10
- package/src/utils/schema.js +190 -125
- package/src/utils/type.js +31 -20
- package/src/validations/_decimals.js +1 -2
- package/types/index.d.ts +27 -23
- package/src/styles/_base.sass +0 -15
- package/src/styles/_button.sass +0 -127
- package/src/styles/_imports.sass +0 -2
- package/src/styles/_layout.sass +0 -13
- package/src/styles/_notifications.sass +0 -33
- package/src/styles/_pulldown.sass +0 -26
- package/src/styles/_scroll.sass +0 -13
- package/src/styles/_settings.sass +0 -55
- package/src/styles/_sortable.sass +0 -9
- package/src/styles/_table.sass +0 -153
- package/src/styles/style.sass +0 -10
- package/src/types/TypeButton.vue +0 -73
- package/src/types/TypeComputed.vue +0 -53
- package/src/types/TypeDate.vue +0 -64
- package/src/types/TypeLabel.vue +0 -19
- package/src/types/TypeMultiselect.vue +0 -376
- package/src/types/TypeNumber.vue +0 -44
- package/src/types/TypeText.vue +0 -67
- package/src/types/TypeTreeList.vue +0 -164
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
v-if="hasLabel || hasTabs || clipboard"
|
|
6
6
|
:class="{ 'dito-schema-menu-header': menuHeader }"
|
|
7
7
|
)
|
|
8
|
-
|
|
8
|
+
DitoLabel(
|
|
9
9
|
v-if="hasLabel"
|
|
10
10
|
:label="label"
|
|
11
11
|
:dataPath="dataPath"
|
|
@@ -15,40 +15,40 @@
|
|
|
15
15
|
)
|
|
16
16
|
//- Pass edit-buttons through to dito-label's own edit-buttons slot:
|
|
17
17
|
template(
|
|
18
|
-
#edit-buttons
|
|
19
18
|
v-if="inlined"
|
|
19
|
+
#edit-buttons
|
|
20
20
|
)
|
|
21
21
|
slot(name="edit-buttons")
|
|
22
|
-
|
|
22
|
+
DitoTabs(
|
|
23
23
|
v-if="tabs"
|
|
24
24
|
:tabs="tabs"
|
|
25
25
|
:selectedTab="selectedTab"
|
|
26
26
|
)
|
|
27
|
-
|
|
27
|
+
DitoClipboard(
|
|
28
28
|
:clipboard="clipboard"
|
|
29
29
|
:dataPath="dataPath"
|
|
30
30
|
:data="data"
|
|
31
31
|
)
|
|
32
|
-
|
|
32
|
+
template(
|
|
33
33
|
v-if="hasTabs"
|
|
34
|
-
v-for="(schema, tab) in tabs"
|
|
35
|
-
ref="tabs"
|
|
36
|
-
:key="tab"
|
|
37
|
-
:visible="selectedTab === tab"
|
|
38
|
-
:tab="tab"
|
|
39
|
-
:schema="schema"
|
|
40
|
-
:dataPath="dataPath"
|
|
41
|
-
:data="data"
|
|
42
|
-
:meta="meta"
|
|
43
|
-
:store="store"
|
|
44
|
-
:single="!inlined && !hasMainPane"
|
|
45
|
-
:disabled="disabled"
|
|
46
|
-
:generateLabels="generateLabels"
|
|
47
|
-
)
|
|
48
|
-
transition-height(
|
|
49
|
-
:enabled="inlined"
|
|
50
34
|
)
|
|
51
|
-
|
|
35
|
+
DitoPane.dito-pane-tab(
|
|
36
|
+
v-for="(tabSchema, tab) in tabs"
|
|
37
|
+
ref="tabs"
|
|
38
|
+
:key="tab"
|
|
39
|
+
:visible="selectedTab === tab"
|
|
40
|
+
:tab="tab"
|
|
41
|
+
:schema="tabSchema"
|
|
42
|
+
:dataPath="dataPath"
|
|
43
|
+
:data="data"
|
|
44
|
+
:meta="meta"
|
|
45
|
+
:store="store"
|
|
46
|
+
:single="!inlined && !hasMainPane"
|
|
47
|
+
:disabled="disabled"
|
|
48
|
+
:generateLabels="generateLabels"
|
|
49
|
+
)
|
|
50
|
+
TransitionHeight(:enabled="inlined")
|
|
51
|
+
DitoPane.dito-pane-main(
|
|
52
52
|
v-if="hasMainPane && opened"
|
|
53
53
|
ref="components"
|
|
54
54
|
:schema="schema"
|
|
@@ -64,13 +64,17 @@
|
|
|
64
64
|
v-if="!inlined && isPopulated"
|
|
65
65
|
name="buttons"
|
|
66
66
|
)
|
|
67
|
-
template(
|
|
67
|
+
template(
|
|
68
|
+
v-if="inlined"
|
|
69
|
+
)
|
|
68
70
|
slot(
|
|
69
71
|
v-if="!hasLabel"
|
|
70
72
|
name="edit-buttons"
|
|
71
73
|
)
|
|
72
|
-
template(
|
|
73
|
-
|
|
74
|
+
template(
|
|
75
|
+
v-else-if="isPopulated"
|
|
76
|
+
)
|
|
77
|
+
DitoPanels(
|
|
74
78
|
:panels="panelSchemas"
|
|
75
79
|
:data="data"
|
|
76
80
|
:meta="meta"
|
|
@@ -79,95 +83,32 @@
|
|
|
79
83
|
)
|
|
80
84
|
</template>
|
|
81
85
|
|
|
82
|
-
<style lang="sass">
|
|
83
|
-
@import '../styles/_imports'
|
|
84
|
-
|
|
85
|
-
.dito-schema
|
|
86
|
-
box-sizing: border-box
|
|
87
|
-
// To display schema next to panels:
|
|
88
|
-
display: flex
|
|
89
|
-
min-height: 100%
|
|
90
|
-
> .dito-schema-content
|
|
91
|
-
flex: 1 1 100%
|
|
92
|
-
// So that schema buttons can be sticky to the bottom:
|
|
93
|
-
display: grid
|
|
94
|
-
grid-template-rows: min-content
|
|
95
|
-
> *:only-child
|
|
96
|
-
grid-row-end: none
|
|
97
|
-
max-width: $content-width
|
|
98
|
-
padding: $content-padding
|
|
99
|
-
> .dito-buttons,
|
|
100
|
-
> .dito-panels
|
|
101
|
-
flex: 1 1 0%
|
|
102
|
-
> .dito-buttons
|
|
103
|
-
margin-left: $form-spacing
|
|
104
|
-
> .dito-panels
|
|
105
|
-
padding: $content-padding $content-padding $content-padding 0
|
|
106
|
-
// Display a ruler between tabbed components and towards the .dito-buttons
|
|
107
|
-
.dito-pane-tab + .dito-pane-main
|
|
108
|
-
&::before
|
|
109
|
-
// Use a pseudo element to display a ruler with proper margins
|
|
110
|
-
display: block
|
|
111
|
-
content: ''
|
|
112
|
-
width: 100%
|
|
113
|
-
border-bottom: $border-style
|
|
114
|
-
// Add removed $form-spacing again to the ruler
|
|
115
|
-
margin: $content-padding $form-spacing-half $form-spacing-half
|
|
116
|
-
.dito-schema-header
|
|
117
|
-
display: flex
|
|
118
|
-
justify-content: space-between
|
|
119
|
-
.dito-tabs,
|
|
120
|
-
.dito-clipboard
|
|
121
|
-
display: flex
|
|
122
|
-
align-self: flex-end
|
|
123
|
-
.dito-clipboard
|
|
124
|
-
&:only-child
|
|
125
|
-
margin-left: auto
|
|
126
|
-
.dito-button
|
|
127
|
-
margin: 0 0 $tab-margin $tab-margin
|
|
128
|
-
&.dito-schema-menu-header
|
|
129
|
-
// Bring the tabs up to the menu.
|
|
130
|
-
position: absolute
|
|
131
|
-
height: $menu-height
|
|
132
|
-
padding: 0 $menu-padding-hor
|
|
133
|
-
max-width: $content-width
|
|
134
|
-
top: 0
|
|
135
|
-
left: 0
|
|
136
|
-
right: 0
|
|
137
|
-
z-index: $menu-z-index
|
|
138
|
-
// Turn off pointer events so that DitoTrail keeps receiving events...
|
|
139
|
-
pointer-events: none
|
|
140
|
-
// ...but allow interaction with the tabs and buttons (e.g. clipboard)
|
|
141
|
-
// layered on top of DitoTrail.
|
|
142
|
-
.dito-tabs,
|
|
143
|
-
.dito-buttons
|
|
144
|
-
pointer-events: auto
|
|
145
|
-
line-height: $menu-line-height
|
|
146
|
-
font-size: $menu-font-size
|
|
147
|
-
button.dito-label
|
|
148
|
-
width: 100%
|
|
149
|
-
// Catch all clicks, even when it would be partially covered by schema.
|
|
150
|
-
z-index: 1
|
|
151
|
-
</style>
|
|
152
|
-
|
|
153
86
|
<script>
|
|
154
87
|
import {
|
|
155
|
-
isObject,
|
|
156
|
-
|
|
88
|
+
isObject,
|
|
89
|
+
isArray,
|
|
90
|
+
isFunction,
|
|
91
|
+
isRegExp,
|
|
92
|
+
parseDataPath,
|
|
93
|
+
normalizeDataPath,
|
|
94
|
+
labelize
|
|
157
95
|
} from '@ditojs/utils'
|
|
158
96
|
import { TransitionHeight } from '@ditojs/ui/src'
|
|
159
97
|
import DitoComponent from '../DitoComponent.js'
|
|
160
98
|
import ItemMixin from '../mixins/ItemMixin.js'
|
|
161
99
|
import { appendDataPath, getParentItem } from '../utils/data.js'
|
|
162
100
|
import {
|
|
163
|
-
getNamedSchemas,
|
|
101
|
+
getNamedSchemas,
|
|
102
|
+
getPanelSchemas,
|
|
103
|
+
setDefaultValues,
|
|
104
|
+
processData
|
|
164
105
|
} from '../utils/schema.js'
|
|
165
106
|
import { getStoreAccessor } from '../utils/accessor.js'
|
|
166
107
|
|
|
167
108
|
// @vue/component
|
|
168
|
-
export default DitoComponent.component('
|
|
169
|
-
components: { TransitionHeight },
|
|
109
|
+
export default DitoComponent.component('DitoSchema', {
|
|
170
110
|
mixins: [ItemMixin],
|
|
111
|
+
components: { TransitionHeight },
|
|
171
112
|
|
|
172
113
|
provide() {
|
|
173
114
|
return {
|
|
@@ -237,9 +178,10 @@ export default DitoComponent.component('dito-schema', {
|
|
|
237
178
|
|
|
238
179
|
selectedTab() {
|
|
239
180
|
const currentTab = this.$route.hash?.slice(1) || null
|
|
240
|
-
const tab =
|
|
241
|
-
|
|
242
|
-
|
|
181
|
+
const tab =
|
|
182
|
+
currentTab && this.shouldRender(this.tabs[currentTab])
|
|
183
|
+
? currentTab
|
|
184
|
+
: this.defaultTab?.name || null
|
|
243
185
|
if (tab !== currentTab) {
|
|
244
186
|
// TODO: Move this watcher!
|
|
245
187
|
// Any tab change needs to be reflected in the router also.
|
|
@@ -249,13 +191,14 @@ export default DitoComponent.component('dito-schema', {
|
|
|
249
191
|
},
|
|
250
192
|
|
|
251
193
|
defaultTab() {
|
|
194
|
+
let first = null
|
|
252
195
|
if (this.tabs) {
|
|
253
|
-
let first = null
|
|
254
196
|
for (const tab of Object.values(this.tabs)) {
|
|
255
197
|
const { defaultTab } = tab
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
|
|
198
|
+
if (
|
|
199
|
+
isFunction(defaultTab)
|
|
200
|
+
? defaultTab.call(this, this.context)
|
|
201
|
+
: defaultTab
|
|
259
202
|
) {
|
|
260
203
|
return tab
|
|
261
204
|
}
|
|
@@ -263,8 +206,8 @@ export default DitoComponent.component('dito-schema', {
|
|
|
263
206
|
first = tab
|
|
264
207
|
}
|
|
265
208
|
}
|
|
266
|
-
return first
|
|
267
209
|
}
|
|
210
|
+
return first
|
|
268
211
|
},
|
|
269
212
|
|
|
270
213
|
clipboard() {
|
|
@@ -394,7 +337,9 @@ export default DitoComponent.component('dito-schema', {
|
|
|
394
337
|
methods: {
|
|
395
338
|
getComponentsByDataPath(dataPath, match) {
|
|
396
339
|
return this._getEntriesByDataPath(
|
|
397
|
-
this.componentsByDataPath,
|
|
340
|
+
this.componentsByDataPath,
|
|
341
|
+
dataPath,
|
|
342
|
+
match
|
|
398
343
|
)
|
|
399
344
|
},
|
|
400
345
|
|
|
@@ -554,23 +499,25 @@ export default DitoComponent.component('dito-schema', {
|
|
|
554
499
|
while (dataPathParts.length > 0) {
|
|
555
500
|
const components = this.getComponentsByDataPath(dataPathParts)
|
|
556
501
|
for (const component of components) {
|
|
557
|
-
if (
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
502
|
+
if (
|
|
503
|
+
await component.navigateToComponent?.(
|
|
504
|
+
fullDataPath,
|
|
505
|
+
subComponents => {
|
|
506
|
+
let found = false
|
|
507
|
+
for (const component of subComponents) {
|
|
508
|
+
const errs = errors[component.dataPath]
|
|
509
|
+
if (
|
|
510
|
+
errs &&
|
|
511
|
+
component.showValidationErrors(errs, first && focus)
|
|
512
|
+
) {
|
|
513
|
+
found = true
|
|
514
|
+
first = false
|
|
515
|
+
}
|
|
569
516
|
}
|
|
517
|
+
return found
|
|
570
518
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
)) {
|
|
519
|
+
)
|
|
520
|
+
) {
|
|
574
521
|
// Found a nested form to display at least parts fo the errors.
|
|
575
522
|
// We can't show all errors at once, so we're done. Don't call
|
|
576
523
|
// `notifyErrors()` yet, as we can only display it once
|
|
@@ -607,10 +554,10 @@ export default DitoComponent.component('dito-schema', {
|
|
|
607
554
|
},
|
|
608
555
|
|
|
609
556
|
resetData() {
|
|
610
|
-
// We can't set `this.data = ...` because it's a property, but we can
|
|
611
|
-
//
|
|
612
|
-
// `
|
|
613
|
-
Object.assign(this.data,
|
|
557
|
+
// We can't set `this.data = ...` because it's a property, but we can set
|
|
558
|
+
// all known properties on it to the values returned by
|
|
559
|
+
// `setDefaultValues()`, as they are all reactive already from the starts:
|
|
560
|
+
Object.assign(this.data, setDefaultValues(this.schema, {}, this))
|
|
614
561
|
this.clearErrors()
|
|
615
562
|
},
|
|
616
563
|
|
|
@@ -648,7 +595,8 @@ export default DitoComponent.component('dito-schema', {
|
|
|
648
595
|
this.schema,
|
|
649
596
|
this.sourceSchema,
|
|
650
597
|
this.data,
|
|
651
|
-
this.dataPath,
|
|
598
|
+
this.dataPath,
|
|
599
|
+
{
|
|
652
600
|
// Needed for DitoContext handling inside `processData` and
|
|
653
601
|
// `processSchemaData()`:
|
|
654
602
|
component: this,
|
|
@@ -692,7 +640,7 @@ export default DitoComponent.component('dito-schema', {
|
|
|
692
640
|
// Multiple entries can be linked to the same data-path, e.g. when
|
|
693
641
|
// there are tabs. Link each data-path to an array of entries.
|
|
694
642
|
const { dataPath } = entry
|
|
695
|
-
const entries = entriesByDataPath[dataPath] ||= []
|
|
643
|
+
const entries = (entriesByDataPath[dataPath] ||= [])
|
|
696
644
|
entries.push(entry)
|
|
697
645
|
return entriesByDataPath
|
|
698
646
|
}, {})
|
|
@@ -724,3 +672,103 @@ export default DitoComponent.component('dito-schema', {
|
|
|
724
672
|
}
|
|
725
673
|
})
|
|
726
674
|
</script>
|
|
675
|
+
|
|
676
|
+
<style lang="scss">
|
|
677
|
+
@import '../styles/_imports';
|
|
678
|
+
|
|
679
|
+
.dito-schema {
|
|
680
|
+
box-sizing: border-box;
|
|
681
|
+
// To display schema next to panels:
|
|
682
|
+
display: flex;
|
|
683
|
+
min-height: 100%;
|
|
684
|
+
|
|
685
|
+
> .dito-schema-content {
|
|
686
|
+
flex: 1 1 100%;
|
|
687
|
+
// So that schema buttons can be sticky to the bottom:
|
|
688
|
+
display: grid;
|
|
689
|
+
grid-template-rows: min-content;
|
|
690
|
+
|
|
691
|
+
> *:only-child {
|
|
692
|
+
grid-row-end: none;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
max-width: $content-width;
|
|
696
|
+
padding: $content-padding;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
> .dito-buttons,
|
|
700
|
+
> .dito-panels {
|
|
701
|
+
flex: 1 1 0%;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
> .dito-buttons {
|
|
705
|
+
margin-left: $form-spacing;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
> .dito-panels {
|
|
709
|
+
padding: $content-padding $content-padding $content-padding 0;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// Display a ruler between tabbed components and towards the .dito-buttons
|
|
713
|
+
.dito-pane-tab + .dito-pane-main {
|
|
714
|
+
&::before {
|
|
715
|
+
// Use a pseudo element to display a ruler with proper margins
|
|
716
|
+
display: block;
|
|
717
|
+
content: '';
|
|
718
|
+
width: 100%;
|
|
719
|
+
border-bottom: $border-style;
|
|
720
|
+
// Add removed $form-spacing again to the ruler
|
|
721
|
+
margin: $content-padding $form-spacing-half $form-spacing-half;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.dito-schema-header {
|
|
727
|
+
display: flex;
|
|
728
|
+
justify-content: space-between;
|
|
729
|
+
|
|
730
|
+
.dito-tabs,
|
|
731
|
+
.dito-clipboard {
|
|
732
|
+
display: flex;
|
|
733
|
+
align-self: flex-end;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
.dito-clipboard {
|
|
737
|
+
&:only-child {
|
|
738
|
+
margin-left: auto;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.dito-button {
|
|
742
|
+
margin: 0 0 $tab-margin $tab-margin;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
&.dito-schema-menu-header {
|
|
747
|
+
// Bring the tabs up to the menu.
|
|
748
|
+
position: absolute;
|
|
749
|
+
height: $menu-height;
|
|
750
|
+
padding: 0 $menu-padding-hor;
|
|
751
|
+
max-width: $content-width;
|
|
752
|
+
top: 0;
|
|
753
|
+
left: 0;
|
|
754
|
+
right: 0;
|
|
755
|
+
z-index: $menu-z-index;
|
|
756
|
+
// Turn off pointer events so that DitoTrail keeps receiving events...
|
|
757
|
+
pointer-events: none;
|
|
758
|
+
// ...but allow interaction with the tabs and buttons (e.g. clipboard)
|
|
759
|
+
// layered on top of DitoTrail.
|
|
760
|
+
.dito-tabs,
|
|
761
|
+
.dito-buttons {
|
|
762
|
+
pointer-events: auto;
|
|
763
|
+
line-height: $menu-line-height;
|
|
764
|
+
font-size: $menu-font-size;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
button.dito-label {
|
|
769
|
+
width: 100%;
|
|
770
|
+
// Catch all clicks, even when it would be partially covered by schema.
|
|
771
|
+
z-index: 1;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
|
|
2
|
+
DitoSchema.dito-schema-inlined(
|
|
3
3
|
:schema="schema"
|
|
4
4
|
:dataPath="dataPath"
|
|
5
5
|
:data="data"
|
|
@@ -15,7 +15,7 @@ dito-schema.dito-schema-inlined(
|
|
|
15
15
|
//- Render dito-edit-buttons for inlined schemas separately from all
|
|
16
16
|
//- others in `TypeList` as a scope, for better handling of layout.
|
|
17
17
|
template(#edit-buttons)
|
|
18
|
-
|
|
18
|
+
DitoEditButtons(
|
|
19
19
|
v-if="deletable || draggable || editable"
|
|
20
20
|
:deletable="deletable"
|
|
21
21
|
:draggable="draggable"
|
|
@@ -30,36 +30,13 @@ dito-schema.dito-schema-inlined(
|
|
|
30
30
|
)
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
|
-
<style lang="sass">
|
|
34
|
-
@import '../styles/_imports'
|
|
35
|
-
|
|
36
|
-
.dito-schema-inlined
|
|
37
|
-
> .dito-schema-content
|
|
38
|
-
padding: 0
|
|
39
|
-
> .dito-schema-header
|
|
40
|
-
// Change spacing so .dito-label covers the full .dito-schema-header.
|
|
41
|
-
margin: -$form-spacing
|
|
42
|
-
.dito-label
|
|
43
|
-
// Add removed $form-spacing again
|
|
44
|
-
--label-padding: #{$form-spacing}
|
|
45
|
-
margin: 0
|
|
46
|
-
width: 100%
|
|
47
|
-
box-sizing: content-box
|
|
48
|
-
// Because tables have a funny way of allowing too much width growth:
|
|
49
|
-
max-width: $content-width
|
|
50
|
-
// Prevent collapsing to min-height when alone in
|
|
51
|
-
// .dito-schema-content, due to grid-template-rows: min-content
|
|
52
|
-
min-height: 2em
|
|
53
|
-
& +.dito-pane
|
|
54
|
-
// Needed for transition-height in DitoSchema:
|
|
55
|
-
min-height: $form-spacing
|
|
56
|
-
</style>
|
|
57
|
-
|
|
58
33
|
<script>
|
|
59
34
|
import DitoComponent from '../DitoComponent.js'
|
|
60
35
|
import { isCompact } from '../utils/schema.js'
|
|
61
36
|
// @vue/component
|
|
62
|
-
export default DitoComponent.component('
|
|
37
|
+
export default DitoComponent.component('DitoSchemaInlined', {
|
|
38
|
+
emits: ['delete'],
|
|
39
|
+
|
|
63
40
|
props: {
|
|
64
41
|
schema: { type: Object, required: true },
|
|
65
42
|
dataPath: { type: String, required: true },
|
|
@@ -87,3 +64,37 @@ export default DitoComponent.component('dito-schema-inlined', {
|
|
|
87
64
|
}
|
|
88
65
|
})
|
|
89
66
|
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss">
|
|
69
|
+
@import '../styles/_imports';
|
|
70
|
+
|
|
71
|
+
.dito-schema-inlined {
|
|
72
|
+
> .dito-schema-content {
|
|
73
|
+
padding: 0;
|
|
74
|
+
|
|
75
|
+
> .dito-schema-header {
|
|
76
|
+
// Change spacing so .dito-label covers the full .dito-schema-header.
|
|
77
|
+
margin: -$form-spacing;
|
|
78
|
+
|
|
79
|
+
.dito-label {
|
|
80
|
+
// Add removed $form-spacing again
|
|
81
|
+
--label-padding: #{$form-spacing};
|
|
82
|
+
|
|
83
|
+
margin: 0;
|
|
84
|
+
width: 100%;
|
|
85
|
+
box-sizing: content-box;
|
|
86
|
+
// Because tables have a funny way of allowing too much width growth:
|
|
87
|
+
max-width: $content-width;
|
|
88
|
+
// Prevent collapsing to min-height when alone in
|
|
89
|
+
// .dito-schema-content, due to grid-template-rows: min-content
|
|
90
|
+
min-height: 2em;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& + .dito-pane {
|
|
94
|
+
// Needed for transition-height in DitoSchema:
|
|
95
|
+
min-height: $form-spacing;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.dito-scopes
|
|
3
|
-
|
|
3
|
+
RouterLink(
|
|
4
4
|
v-for="(scope, key) in scopes"
|
|
5
5
|
:key="key"
|
|
6
|
+
v-slot="{ navigate }"
|
|
6
7
|
:to="getScopeLink(scope)"
|
|
7
8
|
custom
|
|
8
|
-
v-slot="{ navigate }"
|
|
9
9
|
)
|
|
10
10
|
button.dito-button(
|
|
11
11
|
type="button"
|
|
@@ -15,39 +15,11 @@
|
|
|
15
15
|
) {{ getLabel(scope) }}
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
|
-
<style lang="sass">
|
|
19
|
-
@import '../styles/_imports'
|
|
20
|
-
|
|
21
|
-
.dito-scopes
|
|
22
|
-
white-space: nowrap
|
|
23
|
-
display: flex
|
|
24
|
-
.dito-button
|
|
25
|
-
+ellipsis
|
|
26
|
-
border-radius: 0
|
|
27
|
-
// A bit more than the width of ellipsis, to prevent replacing short words
|
|
28
|
-
// with ellipsis.
|
|
29
|
-
min-width: 3em
|
|
30
|
-
flex: 0 1 auto
|
|
31
|
-
&:first-child
|
|
32
|
-
border-top-left-radius: 1em
|
|
33
|
-
border-bottom-left-radius: 1em
|
|
34
|
-
padding-left: 1em
|
|
35
|
-
&:last-child
|
|
36
|
-
border-top-right-radius: 1em
|
|
37
|
-
border-bottom-right-radius: 1em
|
|
38
|
-
padding-right: 1em
|
|
39
|
-
& + .dito-button
|
|
40
|
-
margin-left: -1px
|
|
41
|
-
// Don't cover the focused border of buttons:
|
|
42
|
-
&:focus
|
|
43
|
-
z-index: 1
|
|
44
|
-
</style>
|
|
45
|
-
|
|
46
18
|
<script>
|
|
47
19
|
import DitoComponent from '../DitoComponent.js'
|
|
48
20
|
|
|
49
21
|
// @vue/component
|
|
50
|
-
export default DitoComponent.component('
|
|
22
|
+
export default DitoComponent.component('DitoScopes', {
|
|
51
23
|
props: {
|
|
52
24
|
query: { type: Object, required: true },
|
|
53
25
|
scopes: { type: Object, required: true }
|
|
@@ -64,3 +36,41 @@ export default DitoComponent.component('dito-scopes', {
|
|
|
64
36
|
}
|
|
65
37
|
})
|
|
66
38
|
</script>
|
|
39
|
+
|
|
40
|
+
<style lang="scss">
|
|
41
|
+
@import '../styles/_imports';
|
|
42
|
+
|
|
43
|
+
.dito-scopes {
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
display: flex;
|
|
46
|
+
|
|
47
|
+
.dito-button {
|
|
48
|
+
@include ellipsis;
|
|
49
|
+
|
|
50
|
+
border-radius: 0;
|
|
51
|
+
// A bit more than the width of ellipsis, to prevent replacing short words
|
|
52
|
+
// with ellipsis.
|
|
53
|
+
min-width: 3em;
|
|
54
|
+
flex: 0 1 auto;
|
|
55
|
+
|
|
56
|
+
&:first-child {
|
|
57
|
+
border-top-left-radius: 1em;
|
|
58
|
+
border-bottom-left-radius: 1em;
|
|
59
|
+
padding-left: 1em;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:last-child {
|
|
63
|
+
border-top-right-radius: 1em;
|
|
64
|
+
border-bottom-right-radius: 1em;
|
|
65
|
+
padding-right: 1em;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
& + .dito-button {
|
|
69
|
+
margin-left: -1px;
|
|
70
|
+
} // Don't cover the focused border of buttons:
|
|
71
|
+
&:focus {
|
|
72
|
+
z-index: 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -3,47 +3,11 @@
|
|
|
3
3
|
v-show="loading"
|
|
4
4
|
)
|
|
5
5
|
//- TODO: Convert to BEM
|
|
6
|
-
.v-pulse.v-pulse1(
|
|
7
|
-
|
|
8
|
-
)
|
|
9
|
-
.v-pulse.v-pulse2(
|
|
10
|
-
:style="[spinnerStyle,spinnerDelay2]"
|
|
11
|
-
)
|
|
12
|
-
.v-pulse.v-pulse3(
|
|
13
|
-
:style="[spinnerStyle,spinnerDelay3]"
|
|
14
|
-
)
|
|
6
|
+
.v-pulse.v-pulse1(:style="[spinnerStyle, spinnerDelay1]")
|
|
7
|
+
.v-pulse.v-pulse2(:style="[spinnerStyle, spinnerDelay2]")
|
|
8
|
+
.v-pulse.v-pulse3(:style="[spinnerStyle, spinnerDelay3]")
|
|
15
9
|
</template>
|
|
16
10
|
|
|
17
|
-
<style lang="scss">
|
|
18
|
-
@-webkit-keyframes v-pulseStretchDelay {
|
|
19
|
-
0%,
|
|
20
|
-
80%
|
|
21
|
-
{
|
|
22
|
-
transform: scale(1);
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
45%
|
|
26
|
-
{
|
|
27
|
-
transform: scale(0.1);
|
|
28
|
-
opacity: 0.7;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@keyframes v-pulseStretchDelay {
|
|
33
|
-
0%,
|
|
34
|
-
80%
|
|
35
|
-
{
|
|
36
|
-
transform: scale(1);
|
|
37
|
-
opacity: 1;
|
|
38
|
-
}
|
|
39
|
-
45%
|
|
40
|
-
{
|
|
41
|
-
transform: scale(0.1);
|
|
42
|
-
opacity: 0.7;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
46
|
-
|
|
47
11
|
<script>
|
|
48
12
|
export default {
|
|
49
13
|
props: {
|
|
@@ -96,6 +60,33 @@ export default {
|
|
|
96
60
|
}
|
|
97
61
|
}
|
|
98
62
|
}
|
|
99
|
-
|
|
100
63
|
}
|
|
101
64
|
</script>
|
|
65
|
+
|
|
66
|
+
<style lang="scss">
|
|
67
|
+
@keyframes v-pulseStretchDelay {
|
|
68
|
+
0%,
|
|
69
|
+
80% {
|
|
70
|
+
transform: scale(1);
|
|
71
|
+
opacity: 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
45% {
|
|
75
|
+
transform: scale(0.1);
|
|
76
|
+
opacity: 0.7;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@keyframes v-pulseStretchDelay {
|
|
81
|
+
0%,
|
|
82
|
+
80% {
|
|
83
|
+
transform: scale(1);
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
45% {
|
|
88
|
+
transform: scale(0.1);
|
|
89
|
+
opacity: 0.7;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
</style>
|