@3mo/button 0.2.5 → 0.3.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/dist/Button/Button.d.ts +48 -47
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button.d.ts +48 -47
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +85 -84
- package/dist/Icon/Icon.d.ts +32 -32
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/MaterialIcon.d.ts +1 -1
- package/dist/Icon/MaterialIcon.d.ts.map +1 -1
- package/dist/Icon/index.d.ts +2 -2
- package/dist/InstanceofAttributeController/InstanceofAttributeController.d.ts +8 -8
- package/dist/InstanceofAttributeController/InstanceofAttributeController.d.ts.map +1 -1
- package/dist/InstanceofAttributeController/index.d.ts +1 -1
- package/dist/bundle.js +1 -1
- package/dist/disabledProperty/disabledProperty.d.ts +6 -0
- package/dist/disabledProperty/disabledProperty.d.ts.map +1 -0
- package/dist/disabledProperty/index.d.ts +2 -0
- package/dist/disabledProperty/index.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -2
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { Component } from '@a11d/lit';
|
|
2
|
-
import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
|
|
3
|
-
import { MaterialIcon } from '@3mo/icon';
|
|
4
|
-
export declare const enum ButtonType {
|
|
5
|
-
Normal = "normal",
|
|
6
|
-
Outlined = "outlined",
|
|
7
|
-
Raised = "raised",
|
|
8
|
-
Unelevated = "unelevated"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @attr type
|
|
12
|
-
* @attr disabled
|
|
13
|
-
* @attr leadingIcon
|
|
14
|
-
* @attr trailingIcon
|
|
15
|
-
*
|
|
16
|
-
* @slot - The content of the button.
|
|
17
|
-
* @slot leading - The leading content of the button.
|
|
18
|
-
* @slot trailing - The trailing content of the button.
|
|
19
|
-
*
|
|
20
|
-
* @cssprop --mo-button-accent-color
|
|
21
|
-
* @cssprop --mo-button-horizontal-padding
|
|
22
|
-
* @cssprop --mo-button-disabled-background-color
|
|
23
|
-
* @cssprop --mo-button-disabled-color
|
|
24
|
-
*
|
|
25
|
-
* @csspart button - The composed native button element.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
protected
|
|
35
|
-
protected get
|
|
36
|
-
protected get
|
|
37
|
-
protected get
|
|
38
|
-
protected get
|
|
39
|
-
protected get
|
|
40
|
-
protected get
|
|
41
|
-
protected get
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
1
|
+
import { Component } from '@a11d/lit';
|
|
2
|
+
import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
|
|
3
|
+
import { type MaterialIcon } from '@3mo/icon';
|
|
4
|
+
export declare const enum ButtonType {
|
|
5
|
+
Normal = "normal",
|
|
6
|
+
Outlined = "outlined",
|
|
7
|
+
Raised = "raised",
|
|
8
|
+
Unelevated = "unelevated"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @attr type
|
|
12
|
+
* @attr disabled
|
|
13
|
+
* @attr leadingIcon
|
|
14
|
+
* @attr trailingIcon
|
|
15
|
+
*
|
|
16
|
+
* @slot - The content of the button.
|
|
17
|
+
* @slot leading - The leading content of the button.
|
|
18
|
+
* @slot trailing - The trailing content of the button.
|
|
19
|
+
*
|
|
20
|
+
* @cssprop --mo-button-accent-color
|
|
21
|
+
* @cssprop --mo-button-horizontal-padding
|
|
22
|
+
* @cssprop --mo-button-disabled-background-color
|
|
23
|
+
* @cssprop --mo-button-disabled-color
|
|
24
|
+
*
|
|
25
|
+
* @csspart button - The composed native button element.
|
|
26
|
+
* @csspart ripple - The ripple element.
|
|
27
|
+
*/
|
|
28
|
+
export declare class Button extends Component {
|
|
29
|
+
type: ButtonType;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
leadingIcon?: MaterialIcon;
|
|
32
|
+
trailingIcon?: MaterialIcon;
|
|
33
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
34
|
+
protected readonly instanceofAttributeController: InstanceofAttributeController;
|
|
35
|
+
protected get template(): import("lit-html").TemplateResult<1>;
|
|
36
|
+
protected get isDisabled(): boolean;
|
|
37
|
+
protected get contentTemplate(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
protected get leadingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
39
|
+
protected get leadingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
40
|
+
protected get slotTemplate(): import("lit-html").TemplateResult<1>;
|
|
41
|
+
protected get trailingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
42
|
+
protected get trailingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
43
|
+
}
|
|
44
|
+
declare global {
|
|
45
|
+
interface HTMLElementTagNameMap {
|
|
46
|
+
'mo-button': Button;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
48
49
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../Button.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAwB,MAAM,WAAW,CAAA;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../Button.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAwB,MAAM,WAAW,CAAA;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AAI7C,0BAAkB,UAAU;IAC3B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,UAAU,eAAe;CACzB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,MAAO,SAAQ,SAAS;IACP,IAAI,aAAoB;IACjC,QAAQ,UAAQ;IAExB,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAA;IAEvC,WAAoB,MAAM,kCAEzB;IAED,SAAS,CAAC,QAAQ,CAAC,6BAA6B,gCAA0C;IAE1F,cAAuB,QAAQ,yCAE9B;IAED,SAAS,KAAK,UAAU,YAEvB;IAED,SAAS,KAAK,eAAe,yCAE5B;IAED,SAAS,KAAK,mBAAmB,yCAEhC;IAED,SAAS,KAAK,mBAAmB,0CAEhC;IAED,SAAS,KAAK,YAAY,yCAEzB;IAED,SAAS,KAAK,oBAAoB,yCAEjC;IAED,SAAS,KAAK,oBAAoB,0CAEjC;CACD;AAcD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,MAAM,CAAA;KACnB;CACD"}
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Button.js';
|
|
1
|
+
export * from './Button.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { Component } from '@a11d/lit';
|
|
2
|
-
import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
|
|
3
|
-
import { MaterialIcon } from '@3mo/icon';
|
|
4
|
-
export declare const enum ButtonType {
|
|
5
|
-
Normal = "normal",
|
|
6
|
-
Outlined = "outlined",
|
|
7
|
-
Raised = "raised",
|
|
8
|
-
Unelevated = "unelevated"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @attr type
|
|
12
|
-
* @attr disabled
|
|
13
|
-
* @attr leadingIcon
|
|
14
|
-
* @attr trailingIcon
|
|
15
|
-
*
|
|
16
|
-
* @slot - The content of the button.
|
|
17
|
-
* @slot leading - The leading content of the button.
|
|
18
|
-
* @slot trailing - The trailing content of the button.
|
|
19
|
-
*
|
|
20
|
-
* @cssprop --mo-button-accent-color
|
|
21
|
-
* @cssprop --mo-button-horizontal-padding
|
|
22
|
-
* @cssprop --mo-button-disabled-background-color
|
|
23
|
-
* @cssprop --mo-button-disabled-color
|
|
24
|
-
*
|
|
25
|
-
* @csspart button - The composed native button element.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
protected
|
|
35
|
-
protected get
|
|
36
|
-
protected get
|
|
37
|
-
protected get
|
|
38
|
-
protected get
|
|
39
|
-
protected get
|
|
40
|
-
protected get
|
|
41
|
-
protected get
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
1
|
+
import { Component } from '@a11d/lit';
|
|
2
|
+
import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
|
|
3
|
+
import { type MaterialIcon } from '@3mo/icon';
|
|
4
|
+
export declare const enum ButtonType {
|
|
5
|
+
Normal = "normal",
|
|
6
|
+
Outlined = "outlined",
|
|
7
|
+
Raised = "raised",
|
|
8
|
+
Unelevated = "unelevated"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @attr type
|
|
12
|
+
* @attr disabled
|
|
13
|
+
* @attr leadingIcon
|
|
14
|
+
* @attr trailingIcon
|
|
15
|
+
*
|
|
16
|
+
* @slot - The content of the button.
|
|
17
|
+
* @slot leading - The leading content of the button.
|
|
18
|
+
* @slot trailing - The trailing content of the button.
|
|
19
|
+
*
|
|
20
|
+
* @cssprop --mo-button-accent-color
|
|
21
|
+
* @cssprop --mo-button-horizontal-padding
|
|
22
|
+
* @cssprop --mo-button-disabled-background-color
|
|
23
|
+
* @cssprop --mo-button-disabled-color
|
|
24
|
+
*
|
|
25
|
+
* @csspart button - The composed native button element.
|
|
26
|
+
* @csspart ripple - The ripple element.
|
|
27
|
+
*/
|
|
28
|
+
export declare class Button extends Component {
|
|
29
|
+
type: ButtonType;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
leadingIcon?: MaterialIcon;
|
|
32
|
+
trailingIcon?: MaterialIcon;
|
|
33
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
34
|
+
protected readonly instanceofAttributeController: InstanceofAttributeController;
|
|
35
|
+
protected get template(): import("lit-html").TemplateResult<1>;
|
|
36
|
+
protected get isDisabled(): boolean;
|
|
37
|
+
protected get contentTemplate(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
protected get leadingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
39
|
+
protected get leadingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
40
|
+
protected get slotTemplate(): import("lit-html").TemplateResult<1>;
|
|
41
|
+
protected get trailingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
42
|
+
protected get trailingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
43
|
+
}
|
|
44
|
+
declare global {
|
|
45
|
+
interface HTMLElementTagNameMap {
|
|
46
|
+
'mo-button': Button;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
48
49
|
//# sourceMappingURL=Button.d.ts.map
|
package/dist/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../Button.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAwB,MAAM,WAAW,CAAA;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../Button.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAwB,MAAM,WAAW,CAAA;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AAI7C,0BAAkB,UAAU;IAC3B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,UAAU,eAAe;CACzB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,MAAO,SAAQ,SAAS;IACP,IAAI,aAAoB;IACjC,QAAQ,UAAQ;IAExB,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAA;IAEvC,WAAoB,MAAM,kCAwCzB;IAED,SAAS,CAAC,QAAQ,CAAC,6BAA6B,gCAA0C;IAE1F,cAAuB,QAAQ,yCAW9B;IAED,SAAS,KAAK,UAAU,YAEvB;IAED,SAAS,KAAK,eAAe,yCAM5B;IAED,SAAS,KAAK,mBAAmB,yCAMhC;IAED,SAAS,KAAK,mBAAmB,0CAEhC;IAED,SAAS,KAAK,YAAY,yCAEzB;IAED,SAAS,KAAK,oBAAoB,yCAMjC;IAED,SAAS,KAAK,oBAAoB,0CAEjC;CACD;AAqDD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,MAAM,CAAA;KACnB;CACD"}
|
package/dist/Button.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { component, property, css, Component, html, nothing, style } from '@a11d/lit';
|
|
3
|
-
import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
|
|
4
|
-
import { Button as MwcButton } from '@material/mwc-button';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* @attr
|
|
8
|
-
* @attr
|
|
9
|
-
* @attr
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @slot
|
|
13
|
-
* @slot
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @cssprop --mo-button-
|
|
17
|
-
* @cssprop --mo-button-
|
|
18
|
-
* @cssprop --mo-button-disabled-color
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { component, property, css, Component, html, nothing, style } from '@a11d/lit';
|
|
3
|
+
import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
|
|
4
|
+
import { Button as MwcButton } from '@material/mwc-button';
|
|
5
|
+
import { disabledProperty } from '@3mo/disabled-property';
|
|
6
|
+
/**
|
|
7
|
+
* @attr type
|
|
8
|
+
* @attr disabled
|
|
9
|
+
* @attr leadingIcon
|
|
10
|
+
* @attr trailingIcon
|
|
11
|
+
*
|
|
12
|
+
* @slot - The content of the button.
|
|
13
|
+
* @slot leading - The leading content of the button.
|
|
14
|
+
* @slot trailing - The trailing content of the button.
|
|
15
|
+
*
|
|
16
|
+
* @cssprop --mo-button-accent-color
|
|
17
|
+
* @cssprop --mo-button-horizontal-padding
|
|
18
|
+
* @cssprop --mo-button-disabled-background-color
|
|
19
|
+
* @cssprop --mo-button-disabled-color
|
|
20
|
+
*
|
|
21
|
+
* @csspart button - The composed native button element.
|
|
22
|
+
* @csspart ripple - The ripple element.
|
|
23
|
+
*/
|
|
24
|
+
let Button = class Button extends Component {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.type = "normal" /* ButtonType.Normal */;
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
this.instanceofAttributeController = new InstanceofAttributeController(this);
|
|
30
|
+
}
|
|
31
|
+
static get styles() {
|
|
30
32
|
return css `
|
|
31
33
|
:host {
|
|
32
34
|
display: inline-block;
|
|
@@ -36,10 +38,6 @@ let Button = class Button extends Component {
|
|
|
36
38
|
min-height: 36px;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
:host([disabled]) {
|
|
40
|
-
pointer-events: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
41
|
:host([type=normal]) mwc-button {
|
|
44
42
|
--mo-button-default-horizontal-padding: 12px;
|
|
45
43
|
}
|
|
@@ -69,11 +67,11 @@ let Button = class Button extends Component {
|
|
|
69
67
|
--mdc-button-disabled-outline-color: var(--mo-button-disabled-color, var(--mo-color-gray-transparent));
|
|
70
68
|
--mdc-shape-small: inherit;
|
|
71
69
|
}
|
|
72
|
-
`;
|
|
73
|
-
}
|
|
74
|
-
get template() {
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
get template() {
|
|
75
73
|
return html `
|
|
76
|
-
<mwc-button exportparts='button' expandContent
|
|
74
|
+
<mwc-button exportparts='button,ripple' expandContent
|
|
77
75
|
?raised=${this.type === "raised" /* ButtonType.Raised */}
|
|
78
76
|
?outlined=${this.type === "outlined" /* ButtonType.Outlined */}
|
|
79
77
|
?unelevated=${this.type === "unelevated" /* ButtonType.Unelevated */}
|
|
@@ -81,64 +79,67 @@ let Button = class Button extends Component {
|
|
|
81
79
|
>
|
|
82
80
|
${this.contentTemplate}
|
|
83
81
|
</mwc-button>
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
get isDisabled() {
|
|
87
|
-
return this.disabled;
|
|
88
|
-
}
|
|
89
|
-
get contentTemplate() {
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
get isDisabled() {
|
|
85
|
+
return this.disabled;
|
|
86
|
+
}
|
|
87
|
+
get contentTemplate() {
|
|
90
88
|
return html `
|
|
91
89
|
${this.leadingSlotTemplate}
|
|
92
90
|
${this.slotTemplate}
|
|
93
91
|
${this.trailingSlotTemplate}
|
|
94
|
-
`;
|
|
95
|
-
}
|
|
96
|
-
get leadingSlotTemplate() {
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
get leadingSlotTemplate() {
|
|
97
95
|
return html `
|
|
98
96
|
<slot name='leading' slot='icon'>
|
|
99
97
|
${this.leadingIconTemplate}
|
|
100
98
|
</slot>
|
|
101
|
-
`;
|
|
102
|
-
}
|
|
103
|
-
get leadingIconTemplate() {
|
|
104
|
-
return !this.leadingIcon ? nothing : html `<mo-icon icon=${this.leadingIcon}></mo-icon>`;
|
|
105
|
-
}
|
|
106
|
-
get slotTemplate() {
|
|
107
|
-
return html `<slot ${style({ width: '*' })}></slot>`;
|
|
108
|
-
}
|
|
109
|
-
get trailingSlotTemplate() {
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
get leadingIconTemplate() {
|
|
102
|
+
return !this.leadingIcon ? nothing : html `<mo-icon icon=${this.leadingIcon}></mo-icon>`;
|
|
103
|
+
}
|
|
104
|
+
get slotTemplate() {
|
|
105
|
+
return html `<slot ${style({ width: '*' })}></slot>`;
|
|
106
|
+
}
|
|
107
|
+
get trailingSlotTemplate() {
|
|
110
108
|
return html `
|
|
111
109
|
<slot name='trailing' slot='trailingIcon'>
|
|
112
110
|
${this.trailingIconTemplate}
|
|
113
111
|
</slot>
|
|
114
|
-
`;
|
|
115
|
-
}
|
|
116
|
-
get trailingIconTemplate() {
|
|
117
|
-
return !this.trailingIcon ? nothing : html `<mo-icon icon=${this.trailingIcon}></mo-icon>`;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
__decorate([
|
|
121
|
-
property({ reflect: true })
|
|
122
|
-
], Button.prototype, "type", void 0);
|
|
123
|
-
__decorate([
|
|
124
|
-
|
|
125
|
-
], Button.prototype, "disabled", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
property()
|
|
128
|
-
], Button.prototype, "leadingIcon", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
property()
|
|
131
|
-
], Button.prototype, "trailingIcon", void 0);
|
|
132
|
-
Button = __decorate([
|
|
133
|
-
component('mo-button')
|
|
134
|
-
], Button);
|
|
135
|
-
export { Button };
|
|
136
|
-
MwcButton.addInitializer(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
114
|
+
get trailingIconTemplate() {
|
|
115
|
+
return !this.trailingIcon ? nothing : html `<mo-icon icon=${this.trailingIcon}></mo-icon>`;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ reflect: true })
|
|
120
|
+
], Button.prototype, "type", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
disabledProperty()
|
|
123
|
+
], Button.prototype, "disabled", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property()
|
|
126
|
+
], Button.prototype, "leadingIcon", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
property()
|
|
129
|
+
], Button.prototype, "trailingIcon", void 0);
|
|
130
|
+
Button = __decorate([
|
|
131
|
+
component('mo-button')
|
|
132
|
+
], Button);
|
|
133
|
+
export { Button };
|
|
134
|
+
MwcButton.addInitializer(element => {
|
|
135
|
+
element.addController({
|
|
136
|
+
hostUpdated: () => {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
(_a = element.renderRoot.querySelector('button')) === null || _a === void 0 ? void 0 : _a.setAttribute('part', 'button');
|
|
139
|
+
(_b = element.renderRoot.querySelector('mwc-ripple')) === null || _b === void 0 ? void 0 : _b.setAttribute('part', 'ripple');
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
142
143
|
MwcButton.elementStyles.push(css `
|
|
143
144
|
:host {
|
|
144
145
|
display: inline-grid !important;
|
|
@@ -178,4 +179,4 @@ MwcButton.elementStyles.push(css `
|
|
|
178
179
|
height: unset;
|
|
179
180
|
width: unset;
|
|
180
181
|
}
|
|
181
|
-
`);
|
|
182
|
+
`);
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Component } from '@a11d/lit';
|
|
2
|
-
import { MaterialIcon } from './index.js';
|
|
3
|
-
export declare const enum IconVariant {
|
|
4
|
-
Filled = "filled",
|
|
5
|
-
Outlined = "outlined",
|
|
6
|
-
Sharp = "sharp",
|
|
7
|
-
Rounded = "rounded"
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @attr variant - The variant of the icon tied to a specific font.
|
|
11
|
-
* @attr icon - The icon to display.
|
|
12
|
-
*/
|
|
13
|
-
export declare class Icon extends Component {
|
|
14
|
-
static defaultVariant: IconVariant;
|
|
15
|
-
static readonly fontsByVariant: Map<IconVariant, {
|
|
16
|
-
name: string;
|
|
17
|
-
url: string;
|
|
18
|
-
}>;
|
|
19
|
-
private static readonly fontStyleElement;
|
|
20
|
-
private static readonly fontUrls;
|
|
21
|
-
private static get;
|
|
22
|
-
private static ensureAvailable;
|
|
23
|
-
variant: IconVariant;
|
|
24
|
-
icon?: MaterialIcon;
|
|
25
|
-
static get styles(): import("@a11d/lit").CSSResult;
|
|
26
|
-
protected get template(): import("lit-html").TemplateResult<1>;
|
|
27
|
-
}
|
|
28
|
-
declare global {
|
|
29
|
-
interface HTMLElementTagNameMap {
|
|
30
|
-
'mo-icon': Icon;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
import { Component } from '@a11d/lit';
|
|
2
|
+
import { type MaterialIcon } from './index.js';
|
|
3
|
+
export declare const enum IconVariant {
|
|
4
|
+
Filled = "filled",
|
|
5
|
+
Outlined = "outlined",
|
|
6
|
+
Sharp = "sharp",
|
|
7
|
+
Rounded = "rounded"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @attr variant - The variant of the icon tied to a specific font.
|
|
11
|
+
* @attr icon - The icon to display.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Icon extends Component {
|
|
14
|
+
static defaultVariant: IconVariant;
|
|
15
|
+
static readonly fontsByVariant: Map<IconVariant, {
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
}>;
|
|
19
|
+
private static readonly fontStyleElement;
|
|
20
|
+
private static readonly fontUrls;
|
|
21
|
+
private static get;
|
|
22
|
+
private static ensureAvailable;
|
|
23
|
+
variant: IconVariant;
|
|
24
|
+
icon?: MaterialIcon;
|
|
25
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
26
|
+
protected get template(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
'mo-icon': Icon;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
33
|
//# sourceMappingURL=Icon.d.ts.map
|
package/dist/Icon/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../Icon/Icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyC,MAAM,WAAW,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../Icon/Icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyC,MAAM,WAAW,CAAA;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,0BAAkB,WAAW;IAC5B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;CACnB;AAED;;;GAGG;AACH,qBACa,IAAK,SAAQ,SAAS;IAClC,MAAM,CAAC,cAAc,cAAqB;IAE1C,MAAM,CAAC,QAAQ,CAAC,cAAc;;;OAK5B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAkC;IAC1E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAOpD,OAAO,CAAC,MAAM,CAAC,GAAG;IAUlB,OAAO,CAAC,MAAM,CAAC,eAAe;IAW4C,OAAO,cAAsB;IAC3F,IAAI,CAAC,EAAE,YAAY,CAAA;IAE/B,WAAoB,MAAM,kCAuBzB;IAED,cAAuB,QAAQ,yCAI9B;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,SAAS,EAAE,IAAI,CAAA;KACf;CACD"}
|