@3mo/button 0.2.4 → 0.2.6
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 +47 -47
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button.d.ts +47 -47
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +82 -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,48 @@
|
|
|
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
|
-
export declare class Button extends Component {
|
|
28
|
-
type: ButtonType;
|
|
29
|
-
disabled: boolean;
|
|
30
|
-
leadingIcon?: MaterialIcon;
|
|
31
|
-
trailingIcon?: MaterialIcon;
|
|
32
|
-
static get styles(): import("@a11d/lit").CSSResult;
|
|
33
|
-
protected readonly instanceofAttributeController: InstanceofAttributeController;
|
|
34
|
-
protected get template(): import("lit-html").TemplateResult<1>;
|
|
35
|
-
protected get isDisabled(): boolean;
|
|
36
|
-
protected get contentTemplate(): import("lit-html").TemplateResult<1>;
|
|
37
|
-
protected get leadingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
38
|
-
protected get leadingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
39
|
-
protected get slotTemplate(): import("lit-html").TemplateResult<1>;
|
|
40
|
-
protected get trailingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
41
|
-
protected get trailingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
42
|
-
}
|
|
43
|
-
declare global {
|
|
44
|
-
interface HTMLElementTagNameMap {
|
|
45
|
-
'mo-button': Button;
|
|
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
|
+
*/
|
|
27
|
+
export declare class Button extends Component {
|
|
28
|
+
type: ButtonType;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
leadingIcon?: MaterialIcon;
|
|
31
|
+
trailingIcon?: MaterialIcon;
|
|
32
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
33
|
+
protected readonly instanceofAttributeController: InstanceofAttributeController;
|
|
34
|
+
protected get template(): import("lit-html").TemplateResult<1>;
|
|
35
|
+
protected get isDisabled(): boolean;
|
|
36
|
+
protected get contentTemplate(): import("lit-html").TemplateResult<1>;
|
|
37
|
+
protected get leadingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
protected get leadingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
39
|
+
protected get slotTemplate(): import("lit-html").TemplateResult<1>;
|
|
40
|
+
protected get trailingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
41
|
+
protected get trailingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
'mo-button': Button;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
48
|
//# 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;;;;;;;;;;;;;;;;GAgBG;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;AAWD,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,48 @@
|
|
|
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
|
-
export declare class Button extends Component {
|
|
28
|
-
type: ButtonType;
|
|
29
|
-
disabled: boolean;
|
|
30
|
-
leadingIcon?: MaterialIcon;
|
|
31
|
-
trailingIcon?: MaterialIcon;
|
|
32
|
-
static get styles(): import("@a11d/lit").CSSResult;
|
|
33
|
-
protected readonly instanceofAttributeController: InstanceofAttributeController;
|
|
34
|
-
protected get template(): import("lit-html").TemplateResult<1>;
|
|
35
|
-
protected get isDisabled(): boolean;
|
|
36
|
-
protected get contentTemplate(): import("lit-html").TemplateResult<1>;
|
|
37
|
-
protected get leadingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
38
|
-
protected get leadingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
39
|
-
protected get slotTemplate(): import("lit-html").TemplateResult<1>;
|
|
40
|
-
protected get trailingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
41
|
-
protected get trailingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
42
|
-
}
|
|
43
|
-
declare global {
|
|
44
|
-
interface HTMLElementTagNameMap {
|
|
45
|
-
'mo-button': Button;
|
|
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
|
+
*/
|
|
27
|
+
export declare class Button extends Component {
|
|
28
|
+
type: ButtonType;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
leadingIcon?: MaterialIcon;
|
|
31
|
+
trailingIcon?: MaterialIcon;
|
|
32
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
33
|
+
protected readonly instanceofAttributeController: InstanceofAttributeController;
|
|
34
|
+
protected get template(): import("lit-html").TemplateResult<1>;
|
|
35
|
+
protected get isDisabled(): boolean;
|
|
36
|
+
protected get contentTemplate(): import("lit-html").TemplateResult<1>;
|
|
37
|
+
protected get leadingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
protected get leadingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
39
|
+
protected get slotTemplate(): import("lit-html").TemplateResult<1>;
|
|
40
|
+
protected get trailingSlotTemplate(): import("lit-html").TemplateResult<1>;
|
|
41
|
+
protected get trailingIconTemplate(): import("lit-html").HTMLTemplateResult;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
'mo-button': Button;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
48
|
//# 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;;;;;;;;;;;;;;;;GAgBG;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;AAkDD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,MAAM,CAAA;KACnB;CACD"}
|
package/dist/Button.js
CHANGED
|
@@ -1,42 +1,40 @@
|
|
|
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
|
-
this.
|
|
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
|
+
*/
|
|
23
|
+
let Button = class Button extends Component {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.type = "normal" /* ButtonType.Normal */;
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
this.instanceofAttributeController = new InstanceofAttributeController(this);
|
|
29
|
+
}
|
|
30
|
+
static get styles() {
|
|
30
31
|
return css `
|
|
31
32
|
:host {
|
|
32
33
|
display: inline-block;
|
|
33
34
|
text-transform: uppercase;
|
|
34
35
|
text-align: center;
|
|
35
36
|
border-radius: var(--mo-border-radius, 4px);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
:host([disabled]) {
|
|
39
|
-
pointer-events: none;
|
|
37
|
+
min-height: 36px;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
:host([type=normal]) mwc-button {
|
|
@@ -58,7 +56,7 @@ let Button = class Button extends Component {
|
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
mwc-button {
|
|
61
|
-
min-height:
|
|
59
|
+
min-height: inherit;
|
|
62
60
|
text-align: inherit;
|
|
63
61
|
--mdc-button-horizontal-padding: var(--mo-button-horizontal-padding, var(--mo-button-default-horizontal-padding));
|
|
64
62
|
--mdc-theme-primary: var(--mo-button-accent-color, var(--mo-color-accent, #0077c8));
|
|
@@ -68,9 +66,9 @@ let Button = class Button extends Component {
|
|
|
68
66
|
--mdc-button-disabled-outline-color: var(--mo-button-disabled-color, var(--mo-color-gray-transparent));
|
|
69
67
|
--mdc-shape-small: inherit;
|
|
70
68
|
}
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
get template() {
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
get template() {
|
|
74
72
|
return html `
|
|
75
73
|
<mwc-button exportparts='button' expandContent
|
|
76
74
|
?raised=${this.type === "raised" /* ButtonType.Raised */}
|
|
@@ -80,64 +78,64 @@ let Button = class Button extends Component {
|
|
|
80
78
|
>
|
|
81
79
|
${this.contentTemplate}
|
|
82
80
|
</mwc-button>
|
|
83
|
-
`;
|
|
84
|
-
}
|
|
85
|
-
get isDisabled() {
|
|
86
|
-
return this.disabled;
|
|
87
|
-
}
|
|
88
|
-
get contentTemplate() {
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
get isDisabled() {
|
|
84
|
+
return this.disabled;
|
|
85
|
+
}
|
|
86
|
+
get contentTemplate() {
|
|
89
87
|
return html `
|
|
90
88
|
${this.leadingSlotTemplate}
|
|
91
89
|
${this.slotTemplate}
|
|
92
90
|
${this.trailingSlotTemplate}
|
|
93
|
-
`;
|
|
94
|
-
}
|
|
95
|
-
get leadingSlotTemplate() {
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
get leadingSlotTemplate() {
|
|
96
94
|
return html `
|
|
97
95
|
<slot name='leading' slot='icon'>
|
|
98
96
|
${this.leadingIconTemplate}
|
|
99
97
|
</slot>
|
|
100
|
-
`;
|
|
101
|
-
}
|
|
102
|
-
get leadingIconTemplate() {
|
|
103
|
-
return !this.leadingIcon ? nothing : html `<mo-icon icon=${this.leadingIcon}></mo-icon>`;
|
|
104
|
-
}
|
|
105
|
-
get slotTemplate() {
|
|
106
|
-
return html `<slot ${style({ width: '*' })}></slot>`;
|
|
107
|
-
}
|
|
108
|
-
get trailingSlotTemplate() {
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
get leadingIconTemplate() {
|
|
101
|
+
return !this.leadingIcon ? nothing : html `<mo-icon icon=${this.leadingIcon}></mo-icon>`;
|
|
102
|
+
}
|
|
103
|
+
get slotTemplate() {
|
|
104
|
+
return html `<slot ${style({ width: '*' })}></slot>`;
|
|
105
|
+
}
|
|
106
|
+
get trailingSlotTemplate() {
|
|
109
107
|
return html `
|
|
110
108
|
<slot name='trailing' slot='trailingIcon'>
|
|
111
109
|
${this.trailingIconTemplate}
|
|
112
110
|
</slot>
|
|
113
|
-
`;
|
|
114
|
-
}
|
|
115
|
-
get trailingIconTemplate() {
|
|
116
|
-
return !this.trailingIcon ? nothing : html `<mo-icon icon=${this.trailingIcon}></mo-icon>`;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
__decorate([
|
|
120
|
-
property({ reflect: true })
|
|
121
|
-
], Button.prototype, "type", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
|
|
124
|
-
], Button.prototype, "disabled", void 0);
|
|
125
|
-
__decorate([
|
|
126
|
-
property()
|
|
127
|
-
], Button.prototype, "leadingIcon", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
property()
|
|
130
|
-
], Button.prototype, "trailingIcon", void 0);
|
|
131
|
-
Button = __decorate([
|
|
132
|
-
component('mo-button')
|
|
133
|
-
], Button);
|
|
134
|
-
export { Button };
|
|
135
|
-
MwcButton.addInitializer(async (element) => {
|
|
136
|
-
var _a;
|
|
137
|
-
const button = element;
|
|
138
|
-
await button.updateComplete;
|
|
139
|
-
(_a = button.renderRoot.querySelector('button')) === null || _a === void 0 ? void 0 : _a.setAttribute('part', 'button');
|
|
140
|
-
});
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
get trailingIconTemplate() {
|
|
114
|
+
return !this.trailingIcon ? nothing : html `<mo-icon icon=${this.trailingIcon}></mo-icon>`;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
__decorate([
|
|
118
|
+
property({ reflect: true })
|
|
119
|
+
], Button.prototype, "type", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
disabledProperty()
|
|
122
|
+
], Button.prototype, "disabled", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property()
|
|
125
|
+
], Button.prototype, "leadingIcon", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
property()
|
|
128
|
+
], Button.prototype, "trailingIcon", void 0);
|
|
129
|
+
Button = __decorate([
|
|
130
|
+
component('mo-button')
|
|
131
|
+
], Button);
|
|
132
|
+
export { Button };
|
|
133
|
+
MwcButton.addInitializer(async (element) => {
|
|
134
|
+
var _a;
|
|
135
|
+
const button = element;
|
|
136
|
+
await button.updateComplete;
|
|
137
|
+
(_a = button.renderRoot.querySelector('button')) === null || _a === void 0 ? void 0 : _a.setAttribute('part', 'button');
|
|
138
|
+
});
|
|
141
139
|
MwcButton.elementStyles.push(css `
|
|
142
140
|
:host {
|
|
143
141
|
display: inline-grid !important;
|
|
@@ -177,4 +175,4 @@ MwcButton.elementStyles.push(css `
|
|
|
177
175
|
height: unset;
|
|
178
176
|
width: unset;
|
|
179
177
|
}
|
|
180
|
-
`);
|
|
178
|
+
`);
|
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"}
|