@ditojs/admin 1.8.0 → 1.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
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",
@@ -35,35 +35,35 @@
35
35
  "not ie_mob > 0"
36
36
  ],
37
37
  "dependencies": {
38
- "@ditojs/ui": "^1.8.0",
39
- "@ditojs/utils": "^1.8.0",
38
+ "@ditojs/ui": "^1.10.0",
39
+ "@ditojs/utils": "^1.10.0",
40
40
  "axios": "^0.27.2",
41
41
  "codeflask": "^1.4.1",
42
- "filesize": "^8.0.7",
42
+ "filesize": "^9.0.11",
43
43
  "filesize-parser": "^1.5.0",
44
- "nanoid": "^3.3.4",
44
+ "nanoid": "^4.0.0",
45
45
  "tinycolor2": "^1.4.2",
46
46
  "tiptap": "^1.32.2",
47
47
  "tiptap-commands": "^1.17.1",
48
48
  "tiptap-extensions": "^1.35.2",
49
49
  "to-pascal-case": "^1.0.0",
50
- "vue": "^2.6.14",
50
+ "vue": "^2.7.8",
51
51
  "vue-color": "^2.8.1",
52
52
  "vue-js-modal": "^1.3.35",
53
53
  "vue-multiselect": "^2.1.6",
54
54
  "vue-notification": "^1.3.20",
55
- "vue-router": "^3.5.3",
55
+ "vue-router": "^3.5.4",
56
56
  "vue-spinner": "^1.0.4",
57
- "vue-template-compiler": "^2.6.14",
57
+ "vue-template-compiler": "^2.7.8",
58
58
  "vue-upload-component": "^2.8.22",
59
59
  "vuedraggable": "^2.24.3"
60
60
  },
61
61
  "devDependencies": {
62
- "@ditojs/build": "^1.8.0",
62
+ "@ditojs/build": "^1.10.0",
63
63
  "pug": "^3.0.2",
64
- "sass": "1.52.1",
65
- "vite": "^2.9.9",
66
- "vite-plugin-vue2": "^2.0.1"
64
+ "sass": "1.53.0",
65
+ "vite": "^3.0.2",
66
+ "vite-plugin-vue2": "^2.0.2"
67
67
  },
68
- "gitHead": "bb2c9e85083eabc51d1f4b1fd0bffd6b306b0e47"
68
+ "gitHead": "0b044d649e0fe1bcbcd3603bcdc9c6168058fb6d"
69
69
  }
@@ -1,5 +1,5 @@
1
1
  <template lang="pug">
2
- form.dito-dialog(@submit.prevent="")
2
+ form.dito-dialog(@submit.prevent="submit")
3
3
  dito-schema.dito-scroll(
4
4
  :schema="schema"
5
5
  :data="dialogData"
@@ -67,38 +67,34 @@ export default DitoComponent.component('dito-dialog', {
67
67
  },
68
68
 
69
69
  buttonSchemas() {
70
- return Object.entries(getButtonSchemas(this.buttons)).reduce(
71
- // Process the button schemas to add default click events
72
- // for both 'submit' and 'cancel' buttons:
73
- (schemas, [key, schema]) => {
74
- const { type, events } = schema
75
- if (!events) {
76
- const click = type === 'submit' ? () => this.accept()
77
- : key === 'cancel' ? () => this.cancel()
78
- : null
79
- if (click) {
70
+ return Object.fromEntries(
71
+ Object.entries(getButtonSchemas(this.buttons)).map(
72
+ // Process the button schemas to add default click events
73
+ // for both 'submit' and 'cancel' buttons:
74
+ ([key, schema]) => {
75
+ if (key === 'cancel' && !schema.events) {
80
76
  schema = {
81
77
  ...schema,
82
- events: { click }
78
+ events: {
79
+ click: () => this.cancel()
80
+ }
83
81
  }
84
82
  }
83
+ return [key, schema]
85
84
  }
86
- schemas[key] = schema
87
- return schemas
88
- },
89
- {}
85
+ )
90
86
  )
91
87
  },
92
88
 
93
89
  hasCancel() {
94
- return Object.keys(this.buttonSchemas).includes('cancel')
90
+ return !!this.buttonSchemas.cancel
95
91
  }
96
92
  },
97
93
 
98
94
  mounted() {
99
95
  this.windowEvents = addEvents(window, {
100
96
  keyup: () => {
101
- if (event.keyCode === 27) {
97
+ if (this.hasCancel && event.keyCode === 27) {
102
98
  this.cancel()
103
99
  }
104
100
  }
@@ -124,14 +120,12 @@ export default DitoComponent.component('dito-dialog', {
124
120
  this.hide()
125
121
  },
126
122
 
127
- accept() {
123
+ submit() {
128
124
  this.resolve(this.dialogData)
129
125
  },
130
126
 
131
127
  cancel() {
132
- if (this.hasCancel) {
133
- this.resolve(null)
134
- }
128
+ this.resolve(null)
135
129
  }
136
130
  }
137
131
  })
@@ -13,6 +13,7 @@ import TypeComponent from '../TypeComponent.js'
13
13
 
14
14
  // @vue/component
15
15
  export default TypeComponent.register('label', {
16
+ excludeValue: true,
16
17
  generateLabel: false
17
18
  })
18
19
  </script>
@@ -87,7 +87,9 @@ export async function resolveSchema(schema, unwrapModule = false) {
87
87
  if (keys.length === 1) {
88
88
  const name = keys[0]
89
89
  schema = schema[name]
90
- schema.name = name
90
+ if (name !== 'default') {
91
+ schema.name = name
92
+ }
91
93
  }
92
94
  }
93
95
  }