@exmg/exm-radio 1.1.36 → 1.2.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.
- package/.rollup.cache/root/repo/packages/exm-radio/dist/exm-radio-item.d.ts +16 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/exm-radio-item.js +67 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/index.d.ts +1 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/index.js +2 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/styles/exm-radio-item-css.d.ts +1 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/styles/exm-radio-item-css.js +114 -0
- package/dist/exm-radio-item.js +7 -5
- package/dist/index.js +1 -1
- package/dist/styles/exm-radio-item-css.js +5 -2
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Radio } from '@material/web/radio/internal/radio.js';
|
|
2
|
+
/**
|
|
3
|
+
* exm-radio-item
|
|
4
|
+
* Material 3 radio item
|
|
5
|
+
*/
|
|
6
|
+
export declare class ExmRadioItem extends Radio {
|
|
7
|
+
private readonly maskIdOverride;
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
radio: boolean;
|
|
10
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'exm-radio-item': ExmRadioItem;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { Radio } from '@material/web/radio/internal/radio.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import { styles } from '@material/web/radio/internal/radio-styles.js';
|
|
7
|
+
import { style as radioStyle } from './styles/exm-radio-item-css.js';
|
|
8
|
+
let maskId = 0;
|
|
9
|
+
/**
|
|
10
|
+
* exm-radio-item
|
|
11
|
+
* Material 3 radio item
|
|
12
|
+
*/
|
|
13
|
+
let ExmRadioItem = class ExmRadioItem extends Radio {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
// Unique maskId is required because of a Safari bug that fail to persist
|
|
17
|
+
// reference to the mask. This should be removed once the bug is fixed.
|
|
18
|
+
this.maskIdOverride = `cutout${++maskId}`;
|
|
19
|
+
this.radio = false;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
const classes = { checked: this.checked, disabled: this.disabled };
|
|
23
|
+
const showRadioMap = classMap({ 'show-radio': this.radio });
|
|
24
|
+
return html `
|
|
25
|
+
<div class="container ${classMap(classes)}" aria-hidden="true" tab-index="0">
|
|
26
|
+
<md-ripple .control=${this} ?disabled=${this.disabled}></md-ripple>
|
|
27
|
+
<md-focus-ring .control=${this}></md-focus-ring>
|
|
28
|
+
<div class="radio-container ${showRadioMap}">
|
|
29
|
+
<svg class="icon ${showRadioMap}" viewBox="0 0 20 20">
|
|
30
|
+
<mask id="${this.maskIdOverride}">
|
|
31
|
+
<rect width="100%" height="100%" fill="white" />
|
|
32
|
+
<circle cx="10" cy="10" r="8" fill="black" />
|
|
33
|
+
</mask>
|
|
34
|
+
<circle class="outer circle" cx="10" cy="10" r="10" mask="url(#${this.maskIdOverride})" />
|
|
35
|
+
<circle class="inner circle" cx="10" cy="10" r="5" />
|
|
36
|
+
</svg>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="content-container">
|
|
39
|
+
<div class="image-container">
|
|
40
|
+
<slot name="image"></slot>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="content">
|
|
43
|
+
<slot name="title"></slot>
|
|
44
|
+
<slot name="content"></slot>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<input
|
|
48
|
+
id="input"
|
|
49
|
+
type="radio"
|
|
50
|
+
tabindex="-1"
|
|
51
|
+
.checked=${this.checked}
|
|
52
|
+
.value=${this.value}
|
|
53
|
+
?disabled=${this.disabled}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
ExmRadioItem.styles = [styles, radioStyle];
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: Boolean })
|
|
62
|
+
], ExmRadioItem.prototype, "radio", void 0);
|
|
63
|
+
ExmRadioItem = __decorate([
|
|
64
|
+
customElement('exm-radio-item')
|
|
65
|
+
], ExmRadioItem);
|
|
66
|
+
export { ExmRadioItem };
|
|
67
|
+
//# sourceMappingURL=exm-radio-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExmRadioItem } from './exm-radio-item.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
background: rgba(0, 0, 0, 0);
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
position: relative;
|
|
10
|
+
--md-radio-disabled-icon-color: grey;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
15
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
16
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
17
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
border: 1px solid var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
20
|
+
display: flex;
|
|
21
|
+
position: relative;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding: 1rem 1px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.container.disabled {
|
|
28
|
+
border: 1px solid var(--md-radio-disabled-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
29
|
+
color: var(--md-radio-disabled-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.container.checked {
|
|
33
|
+
border: 2px solid var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4));
|
|
34
|
+
padding: calc(1rem - 1px) 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([left-align]) .container {
|
|
38
|
+
justify-content: flex-start;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([right-align]) .container {
|
|
42
|
+
justify-content: flex-end;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
md-ripple {
|
|
46
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
47
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
48
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
49
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
md-focus-ring {
|
|
55
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
56
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
57
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
58
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#input {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
svg {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
svg.show-radio {
|
|
72
|
+
display: block;
|
|
73
|
+
position: relative;
|
|
74
|
+
width: 20px;
|
|
75
|
+
height: 20px;
|
|
76
|
+
margin-left: 1rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
slot[name='title'] {
|
|
80
|
+
font-size: var(--exm-radio-title-font-size, 24px);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
slot[name='content'] {
|
|
84
|
+
font-size: var(--exm-radio-content-font-size, 16px);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
slot[name='image'] {
|
|
88
|
+
margin-right: 1rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.radio-container {
|
|
92
|
+
height: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.image-container {
|
|
96
|
+
display: flex;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.image-container > ::slotted(*) {
|
|
100
|
+
margin-right: 1rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.content-container {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
padding: 0 1rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.content {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
//# sourceMappingURL=exm-radio-item-css.js.map
|
package/dist/exm-radio-item.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { __decorate } from
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { Radio } from '@material/web/radio/internal/radio.js';
|
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
6
|
import { styles } from '@material/web/radio/internal/radio-styles.js';
|
|
7
|
-
import { style
|
|
7
|
+
import { style } from './styles/exm-radio-item-css.js';
|
|
8
|
+
|
|
8
9
|
let maskId = 0;
|
|
9
10
|
/**
|
|
10
11
|
* exm-radio-item
|
|
@@ -56,12 +57,13 @@ let ExmRadioItem = class ExmRadioItem extends Radio {
|
|
|
56
57
|
`;
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
ExmRadioItem.styles = [styles,
|
|
60
|
+
ExmRadioItem.styles = [styles, style];
|
|
60
61
|
__decorate([
|
|
61
62
|
property({ type: Boolean })
|
|
62
63
|
], ExmRadioItem.prototype, "radio", void 0);
|
|
63
64
|
ExmRadioItem = __decorate([
|
|
64
65
|
customElement('exm-radio-item')
|
|
65
66
|
], ExmRadioItem);
|
|
67
|
+
|
|
66
68
|
export { ExmRadioItem };
|
|
67
|
-
//# sourceMappingURL=exm-radio-item.js.map
|
|
69
|
+
//# sourceMappingURL=exm-radio-item.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ExmRadioItem } from './exm-radio-item.js';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const style = css `
|
|
3
4
|
:host {
|
|
4
5
|
display: block;
|
|
5
6
|
background: rgba(0, 0, 0, 0);
|
|
@@ -111,4 +112,6 @@ export const style = css `
|
|
|
111
112
|
flex-direction: column;
|
|
112
113
|
}
|
|
113
114
|
`;
|
|
114
|
-
|
|
115
|
+
|
|
116
|
+
export { style };
|
|
117
|
+
//# sourceMappingURL=exm-radio-item-css.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-radio",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Material style radio element",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Ex Machina"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b5f4ed4f41d79e3cce85dc0c44181ef4413d7458"
|
|
48
48
|
}
|