druxt-entity 0.26.1 → 0.27.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.
|
@@ -377,11 +377,17 @@ export default {
|
|
|
377
377
|
const scopedSlots = {}
|
|
378
378
|
|
|
379
379
|
if (!this.schema) {
|
|
380
|
+
const summary = `Missing display settings for resource type: '${this.type}--${this.mode}'`
|
|
381
|
+
const description = [
|
|
382
|
+
h('p', 'Create a Druxt theme component to render the entity.'),
|
|
383
|
+
]
|
|
384
|
+
|
|
380
385
|
scopedSlots.debug = () => h('DruxtDebug',
|
|
381
|
-
{ props: { summary
|
|
386
|
+
{ props: { summary } },
|
|
382
387
|
[
|
|
383
|
-
h('
|
|
384
|
-
h('
|
|
388
|
+
h('div', description),
|
|
389
|
+
!!this.component.options.length && h('DruxtDevelTemplate', { props: { options: this.component.options }}),
|
|
390
|
+
h('details', [h('summary', 'JSON:API resource'), h('pre', [h('code', [JSON.stringify(this.model, null, ' ')])])])
|
|
385
391
|
]
|
|
386
392
|
)
|
|
387
393
|
return scopedSlots
|
|
@@ -414,7 +420,22 @@ export default {
|
|
|
414
420
|
|
|
415
421
|
return scopedSlots
|
|
416
422
|
},
|
|
417
|
-
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Druxt development template tool configuration.
|
|
426
|
+
*/
|
|
427
|
+
template: {
|
|
428
|
+
debug: '{ entity, schema }',
|
|
429
|
+
mixins: {
|
|
430
|
+
'DruxtEntityMixin': 'druxt-entity'
|
|
431
|
+
},
|
|
432
|
+
druxt: {
|
|
433
|
+
'query.//fields': ['name', 'path', 'title'],
|
|
434
|
+
'query.//include': [],
|
|
435
|
+
'query.//schema': true
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
418
439
|
}
|
|
419
440
|
|
|
420
441
|
/**
|
|
@@ -416,12 +416,17 @@ export default {
|
|
|
416
416
|
|
|
417
417
|
// Fallback: Provide debug data.
|
|
418
418
|
if (this.$nuxt.context.isDev) {
|
|
419
|
+
const summary = `Missing Vue template for '${this.schema.id} (${this.schema.type}')`
|
|
420
|
+
const description = [
|
|
421
|
+
h('p', 'Create a Druxt theme component to render the field.'),
|
|
422
|
+
]
|
|
419
423
|
return h('DruxtDebug',
|
|
420
|
-
{ props: { summary
|
|
424
|
+
{ props: { summary } },
|
|
421
425
|
[
|
|
422
|
-
h('
|
|
423
|
-
h('
|
|
424
|
-
h('
|
|
426
|
+
h('div', description),
|
|
427
|
+
!!this.component.options.length && h('DruxtDevelTemplate', { props: { options: this.component.options }}),
|
|
428
|
+
h('details', [h('summary', 'Data'), h('pre', [h('code', [JSON.stringify(item, null, ' ')])])]),
|
|
429
|
+
!!this.schema && h('details', [h('summary', 'Schema'), h('pre', [h('code', [JSON.stringify(this.schema, null, ' ')])])])
|
|
425
430
|
]
|
|
426
431
|
)
|
|
427
432
|
}
|
|
@@ -446,6 +451,15 @@ export default {
|
|
|
446
451
|
|
|
447
452
|
return scopedSlots
|
|
448
453
|
},
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Druxt development template tool configuration.
|
|
457
|
+
*/
|
|
458
|
+
template: {
|
|
459
|
+
mixins: {
|
|
460
|
+
'DruxtFieldMixin': 'druxt-entity'
|
|
461
|
+
}
|
|
462
|
+
}
|
|
449
463
|
},
|
|
450
464
|
}
|
|
451
465
|
|
package/dist/druxt-entity.esm.js
CHANGED
|
@@ -177,8 +177,8 @@ const DruxtEntityMixin = {
|
|
|
177
177
|
require: true
|
|
178
178
|
},
|
|
179
179
|
fields: {
|
|
180
|
-
type: Object,
|
|
181
|
-
|
|
180
|
+
type: [Object, Boolean],
|
|
181
|
+
default: void 0
|
|
182
182
|
},
|
|
183
183
|
langcode: {
|
|
184
184
|
type: String,
|
|
@@ -186,7 +186,7 @@ const DruxtEntityMixin = {
|
|
|
186
186
|
},
|
|
187
187
|
schema: {
|
|
188
188
|
type: Object,
|
|
189
|
-
|
|
189
|
+
default: void 0
|
|
190
190
|
},
|
|
191
191
|
value: {
|
|
192
192
|
type: Object,
|
|
@@ -197,7 +197,7 @@ const DruxtEntityMixin = {
|
|
|
197
197
|
model: value
|
|
198
198
|
}),
|
|
199
199
|
computed: {
|
|
200
|
-
classes: ({ schema }) => [
|
|
200
|
+
classes: ({ schema }) => schema && [
|
|
201
201
|
schema.id,
|
|
202
202
|
schema.resourceType,
|
|
203
203
|
schema.config.entityType,
|
package/dist/druxt-entity.ssr.js
CHANGED
|
@@ -181,8 +181,8 @@ const DruxtEntityMixin = {
|
|
|
181
181
|
require: true
|
|
182
182
|
},
|
|
183
183
|
fields: {
|
|
184
|
-
type: Object,
|
|
185
|
-
|
|
184
|
+
type: [Object, Boolean],
|
|
185
|
+
default: void 0
|
|
186
186
|
},
|
|
187
187
|
langcode: {
|
|
188
188
|
type: String,
|
|
@@ -190,7 +190,7 @@ const DruxtEntityMixin = {
|
|
|
190
190
|
},
|
|
191
191
|
schema: {
|
|
192
192
|
type: Object,
|
|
193
|
-
|
|
193
|
+
default: void 0
|
|
194
194
|
},
|
|
195
195
|
value: {
|
|
196
196
|
type: Object,
|
|
@@ -201,7 +201,7 @@ const DruxtEntityMixin = {
|
|
|
201
201
|
model: value
|
|
202
202
|
}),
|
|
203
203
|
computed: {
|
|
204
|
-
classes: ({ schema }) => [
|
|
204
|
+
classes: ({ schema }) => schema && [
|
|
205
205
|
schema.id,
|
|
206
206
|
schema.resourceType,
|
|
207
207
|
schema.config.entityType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "druxt-entity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Drupal Display Mode powered Entity, Form and Field Druxt components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"deepmerge": "^4.2.2",
|
|
48
|
-
"drupal-jsonapi-params": "^2.
|
|
49
|
-
"druxt": "^0.
|
|
50
|
-
"druxt-router": "^0.
|
|
51
|
-
"druxt-schema": "^0.11.
|
|
48
|
+
"drupal-jsonapi-params": "^2.1.0",
|
|
49
|
+
"druxt": "^0.21.0",
|
|
50
|
+
"druxt-router": "^0.29.0",
|
|
51
|
+
"druxt-schema": "^0.11.1"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|