@universal-material/web 3.0.0 → 3.0.1
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/README.md +28 -0
- package/button/button-base.d.ts +15 -9
- package/button/button-base.d.ts.map +1 -1
- package/button/button-base.js +46 -93
- package/button/button-base.js.map +1 -1
- package/button/button-base.styles.d.ts +2 -0
- package/button/button-base.styles.d.ts.map +1 -0
- package/button/button-base.styles.js +75 -0
- package/button/button-base.styles.js.map +1 -0
- package/button/button-set.d.ts +10 -2
- package/button/button-set.d.ts.map +1 -1
- package/button/button-set.js +27 -16
- package/button/button-set.js.map +1 -1
- package/button/button-set.styles.d.ts +2 -0
- package/button/button-set.styles.d.ts.map +1 -0
- package/button/button-set.styles.js +39 -0
- package/button/button-set.styles.js.map +1 -0
- package/button/button.d.ts +18 -4
- package/button/button.d.ts.map +1 -1
- package/button/button.js +29 -102
- package/button/button.js.map +1 -1
- package/button/button.styles.d.ts +2 -0
- package/button/button.styles.d.ts.map +1 -0
- package/button/button.styles.js +96 -0
- package/button/button.styles.js.map +1 -0
- package/button/fab.d.ts +14 -2
- package/button/fab.d.ts.map +1 -1
- package/button/fab.js +25 -106
- package/button/fab.js.map +1 -1
- package/button/fab.styles.d.ts +2 -0
- package/button/fab.styles.d.ts.map +1 -0
- package/button/fab.styles.js +89 -0
- package/button/fab.styles.js.map +1 -0
- package/button/icon-button.d.ts +3 -4
- package/button/icon-button.d.ts.map +1 -1
- package/button/icon-button.js +15 -89
- package/button/icon-button.js.map +1 -1
- package/button/icon-button.styles.d.ts +2 -0
- package/button/icon-button.styles.d.ts.map +1 -0
- package/button/icon-button.styles.js +70 -0
- package/button/icon-button.styles.js.map +1 -0
- package/card/card-content.d.ts +5 -3
- package/card/card-content.d.ts.map +1 -1
- package/card/card-content.js +33 -13
- package/card/card-content.js.map +1 -1
- package/card/card-content.styles.d.ts +2 -0
- package/card/card-content.styles.d.ts.map +1 -0
- package/card/card-content.styles.js +15 -0
- package/card/card-content.styles.js.map +1 -0
- package/card/card-media.d.ts +3 -3
- package/card/card-media.d.ts.map +1 -1
- package/card/card-media.js +9 -17
- package/card/card-media.js.map +1 -1
- package/card/card-media.styles.d.ts +2 -0
- package/card/card-media.styles.d.ts.map +1 -0
- package/card/card-media.styles.js +13 -0
- package/card/card-media.styles.js.map +1 -0
- package/card/card.d.ts +9 -6
- package/card/card.d.ts.map +1 -1
- package/card/card.js +22 -34
- package/card/card.js.map +1 -1
- package/card/card.styles.d.ts +2 -0
- package/card/card.styles.d.ts.map +1 -0
- package/card/card.styles.js +26 -0
- package/card/card.styles.js.map +1 -0
- package/checkbox/checkbox.d.ts +16 -0
- package/checkbox/checkbox.d.ts.map +1 -0
- package/checkbox/checkbox.js +75 -0
- package/checkbox/checkbox.js.map +1 -0
- package/container/container.d.ts +14 -0
- package/container/container.d.ts.map +1 -0
- package/container/container.js +23 -0
- package/container/container.js.map +1 -0
- package/container/container.styles.d.ts +2 -0
- package/container/container.styles.d.ts.map +1 -0
- package/container/container.styles.js +43 -0
- package/container/container.styles.js.map +1 -0
- package/custom-elements.json +3706 -0
- package/divider/divider.d.ts +5 -2
- package/divider/divider.d.ts.map +1 -1
- package/divider/divider.js +11 -19
- package/divider/divider.js.map +1 -1
- package/divider/divider.styles.d.ts +2 -0
- package/divider/divider.styles.d.ts.map +1 -0
- package/divider/divider.styles.js +15 -0
- package/divider/divider.styles.js.map +1 -0
- package/elevation/elevation.d.ts +4 -3
- package/elevation/elevation.d.ts.map +1 -1
- package/elevation/elevation.js +11 -37
- package/elevation/elevation.js.map +1 -1
- package/elevation/elevation.styles.d.ts +2 -0
- package/elevation/elevation.styles.d.ts.map +1 -0
- package/elevation/elevation.styles.js +28 -0
- package/elevation/elevation.styles.js.map +1 -0
- package/index.d.ts +23 -0
- package/index.d.ts.map +1 -0
- package/index.js +23 -0
- package/index.js.map +1 -0
- package/package.json +35 -26
- package/ripple/ripple.d.ts +11 -5
- package/ripple/ripple.d.ts.map +1 -1
- package/ripple/ripple.js +66 -120
- package/ripple/ripple.js.map +1 -1
- package/ripple/ripple.styles.d.ts +2 -0
- package/ripple/ripple.styles.d.ts.map +1 -0
- package/ripple/ripple.styles.js +74 -0
- package/ripple/ripple.styles.js.map +1 -0
- package/shared/base.styles.d.ts +2 -0
- package/shared/base.styles.d.ts.map +1 -0
- package/shared/base.styles.js +9 -0
- package/shared/base.styles.js.map +1 -0
- package/table/table-body.d.ts +11 -0
- package/table/table-body.d.ts.map +1 -0
- package/table/table-body.js +21 -0
- package/table/table-body.js.map +1 -0
- package/table/table-body.styles.d.ts +2 -0
- package/table/table-body.styles.d.ts.map +1 -0
- package/table/table-body.styles.js +11 -0
- package/table/table-body.styles.js.map +1 -0
- package/table/table-cell.d.ts +11 -0
- package/table/table-cell.d.ts.map +1 -0
- package/table/table-cell.js +21 -0
- package/table/table-cell.js.map +1 -0
- package/table/table-cell.styles.d.ts +2 -0
- package/table/table-cell.styles.d.ts.map +1 -0
- package/table/table-cell.styles.js +11 -0
- package/table/table-cell.styles.js.map +1 -0
- package/table/table-head.d.ts +11 -0
- package/table/table-head.d.ts.map +1 -0
- package/table/table-head.js +21 -0
- package/table/table-head.js.map +1 -0
- package/table/table-head.styles.d.ts +2 -0
- package/table/table-head.styles.d.ts.map +1 -0
- package/table/table-head.styles.js +11 -0
- package/table/table-head.styles.js.map +1 -0
- package/table/table-header-cell.d.ts +11 -0
- package/table/table-header-cell.d.ts.map +1 -0
- package/table/table-header-cell.js +21 -0
- package/table/table-header-cell.js.map +1 -0
- package/table/table-header-cell.styles.d.ts +2 -0
- package/table/table-header-cell.styles.d.ts.map +1 -0
- package/table/table-header-cell.styles.js +12 -0
- package/table/table-header-cell.styles.js.map +1 -0
- package/table/table-row.d.ts +11 -0
- package/table/table-row.d.ts.map +1 -0
- package/{card/button-set.js → table/table-row.js} +10 -15
- package/table/table-row.js.map +1 -0
- package/table/table-row.styles.d.ts +2 -0
- package/table/table-row.styles.d.ts.map +1 -0
- package/table/table-row.styles.js +7 -0
- package/table/table-row.styles.js.map +1 -0
- package/table/table.d.ts +16 -0
- package/table/table.d.ts.map +1 -0
- package/table/table.js +19 -0
- package/table/table.js.map +1 -0
- package/table/table.styles.d.ts +2 -0
- package/table/table.styles.d.ts.map +1 -0
- package/table/table.styles.js +16 -0
- package/table/table.styles.js.map +1 -0
- package/theme/color.d.ts +7 -0
- package/theme/color.d.ts.map +1 -0
- package/theme/color.js +2 -0
- package/theme/color.js.map +1 -0
- package/theme/css-var-builder.d.ts +9 -0
- package/theme/css-var-builder.d.ts.map +1 -0
- package/theme/css-var-builder.js +25 -0
- package/theme/css-var-builder.js.map +1 -0
- package/theme/index.d.ts +2 -0
- package/theme/index.d.ts.map +1 -0
- package/theme/index.js +2 -0
- package/theme/index.js.map +1 -0
- package/theme/neutral-colors.d.ts +4 -0
- package/theme/neutral-colors.d.ts.map +1 -0
- package/theme/neutral-colors.js +19 -0
- package/theme/neutral-colors.js.map +1 -0
- package/theme/rgb-color.d.ts +9 -0
- package/theme/rgb-color.d.ts.map +1 -0
- package/theme/rgb-color.js +13 -0
- package/theme/rgb-color.js.map +1 -0
- package/theme/theme-builder.d.ts +27 -0
- package/theme/theme-builder.d.ts.map +1 -0
- package/theme/theme-builder.js +146 -0
- package/theme/theme-builder.js.map +1 -0
- package/theme/theme-color.d.ts +6 -0
- package/theme/theme-color.d.ts.map +1 -0
- package/theme/theme-color.js +2 -0
- package/theme/theme-color.js.map +1 -0
- package/all.d.ts +0 -9
- package/all.d.ts.map +0 -1
- package/all.js +0 -9
- package/all.js.map +0 -1
- package/card/button-set.d.ts +0 -11
- package/card/button-set.d.ts.map +0 -1
- package/card/button-set.js.map +0 -1
- package/shared/area-hidden-element.d.ts +0 -5
- package/shared/area-hidden-element.d.ts.map +0 -1
- package/shared/area-hidden-element.js +0 -10
- package/shared/area-hidden-element.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Universal Material
|
|
2
|
+
|
|
3
|
+
### Getting started
|
|
4
|
+
|
|
5
|
+
#### Install
|
|
6
|
+
Install Universal Material components using [npm and node](https://nodejs.org/).
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
npm i @universal-material/web
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Import
|
|
13
|
+
Import element definitions from `@universal-material/web/<component>/<component-variant>.js` or import everything from `@universal-material/web`.
|
|
14
|
+
```
|
|
15
|
+
// index.js
|
|
16
|
+
import '@universal-material/web/button/button.js';
|
|
17
|
+
import '@universal-material/web/card/card.js';
|
|
18
|
+
import '@universal-material/web/checkbox/checkbox.js';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
https://universal-material.github.io
|
|
23
|
+
|
|
24
|
+
## Thanks
|
|
25
|
+
|
|
26
|
+
<img src="https://live.browserstack.com/images/opensource/browserstack-logo.svg" alt="BrowserStack Logo" width="490" height="106">
|
|
27
|
+
|
|
28
|
+
Thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers!
|
package/button/button-base.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../elevation/elevation';
|
|
3
|
-
import '../ripple/ripple';
|
|
1
|
+
import { HTMLTemplateResult, LitElement, nothing } from 'lit';
|
|
2
|
+
import '../elevation/elevation.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
4
|
export declare abstract class ButtonBase extends LitElement {
|
|
5
|
+
#private;
|
|
5
6
|
static readonly formAssociated = true;
|
|
6
|
-
static styles: CSSResult | CSSResult[];
|
|
7
7
|
/**
|
|
8
|
-
* Whether
|
|
8
|
+
* Whether the button is disabled or not.
|
|
9
9
|
*/
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
/**
|
|
@@ -16,11 +16,18 @@ export declare abstract class ButtonBase extends LitElement {
|
|
|
16
16
|
* Where to display the linked `href` URL for a link button. Common options
|
|
17
17
|
* include `_blank` to open in a new tab.
|
|
18
18
|
*/
|
|
19
|
-
target:
|
|
20
|
-
type:
|
|
21
|
-
|
|
19
|
+
target: string;
|
|
20
|
+
type: string;
|
|
21
|
+
value: string;
|
|
22
|
+
name: string | undefined;
|
|
22
23
|
private readonly buttonElement;
|
|
23
24
|
private readonly ripple;
|
|
25
|
+
/**
|
|
26
|
+
* The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)
|
|
27
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form
|
|
28
|
+
*/
|
|
29
|
+
get form(): HTMLFormElement | null;
|
|
30
|
+
constructor();
|
|
24
31
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
32
|
private renderButton;
|
|
26
33
|
private renderLink;
|
|
@@ -32,6 +39,5 @@ export declare abstract class ButtonBase extends LitElement {
|
|
|
32
39
|
protected getAriaLabel(): string | null | typeof nothing;
|
|
33
40
|
private innerHandleClick;
|
|
34
41
|
protected handleClick(_: UIEvent): void;
|
|
35
|
-
private getFormElement;
|
|
36
42
|
}
|
|
37
43
|
//# sourceMappingURL=button-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGpE,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC;AAG7B,8BAAsB,UAAW,SAAQ,UAAU;;IAEjD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC;;OAEG;IACuC,QAAQ,UAAS;IAE3D;;OAEG;IACS,IAAI,SAAM;IAEtB;;;OAGG;IACS,MAAM,EAAE,MAAM,CAAM;IAEpB,IAAI,EAAE,MAAM,CAAY;IAET,KAAK,EAAE,MAAM,CAAM;IAClC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEtD;;;OAGG;IACH,IACI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;;cASkB,MAAM;IAMzB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAelB,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,kBAAkB;IAE7C,iBAAiB;IAMjB,oBAAoB;IAMpB,KAAK;IAIL,IAAI;IAIb,SAAS,CAAC,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,OAAO,OAAO;IAIxD,OAAO,CAAC,gBAAgB;IA8BxB,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;CAGxC"}
|
package/button/button-base.js
CHANGED
|
@@ -4,15 +4,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
+
};
|
|
18
|
+
var _ButtonBase_elementInternals;
|
|
19
|
+
import { html, LitElement, nothing } from 'lit';
|
|
8
20
|
import { property, query } from 'lit/decorators.js';
|
|
9
|
-
import '../elevation/elevation';
|
|
10
|
-
import '../ripple/ripple';
|
|
21
|
+
import '../elevation/elevation.js';
|
|
22
|
+
import '../ripple/ripple.js';
|
|
11
23
|
export class ButtonBase extends LitElement {
|
|
24
|
+
/**
|
|
25
|
+
* The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)
|
|
26
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form
|
|
27
|
+
*/
|
|
28
|
+
get form() {
|
|
29
|
+
return __classPrivateFieldGet(this, _ButtonBase_elementInternals, "f").form;
|
|
30
|
+
}
|
|
12
31
|
constructor() {
|
|
13
|
-
super(
|
|
32
|
+
super();
|
|
14
33
|
/**
|
|
15
|
-
* Whether
|
|
34
|
+
* Whether the button is disabled or not.
|
|
16
35
|
*/
|
|
17
36
|
this.disabled = false;
|
|
18
37
|
/**
|
|
@@ -25,8 +44,9 @@ export class ButtonBase extends LitElement {
|
|
|
25
44
|
*/
|
|
26
45
|
this.target = '';
|
|
27
46
|
this.type = 'submit';
|
|
28
|
-
|
|
29
|
-
this
|
|
47
|
+
this.value = '';
|
|
48
|
+
_ButtonBase_elementInternals.set(this, void 0);
|
|
49
|
+
__classPrivateFieldSet(this, _ButtonBase_elementInternals, this.attachInternals(), "f");
|
|
30
50
|
}
|
|
31
51
|
render() {
|
|
32
52
|
return this.href
|
|
@@ -34,7 +54,6 @@ export class ButtonBase extends LitElement {
|
|
|
34
54
|
: this.renderButton();
|
|
35
55
|
}
|
|
36
56
|
renderButton() {
|
|
37
|
-
// Needed for closure conformance
|
|
38
57
|
return html `
|
|
39
58
|
<button
|
|
40
59
|
id="button"
|
|
@@ -42,14 +61,12 @@ export class ButtonBase extends LitElement {
|
|
|
42
61
|
?disabled=${this.disabled}
|
|
43
62
|
aria-label="${this.getAriaLabel()}"
|
|
44
63
|
type="button">
|
|
45
|
-
<u-elevation></u-elevation>
|
|
46
64
|
<u-ripple ?disabled=${this.disabled}></u-ripple>
|
|
47
|
-
|
|
48
|
-
</button
|
|
65
|
+
<u-elevation></u-elevation>
|
|
66
|
+
</button>
|
|
67
|
+
${this.renderContent()}`;
|
|
49
68
|
}
|
|
50
69
|
renderLink() {
|
|
51
|
-
// Needed for closure conformance
|
|
52
|
-
// const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;
|
|
53
70
|
return html `<a
|
|
54
71
|
id="link"
|
|
55
72
|
class="button"
|
|
@@ -59,8 +76,8 @@ export class ButtonBase extends LitElement {
|
|
|
59
76
|
target=${this.target || nothing}>
|
|
60
77
|
<u-elevation></u-elevation>
|
|
61
78
|
<u-ripple ?disabled=${this.disabled}></u-ripple>
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
</a>
|
|
80
|
+
${this.renderContent()}`;
|
|
64
81
|
}
|
|
65
82
|
connectedCallback() {
|
|
66
83
|
super.connectedCallback();
|
|
@@ -90,91 +107,21 @@ export class ButtonBase extends LitElement {
|
|
|
90
107
|
if (this.type === 'button' || !!this.href) {
|
|
91
108
|
return;
|
|
92
109
|
}
|
|
93
|
-
|
|
110
|
+
if (!this.form) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
__classPrivateFieldGet(this, _ButtonBase_elementInternals, "f").setFormValue(this.value);
|
|
94
114
|
if (this.type === 'submit') {
|
|
95
|
-
|
|
115
|
+
this.form.requestSubmit();
|
|
96
116
|
return;
|
|
97
117
|
}
|
|
98
|
-
|
|
118
|
+
this.form.reset();
|
|
99
119
|
}
|
|
100
120
|
handleClick(_) {
|
|
101
121
|
}
|
|
102
|
-
getFormElement() {
|
|
103
|
-
if (!this.form) {
|
|
104
|
-
return this.closest('FORM');
|
|
105
|
-
}
|
|
106
|
-
return document.getElementById(this.form);
|
|
107
|
-
}
|
|
108
122
|
}
|
|
123
|
+
_ButtonBase_elementInternals = new WeakMap();
|
|
109
124
|
ButtonBase.formAssociated = true;
|
|
110
|
-
ButtonBase.styles = css `
|
|
111
|
-
|
|
112
|
-
:host {
|
|
113
|
-
--_primary-color: var(--u-primary-color, #6750a4);
|
|
114
|
-
--_shadow-color-rgb: var(--u-shadow-color-rgb, 0,0,0);
|
|
115
|
-
|
|
116
|
-
-webkit-tap-highlight-color: transparent;
|
|
117
|
-
display: inline-block;
|
|
118
|
-
vertical-align: baseline;
|
|
119
|
-
transition: color 150ms ease-in-out, background-color 150ms ease-in-out;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host([disabled]) {
|
|
123
|
-
--u-elevation-level: 0 !important;
|
|
124
|
-
background-color: var(--u-button-disabled-background-color, rgba(var(--u-on-surface-color-rgb, 29, 27, 32), .12)) !important;
|
|
125
|
-
color: var(--u-button-disabled-text-color, rgba(var(--u-on-surface-color-rgb, 29, 27, 32), .38)) !important;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
:host([disabled]) .button {
|
|
129
|
-
cursor: default;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
* {
|
|
133
|
-
color: inherit;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
u-elevation {
|
|
137
|
-
z-index: -1;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.button {
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
display: flex;
|
|
143
|
-
align-items: center;
|
|
144
|
-
justify-content: center;
|
|
145
|
-
position: relative;
|
|
146
|
-
width: 100%;
|
|
147
|
-
height: 100%;
|
|
148
|
-
margin: 0;
|
|
149
|
-
font-family: inherit;
|
|
150
|
-
border-radius: inherit;
|
|
151
|
-
color: inherit;
|
|
152
|
-
border: none;
|
|
153
|
-
text-align: center;
|
|
154
|
-
white-space: nowrap;
|
|
155
|
-
background: transparent;
|
|
156
|
-
user-select: none;
|
|
157
|
-
text-decoration: none;
|
|
158
|
-
outline: 0;
|
|
159
|
-
z-index: 0;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.button:focus-visible {
|
|
163
|
-
animation: offset-pulse 400ms ease;
|
|
164
|
-
animation-fill-mode: forwards;
|
|
165
|
-
outline-offset: 2px;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
::slotted([slot=icon]) {
|
|
169
|
-
display: inline-block;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@keyframes offset-pulse {
|
|
173
|
-
0% {outline: 4px solid var(--u-primary-color, #6750a4)}
|
|
174
|
-
50% {outline: 8px solid var(--u-primary-color, #6750a4)}
|
|
175
|
-
100% {outline: 4px solid var(--u-primary-color, #6750a4)}
|
|
176
|
-
}
|
|
177
|
-
`;
|
|
178
125
|
__decorate([
|
|
179
126
|
property({ type: Boolean, reflect: true })
|
|
180
127
|
], ButtonBase.prototype, "disabled", void 0);
|
|
@@ -187,13 +134,19 @@ __decorate([
|
|
|
187
134
|
__decorate([
|
|
188
135
|
property()
|
|
189
136
|
], ButtonBase.prototype, "type", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ reflect: true })
|
|
139
|
+
], ButtonBase.prototype, "value", void 0);
|
|
190
140
|
__decorate([
|
|
191
141
|
property()
|
|
192
|
-
], ButtonBase.prototype, "
|
|
142
|
+
], ButtonBase.prototype, "name", void 0);
|
|
193
143
|
__decorate([
|
|
194
144
|
query('.button')
|
|
195
145
|
], ButtonBase.prototype, "buttonElement", void 0);
|
|
196
146
|
__decorate([
|
|
197
147
|
query('u-ripple')
|
|
198
148
|
], ButtonBase.prototype, "ripple", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
property()
|
|
151
|
+
], ButtonBase.prototype, "form", null);
|
|
199
152
|
//# sourceMappingURL=button-base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"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","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport '../elevation/elevation.js';\nimport '../ripple/ripple.js';\nimport { UmRipple } from '../ripple/ripple';\n\nexport abstract class ButtonBase extends LitElement {\n\n static readonly formAssociated = true;\n\n /**\n * Whether the button is disabled or not.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * Where to display the linked `href` URL for a link button. Common options\n * include `_blank` to open in a new tab.\n */\n @property() target: string = '';\n\n @property() type: string = 'submit';\n\n @property({reflect: true}) value: string = '';\n @property() name: string | undefined;\n\n @query('.button') private readonly buttonElement!: HTMLElement;\n @query('u-ripple') private readonly ripple!: UmRipple;\n\n /**\n * The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)\n * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form\n */\n @property()\n get form(): HTMLFormElement | null {\n return this.#elementInternals.form;\n }\n\n readonly #elementInternals: ElementInternals;\n\n constructor() {\n super();\n this.#elementInternals = this.attachInternals();\n }\n\n protected override render() {\n return this.href\n ? this.renderLink()\n : this.renderButton();\n }\n\n private renderButton() {\n\n return html`\n <button\n id=\"button\"\n class=\"button\"\n ?disabled=${this.disabled}\n aria-label=\"${this.getAriaLabel()}\"\n type=\"button\">\n <u-ripple ?disabled=${this.disabled}></u-ripple>\n <u-elevation></u-elevation>\n </button>\n ${this.renderContent()}`;\n }\n\n private renderLink() {\n\n return html`<a\n id=\"link\"\n class=\"button\"\n href=${this.disabled ? nothing : this.href}\n aria-disabled=${this.disabled || nothing}\n aria-label=\"${this.getAriaLabel()}\"\n target=${this.target || nothing}>\n <u-elevation></u-elevation>\n <u-ripple ?disabled=${this.disabled}></u-ripple>\n </a>\n ${this.renderContent()}`;\n }\n\n protected abstract renderContent(): HTMLTemplateResult;\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('click', this.innerHandleClick);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('click', this.innerHandleClick);\n }\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n protected getAriaLabel(): string | null | typeof nothing {\n return this.ariaLabel || nothing;\n }\n\n private innerHandleClick(event: UIEvent): void {\n\n if (this.disabled) {\n return;\n }\n\n if (event.detail === 0) {\n this.ripple.createRipple();\n }\n\n this.handleClick(event);\n\n if (this.type === 'button' || !!this.href) {\n return;\n }\n\n if (!this.form) {\n return;\n }\n\n this.#elementInternals.setFormValue(this.value);\n\n if (this.type === 'submit') {\n this.form.requestSubmit();\n return;\n }\n\n this.form.reset();\n }\n\n protected handleClick(_: UIEvent): void {\n\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-base.styles.d.ts","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAwElB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
5
|
+
-webkit-tap-highlight-color: transparent;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
vertical-align: baseline;
|
|
10
|
+
position: relative;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
font-family: var(--u-font-family-base, system-ui);
|
|
13
|
+
transition: color 150ms ease-in-out, background-color 150ms ease-in-out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
--u-elevation-level: 0 !important;
|
|
18
|
+
background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface, 29, 27, 32), 0.12)) !important;
|
|
19
|
+
color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface, 29, 27, 32), 0.38)) !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([disabled]) .button {
|
|
23
|
+
cursor: default;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
* {
|
|
27
|
+
color: inherit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
u-elevation {
|
|
31
|
+
z-index: -1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.button {
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
border-radius: inherit;
|
|
40
|
+
color: inherit;
|
|
41
|
+
border: none;
|
|
42
|
+
margin: 0;
|
|
43
|
+
padding: 0;
|
|
44
|
+
text-align: center;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
background: transparent;
|
|
47
|
+
user-select: none;
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
outline: 0;
|
|
50
|
+
z-index: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.button:focus-visible {
|
|
54
|
+
animation: offset-pulse 400ms ease;
|
|
55
|
+
animation-fill-mode: forwards;
|
|
56
|
+
outline-offset: 2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::slotted([slot=icon]) {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes offset-pulse {
|
|
64
|
+
0% {
|
|
65
|
+
outline: 4px solid var(--_color-primary);
|
|
66
|
+
}
|
|
67
|
+
50% {
|
|
68
|
+
outline: 8px solid var(--_color-primary);
|
|
69
|
+
}
|
|
70
|
+
100% {
|
|
71
|
+
outline: 4px solid var(--_color-primary);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
//# sourceMappingURL=button-base.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-base.styles.js","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n -webkit-tap-highlight-color: transparent;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: baseline;\n position: relative;\n white-space: nowrap;\n font-family: var(--u-font-family-base, system-ui);\n transition: color 150ms ease-in-out, background-color 150ms ease-in-out;\n }\n\n :host([disabled]) {\n --u-elevation-level: 0 !important;\n background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface, 29, 27, 32), 0.12)) !important;\n color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface, 29, 27, 32), 0.38)) !important;\n }\n\n :host([disabled]) .button {\n cursor: default;\n }\n\n * {\n color: inherit;\n }\n\n u-elevation {\n z-index: -1;\n }\n\n .button {\n cursor: pointer;\n position: absolute;\n inset: 0;\n font-family: inherit;\n border-radius: inherit;\n color: inherit;\n border: none;\n margin: 0;\n padding: 0;\n text-align: center;\n white-space: nowrap;\n background: transparent;\n user-select: none;\n text-decoration: none;\n outline: 0;\n z-index: 0;\n }\n\n .button:focus-visible {\n animation: offset-pulse 400ms ease;\n animation-fill-mode: forwards;\n outline-offset: 2px;\n }\n\n ::slotted([slot=icon]) {\n display: inline-block;\n }\n\n @keyframes offset-pulse {\n 0% {\n outline: 4px solid var(--_color-primary);\n }\n 50% {\n outline: 8px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n`;\n"]}
|
package/button/button-set.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class UmButtonSet extends LitElement {
|
|
3
3
|
static styles: import("lit").CSSResult;
|
|
4
|
+
/**
|
|
5
|
+
* Set the alignment of the buttons at the `start`, `center` or at the `end`.
|
|
6
|
+
*/
|
|
7
|
+
align: 'start' | 'center' | 'end';
|
|
8
|
+
/**
|
|
9
|
+
* Whether to render the buttons stacked or not
|
|
10
|
+
*/
|
|
11
|
+
stack: boolean;
|
|
4
12
|
render(): HTMLTemplateResult;
|
|
5
13
|
}
|
|
6
14
|
declare global {
|
|
7
15
|
interface HTMLElementTagNameMap {
|
|
8
|
-
'u-button-set':
|
|
16
|
+
'u-button-set': UmButtonSet;
|
|
9
17
|
}
|
|
10
18
|
}
|
|
11
19
|
//# sourceMappingURL=button-set.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-set.d.ts","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button-set.d.ts","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAK3D,qBACa,WAAY,SAAQ,UAAU;IAEzC,OAAgB,MAAM,0BAAU;IAEhC;;OAEG;IACwB,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAS;IAErE;;OAEG;IACuC,KAAK,UAAS;IAE/C,MAAM,IAAI,kBAAkB;CAItC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
package/button/button-set.js
CHANGED
|
@@ -4,24 +4,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
8
|
-
import { customElement } from 'lit/decorators.js';
|
|
9
|
-
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { styles } from './button-set.styles';
|
|
10
|
+
let UmButtonSet = class UmButtonSet extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Set the alignment of the buttons at the `start`, `center` or at the `end`.
|
|
15
|
+
*/
|
|
16
|
+
this.align = 'end';
|
|
17
|
+
/**
|
|
18
|
+
* Whether to render the buttons stacked or not
|
|
19
|
+
*/
|
|
20
|
+
this.stack = false;
|
|
21
|
+
}
|
|
10
22
|
render() {
|
|
11
|
-
return html
|
|
23
|
+
return html `
|
|
24
|
+
<slot></slot>`;
|
|
12
25
|
}
|
|
13
26
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`;
|
|
23
|
-
ButtonSet = __decorate([
|
|
27
|
+
UmButtonSet.styles = styles;
|
|
28
|
+
__decorate([
|
|
29
|
+
property({ reflect: true })
|
|
30
|
+
], UmButtonSet.prototype, "align", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
property({ type: Boolean, reflect: true })
|
|
33
|
+
], UmButtonSet.prototype, "stack", void 0);
|
|
34
|
+
UmButtonSet = __decorate([
|
|
24
35
|
customElement('u-button-set')
|
|
25
|
-
],
|
|
26
|
-
export {
|
|
36
|
+
], UmButtonSet);
|
|
37
|
+
export { UmButtonSet };
|
|
27
38
|
//# sourceMappingURL=button-set.js.map
|
package/button/button-set.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-set.js","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button-set.js","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAIL;;WAEG;QACwB,UAAK,GAA+B,KAAK,CAAC;QAErE;;WAEG;QACuC,UAAK,GAAG,KAAK,CAAC;IAM1D,CAAC;IAJU,MAAM;QACb,OAAO,IAAI,CAAA;oBACK,CAAC;IACnB,CAAC;;AAfe,kBAAM,GAAG,MAAM,AAAT,CAAU;AAKL;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;0CAA2C;AAK3B;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAe;AAZ7C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAkBvB","sourcesContent":["import { html, HTMLTemplateResult, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './button-set.styles';\n\n@customElement('u-button-set')\nexport class UmButtonSet extends LitElement {\n\n static override styles = styles;\n\n /**\n * Set the alignment of the buttons at the `start`, `center` or at the `end`.\n */\n @property({reflect: true}) align: 'start' | 'center' | 'end' = 'end';\n\n /**\n * Whether to render the buttons stacked or not\n */\n @property({type: Boolean, reflect: true}) stack = false;\n\n override render(): HTMLTemplateResult {\n return html`\n <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button-set': UmButtonSet;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.styles.d.ts","sourceRoot":"","sources":["../../src/button/button-set.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAoClB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
align-items: center;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([align=start]) {
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([align=center]) {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([align=end]) {
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([stack][align=start]) {
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([stack][align=center]) {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([stack][align=end]) {
|
|
31
|
+
align-items: flex-end;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([stack]) {
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
//# sourceMappingURL=button-set.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.styles.js","sourceRoot":"","sources":["../../src/button/button-set.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: flex;\n gap: 8px;\n align-items: center;\n flex-wrap: wrap;\n }\n\n :host([align=start]) {\n justify-content: flex-start;\n }\n\n :host([align=center]) {\n justify-content: center;\n }\n\n :host([align=end]) {\n justify-content: flex-end;\n }\n\n :host([stack][align=start]) {\n align-items: flex-start;\n }\n\n :host([stack][align=center]) {\n align-items: center;\n }\n\n :host([stack][align=end]) {\n align-items: flex-end;\n }\n\n :host([stack]) {\n flex-direction: column;\n justify-content: flex-start;\n }\n`;\n"]}
|
package/button/button.d.ts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { CSSResult, HTMLTemplateResult } from 'lit';
|
|
2
|
-
import '../ripple/ripple';
|
|
3
2
|
import { ButtonBase } from './button-base';
|
|
4
|
-
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
export declare class UmButton extends ButtonBase {
|
|
5
5
|
static styles: CSSResult | CSSResult[];
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The Button variant to render
|
|
8
|
+
*/
|
|
9
|
+
variant: 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
10
|
+
/**
|
|
11
|
+
* The Button color
|
|
12
|
+
*
|
|
13
|
+
* _Note:_ Filled buttons only
|
|
14
|
+
*/
|
|
15
|
+
color: 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;
|
|
7
16
|
trailingIcon: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the button has icon or not
|
|
19
|
+
*
|
|
20
|
+
* _Note:_ Readonly
|
|
21
|
+
*/
|
|
8
22
|
hasIcon: boolean;
|
|
9
23
|
private readonly assignedIcons;
|
|
10
24
|
protected renderContent(): HTMLTemplateResult;
|
|
@@ -12,7 +26,7 @@ export declare class Button extends ButtonBase {
|
|
|
12
26
|
}
|
|
13
27
|
declare global {
|
|
14
28
|
interface HTMLElementTagNameMap {
|
|
15
|
-
'u-button':
|
|
29
|
+
'u-button': UmButton;
|
|
16
30
|
}
|
|
17
31
|
}
|
|
18
32
|
//# sourceMappingURL=button.d.ts.map
|
package/button/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,qBAAqB,CAAC;AAE7B,qBACa,QAAS,SAAQ,UAAU;IAEtC,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAA8B;IAE7E;;OAEG;IACwB,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAY;IAErG;;;;OAIG;IACwB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;IAEvB,YAAY,UAAS;IAE3F;;;;OAIG;IAC8D,OAAO,UAAS;IAGjF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;cAE5B,aAAa,IAAI,kBAAkB;IActD,OAAO,CAAC,gBAAgB;CAGzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,QAAQ,CAAC;KACtB;CACF"}
|