@ditojs/admin 2.6.8 → 2.6.9

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.6.8",
3
+ "version": "2.6.9",
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.4"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "6c09a5f0fe96aeadf73ca07daa427e39a7f1462d",
86
+ "gitHead": "40ee20c006b240c735252fb8fcebd538ace2f508",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -84,6 +84,19 @@ export default DitoComponent.component('DitoHeader', {
84
84
  z-index: $header-z-index;
85
85
  @include user-select(none);
86
86
 
87
+ &::after {
88
+ // Cover the gaps between the different headers that might appear due to
89
+ // layout rounding imprecisions.
90
+ content: '';
91
+ top: 0;
92
+ bottom: 0;
93
+ left: calc(100% - 1px);
94
+ width: 2px;
95
+ position: absolute;
96
+ background: inherit;
97
+ z-index: -1;
98
+ }
99
+
87
100
  span {
88
101
  display: inline-block;
89
102
  padding: $header-padding;
@@ -222,17 +222,20 @@ export default DitoComponent.component('DitoPanel', {
222
222
  border-bottom-right-radius: $border-radius;
223
223
 
224
224
  > .dito-schema-content {
225
- > .dito-pane {
226
- padding: (2 * $form-spacing - $input-padding-ver)
227
- (2 * $form-spacing - $input-padding-hor);
228
- }
225
+ .dito-pane {
226
+ margin: -$form-spacing-half;
229
227
 
230
- .dito-label {
231
- margin: $form-spacing 0;
228
+ > .dito-container:not(.dito-container--single) {
229
+ padding: $form-spacing-half;
230
+ }
232
231
  }
233
232
 
234
- .dito-container {
235
- padding: $form-spacing-half;
233
+ > .dito-pane {
234
+ padding: $form-spacing;
235
+
236
+ &.dito-pane--single {
237
+ margin: 0;
238
+ }
236
239
  }
237
240
 
238
241
  .dito-object {
@@ -283,25 +283,24 @@ export async function processSchemaComponent(
283
283
  ])
284
284
  }
285
285
 
286
- export async function processView(component, api, schema, name, menuLevel = 0) {
286
+ export async function processView(component, api, schema, name, fullPath = '') {
287
287
  processSchemaDefaults(api, schema)
288
+ processRouteSchema(api, schema, name, fullPath)
288
289
  let children = []
289
290
  if (isView(schema)) {
290
- processRouteSchema(api, schema, name)
291
291
  await processNestedSchemas(api, schema)
292
292
  await processSchemaComponents(api, schema, children)
293
293
  } else if (isMenu(schema)) {
294
- processRouteSchema(api, schema, name)
295
294
  children = await Promise.all(
296
295
  Object.entries(schema.items).map(async ([name, item]) =>
297
- processView(component, api, item, name, menuLevel + 1)
296
+ processView(component, api, item, name, schema.fullPath)
298
297
  )
299
298
  )
300
299
  } else {
301
300
  throw new Error(`Invalid view schema: '${getSchemaIdentifier(schema)}'`)
302
301
  }
303
302
  return {
304
- path: menuLevel === 0 ? `/${schema.path}` : schema.path,
303
+ path: schema.fullPath,
305
304
  children,
306
305
  component,
307
306
  meta: {
@@ -343,10 +342,13 @@ export function processNestedSchemaDefaults(api, schema) {
343
342
  })
344
343
  }
345
344
 
346
- export function processRouteSchema(api, schema, name) {
345
+ export function processRouteSchema(api, schema, name, fullPath = null) {
347
346
  // Used for view and source schemas, see SourceMixin.
348
347
  schema.name ??= name
349
348
  schema.path ??= api.normalizePath(name)
349
+ if (fullPath !== null) {
350
+ schema.fullPath = `${fullPath}/${schema.path}`
351
+ }
350
352
  }
351
353
 
352
354
  export async function processForms(api, schema, level) {
@@ -466,8 +468,8 @@ export function getViewEditPath(schema, id, context) {
466
468
  const view = getViewSchema(schema, context)
467
469
  if (view) {
468
470
  const path = isSingleComponentView(view)
469
- ? `/${view.path}`
470
- : `/${view.path}/${view.path}`
471
+ ? view.fullPath
472
+ : `${view.fullPath}/${view.path}`
471
473
  return `${path}/${id}`
472
474
  }
473
475
  return null