druxt-breadcrumb 0.15.1 → 0.17.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.
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
* @type {boolean}
|
|
46
46
|
* @default true
|
|
47
47
|
* @example @lang vue
|
|
48
|
-
* <
|
|
48
|
+
* <DruxtBreadcrumb :home="false" />
|
|
49
49
|
*/
|
|
50
50
|
home: {
|
|
51
51
|
type: Boolean,
|
|
@@ -60,7 +60,7 @@ export default {
|
|
|
60
60
|
* @type {string}
|
|
61
61
|
*
|
|
62
62
|
* @example @lang vue
|
|
63
|
-
* <
|
|
63
|
+
* <DruxtBreadcrumb path="/node/1" />
|
|
64
64
|
*/
|
|
65
65
|
path: {
|
|
66
66
|
type: String,
|
|
@@ -144,12 +144,13 @@ export default {
|
|
|
144
144
|
route = false
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
// If this route has a label and doesn't resolve to the current path, add to the crumbs.
|
|
148
|
+
if (route.label && route.resolvedPath !== path) {
|
|
148
149
|
crumbs.push({ to, text: route.label })
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
// If this route is the home path, prevent a duplicate home item.
|
|
152
|
-
if (route.isHomePath) {
|
|
153
|
+
if (route.isHomePath || to === ['/', (route.props || {}).langcode].filter((o) => o).join('')) {
|
|
153
154
|
addHome = false
|
|
154
155
|
}
|
|
155
156
|
|
|
@@ -224,6 +225,16 @@ export default {
|
|
|
224
225
|
|
|
225
226
|
return scopedSlots
|
|
226
227
|
},
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Druxt development template tool configuration.
|
|
231
|
+
*/
|
|
232
|
+
template: {
|
|
233
|
+
debug: 'crumbs',
|
|
234
|
+
mixins: {
|
|
235
|
+
'DruxtBreadcrumbMixin': 'druxt-breadcrumb'
|
|
236
|
+
}
|
|
237
|
+
}
|
|
227
238
|
},
|
|
228
239
|
}
|
|
229
240
|
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { join, resolve } from 'path';
|
|
2
2
|
|
|
3
|
-
const DruxtBreadcrumbModule = function() {
|
|
3
|
+
const DruxtBreadcrumbModule = async function(moduleOptions = {}) {
|
|
4
|
+
const options = {
|
|
5
|
+
baseUrl: moduleOptions.baseUrl,
|
|
6
|
+
...(this.options || {}).druxt || {},
|
|
7
|
+
breadcrumb: {
|
|
8
|
+
...((this.options || {}).druxt || {}).breadcrumb,
|
|
9
|
+
...moduleOptions
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
await this.addModule(["druxt", options]);
|
|
13
|
+
await this.addModule(["druxt-router/nuxt", options]);
|
|
4
14
|
this.nuxt.hook("components:dirs", (dirs) => {
|
|
5
15
|
dirs.push({ path: join(__dirname, "components") });
|
|
6
16
|
dirs.push({ path: join(__dirname, "components/blocks") });
|
|
7
17
|
});
|
|
8
|
-
const { addTemplate, options } = this;
|
|
9
18
|
this.nuxt.hook("storybook:config", ({ stories }) => {
|
|
10
|
-
addTemplate({
|
|
19
|
+
this.addTemplate({
|
|
11
20
|
src: resolve(__dirname, "../templates/druxt-breadcrumb.stories.js"),
|
|
12
21
|
fileName: "stories/druxt-breadcrumb.stories.js"
|
|
13
22
|
});
|
|
14
|
-
stories.push(resolve(options.buildDir, "./stories/druxt-breadcrumb.stories.js"));
|
|
23
|
+
stories.push(resolve(this.options.buildDir, "./stories/druxt-breadcrumb.stories.js"));
|
|
15
24
|
});
|
|
16
25
|
};
|
|
17
26
|
DruxtBreadcrumbModule.meta = require("../package.json");
|
|
@@ -4,18 +4,27 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
|
-
const DruxtBreadcrumbModule = function() {
|
|
7
|
+
const DruxtBreadcrumbModule = async function(moduleOptions = {}) {
|
|
8
|
+
const options = {
|
|
9
|
+
baseUrl: moduleOptions.baseUrl,
|
|
10
|
+
...(this.options || {}).druxt || {},
|
|
11
|
+
breadcrumb: {
|
|
12
|
+
...((this.options || {}).druxt || {}).breadcrumb,
|
|
13
|
+
...moduleOptions
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
await this.addModule(["druxt", options]);
|
|
17
|
+
await this.addModule(["druxt-router/nuxt", options]);
|
|
8
18
|
this.nuxt.hook("components:dirs", (dirs) => {
|
|
9
19
|
dirs.push({ path: path.join(__dirname, "components") });
|
|
10
20
|
dirs.push({ path: path.join(__dirname, "components/blocks") });
|
|
11
21
|
});
|
|
12
|
-
const { addTemplate, options } = this;
|
|
13
22
|
this.nuxt.hook("storybook:config", ({ stories }) => {
|
|
14
|
-
addTemplate({
|
|
23
|
+
this.addTemplate({
|
|
15
24
|
src: path.resolve(__dirname, "../templates/druxt-breadcrumb.stories.js"),
|
|
16
25
|
fileName: "stories/druxt-breadcrumb.stories.js"
|
|
17
26
|
});
|
|
18
|
-
stories.push(path.resolve(options.buildDir, "./stories/druxt-breadcrumb.stories.js"));
|
|
27
|
+
stories.push(path.resolve(this.options.buildDir, "./stories/druxt-breadcrumb.stories.js"));
|
|
19
28
|
});
|
|
20
29
|
};
|
|
21
30
|
DruxtBreadcrumbModule.meta = require("../package.json");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "druxt-breadcrumb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Decoupled Router based Breadcrumb Druxt component.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"breadcrumb",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"templates"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"druxt": "^0.
|
|
46
|
-
"druxt-blocks": "^0.
|
|
47
|
-
"druxt-router": "^0.
|
|
45
|
+
"druxt": "^0.21.0",
|
|
46
|
+
"druxt-blocks": "^0.17.0",
|
|
47
|
+
"druxt-router": "^0.29.0"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"vue": "^2.
|
|
50
|
+
"vue": "^2.7.10",
|
|
51
51
|
"vuex": "^3.6.2"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import DruxtBreadcrumb from 'druxt-breadcrumb/dist/components
|
|
1
|
+
import DruxtBreadcrumb from 'druxt-breadcrumb/dist/components/DruxtBreadcrumb.vue'
|
|
2
|
+
import DruxtModule from 'druxt/dist/components/DruxtModule.vue'
|
|
3
|
+
|
|
4
|
+
DruxtBreadcrumb.__docgenInfo.props = [
|
|
5
|
+
...DruxtModule.__docgenInfo.props,
|
|
6
|
+
...DruxtBreadcrumb.__docgenInfo.props,
|
|
7
|
+
].sort((a, b) => a.name < b.name ? -1 : 1).filter((o) => o.name !== 'v-model')
|
|
2
8
|
|
|
3
9
|
export default {
|
|
4
10
|
title: 'Druxt/Breadcrumb/DruxtBreadcrumb',
|