@exmg/exm-breadcrumbs 1.2.8 → 1.2.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/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/exm-breadcrumbs-base.d.ts +4 -4
- package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/exm-breadcrumbs-base.js +5 -5
- package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/exm-breadcrumbs.d.ts +1 -1
- package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/exm-breadcrumbs.js +1 -1
- package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/exm-breadcrumbs.stories.d.ts +19 -0
- package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/exm-breadcrumbs.stories.js +25 -0
- package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/styles/exm-breadcrumbs-styles-css.js +3 -3
- package/README.md +2 -2
- package/dist/exm-breadcrumb-mixin.js +2 -2
- package/dist/exm-breadcrumbs-base.d.ts +4 -4
- package/dist/exm-breadcrumbs-base.js +6 -6
- package/dist/exm-breadcrumbs-controller.js +1 -1
- package/dist/exm-breadcrumbs.d.ts +1 -1
- package/dist/exm-breadcrumbs.js +2 -2
- package/dist/exm-breadcrumbs.stories.d.ts +19 -0
- package/dist/node_modules/.bun/@rollup_plugin-typescript@12.3.0_8b7a8dd02ef2c96b/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/styles/exm-breadcrumbs-styles-css.js +3 -3
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BreadcrumbItem } from './types.js';
|
|
2
2
|
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
3
|
-
export declare const arrowSeparator: import("lit
|
|
3
|
+
export declare const arrowSeparator: import("lit").TemplateResult<1>;
|
|
4
4
|
export declare class ExmBreadcrumbsBase extends ExmgElement {
|
|
5
5
|
/**
|
|
6
6
|
* The items displayed by the breadcrumbs
|
|
@@ -8,10 +8,10 @@ export declare class ExmBreadcrumbsBase extends ExmgElement {
|
|
|
8
8
|
*/
|
|
9
9
|
items: BreadcrumbItem[];
|
|
10
10
|
/**
|
|
11
|
-
* Whether or not to display the arrow
|
|
11
|
+
* Whether or not to display the arrow separator
|
|
12
12
|
* @type {Boolean}
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
arrowSeparator: boolean;
|
|
15
15
|
protected renderItems(): unknown;
|
|
16
|
-
render(): import("lit
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
17
|
}
|
|
@@ -18,21 +18,21 @@ export class ExmBreadcrumbsBase extends ExmgElement {
|
|
|
18
18
|
*/
|
|
19
19
|
this.items = [];
|
|
20
20
|
/**
|
|
21
|
-
* Whether or not to display the arrow
|
|
21
|
+
* Whether or not to display the arrow separator
|
|
22
22
|
* @type {Boolean}
|
|
23
23
|
*/
|
|
24
|
-
this.
|
|
24
|
+
this.arrowSeparator = false;
|
|
25
25
|
}
|
|
26
26
|
renderItems() {
|
|
27
27
|
var _a;
|
|
28
28
|
const lastIndex = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) - 1;
|
|
29
29
|
return repeat(this.items || [], ({ href, content }) => `${href}${content}`, ({ href, content }, index) => {
|
|
30
30
|
return html `
|
|
31
|
-
<li class="${classMap({
|
|
31
|
+
<li class="${classMap({ arrowSeparator: this.arrowSeparator })}">
|
|
32
32
|
<a href=${lastIndex !== index ? href : ''} aria-current=${index === lastIndex ? 'page' : 'false'}>
|
|
33
33
|
${content}
|
|
34
34
|
</a>
|
|
35
|
-
${this.
|
|
35
|
+
${this.arrowSeparator && index !== lastIndex ? arrowSeparator : nothing}
|
|
36
36
|
</li>
|
|
37
37
|
`;
|
|
38
38
|
});
|
|
@@ -52,5 +52,5 @@ __decorate([
|
|
|
52
52
|
], ExmBreadcrumbsBase.prototype, "items", void 0);
|
|
53
53
|
__decorate([
|
|
54
54
|
property({ type: Boolean, attribute: 'arrow-separator', reflect: true })
|
|
55
|
-
], ExmBreadcrumbsBase.prototype, "
|
|
55
|
+
], ExmBreadcrumbsBase.prototype, "arrowSeparator", void 0);
|
|
56
56
|
//# sourceMappingURL=exm-breadcrumbs-base.js.map
|
|
@@ -2,7 +2,7 @@ import { ExmBreadcrumbsBase } from './exm-breadcrumbs-base.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* exm-breadcrumbs
|
|
4
4
|
*
|
|
5
|
-
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow
|
|
5
|
+
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow separator
|
|
6
6
|
*
|
|
7
7
|
* * Example:
|
|
8
8
|
* ```js
|
|
@@ -5,7 +5,7 @@ import { ExmBreadcrumbsBase } from './exm-breadcrumbs-base.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* exm-breadcrumbs
|
|
7
7
|
*
|
|
8
|
-
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow
|
|
8
|
+
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow separator
|
|
9
9
|
*
|
|
10
10
|
* * Example:
|
|
11
11
|
* ```js
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { ExmBreadcrumbs } from './exm-breadcrumbs.js';
|
|
3
|
+
import './exm-breadcrumbs.js';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
tags: string[];
|
|
7
|
+
render: (args: ExmBreadcrumbs) => import("lit").TemplateResult<1>;
|
|
8
|
+
argTypes: {
|
|
9
|
+
items: {
|
|
10
|
+
control: "object";
|
|
11
|
+
};
|
|
12
|
+
arrowSeparator: {
|
|
13
|
+
control: "boolean";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<ExmBreadcrumbs>;
|
|
19
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './exm-breadcrumbs.js';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
const items = [
|
|
4
|
+
{ href: '/home', content: 'Home page' },
|
|
5
|
+
{ href: '/users', content: 'User List' },
|
|
6
|
+
{ href: '/users/1234', content: 'Mark' },
|
|
7
|
+
{ href: '/users/1234/details', content: 'Details' },
|
|
8
|
+
];
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Packages/Breadcrumbs',
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
render: (args) => html `<exm-breadcrumbs .items="${args.items}" ?arrow-separator="${args.arrowSeparator}"></exm-breadcrumbs>`,
|
|
13
|
+
argTypes: {
|
|
14
|
+
items: { control: 'object' },
|
|
15
|
+
arrowSeparator: { control: 'boolean' },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export const Default = {
|
|
20
|
+
args: {
|
|
21
|
+
items: items,
|
|
22
|
+
arrowSeparator: true,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=exm-breadcrumbs.stories.js.map
|
package/.rollup.cache/root/repo/packages/exm-breadcrumbs/dist/styles/exm-breadcrumbs-styles-css.js
CHANGED
|
@@ -2,7 +2,7 @@ import { css } from 'lit';
|
|
|
2
2
|
export const style = css `
|
|
3
3
|
:host {
|
|
4
4
|
display: block;
|
|
5
|
-
--_breadcrumbs-
|
|
5
|
+
--_breadcrumbs-separator-color: var(--breadcrumbs-separator-color, var(--md-sys-color-primary, #0071dc));
|
|
6
6
|
--_breadcrumbs-text-color: var(--breadcrumbs-text-color, var(--md-sys-color-primary, #0071dc));
|
|
7
7
|
--_breadcrumbs-decoration-color: var(--breadcrumbs-decoration-color, var(--md-sys-color-primary, #0071dc));
|
|
8
8
|
--_breadcrumbs-visited-color: var(--breadcrumbs-visited-color, var(--md-sys-color-primary, #0071dc));
|
|
@@ -23,7 +23,7 @@ export const style = css `
|
|
|
23
23
|
justify-content: center;
|
|
24
24
|
align-items: center;
|
|
25
25
|
padding: 0 var(--_breadcrumbs-item-separator-padding, 0);
|
|
26
|
-
fill: var(--_breadcrumbs-
|
|
26
|
+
fill: var(--_breadcrumbs-separator-color);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
nav.breadcrumb li {
|
|
@@ -55,7 +55,7 @@ export const style = css `
|
|
|
55
55
|
display: inline-block;
|
|
56
56
|
margin: 0 0.25em;
|
|
57
57
|
transform: rotate(15deg);
|
|
58
|
-
border-right: 0.1em solid var(--_breadcrumbs-
|
|
58
|
+
border-right: 0.1em solid var(--_breadcrumbs-separator-color);
|
|
59
59
|
height: 0.8em;
|
|
60
60
|
content: '';
|
|
61
61
|
}
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# @exmg/exm-breadcrumbs
|
|
4
4
|
|
|
5
|
-
Component to render breadcrumbs within a page or component with the option to enable / disable arrow
|
|
5
|
+
Component to render breadcrumbs within a page or component with the option to enable / disable arrow separator
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -41,7 +41,7 @@ private items = [
|
|
|
41
41
|
| Name | Type | Default | Description |
|
|
42
42
|
| ---------------- | --------- | ------- | --------------------------------------------- |
|
|
43
43
|
| `items` | `array` | _[]_ | The items displayed by the breadcrumbs |
|
|
44
|
-
| `
|
|
44
|
+
| `arrowSeparator` | `boolean` | _false_ | Whether or not to display the arrow separator |
|
|
45
45
|
|
|
46
46
|
### Methods
|
|
47
47
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import {
|
|
1
|
+
import { __decorate } from './node_modules/.bun/@rollup_plugin-typescript@12.3.0_8b7a8dd02ef2c96b/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { ExmgElement, observer } from '@exmg/lit-base/index.js';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BreadcrumbItem } from './types.js';
|
|
2
2
|
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
3
|
-
export declare const arrowSeparator: import("lit
|
|
3
|
+
export declare const arrowSeparator: import("lit").TemplateResult<1>;
|
|
4
4
|
export declare class ExmBreadcrumbsBase extends ExmgElement {
|
|
5
5
|
/**
|
|
6
6
|
* The items displayed by the breadcrumbs
|
|
@@ -8,10 +8,10 @@ export declare class ExmBreadcrumbsBase extends ExmgElement {
|
|
|
8
8
|
*/
|
|
9
9
|
items: BreadcrumbItem[];
|
|
10
10
|
/**
|
|
11
|
-
* Whether or not to display the arrow
|
|
11
|
+
* Whether or not to display the arrow separator
|
|
12
12
|
* @type {Boolean}
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
arrowSeparator: boolean;
|
|
15
15
|
protected renderItems(): unknown;
|
|
16
|
-
render(): import("lit
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
1
|
+
import { __decorate } from './node_modules/.bun/@rollup_plugin-typescript@12.3.0_8b7a8dd02ef2c96b/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { html, nothing } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { repeat } from 'lit/directives/repeat.js';
|
|
@@ -19,21 +19,21 @@ class ExmBreadcrumbsBase extends ExmgElement {
|
|
|
19
19
|
*/
|
|
20
20
|
this.items = [];
|
|
21
21
|
/**
|
|
22
|
-
* Whether or not to display the arrow
|
|
22
|
+
* Whether or not to display the arrow separator
|
|
23
23
|
* @type {Boolean}
|
|
24
24
|
*/
|
|
25
|
-
this.
|
|
25
|
+
this.arrowSeparator = false;
|
|
26
26
|
}
|
|
27
27
|
renderItems() {
|
|
28
28
|
var _a;
|
|
29
29
|
const lastIndex = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) - 1;
|
|
30
30
|
return repeat(this.items || [], ({ href, content }) => `${href}${content}`, ({ href, content }, index) => {
|
|
31
31
|
return html `
|
|
32
|
-
<li class="${classMap({
|
|
32
|
+
<li class="${classMap({ arrowSeparator: this.arrowSeparator })}">
|
|
33
33
|
<a href=${lastIndex !== index ? href : ''} aria-current=${index === lastIndex ? 'page' : 'false'}>
|
|
34
34
|
${content}
|
|
35
35
|
</a>
|
|
36
|
-
${this.
|
|
36
|
+
${this.arrowSeparator && index !== lastIndex ? arrowSeparator : nothing}
|
|
37
37
|
</li>
|
|
38
38
|
`;
|
|
39
39
|
});
|
|
@@ -53,7 +53,7 @@ __decorate([
|
|
|
53
53
|
], ExmBreadcrumbsBase.prototype, "items", void 0);
|
|
54
54
|
__decorate([
|
|
55
55
|
property({ type: Boolean, attribute: 'arrow-separator', reflect: true })
|
|
56
|
-
], ExmBreadcrumbsBase.prototype, "
|
|
56
|
+
], ExmBreadcrumbsBase.prototype, "arrowSeparator", void 0);
|
|
57
57
|
|
|
58
58
|
export { ExmBreadcrumbsBase, arrowSeparator };
|
|
59
59
|
//# sourceMappingURL=exm-breadcrumbs-base.js.map
|
|
@@ -2,7 +2,7 @@ import { ExmBreadcrumbsBase } from './exm-breadcrumbs-base.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* exm-breadcrumbs
|
|
4
4
|
*
|
|
5
|
-
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow
|
|
5
|
+
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow separator
|
|
6
6
|
*
|
|
7
7
|
* * Example:
|
|
8
8
|
* ```js
|
package/dist/exm-breadcrumbs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
1
|
+
import { __decorate } from './node_modules/.bun/@rollup_plugin-typescript@12.3.0_8b7a8dd02ef2c96b/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import { style } from './styles/exm-breadcrumbs-styles-css.js';
|
|
4
4
|
import { ExmBreadcrumbsBase } from './exm-breadcrumbs-base.js';
|
|
@@ -6,7 +6,7 @@ import { ExmBreadcrumbsBase } from './exm-breadcrumbs-base.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* exm-breadcrumbs
|
|
8
8
|
*
|
|
9
|
-
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow
|
|
9
|
+
* Component to render breadcrumbs within a page or component with the option to enable / disable arrow separator
|
|
10
10
|
*
|
|
11
11
|
* * Example:
|
|
12
12
|
* ```js
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { ExmBreadcrumbs } from './exm-breadcrumbs.js';
|
|
3
|
+
import './exm-breadcrumbs.js';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
tags: string[];
|
|
7
|
+
render: (args: ExmBreadcrumbs) => import("lit").TemplateResult<1>;
|
|
8
|
+
argTypes: {
|
|
9
|
+
items: {
|
|
10
|
+
control: "object";
|
|
11
|
+
};
|
|
12
|
+
arrowSeparator: {
|
|
13
|
+
control: "boolean";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<ExmBreadcrumbs>;
|
|
19
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function __decorate(decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
26
|
+
var e = new Error(message);
|
|
27
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { __decorate };
|
|
31
|
+
//# sourceMappingURL=tslib.es6.js.map
|
|
@@ -3,7 +3,7 @@ import { css } from 'lit';
|
|
|
3
3
|
const style = css `
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
|
-
--_breadcrumbs-
|
|
6
|
+
--_breadcrumbs-separator-color: var(--breadcrumbs-separator-color, var(--md-sys-color-primary, #0071dc));
|
|
7
7
|
--_breadcrumbs-text-color: var(--breadcrumbs-text-color, var(--md-sys-color-primary, #0071dc));
|
|
8
8
|
--_breadcrumbs-decoration-color: var(--breadcrumbs-decoration-color, var(--md-sys-color-primary, #0071dc));
|
|
9
9
|
--_breadcrumbs-visited-color: var(--breadcrumbs-visited-color, var(--md-sys-color-primary, #0071dc));
|
|
@@ -24,7 +24,7 @@ const style = css `
|
|
|
24
24
|
justify-content: center;
|
|
25
25
|
align-items: center;
|
|
26
26
|
padding: 0 var(--_breadcrumbs-item-separator-padding, 0);
|
|
27
|
-
fill: var(--_breadcrumbs-
|
|
27
|
+
fill: var(--_breadcrumbs-separator-color);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
nav.breadcrumb li {
|
|
@@ -56,7 +56,7 @@ const style = css `
|
|
|
56
56
|
display: inline-block;
|
|
57
57
|
margin: 0 0.25em;
|
|
58
58
|
transform: rotate(15deg);
|
|
59
|
-
border-right: 0.1em solid var(--_breadcrumbs-
|
|
59
|
+
border-right: 0.1em solid var(--_breadcrumbs-separator-color);
|
|
60
60
|
height: 0.8em;
|
|
61
61
|
content: '';
|
|
62
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-breadcrumbs",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c27c4ffabda0c6a509df58537017af65719d1e57"
|
|
39
39
|
}
|