@digital-realty/ix-icon-button 1.0.22 → 1.0.23
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/IxIconButton.d.ts
CHANGED
package/dist/IxIconButton.js
CHANGED
|
@@ -49,6 +49,7 @@ export class IxIconButton extends LitElement {
|
|
|
49
49
|
this.name = undefined;
|
|
50
50
|
this.value = undefined;
|
|
51
51
|
this.label = undefined;
|
|
52
|
+
this.filledIcon = false;
|
|
52
53
|
}
|
|
53
54
|
render() {
|
|
54
55
|
const ariaLabel = this.label || this.ariaLabel;
|
|
@@ -76,11 +77,13 @@ export class IxIconButton extends LitElement {
|
|
|
76
77
|
name=${ifDefined(this.name)}
|
|
77
78
|
value=${ifDefined(this.value)}
|
|
78
79
|
>${this.icon
|
|
79
|
-
? html `<ix-icon>${this.icon}</ix-icon>`
|
|
80
|
+
? html `<ix-icon ?filled=${this.filledIcon}>${this.icon}</ix-icon>`
|
|
80
81
|
: html `<slot name="default"></slot
|
|
81
82
|
><slot name="selected" slot="selected"></slot>`}
|
|
82
83
|
${this.selectedIcon
|
|
83
|
-
? html `<ix-icon slot="selected"
|
|
84
|
+
? html `<ix-icon ?filled=${this.filledIcon} slot="selected"
|
|
85
|
+
>${this.selectedIcon}</ix-icon
|
|
86
|
+
>`
|
|
84
87
|
: nothing}
|
|
85
88
|
</${tag}>`;
|
|
86
89
|
}
|
|
@@ -130,4 +133,7 @@ __decorate([
|
|
|
130
133
|
__decorate([
|
|
131
134
|
property()
|
|
132
135
|
], IxIconButton.prototype, "label", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
property({ type: Boolean })
|
|
138
|
+
], IxIconButton.prototype, "filledIcon", void 0);
|
|
133
139
|
//# sourceMappingURL=IxIconButton.js.map
|
package/dist/IxIconButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IxIconButton.js","sourceRoot":"","sources":["../src/IxIconButton.ts"],"names":[],"m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,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;uDAErB;AAMG;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAgB;AAOA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAkB;AAEjD;IAAX,QAAQ,EAAE;0CAAoC;AAEnC;IAAX,QAAQ,EAAE;0CAAsC;AAErC;IAAX,QAAQ,EAAE;2CAAuC;AAEtC;IAAX,QAAQ,EAAE;2CAAuC;AAErB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAAoB","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { StaticValue, literal, html as staticHtml } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { ARIAMixinStrict } from '@material/web/internal/aria/aria.js';\nimport '@material/web/iconbutton/icon-button.js';\nimport '@material/web/iconbutton/filled-icon-button.js';\nimport '@material/web/iconbutton/filled-tonal-icon-button.js';\nimport '@material/web/iconbutton/outlined-icon-button.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport { IconButton } from '@material/web/iconbutton/internal/icon-button';\nimport { FormSubmitterType } from '@material/web/internal/controller/form-submitter.js';\n\ntype LinkTarget = '_blank' | '_parent' | '_self' | '_top';\nexport type Appearance =\n | 'filled'\n | 'filled-tonal'\n | 'outlined'\n | 'icon-filled'\n | 'default';\n\nexport class IxIconButton extends LitElement {\n @query('.button')\n readonly component!: IconButton;\n\n @property()\n appearance: Appearance = 'default';\n\n @property()\n icon: string = '';\n\n @property()\n selectedIcon: string = '';\n\n /**\n * Disables the icon button and makes it non-interactive.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Flips the icon if it is in an RTL context at startup.\n */\n @property({ type: Boolean, attribute: 'flip-icon-in-rtl' })\n flipIconInRtl = false;\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.\n */\n @property() href: string | undefined = undefined;\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `target` attribute.\n */\n @property() target: LinkTarget | '' | undefined = undefined;\n\n /**\n * The `aria-label` of the button when the button is toggleable and selected.\n */\n @property({ attribute: 'aria-label-selected' }) ariaLabelSelected:\n | string\n | undefined = undefined;\n\n /**\n * When true, the button will toggle between selected and unselected\n * states\n */\n @property({ type: Boolean }) toggle = false;\n\n /**\n * Sets the selected state. When false, displays the default icon. When true,\n * displays the selected icon, or the default icon If no `slot=\"selected\"`\n * icon is provided.\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n @property() type: FormSubmitterType = 'submit';\n\n @property() name: string | undefined = undefined;\n\n @property() value: string | undefined = undefined;\n\n @property() label: string | undefined = undefined;\n\n @property({ type: Boolean }) filledIcon = false;\n\n render() {\n const ariaLabel = this.label || (this as ARIAMixinStrict).ariaLabel;\n\n let tag: StaticValue = literal`md-icon-button`;\n if (this.appearance === 'outlined') {\n tag = literal`md-outlined-icon-button`;\n } else if (this.appearance === 'filled') {\n tag = literal`md-filled-icon-button`;\n } else if (this.appearance === 'filled-tonal') {\n tag = literal`md-filled-tonal-icon-button`;\n }\n\n return staticHtml`<${tag}\n class=\"button\"\n ?disabled=${this.disabled}\n ?flip-icon-in-rtl=${this.flipIconInRtl}\n href=${ifDefined(this.href)}\n target=${ifDefined(this.target)}\n aria-label-selected=${ifDefined(this.ariaLabelSelected)}\n aria-label=${ariaLabel || nothing}\n ?toggle=${this.toggle}\n ?selected=${this.selected}\n type=${this.type}\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n >${\n this.icon\n ? html`<ix-icon ?filled=${this.filledIcon}>${this.icon}</ix-icon>`\n : html`<slot name=\"default\"></slot\n ><slot name=\"selected\" slot=\"selected\"></slot>`\n }\n ${\n this.selectedIcon\n ? html`<ix-icon ?filled=${this.filledIcon} slot=\"selected\"\n >${this.selectedIcon}</ix-icon\n >`\n : nothing\n }\n </${tag}>`;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-icon-button following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.23",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"README.md",
|
|
100
100
|
"LICENSE"
|
|
101
101
|
],
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "da586fb3d29c5d12fc0e3cd279cc0feb3adcb879"
|
|
103
103
|
}
|