@fluid-topics/ft-button 1.3.45 → 1.3.46
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/build/ft-base-button.d.ts +1 -1
- package/build/ft-base-button.js +9 -11
- package/build/ft-button.d.ts +2 -0
- package/build/ft-button.js +6 -1
- package/build/ft-button.light.js +111 -93
- package/build/ft-button.min.js +132 -114
- package/build/ftds-button.d.ts +2 -0
- package/build/ftds-button.js +10 -6
- package/package.json +8 -8
|
@@ -52,7 +52,7 @@ export declare class FtBaseButton extends FtBaseButton_base implements FtBaseBut
|
|
|
52
52
|
private setTooltipManual;
|
|
53
53
|
click(): void;
|
|
54
54
|
private getLabel;
|
|
55
|
-
|
|
55
|
+
getTextContent(): string;
|
|
56
56
|
protected hasTextContent(): boolean;
|
|
57
57
|
private onSlotchange;
|
|
58
58
|
private isDisabled;
|
package/build/ft-base-button.js
CHANGED
|
@@ -7,7 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { FtLitElement, isSafari, toFtFormComponent, unslotText } from "@fluid-topics/ft-wc-utils";
|
|
8
8
|
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
9
9
|
import { FtTooltip } from "@fluid-topics/ft-tooltip";
|
|
10
|
-
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
11
10
|
import { FtIcon } from "@fluid-topics/ft-icon";
|
|
12
11
|
import { FtLoader } from "@fluid-topics/ft-loader";
|
|
13
12
|
import { html } from "lit";
|
|
@@ -56,13 +55,13 @@ class FtBaseButton extends toFtFormComponent(FtLitElement) {
|
|
|
56
55
|
?disabled=${this.isDisabled()}
|
|
57
56
|
?activated=${this.activated}
|
|
58
57
|
></ft-ripple>
|
|
59
|
-
<ft-typography part="label"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
<ft-or-ftds-typography part="label"
|
|
59
|
+
variant="${this.typographyVariant}"
|
|
60
|
+
element="span"
|
|
61
|
+
class="ft-button--label ${isSafari ? "ft-safari-ellipsis-fix" : ""}"
|
|
62
|
+
?hidden=${!this.hasTextContent()}>
|
|
64
63
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
65
|
-
</ft-typography>
|
|
64
|
+
</ft-or-ftds-typography>
|
|
66
65
|
${this.resolveIcon()}
|
|
67
66
|
`;
|
|
68
67
|
const href = this.href != null && this.href.trim().length > 0 ? this.href : undefined;
|
|
@@ -131,13 +130,13 @@ class FtBaseButton extends toFtFormComponent(FtLitElement) {
|
|
|
131
130
|
(_a = this.button) === null || _a === void 0 ? void 0 : _a.click();
|
|
132
131
|
}
|
|
133
132
|
getLabel() {
|
|
134
|
-
return this.label || this.
|
|
133
|
+
return this.label || this.getTextContent();
|
|
135
134
|
}
|
|
136
|
-
|
|
135
|
+
getTextContent() {
|
|
137
136
|
return unslotText(this.slottedContent).trim();
|
|
138
137
|
}
|
|
139
138
|
hasTextContent() {
|
|
140
|
-
return this.
|
|
139
|
+
return this.getTextContent().length > 0;
|
|
141
140
|
}
|
|
142
141
|
onSlotchange() {
|
|
143
142
|
this.requestUpdate();
|
|
@@ -149,7 +148,6 @@ class FtBaseButton extends toFtFormComponent(FtLitElement) {
|
|
|
149
148
|
FtBaseButton.elementDefinitions = {
|
|
150
149
|
"ft-ripple": FtRipple,
|
|
151
150
|
"ft-tooltip": FtTooltip,
|
|
152
|
-
"ft-typography": FtTypography,
|
|
153
151
|
"ft-icon": FtIcon,
|
|
154
152
|
"ft-loader": FtLoader,
|
|
155
153
|
};
|
package/build/ft-button.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
1
2
|
import { FtButtonProperties } from "./ft-button.properties";
|
|
2
3
|
import { FtBaseButton } from "./ft-base-button";
|
|
3
4
|
import { ClassInfo } from "lit/directives/class-map.js";
|
|
4
5
|
export declare class FtButton extends FtBaseButton implements FtButtonProperties {
|
|
6
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
5
7
|
primary: boolean;
|
|
6
8
|
outlined: boolean;
|
|
7
9
|
dense: boolean;
|
package/build/ft-button.js
CHANGED
|
@@ -8,6 +8,7 @@ import { property } from "lit/decorators.js";
|
|
|
8
8
|
import { safariEllipsisFix } from "@fluid-topics/ft-wc-utils";
|
|
9
9
|
import { classicStyles } from "./ft-button.styles";
|
|
10
10
|
import { FtBaseButton } from "./ft-base-button";
|
|
11
|
+
import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
|
|
11
12
|
class FtButton extends FtBaseButton {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -29,9 +30,13 @@ class FtButton extends FtBaseButton {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
get typographyVariant() {
|
|
32
|
-
return
|
|
33
|
+
return FtTypographyVariants.button;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
FtButton.elementDefinitions = {
|
|
37
|
+
...FtBaseButton.elementDefinitions,
|
|
38
|
+
"ft-or-ftds-typography": FtTypography,
|
|
39
|
+
};
|
|
35
40
|
FtButton.styles = [
|
|
36
41
|
safariEllipsisFix,
|
|
37
42
|
classicStyles,
|