@ditojs/admin 2.0.2 → 2.0.3

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.0.2",
3
+ "version": "2.0.3",
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",
@@ -33,31 +33,31 @@
33
33
  "not ie_mob > 0"
34
34
  ],
35
35
  "dependencies": {
36
- "@ditojs/ui": "^2.0.1",
36
+ "@ditojs/ui": "^2.0.3",
37
37
  "@ditojs/utils": "^2.0.1",
38
38
  "@kyvg/vue3-notification": "^2.9.0",
39
39
  "@lk77/vue3-color": "^3.0.6",
40
- "@tiptap/core": "^2.0.1",
41
- "@tiptap/extension-blockquote": "^2.0.1",
42
- "@tiptap/extension-bold": "^2.0.1",
43
- "@tiptap/extension-bullet-list": "^2.0.1",
44
- "@tiptap/extension-code": "^2.0.1",
45
- "@tiptap/extension-code-block": "^2.0.1",
46
- "@tiptap/extension-document": "^2.0.1",
47
- "@tiptap/extension-hard-break": "^2.0.1",
48
- "@tiptap/extension-heading": "^2.0.1",
49
- "@tiptap/extension-history": "^2.0.1",
50
- "@tiptap/extension-horizontal-rule": "^2.0.1",
51
- "@tiptap/extension-italic": "^2.0.1",
52
- "@tiptap/extension-link": "^2.0.1",
53
- "@tiptap/extension-list-item": "^2.0.1",
54
- "@tiptap/extension-ordered-list": "^2.0.1",
55
- "@tiptap/extension-paragraph": "^2.0.1",
56
- "@tiptap/extension-strike": "^2.0.1",
57
- "@tiptap/extension-text": "^2.0.1",
58
- "@tiptap/extension-underline": "^2.0.1",
59
- "@tiptap/pm": "^2.0.1",
60
- "@tiptap/vue-3": "^2.0.1",
40
+ "@tiptap/core": "^2.0.2",
41
+ "@tiptap/extension-blockquote": "^2.0.2",
42
+ "@tiptap/extension-bold": "^2.0.2",
43
+ "@tiptap/extension-bullet-list": "^2.0.2",
44
+ "@tiptap/extension-code": "^2.0.2",
45
+ "@tiptap/extension-code-block": "^2.0.2",
46
+ "@tiptap/extension-document": "^2.0.2",
47
+ "@tiptap/extension-hard-break": "^2.0.2",
48
+ "@tiptap/extension-heading": "^2.0.2",
49
+ "@tiptap/extension-history": "^2.0.2",
50
+ "@tiptap/extension-horizontal-rule": "^2.0.2",
51
+ "@tiptap/extension-italic": "^2.0.2",
52
+ "@tiptap/extension-link": "^2.0.2",
53
+ "@tiptap/extension-list-item": "^2.0.2",
54
+ "@tiptap/extension-ordered-list": "^2.0.2",
55
+ "@tiptap/extension-paragraph": "^2.0.2",
56
+ "@tiptap/extension-strike": "^2.0.2",
57
+ "@tiptap/extension-text": "^2.0.2",
58
+ "@tiptap/extension-underline": "^2.0.2",
59
+ "@tiptap/pm": "^2.0.2",
60
+ "@tiptap/vue-3": "^2.0.2",
61
61
  "codeflask": "^1.4.1",
62
62
  "filesize": "^10.0.7",
63
63
  "filesize-parser": "^1.5.0",
@@ -80,7 +80,7 @@
80
80
  "vite": "^4.2.1"
81
81
  },
82
82
  "types": "types",
83
- "gitHead": "3e7213fbe25c5697f4f11dada830037934e396c8",
83
+ "gitHead": "5ca73cc4cf410fbaa95a8e7079cb5c264cc67b7c",
84
84
  "scripts": {
85
85
  "build": "vite build",
86
86
  "watch": "yarn build --mode 'development' --watch",
@@ -52,7 +52,7 @@ component.dito-label(
52
52
  // so that buttons always appear right-aligned:
53
53
  flex: 1 1 auto
54
54
  &::after
55
- content: '\a0' // &nbps;
55
+ content: '\a0' //  
56
56
 
57
57
  .dito-label-prefix,
58
58
  .dito-label-suffix
@@ -94,8 +94,9 @@ component.dito-label(
94
94
  > .dito-schema-content
95
95
  > .dito-pane
96
96
  > .dito-container
97
- > .dito-label:not(.dito-label-component)
98
- display: inline-block
97
+ display: flex
98
+ flex-flow: row wrap
99
+ align-items: baseline
99
100
  </style>
100
101
 
101
102
  <script>
@@ -130,11 +131,7 @@ export default DitoComponent.component('dito-label', {
130
131
  },
131
132
 
132
133
  attributes() {
133
- return {
134
- ...(this.collapsible && {
135
- onClick: this.onClick
136
- })
137
- }
134
+ return this.collapsible ? { onClick: this.onClick } : {}
138
135
  },
139
136
 
140
137
  isActive() {
@@ -3,7 +3,7 @@ import ValidationMixin from './ValidationMixin.js'
3
3
  import { getSchemaAccessor } from '../utils/accessor.js'
4
4
  import { computeValue } from '../utils/schema.js'
5
5
  import { getItem, getParentItem } from '../utils/data.js'
6
- import { isString, asArray, camelize } from '@ditojs/utils'
6
+ import { isString, asArray } from '@ditojs/utils'
7
7
 
8
8
  // @vue/component
9
9
  export default {
@@ -156,10 +156,17 @@ export default {
156
156
  type: String
157
157
  }),
158
158
 
159
+ // @overridable
160
+ events() {
161
+ const { onFocus, onBlur, onInput, onChange } = this
162
+ return { onFocus, onBlur, onInput, onChange }
163
+ },
164
+
159
165
  attributes() {
160
166
  const { nativeField, textField } = this.$options
161
167
 
162
168
  const attributes = {
169
+ ...this.events,
163
170
  disabled: this.disabled
164
171
  }
165
172
 
@@ -176,25 +183,7 @@ export default {
176
183
  }
177
184
  }
178
185
 
179
- return {
180
- ...Object.fromEntries(
181
- Object.entries(this.$attrs).filter(([key]) => key.startsWith('on'))
182
- ),
183
- ...this.events,
184
- ...attributes
185
- }
186
- },
187
-
188
- events() {
189
- const events = this.getEvents()
190
- // Register callbacks for all provides non-recognized events,
191
- // assuming they are native events.
192
- // TODO: Move to vue3-style `on[A-Z]` event handlers naming that aren't
193
- // namespaced in `schema.events` once the transition is complete.
194
- for (const event of Object.keys(this.schema.events || {})) {
195
- events[`on${camelize(event, true)}`] ||= () => this.emitEvent(event)
196
- }
197
- return events
186
+ return attributes
198
187
  },
199
188
 
200
189
  validations() {
@@ -235,12 +224,6 @@ export default {
235
224
  }
236
225
  },
237
226
 
238
- // @overridable
239
- getEvents() {
240
- const { onFocus, onBlur, onInput, onChange } = this
241
- return { onFocus, onBlur, onInput, onChange }
242
- },
243
-
244
227
  // @overridable
245
228
  getValidations() {
246
229
  return null
@@ -41,16 +41,17 @@ export default TypeComponent.register([
41
41
  closeForm: getSchemaAccessor('closeForm', {
42
42
  type: Boolean,
43
43
  default: false
44
- })
45
- },
44
+ }),
46
45
 
47
- methods: {
48
46
  // @override
49
- getEvents() {
47
+ events() {
50
48
  const { onFocus, onBlur, onClick } = this
51
49
  return { onFocus, onBlur, onClick }
52
- },
50
+ }
51
+
52
+ },
53
53
 
54
+ methods: {
54
55
  async submit(options) {
55
56
  return this.resourceComponent?.submit(this, options)
56
57
  },
@@ -7,8 +7,6 @@
7
7
  )
8
8
  vue-multiselect(
9
9
  ref="element"
10
- v-model="selectedOptions"
11
- v-bind="attributes"
12
10
  :show-labels="false"
13
11
  :placeholder="placeholder"
14
12
  tag-placeholder="Press enter to add new tag",
@@ -25,9 +23,12 @@
25
23
  :clear-on-select="!searchFilter"
26
24
  :close-on-select="!stayOpen"
27
25
  :loading="isLoading"
28
- @open="populate = true"
26
+ @open="onOpen"
27
+ @close="onClose"
29
28
  @tag="onAddTag"
30
29
  @search-change="onSearchChange"
30
+ v-model="selectedOptions"
31
+ v-bind="attributes"
31
32
  )
32
33
  button.dito-button-clear.dito-button-overlay(
33
34
  type="button"
@@ -224,6 +225,7 @@
224
225
  <script>
225
226
  import TypeComponent from '../TypeComponent.js'
226
227
  import DitoContext from '../DitoContext.js'
228
+ import TypeMixin from '../mixins/TypeMixin.js'
227
229
  import OptionsMixin from '../mixins/OptionsMixin.js'
228
230
  import VueMultiselect from 'vue-multiselect'
229
231
  import { getSchemaAccessor } from '../utils/accessor.js'
@@ -329,6 +331,24 @@ export default TypeComponent.register('multiselect', {
329
331
  this.$refs.element.activate()
330
332
  },
331
333
 
334
+ onOpen() {
335
+ this.populate = true
336
+ },
337
+
338
+ onClose() {
339
+ // Since we don't fire blur events while the multiselect is open (see
340
+ // below), we need to do it here, when it's actually closed.
341
+ if (this.focused) {
342
+ this.onBlur()
343
+ }
344
+ },
345
+
346
+ onBlur() {
347
+ if (!this.$refs.element.isOpen) {
348
+ TypeMixin.methods.onBlur.call(this)
349
+ }
350
+ },
351
+
332
352
  onAddTag(tag) {
333
353
  const option = this.addTagOption(tag)
334
354
  if (option) {
@@ -2,7 +2,6 @@
2
2
  switch-button.dito-switch(
3
3
  ref="element"
4
4
  :id="dataPath"
5
- :sync="true"
6
5
  :labels="labels"
7
6
  v-model="value"
8
7
  v-bind="attributes"