@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.
Files changed (116) hide show
  1. package/dist/dito-admin.es.js +1511 -1435
  2. package/dist/dito-admin.umd.js +4 -4
  3. package/dist/style.css +1 -1
  4. package/package.json +31 -31
  5. package/src/DitoAdmin.js +66 -31
  6. package/src/DitoComponent.js +4 -1
  7. package/src/DitoContext.js +13 -5
  8. package/src/{TypeComponent.js → DitoTypeComponent.js} +8 -5
  9. package/src/components/DitoAccount.vue +20 -19
  10. package/src/components/DitoButtons.vue +14 -12
  11. package/src/components/DitoClipboard.vue +16 -8
  12. package/src/components/DitoContainer.vue +56 -43
  13. package/src/components/DitoCreateButton.vue +20 -15
  14. package/src/components/DitoDialog.vue +69 -48
  15. package/src/components/DitoEditButtons.vue +16 -14
  16. package/src/components/DitoElement.vue +2 -3
  17. package/src/components/DitoErrors.vue +18 -13
  18. package/src/components/DitoForm.vue +41 -24
  19. package/src/components/DitoFormNested.vue +12 -10
  20. package/src/components/DitoHeader.vue +103 -69
  21. package/src/components/DitoLabel.vue +108 -81
  22. package/src/components/DitoMenu.vue +52 -36
  23. package/src/components/DitoPagination.vue +9 -7
  24. package/src/components/DitoPane.vue +53 -45
  25. package/src/components/DitoPanel.vue +62 -42
  26. package/src/components/DitoPanels.vue +11 -10
  27. package/src/components/DitoRoot.vue +57 -46
  28. package/src/components/DitoSchema.vue +179 -131
  29. package/src/components/DitoSchemaInlined.vue +39 -28
  30. package/src/components/DitoScopes.vue +41 -31
  31. package/src/components/DitoSpinner.vue +31 -40
  32. package/src/components/DitoTableCell.vue +9 -9
  33. package/src/components/DitoTableHead.vue +52 -37
  34. package/src/components/DitoTabs.vue +39 -29
  35. package/src/components/DitoTreeItem.vue +140 -86
  36. package/src/components/DitoVNode.vue +1 -1
  37. package/src/components/DitoView.vue +13 -11
  38. package/src/mixins/DataMixin.js +11 -9
  39. package/src/mixins/DitoMixin.js +47 -25
  40. package/src/mixins/EmitterMixin.js +2 -1
  41. package/src/mixins/ItemMixin.js +15 -10
  42. package/src/mixins/LoadingMixin.js +2 -1
  43. package/src/mixins/NumberMixin.js +15 -10
  44. package/src/mixins/OptionsMixin.js +24 -12
  45. package/src/mixins/ResourceMixin.js +42 -34
  46. package/src/mixins/RouteMixin.js +8 -8
  47. package/src/mixins/SortableMixin.js +1 -1
  48. package/src/mixins/SourceMixin.js +68 -34
  49. package/src/mixins/TypeMixin.js +5 -4
  50. package/src/mixins/ValidationMixin.js +3 -0
  51. package/src/styles/_base.scss +17 -0
  52. package/src/styles/_button.scss +212 -0
  53. package/src/styles/_imports.scss +2 -0
  54. package/src/styles/_layout.scss +22 -0
  55. package/src/styles/_notifications.scss +54 -0
  56. package/src/styles/_pulldown.scss +39 -0
  57. package/src/styles/_scroll.scss +15 -0
  58. package/src/styles/_settings.scss +68 -0
  59. package/src/styles/_sortable.scss +13 -0
  60. package/src/styles/_table.scss +224 -0
  61. package/src/styles/style.scss +9 -0
  62. package/src/types/DitoTypeButton.vue +72 -0
  63. package/src/types/{TypeCheckbox.vue → DitoTypeCheckbox.vue} +12 -11
  64. package/src/types/{TypeCheckboxes.vue → DitoTypeCheckboxes.vue} +21 -15
  65. package/src/types/{TypeCode.vue → DitoTypeCode.vue} +46 -34
  66. package/src/types/{TypeColor.vue → DitoTypeColor.vue} +71 -52
  67. package/src/types/{TypeComponent.vue → DitoTypeComponent.vue} +2 -2
  68. package/src/types/DitoTypeComputed.vue +54 -0
  69. package/src/types/DitoTypeDate.vue +64 -0
  70. package/src/types/DitoTypeLabel.vue +23 -0
  71. package/src/types/{TypeList.vue → DitoTypeList.vue} +83 -61
  72. package/src/types/{TypeMarkup.vue → DitoTypeMarkup.vue} +172 -122
  73. package/src/types/DitoTypeMultiselect.vue +434 -0
  74. package/src/types/DitoTypeNumber.vue +46 -0
  75. package/src/types/{TypeObject.vue → DitoTypeObject.vue} +41 -26
  76. package/src/types/{TypePanel.vue → DitoTypePanel.vue} +2 -2
  77. package/src/types/{TypeProgress.vue → DitoTypeProgress.vue} +4 -6
  78. package/src/types/{TypeRadio.vue → DitoTypeRadio.vue} +17 -13
  79. package/src/types/{TypeSection.vue → DitoTypeSection.vue} +17 -17
  80. package/src/types/{TypeSelect.vue → DitoTypeSelect.vue} +39 -35
  81. package/src/types/{TypeSlider.vue → DitoTypeSlider.vue} +29 -23
  82. package/src/types/{TypeSwitch.vue → DitoTypeSwitch.vue} +15 -13
  83. package/src/types/DitoTypeText.vue +77 -0
  84. package/src/types/{TypeTextarea.vue → DitoTypeTextarea.vue} +17 -14
  85. package/src/types/DitoTypeTreeList.vue +191 -0
  86. package/src/types/{TypeUpload.vue → DitoTypeUpload.vue} +92 -65
  87. package/src/types/index.js +26 -26
  88. package/src/utils/SchemaGraph.js +21 -13
  89. package/src/utils/accessor.js +17 -9
  90. package/src/utils/data.js +4 -1
  91. package/src/utils/filter.js +8 -10
  92. package/src/utils/options.js +3 -3
  93. package/src/utils/resource.js +12 -10
  94. package/src/utils/schema.js +190 -125
  95. package/src/utils/type.js +31 -20
  96. package/src/validations/_decimals.js +1 -2
  97. package/types/index.d.ts +27 -23
  98. package/src/styles/_base.sass +0 -15
  99. package/src/styles/_button.sass +0 -127
  100. package/src/styles/_imports.sass +0 -2
  101. package/src/styles/_layout.sass +0 -13
  102. package/src/styles/_notifications.sass +0 -33
  103. package/src/styles/_pulldown.sass +0 -26
  104. package/src/styles/_scroll.sass +0 -13
  105. package/src/styles/_settings.sass +0 -55
  106. package/src/styles/_sortable.sass +0 -9
  107. package/src/styles/_table.sass +0 -153
  108. package/src/styles/style.sass +0 -10
  109. package/src/types/TypeButton.vue +0 -73
  110. package/src/types/TypeComputed.vue +0 -53
  111. package/src/types/TypeDate.vue +0 -64
  112. package/src/types/TypeLabel.vue +0 -19
  113. package/src/types/TypeMultiselect.vue +0 -376
  114. package/src/types/TypeNumber.vue +0 -44
  115. package/src/types/TypeText.vue +0 -67
  116. package/src/types/TypeTreeList.vue +0 -164
@@ -5,87 +5,29 @@ nav.dito-header
5
5
  li(
6
6
  v-for="(component, index) in trail"
7
7
  )
8
- template(v-if="index === trail.length - 1")
8
+ template(
9
+ v-if="index === trail.length - 1"
10
+ )
9
11
  span(:class="getBreadcrumbClass(component)")
10
12
  | {{ component.breadcrumb }}
11
- router-link.dito-breadcrumb(v-else, :to="component.path")
13
+ RouterLink.dito-breadcrumb(
14
+ v-else
15
+ :to="component.path"
16
+ )
12
17
  span(:class="getBreadcrumbClass(component)")
13
18
  | {{ component.breadcrumb }}
14
- dito-spinner(v-if="isLoading")
19
+ DitoSpinner(
20
+ v-if="isLoading"
21
+ )
15
22
  slot
16
23
  </template>
17
24
 
18
- <style lang="sass">
19
- @import '../styles/_imports'
20
-
21
- .dito-header
22
- background: $color-black
23
- font-size: $menu-font-size
24
- line-height: $menu-line-height
25
- z-index: $menu-z-index
26
- +user-select(none)
27
- span
28
- display: inline-block
29
- padding: $menu-padding
30
- color: $color-white
31
- .dito-trail
32
- display: flex
33
- box-sizing: border-box
34
- height: 3em
35
- width: 100%
36
- max-width: $content-width + $content-padding
37
- ul
38
- display: flex
39
- a
40
- position: relative
41
- display: block
42
- padding-right: 0.4em
43
- $angle: 33deg
44
- &:hover
45
- color: #999
46
- &::before,
47
- &::after
48
- position: absolute
49
- content: ''
50
- width: 1px
51
- height: 1.2em
52
- right: -1px
53
- background: $color-dark
54
- &::before
55
- top: 50%
56
- transform: rotate($angle)
57
- transform-origin: top
58
- &::after
59
- bottom: 50%
60
- transform: rotate(-$angle)
61
- transform-origin: bottom
62
- .dito-spinner
63
- margin-top: $menu-padding-ver
64
- .dito-dirty
65
- &:after
66
- content: ''
67
- display: inline-block
68
- background-color: $color-white
69
- width: 8px
70
- height: 8px
71
- margin: 2px
72
- margin-left: 0.5em
73
- border-radius: 100%
74
- .dito-account,
75
- .dito-login
76
- position: absolute
77
- top: 0
78
- cursor: pointer
79
- .dito-account
80
- left: $content-width + $content-padding * 2
81
- </style>
82
-
83
25
  <script>
84
26
  import DitoComponent from '../DitoComponent.js'
85
27
  import DitoSpinner from './DitoSpinner.vue'
86
28
 
87
29
  // @vue/component
88
- export default DitoComponent.component('dito-header', {
30
+ export default DitoComponent.component('DitoHeader', {
89
31
  components: { DitoSpinner },
90
32
 
91
33
  props: {
@@ -128,3 +70,95 @@ export default DitoComponent.component('dito-header', {
128
70
  }
129
71
  })
130
72
  </script>
73
+
74
+ <style lang="scss">
75
+ @import '../styles/_imports';
76
+
77
+ .dito-header {
78
+ background: $color-black;
79
+ font-size: $menu-font-size;
80
+ line-height: $menu-line-height;
81
+ z-index: $menu-z-index;
82
+ @include user-select(none);
83
+
84
+ span {
85
+ display: inline-block;
86
+ padding: $menu-padding;
87
+ color: $color-white;
88
+ }
89
+
90
+ .dito-trail {
91
+ display: flex;
92
+ box-sizing: border-box;
93
+ height: 3em;
94
+ width: 100%;
95
+ max-width: $content-width + $content-padding;
96
+
97
+ ul {
98
+ display: flex;
99
+ }
100
+
101
+ a {
102
+ position: relative;
103
+ display: block;
104
+ padding-right: 0.4em;
105
+
106
+ $angle: 33deg;
107
+
108
+ &:hover {
109
+ color: #999999;
110
+ }
111
+
112
+ &::before,
113
+ &::after {
114
+ position: absolute;
115
+ content: '';
116
+ width: 1px;
117
+ height: 1.2em;
118
+ right: -1px;
119
+ background: $color-dark;
120
+ }
121
+
122
+ &::before {
123
+ top: 50%;
124
+ transform: rotate($angle);
125
+ transform-origin: top;
126
+ }
127
+
128
+ &::after {
129
+ bottom: 50%;
130
+ transform: rotate(-$angle);
131
+ transform-origin: bottom;
132
+ }
133
+ }
134
+ }
135
+
136
+ .dito-spinner {
137
+ margin-top: $menu-padding-ver;
138
+ }
139
+
140
+ .dito-dirty {
141
+ &::after {
142
+ content: '';
143
+ display: inline-block;
144
+ background-color: $color-white;
145
+ width: 8px;
146
+ height: 8px;
147
+ margin: 2px;
148
+ margin-left: 0.5em;
149
+ border-radius: 100%;
150
+ }
151
+ }
152
+
153
+ .dito-account,
154
+ .dito-login {
155
+ position: absolute;
156
+ top: 0;
157
+ cursor: pointer;
158
+ }
159
+
160
+ .dito-account {
161
+ left: $content-width + $content-padding * 2;
162
+ }
163
+ }
164
+ </style>
@@ -9,102 +9,33 @@ component.dito-label(
9
9
  v-if="collapsible"
10
10
  :class="{ 'dito-opened': !collapsed }"
11
11
  )
12
- dito-element.dito-label-prefix(
12
+ DitoElement.dito-label-prefix(
13
13
  v-for="(prefix, index) of prefixes"
14
- tag="span"
15
14
  :key="`prefix-${index}`"
15
+ tag="span"
16
16
  :content="prefix"
17
17
  )
18
- label(:for="dataPath" v-html="text")
19
- dito-element.dito-label-suffix(
18
+ label(
19
+ :for="dataPath"
20
+ v-html="text"
21
+ )
22
+ DitoElement.dito-label-suffix(
20
23
  v-for="(suffix, index) of suffixes"
21
- tag="span"
22
24
  :key="`suffix-${index}`"
25
+ tag="span"
23
26
  :content="suffix"
24
27
  )
25
28
  slot(name="edit-buttons")
26
29
  </template>
27
30
 
28
- <style lang="sass">
29
- @import '../styles/_imports'
30
-
31
- .dito-label
32
- --label-padding: 0
33
- // For buttons and chevron to align right:
34
- display: flex
35
- position: relative
36
- // Vertically center all items in the label, e.g. chevron, edit-buttons.
37
- align-items: center
38
- padding: var(--label-padding)
39
- margin: 0 0 $form-spacing-half 0
40
-
41
- label
42
- display: inline
43
- cursor: inherit
44
- font-weight: bold
45
- white-space: nowrap
46
-
47
- label,
48
- .dito-label-prefix,
49
- .dito-label-suffix
50
- &:nth-last-child(2)
51
- // To stretch either label or .dito-label-suffix to full available width
52
- // so that buttons always appear right-aligned:
53
- flex: 1 1 auto
54
- &::after
55
- content: '\a0' // &nbsp;
56
-
57
- .dito-label-prefix,
58
- .dito-label-suffix
59
- +user-select(none)
60
- +ellipsis
61
-
62
- .dito-buttons
63
- // Move the label padding inside .dito-buttons, so that it captures all
64
- // near mouse events:
65
- margin: calc(-1 * var(--label-padding))
66
- margin-left: 0
67
- padding: var(--label-padding)
68
-
69
- &.dito-width-fill
70
- width: 100%
71
- // In order for ellipsis to work on labels without affecting other layout,
72
- // we need to position it absolutely inside its container.
73
- label
74
- +ellipsis
75
- position: absolute
76
- max-width: 100%
77
- &::after
78
- // Since <label> uses `position: absolute`, set content to a zero-width
79
- // space on its parent to enforce the right text height in the container
80
- content: '\200b' // zero-width space
81
-
82
- a.dito-label
83
- &:hover
84
- .dito-chevron
85
- color: $color-darker
86
- &:focus:not(:active):not(.dito-active)
87
- .dito-chevron
88
- -webkit-text-stroke: $border-width $color-active
89
-
90
- // Display labels in compact schema as inline-blocks, to allow compact layouts
91
- // with `width: 'auto'` elements:
92
- // TODO: Find a better way to control this behavior.
93
- .dito-schema-compact
94
- > .dito-schema-content
95
- > .dito-pane
96
- > .dito-container
97
- display: flex
98
- flex-flow: row wrap
99
- align-items: baseline
100
- </style>
101
-
102
31
  <script>
103
32
  import DitoComponent from '../DitoComponent.js'
104
33
  import { isObject, asArray } from '@ditojs/utils'
105
34
 
106
35
  // @vue/component
107
- export default DitoComponent.component('dito-label', {
36
+ export default DitoComponent.component('DitoLabel', {
37
+ emits: ['expand'],
38
+
108
39
  props: {
109
40
  label: { type: [String, Object], default: null },
110
41
  dataPath: { type: String, default: null },
@@ -146,5 +77,101 @@ export default DitoComponent.component('dito-label', {
146
77
  }
147
78
  }
148
79
  })
149
-
150
80
  </script>
81
+
82
+ <style lang="scss">
83
+ @import '../styles/_imports';
84
+
85
+ .dito-label {
86
+ --label-padding: 0;
87
+ // For buttons and chevron to align right:
88
+ display: flex;
89
+ position: relative;
90
+ // Vertically center all items in the label, e.g. chevron, edit-buttons.
91
+ align-items: center;
92
+ padding: var(--label-padding);
93
+ margin: 0 0 $form-spacing-half 0;
94
+
95
+ label {
96
+ display: inline;
97
+ cursor: inherit;
98
+ font-weight: bold;
99
+ white-space: nowrap;
100
+ }
101
+
102
+ label,
103
+ .dito-label-prefix,
104
+ .dito-label-suffix {
105
+ &:nth-last-child(2) {
106
+ // To stretch either label or .dito-label-suffix to full available width
107
+ // so that buttons always appear right-aligned:
108
+ flex: 1 1 auto;
109
+ }
110
+
111
+ &::after {
112
+ content: '\a0'; // &nbsp;;
113
+ }
114
+ }
115
+
116
+ .dito-label-prefix,
117
+ .dito-label-suffix {
118
+ @include user-select(none);
119
+ @include ellipsis;
120
+ }
121
+
122
+ .dito-buttons {
123
+ // Move the label padding inside .dito-buttons, so that it captures all
124
+ // near mouse events:
125
+ margin: calc(-1 * var(--label-padding));
126
+ margin-left: 0;
127
+ padding: var(--label-padding);
128
+ }
129
+
130
+ &.dito-width-fill {
131
+ width: 100%;
132
+ // In order for ellipsis to work on labels without affecting other layout,
133
+ // we need to position it absolutely inside its container.
134
+ label {
135
+ @include ellipsis;
136
+
137
+ position: absolute;
138
+ max-width: 100%;
139
+ }
140
+
141
+ &::after {
142
+ // Since <label> uses `position: absolute`, set content to a zero-width
143
+ // space on its parent to enforce the right text height in the container
144
+ content: '\200b'; // zero-width space;
145
+ }
146
+ }
147
+ }
148
+
149
+ a.dito-label {
150
+ &:hover {
151
+ .dito-chevron {
152
+ color: $color-darker;
153
+ }
154
+ }
155
+
156
+ &:focus:not(:active, .dito-active) {
157
+ .dito-chevron {
158
+ -webkit-text-stroke: $border-width $color-active;
159
+ }
160
+ // Display labels in compact schema as inline-blocks, to allow compact
161
+ // layouts with `width: 'auto'` elements:
162
+ // TODO: Find a better way to control this behavior.
163
+ }
164
+ }
165
+
166
+ .dito-schema-compact {
167
+ > .dito-schema-content {
168
+ > .dito-pane {
169
+ > .dito-container {
170
+ display: flex;
171
+ flex-flow: row wrap;
172
+ align-items: baseline;
173
+ }
174
+ }
175
+ }
176
+ }
177
+ </style>
@@ -2,49 +2,65 @@
2
2
  nav.dito-menu.dito-scroll-parent
3
3
  h1 {{ appState.title }}
4
4
  ul.dito-scroll
5
- li(v-for="view in views")
6
- router-link.dito-link(
5
+ li(
6
+ v-for="view in views"
7
+ )
8
+ RouterLink.dito-link(
7
9
  v-if="shouldRender(view)"
8
10
  :to="`/${view.path}`"
9
- active-class="dito-active"
11
+ activeClass="dito-active"
10
12
  ) {{ getLabel(view) }}
11
13
  </template>
12
14
 
13
- <style lang="sass">
14
- @import '../styles/_imports'
15
-
16
- .dito-menu
17
- flex: initial
18
- font-size: $menu-font-size
19
- white-space: nowrap
20
- +user-select(none)
21
- ul
22
- background: $color-lighter
23
- border-right: $border-style
24
- a,
25
- h1
26
- display: block
27
- h1
28
- padding: $menu-padding
29
- line-height: $menu-line-height
30
- font-weight: bold
31
- background: $color-darker
32
- border-right: $border-width solid $color-darkest
33
- color: $color-white
34
- .dito-link
35
- padding: $menu-padding
36
- line-height: $menu-line-height
37
- &.dito-active
38
- color: $color-white
39
- background: $color-active
40
- .dito-link
41
- &:focus:not(:active):not(.dito-active)
42
- box-shadow: $shadow-focus
43
- </style>
44
-
45
15
  <script>
46
16
  import DitoComponent from '../DitoComponent.js'
47
17
 
48
18
  // @vue/component
49
- export default DitoComponent.component('dito-menu', {})
19
+ export default DitoComponent.component('DitoMenu', {})
50
20
  </script>
21
+
22
+ <style lang="scss">
23
+ @import '../styles/_imports';
24
+
25
+ .dito-menu {
26
+ flex: initial;
27
+ font-size: $menu-font-size;
28
+ white-space: nowrap;
29
+ @include user-select(none);
30
+
31
+ ul {
32
+ background: $color-lighter;
33
+ border-right: $border-style;
34
+ }
35
+
36
+ a,
37
+ h1 {
38
+ display: block;
39
+ }
40
+
41
+ h1 {
42
+ padding: $menu-padding;
43
+ line-height: $menu-line-height;
44
+ font-weight: bold;
45
+ background: $color-darker;
46
+ border-right: $border-width solid $color-darkest;
47
+ color: $color-white;
48
+ }
49
+
50
+ .dito-link {
51
+ padding: $menu-padding;
52
+ line-height: $menu-line-height;
53
+
54
+ &.dito-active {
55
+ color: $color-white;
56
+ background: $color-active;
57
+ }
58
+ }
59
+ }
60
+
61
+ .dito-link {
62
+ &:focus:not(:active, .dito-active) {
63
+ box-shadow: $shadow-focus;
64
+ }
65
+ }
66
+ </style>
@@ -1,8 +1,8 @@
1
1
  <template lang="pug">
2
- pagination(
2
+ Pagination(
3
+ v-model:page="page"
3
4
  :pageSize="limit"
4
5
  :total="total"
5
- v-model:page="page"
6
6
  )
7
7
  </template>
8
8
 
@@ -11,7 +11,7 @@ import { Pagination } from '@ditojs/ui/src'
11
11
  import DitoComponent from '../DitoComponent.js'
12
12
 
13
13
  // @vue/component
14
- export default DitoComponent.component('dito-pagination', {
14
+ export default DitoComponent.component('DitoPagination', {
15
15
  components: { Pagination },
16
16
 
17
17
  props: {
@@ -28,10 +28,12 @@ export default DitoComponent.component('dito-pagination', {
28
28
 
29
29
  set(page) {
30
30
  if (this.page !== page) {
31
- this.$router.push(this.getQueryLink({
32
- ...this.query,
33
- page: (page - 1)
34
- }))
31
+ this.$router.push(
32
+ this.getQueryLink({
33
+ ...this.query,
34
+ page: page - 1
35
+ })
36
+ )
35
37
  }
36
38
  }
37
39
  }
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/no-template-shadow -->
1
2
  <template lang="pug">
2
3
  .dito-pane(
3
4
  v-if="isPopulated && componentSchemas.length > 0"
@@ -15,7 +16,7 @@
15
16
  .dito-break(
16
17
  v-if="schema.break === 'before'"
17
18
  )
18
- dito-container(
19
+ DitoContainer(
19
20
  v-if="shouldRender(schema)"
20
21
  :key="nestedDataPath"
21
22
  :schema="schema"
@@ -33,47 +34,13 @@
33
34
  )
34
35
  </template>
35
36
 
36
- <style lang="sass">
37
- @import '../styles/_imports'
38
-
39
- .dito-pane
40
- display: flex
41
- position: relative
42
- flex-flow: row wrap
43
- align-content: flex-start
44
- align-items: baseline
45
- // Remove the padding added by `.dito-container` inside `.dito-pane`:
46
- margin: (-$form-spacing) (-$form-spacing-half)
47
- // Add removed horizontal margin again to max-width:
48
- max-width: $content-width + 2 * $form-spacing-half
49
- // Use `flex: 0%` for all `.dito-pane` except `.dito-pane-main`,
50
- // so that the `.dito-buttons-main` can be moved all the way to the bottom.
51
- flex: 0%
52
-
53
- &.dito-pane-main
54
- flex: 100%
55
-
56
- .dito-schema-header:not(.dito-schema-menu-header) + &
57
- // Clear top-margin if the components are preceded by a schema header.
58
- margin-top: 0
59
-
60
- .dito-container.dito-omit-padding > &
61
- // Clear margins set above again if parent is omitting padding.
62
- margin: 0
63
- max-width: unset
64
-
65
- .dito-break
66
- flex: 100%
67
- height: 0
68
- </style>
69
-
70
37
  <script>
71
38
  import DitoComponent from '../DitoComponent.js'
72
39
  import { appendDataPath } from '../utils/data.js'
73
40
  import { getAllPanelSchemas, isNested } from '../utils/schema.js'
74
41
 
75
42
  // @vue/component
76
- export default DitoComponent.component('dito-pane', {
43
+ export default DitoComponent.component('DitoPane', {
77
44
  provide() {
78
45
  return {
79
46
  $tabComponent: () => this.tabComponent
@@ -116,9 +83,10 @@ export default DitoComponent.component('dito-pane', {
116
83
  const nestedDataPath = appendDataPath(this.dataPath, name)
117
84
  return {
118
85
  schema,
119
- dataPath: nested && !wrapPrimitives
120
- ? nestedDataPath
121
- : this.dataPath,
86
+ dataPath:
87
+ nested && !wrapPrimitives
88
+ ? nestedDataPath
89
+ : this.dataPath,
122
90
  nestedDataPath,
123
91
  nested,
124
92
  store: nested ? this.getChildStore(name) : this.store
@@ -131,12 +99,13 @@ export default DitoComponent.component('dito-pane', {
131
99
  // Gather all panel schemas from all component schemas, by finding those
132
100
  // that want to provide a panel. See `getAllPanelSchemas()` for details.
133
101
  return this.componentSchemas.flatMap(
134
- ({ schema, nestedDataPath: dataPath }) => getAllPanelSchemas(
135
- schema,
136
- dataPath,
137
- this.schemaComponent,
138
- this.tabComponent
139
- )
102
+ ({ schema, nestedDataPath: dataPath }) =>
103
+ getAllPanelSchemas(
104
+ schema,
105
+ dataPath,
106
+ this.schemaComponent,
107
+ this.tabComponent
108
+ )
140
109
  )
141
110
  },
142
111
 
@@ -166,3 +135,42 @@ export default DitoComponent.component('dito-pane', {
166
135
  }
167
136
  })
168
137
  </script>
138
+
139
+ <style lang="scss">
140
+ @import '../styles/_imports';
141
+
142
+ .dito-pane {
143
+ display: flex;
144
+ position: relative;
145
+ flex-flow: row wrap;
146
+ align-content: flex-start;
147
+ align-items: baseline;
148
+ // Remove the padding added by `.dito-container` inside `.dito-pane`:
149
+ margin: (-$form-spacing) (-$form-spacing-half);
150
+ // Add removed horizontal margin again to max-width:
151
+ max-width: $content-width + 2 * $form-spacing-half;
152
+ // Use `flex: 0%` for all `.dito-pane` except `.dito-pane-main`,
153
+ // so that the `.dito-buttons-main` can be moved all the way to the bottom.
154
+ flex: 0%;
155
+
156
+ &.dito-pane-main {
157
+ flex: 100%;
158
+ }
159
+
160
+ .dito-schema-header:not(.dito-schema-menu-header) + & {
161
+ // Clear top-margin if the components are preceded by a schema header.
162
+ margin-top: 0;
163
+ }
164
+
165
+ .dito-container.dito-omit-padding > & {
166
+ // Clear margins set above again if parent is omitting padding.
167
+ margin: 0;
168
+ max-width: unset;
169
+ }
170
+
171
+ .dito-break {
172
+ flex: 100%;
173
+ height: 0;
174
+ }
175
+ }
176
+ </style>