@ditojs/admin 2.9.3 → 2.9.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
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",
@@ -83,7 +83,7 @@
83
83
  "vite": "^4.3.7"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "8855fb3de01a12a456a622cc17c0c03ffdbf7eab",
86
+ "gitHead": "e3e70442d05a10fd6a82c4ed58f9580b3643d4ab",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -64,14 +64,16 @@ export default DitoComponent.component('DitoClipboard', {
64
64
  },
65
65
 
66
66
  watch: {
67
+ // Check right away also in case there's already data (e.g. create form):
67
68
  'parentComponent.hasData': {
68
- // Check right away also in case there's already data (e.g. create form).
69
69
  immediate: true,
70
- handler(hasData) {
71
- this.copyEnabled = hasData
72
- }
70
+ handler: 'updateCopy'
73
71
  },
74
- 'appState.clipboardData': 'updatePaste'
72
+
73
+ 'appState.clipboardData': {
74
+ immediate: true,
75
+ handler: 'updatePaste'
76
+ }
75
77
  },
76
78
 
77
79
  mounted() {
@@ -109,6 +111,10 @@ export default DitoComponent.component('DitoClipboard', {
109
111
  return this.checkClipboardData(clipboardData)
110
112
  },
111
113
 
114
+ updateCopy() {
115
+ this.copyEnabled = this.parentComponent.hasData
116
+ },
117
+
112
118
  async updatePaste() {
113
119
  this.pasteEnabled = !!this.checkClipboardData(this.appState.clipboardData)
114
120
  if (!this.pasteEnabled && this.appState.agent.chrome) {
@@ -127,6 +127,13 @@ export default DitoComponent.component('DitoCreateButton', {
127
127
 
128
128
  .dito-pulldown {
129
129
  right: 0;
130
+
131
+ .dito-buttons-sticky & {
132
+ top: unset;
133
+ right: unset;
134
+ bottom: 0;
135
+ left: 0;
136
+ }
130
137
  }
131
138
  }
132
139
  </style>
@@ -4,7 +4,7 @@
4
4
  role="dialog"
5
5
  aria-expanded="true"
6
6
  aria-modal="true"
7
- :style="{ '--width': `${settings.width}px` }"
7
+ :style="{ '--width': settings.width ? `${settings.width}px` : null }"
8
8
  @mouseup="onMouseUp"
9
9
  )
10
10
  UseFocusTrap.dito-dialog__focus-trap(:options="focusTrapOptions")
@@ -19,6 +19,7 @@
19
19
  DitoSchema(
20
20
  :schema="schema"
21
21
  :data="dialogData"
22
+ padding="root"
22
23
  scrollable
23
24
  generateLabels
24
25
  )
@@ -32,6 +32,7 @@
32
32
  :data="data"
33
33
  :meta="meta"
34
34
  :store="store"
35
+ :padding="isNestedRoute ? 'nested' : 'root'"
35
36
  :disabled="isLoading"
36
37
  :scrollable="isRootForm"
37
38
  generateLabels
@@ -10,11 +10,8 @@ export default DitoComponent.component('DitoFormNested', {
10
10
 
11
11
  <style lang="scss">
12
12
  .dito-form-nested {
13
- &,
14
- .dito-scroll {
15
- // No scrolling inside nested forms, and prevent open .multiselect from
16
- // being cropped.
17
- overflow: visible;
18
- }
13
+ // No scrolling inside nested forms, and prevent open .multiselect from
14
+ // being cropped.
15
+ overflow: visible;
19
16
  }
20
17
  </style>
@@ -3,9 +3,7 @@
3
3
  .dito-pane(
4
4
  v-if="isPopulated && componentSchemas.length > 0"
5
5
  v-resize="onResizePane"
6
- :class=`{
7
- 'dito-pane--single': isSingleComponent
8
- }`
6
+ :class="classes"
9
7
  )
10
8
  template(
11
9
  v-for=`{
@@ -63,6 +61,7 @@ export default DitoComponent.component('DitoPane', {
63
61
  meta: { type: Object, required: true },
64
62
  store: { type: Object, required: true },
65
63
  tab: { type: String, default: null },
64
+ padding: { type: String, default: null },
66
65
  single: { type: Boolean, default: false },
67
66
  disabled: { type: Boolean, default: false },
68
67
  generateLabels: { type: Boolean, default: false },
@@ -76,6 +75,13 @@ export default DitoComponent.component('DitoPane', {
76
75
  },
77
76
 
78
77
  computed: {
78
+ classes() {
79
+ return {
80
+ 'dito-pane--single': this.isSingleComponent,
81
+ [`dito-pane--padding-${this.padding}`]: !!this.padding
82
+ }
83
+ },
84
+
79
85
  tabComponent() {
80
86
  return this.tab ? this : this.$tabComponent()
81
87
  },
@@ -249,7 +255,7 @@ export default DitoComponent.component('DitoPane', {
249
255
  flex: 100%;
250
256
  }
251
257
 
252
- .dito-scroll > & {
258
+ &--padding-root {
253
259
  // A root-level pane inside a scroll view. Clear negative margin from above.
254
260
  margin: 0;
255
261
  // Move the negative margin used to remove the padding added by
@@ -264,26 +270,34 @@ export default DitoComponent.component('DitoPane', {
264
270
  // Reduce top spacing when the first row has labels.
265
271
  margin-top: -$form-spacing-half;
266
272
  }
267
- }
268
273
 
269
- // Display a ruler between tabbed components and towards the .dito-buttons
270
- &__tab + &__main {
271
- &::before {
272
- // Use a pseudo element to display a ruler with proper margins
273
- display: block;
274
- content: '';
275
- width: 100%;
276
- border-bottom: $border-style;
277
- // Shift ruler up by $root-padding to exclude removed $form-spacing-half.
278
- margin: (-$root-padding) $form-spacing-half $root-padding;
279
- padding: $form-spacing-half;
274
+ // Display a ruler between tabbed components and towards the .dito-buttons
275
+ &__tab + &__main {
276
+ &::before {
277
+ // Use a pseudo element to display a ruler with proper margins
278
+ display: block;
279
+ content: '';
280
+ width: 100%;
281
+ border-bottom: $border-style;
282
+ // Shift ruler up by $root-padding to exclude removed $form-spacing-half
283
+ margin: (-$root-padding) $form-spacing-half $root-padding;
284
+ padding: $form-spacing-half;
285
+ }
280
286
  }
287
+
288
+ &__main + .dito-buttons-main {
289
+ // Needed forms with sticky main buttons.
290
+ margin: $content-padding;
291
+ margin-bottom: 0;
292
+ }
293
+ }
294
+
295
+ &--padding-nested {
296
+ padding: $form-spacing;
281
297
  }
282
298
 
283
- &__main + .dito-buttons-main {
284
- // Needed forms with sticky main buttons.
285
- margin: $content-padding;
286
- margin-bottom: 0;
299
+ &--padding-panel {
300
+ padding: $form-spacing;
287
301
  }
288
302
 
289
303
  .dito-break {
@@ -12,6 +12,7 @@ component.dito-panel(
12
12
  :data="panelData"
13
13
  :meta="meta"
14
14
  :store="store"
15
+ padding="panel"
15
16
  :disabled="disabled"
16
17
  :hasOwnData="hasOwnData"
17
18
  generateLabels
@@ -222,22 +223,6 @@ export default DitoComponent.component('DitoPanel', {
222
223
  border-bottom-right-radius: $border-radius;
223
224
 
224
225
  > .dito-schema-content {
225
- > .dito-pane {
226
- padding: $form-spacing;
227
- }
228
-
229
- .dito-pane {
230
- margin: -$form-spacing-half;
231
-
232
- &.dito-pane--single {
233
- margin: 0;
234
- }
235
-
236
- > .dito-container:not(.dito-container--single) {
237
- padding: $form-spacing-half;
238
- }
239
- }
240
-
241
226
  .dito-object {
242
227
  border: none;
243
228
  padding: 0;
@@ -13,7 +13,7 @@
13
13
  :data="data"
14
14
  :meta="meta"
15
15
  :store="getChildStore(schema.name)"
16
- :disabled="schema.disabled != null ? schema.disabled : disabled"
16
+ :disabled="schema.disabled ?? disabled"
17
17
  :panelTabComponent="tabComponent"
18
18
  )
19
19
  </template>
@@ -68,6 +68,7 @@ slot(name="before")
68
68
  :data="data"
69
69
  :meta="meta"
70
70
  :store="store"
71
+ :padding="padding"
71
72
  :single="!inlined && !hasMainPane"
72
73
  :disabled="disabled"
73
74
  :generateLabels="generateLabels"
@@ -81,6 +82,7 @@ slot(name="before")
81
82
  :data="data"
82
83
  :meta="meta"
83
84
  :store="store"
85
+ :padding="padding"
84
86
  :single="!inlined && !hasTabs"
85
87
  :disabled="disabled"
86
88
  :generateLabels="generateLabels"
@@ -143,6 +145,7 @@ export default DitoComponent.component('DitoSchema', {
143
145
  meta: { type: Object, default: () => ({}) },
144
146
  store: { type: Object, default: () => ({}) },
145
147
  label: { type: [String, Object], default: null },
148
+ padding: { type: String, default: null },
146
149
  inlined: { type: Boolean, default: false },
147
150
  disabled: { type: Boolean, default: false },
148
151
  collapsed: { type: Boolean, default: false },
@@ -20,6 +20,7 @@ template(
20
20
  :data="data"
21
21
  :meta="meta"
22
22
  :store="getChildStore(name)"
23
+ padding="root"
23
24
  :disabled="isLoading"
24
25
  scrollable
25
26
  )
@@ -37,8 +37,6 @@ const ditoOptionKeys = [
37
37
  'excludeValue',
38
38
  'ignoreMissingValue',
39
39
  'omitSpacing',
40
- 'formatValue',
41
- 'parseValue',
42
40
  'processValue',
43
41
  'processSchema',
44
42
  'getPanelSchema',