@digital-realty/ix-grid 1.0.31 → 1.0.33
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/dist/components/IxGridNav.d.ts +14 -0
- package/dist/components/IxGridNav.js +76 -0
- package/dist/components/IxGridNav.js.map +1 -0
- package/dist/components/ix-grid-nav.d.ts +1 -0
- package/dist/components/ix-grid-nav.js +3 -0
- package/dist/components/ix-grid-nav.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/react/IxGridNav.d.ts +2 -0
- package/dist/react/IxGridNav.js +9 -0
- package/dist/react/IxGridNav.js.map +1 -0
- package/package.json +10 -6
- package/src/components/IxGridNav.ts +80 -0
- package/src/components/ix-grid-nav.ts +3 -0
- package/src/index.ts +1 -0
- package/src/react/IxGridNav.ts +9 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@digital-realty/ix-button';
|
|
3
|
+
export interface IGridNavButton {
|
|
4
|
+
path?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class IxGridNavigation extends LitElement {
|
|
10
|
+
buttons: IGridNavButton[];
|
|
11
|
+
static styles: import("lit").CSSResult;
|
|
12
|
+
renderButton: ({ path, text, onClick, disabled }: IGridNavButton) => import("lit").TemplateResult<1>;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html, css } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import '@digital-realty/ix-button';
|
|
6
|
+
export class IxGridNavigation extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.buttons = [];
|
|
10
|
+
// eslint-disable-next-line class-methods-use-this
|
|
11
|
+
this.renderButton = ({ path, text, onClick, disabled }) => html `
|
|
12
|
+
<ix-button
|
|
13
|
+
?disabled=${disabled}
|
|
14
|
+
href=${ifDefined(path)}
|
|
15
|
+
@click=${onClick}
|
|
16
|
+
class="button"
|
|
17
|
+
><div class="button-text">${text}</div></ix-button
|
|
18
|
+
>
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return html `
|
|
23
|
+
<div class="container">
|
|
24
|
+
${this.buttons.map(button => this.renderButton(button))}
|
|
25
|
+
</div>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
IxGridNavigation.styles = css `
|
|
30
|
+
:host {
|
|
31
|
+
--md-filled-button-container-color: var(
|
|
32
|
+
--grid-nav-button-container-color,
|
|
33
|
+
var(--ix-text-dark, #000)
|
|
34
|
+
);
|
|
35
|
+
--md-filled-button-container-height: var(
|
|
36
|
+
--grid-nav-button-container-height,
|
|
37
|
+
2.5rem
|
|
38
|
+
);
|
|
39
|
+
--md-filled-button-leading-space: var(
|
|
40
|
+
--grid-nav-button-leading-space,
|
|
41
|
+
20px
|
|
42
|
+
);
|
|
43
|
+
--md-filled-button-trailing-space: var(
|
|
44
|
+
--grid-nav-button-trailing-space,
|
|
45
|
+
20px
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[disabled] {
|
|
50
|
+
--md-filled-button-disabled-container-color: var(
|
|
51
|
+
--grid-nav-button-disabled-container-color,
|
|
52
|
+
transparent
|
|
53
|
+
);
|
|
54
|
+
--md-filled-button-disabled-label-text-color: var(
|
|
55
|
+
--grid-nav-button-disabled-container-color,
|
|
56
|
+
var(--ix-text-dark, #000)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.container {
|
|
61
|
+
display: var(--grid-nav-button-group-display, flex);
|
|
62
|
+
gap: var(--grid-nav-button-group-gap, 0.5rem);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.button {
|
|
66
|
+
margin: var(--grid-nav-button-margin, 0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.button-text {
|
|
70
|
+
text-transform: var(--grid-nav-button-text-transform, none);
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ type: Array, attribute: false })
|
|
75
|
+
], IxGridNavigation.prototype, "buttons", void 0);
|
|
76
|
+
//# sourceMappingURL=IxGridNav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxGridNav.js","sourceRoot":"","sources":["../../src/components/IxGridNav.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,2BAA2B,CAAC;AASnC,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAC+C,YAAO,GAAqB,EAAE,CAAC;QA+C5E,kDAAkD;QAClD,iBAAY,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAkB,EAAE,EAAE,CACnE,IAAI,CAAA;;oBAEY,QAAQ;eACb,SAAS,CAAC,IAAI,CAAC;iBACb,OAAO;;oCAEY,IAAI;;KAEnC,CAAC;IASN,CAAC;IAPC,MAAM;QACJ,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;;KAE1D,CAAC;IACJ,CAAC;;AA/DM,uBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ClB,CAAC;AA7C2C;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDAAgC","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport '@digital-realty/ix-button';\n\nexport interface IGridNavButton {\n path?: string;\n disabled?: boolean;\n onClick?: () => void;\n text: string;\n}\n\nexport class IxGridNavigation extends LitElement {\n @property({ type: Array, attribute: false }) buttons: IGridNavButton[] = [];\n\n static styles = css`\n :host {\n --md-filled-button-container-color: var(\n --grid-nav-button-container-color,\n var(--ix-text-dark, #000)\n );\n --md-filled-button-container-height: var(\n --grid-nav-button-container-height,\n 2.5rem\n );\n --md-filled-button-leading-space: var(\n --grid-nav-button-leading-space,\n 20px\n );\n --md-filled-button-trailing-space: var(\n --grid-nav-button-trailing-space,\n 20px\n );\n }\n\n [disabled] {\n --md-filled-button-disabled-container-color: var(\n --grid-nav-button-disabled-container-color,\n transparent\n );\n --md-filled-button-disabled-label-text-color: var(\n --grid-nav-button-disabled-container-color,\n var(--ix-text-dark, #000)\n );\n }\n\n .container {\n display: var(--grid-nav-button-group-display, flex);\n gap: var(--grid-nav-button-group-gap, 0.5rem);\n }\n\n .button {\n margin: var(--grid-nav-button-margin, 0);\n }\n\n .button-text {\n text-transform: var(--grid-nav-button-text-transform, none);\n }\n `;\n\n // eslint-disable-next-line class-methods-use-this\n renderButton = ({ path, text, onClick, disabled }: IGridNavButton) =>\n html`\n <ix-button\n ?disabled=${disabled}\n href=${ifDefined(path)}\n @click=${onClick}\n class=\"button\"\n ><div class=\"button-text\">${text}</div></ix-button\n >\n `;\n\n render() {\n return html`\n <div class=\"container\">\n ${this.buttons.map(button => this.renderButton(button))}\n </div>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-grid-nav.js","sourceRoot":"","sources":["../../src/components/ix-grid-nav.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { IxGridNavigation } from './IxGridNav.js';\n\nwindow.customElements.define('ix-grid-nav', IxGridNavigation);\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { IxGrid } from './IxGrid.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export { IxGrid } from './IxGrid.js';\nexport { IxGridNavigation } from './components/IxGridNav.js';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxGridNavigation } from '../components/IxGridNav.js';
|
|
4
|
+
export const IxGridNav = createComponent({
|
|
5
|
+
tagName: 'ix-grid-nav',
|
|
6
|
+
elementClass: IxGridNavigation,
|
|
7
|
+
react: React,
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=IxGridNav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxGridNav.js","sourceRoot":"","sources":["../../src/react/IxGridNav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,KAAK;CACb,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit/react';\nimport { IxGridNavigation } from '../components/IxGridNav.js';\n\nexport const IxGridNav = createComponent({\n tagName: 'ix-grid-nav',\n elementClass: IxGridNavigation,\n react: React,\n});\n"]}
|
package/package.json
CHANGED
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
"description": "Webcomponent ix-grid following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.33",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/index.js",
|
|
12
12
|
"./ix-grid.js": "./dist/ix-grid.js",
|
|
13
|
-
"./ix-grid.
|
|
13
|
+
"./ix-grid-nav.js": "./dist/components/ix-grid-nav.js",
|
|
14
|
+
"./ix-grid.min.js": "./dist/ix-grid.min.js",
|
|
15
|
+
"./IxGridNav": "./dist/react/IxGridNav.js"
|
|
14
16
|
},
|
|
15
17
|
"publishConfig": {
|
|
16
18
|
"access": "public"
|
|
@@ -28,16 +30,18 @@
|
|
|
28
30
|
"dependencies": {
|
|
29
31
|
"@digital-realty/ix-button": "^3.2.31",
|
|
30
32
|
"@digital-realty/ix-icon": "^1.0.36",
|
|
31
|
-
"@digital-realty/ix-icon-button": "^1.0.
|
|
33
|
+
"@digital-realty/ix-icon-button": "^1.0.39",
|
|
32
34
|
"@digital-realty/ix-menu": "^1.0.4",
|
|
33
35
|
"@digital-realty/ix-select": "^1.0.37",
|
|
34
36
|
"@digital-realty/ix-switch": "^2.1.10",
|
|
37
|
+
"@lit/react": "^1.0.5",
|
|
35
38
|
"@vaadin/grid": "^24.3.11",
|
|
36
|
-
"lit": "^2.0.2"
|
|
39
|
+
"lit": "^2.0.2",
|
|
40
|
+
"react": "^18.3.1"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
43
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
40
|
-
"@digital-realty/theme": "^1.0.
|
|
44
|
+
"@digital-realty/theme": "^1.0.29",
|
|
41
45
|
"@open-wc/eslint-config": "^9.2.1",
|
|
42
46
|
"@open-wc/testing": "^3.1.6",
|
|
43
47
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
@@ -98,5 +102,5 @@
|
|
|
98
102
|
"prettier --write"
|
|
99
103
|
]
|
|
100
104
|
},
|
|
101
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "e993c7e822eae9ea4237661270a2d62c556d171c"
|
|
102
106
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import '@digital-realty/ix-button';
|
|
5
|
+
|
|
6
|
+
export interface IGridNavButton {
|
|
7
|
+
path?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class IxGridNavigation extends LitElement {
|
|
14
|
+
@property({ type: Array, attribute: false }) buttons: IGridNavButton[] = [];
|
|
15
|
+
|
|
16
|
+
static styles = css`
|
|
17
|
+
:host {
|
|
18
|
+
--md-filled-button-container-color: var(
|
|
19
|
+
--grid-nav-button-container-color,
|
|
20
|
+
var(--ix-text-dark, #000)
|
|
21
|
+
);
|
|
22
|
+
--md-filled-button-container-height: var(
|
|
23
|
+
--grid-nav-button-container-height,
|
|
24
|
+
2.5rem
|
|
25
|
+
);
|
|
26
|
+
--md-filled-button-leading-space: var(
|
|
27
|
+
--grid-nav-button-leading-space,
|
|
28
|
+
20px
|
|
29
|
+
);
|
|
30
|
+
--md-filled-button-trailing-space: var(
|
|
31
|
+
--grid-nav-button-trailing-space,
|
|
32
|
+
20px
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[disabled] {
|
|
37
|
+
--md-filled-button-disabled-container-color: var(
|
|
38
|
+
--grid-nav-button-disabled-container-color,
|
|
39
|
+
transparent
|
|
40
|
+
);
|
|
41
|
+
--md-filled-button-disabled-label-text-color: var(
|
|
42
|
+
--grid-nav-button-disabled-container-color,
|
|
43
|
+
var(--ix-text-dark, #000)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.container {
|
|
48
|
+
display: var(--grid-nav-button-group-display, flex);
|
|
49
|
+
gap: var(--grid-nav-button-group-gap, 0.5rem);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button {
|
|
53
|
+
margin: var(--grid-nav-button-margin, 0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button-text {
|
|
57
|
+
text-transform: var(--grid-nav-button-text-transform, none);
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
// eslint-disable-next-line class-methods-use-this
|
|
62
|
+
renderButton = ({ path, text, onClick, disabled }: IGridNavButton) =>
|
|
63
|
+
html`
|
|
64
|
+
<ix-button
|
|
65
|
+
?disabled=${disabled}
|
|
66
|
+
href=${ifDefined(path)}
|
|
67
|
+
@click=${onClick}
|
|
68
|
+
class="button"
|
|
69
|
+
><div class="button-text">${text}</div></ix-button
|
|
70
|
+
>
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
render() {
|
|
74
|
+
return html`
|
|
75
|
+
<div class="container">
|
|
76
|
+
${this.buttons.map(button => this.renderButton(button))}
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxGridNavigation } from '../components/IxGridNav.js';
|
|
4
|
+
|
|
5
|
+
export const IxGridNav = createComponent({
|
|
6
|
+
tagName: 'ix-grid-nav',
|
|
7
|
+
elementClass: IxGridNavigation,
|
|
8
|
+
react: React,
|
|
9
|
+
});
|