@digital-realty/ix-button 3.2.30 → 3.2.31
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/ix-button.min.js +19 -0
- package/package.json +7 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{LitElement,isServer,html,nothing,css}from"lit";import{__decorate}from"tslib";import{literal,html as html$1}from"lit/static-html.js";import{property}from"lit/decorators.js";import{isActivationClick,dispatchActivationClick}from"@material/web/internal/events/form-label-activation.js";import{ifDefined}from"lit/directives/if-defined.js";import{internals}from"@material/web/labs/behaviors/element-internals.js";import"@material/web/button/text-button.js";import"@material/web/button/elevated-button.js";import"@material/web/button/filled-button.js";import"@material/web/button/outlined-button.js";import"@material/web/button/filled-tonal-button.js";import"@material/web/icon/icon.js";import{setupFormSubmitter}from"@material/web/internal/controller/form-submitter.js";import{requestUpdateOnAriaChange}from"@material/web/internal/aria/delegate.js";var _a;class IxButton extends LitElement{get form(){return this[internals].form}set form(t){this.setAttribute("form",t)}get buttonElement(){var t;return null==(t=null==(t=null==(t=this.shadowRoot)?void 0:t.querySelector(".md-button"))?void 0:t.shadowRoot)?void 0:t.querySelector(".button")}get name(){var t;return null!=(t=this.getAttribute("name"))?t:""}set name(t){this.setAttribute("name",t)}focus(){this.buttonElement.focus()}blur(){this.buttonElement.blur()}constructor(){super(),this.value="",this[_a]=this.attachInternals(),this.type="submit",this.disabled=!1,this.href=void 0,this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.appearance="filled",this.handleActivationClick=t=>{isActivationClick(t)&&this.buttonElement&&(this.focus(),dispatchActivationClick(this.buttonElement))},this.tags={elevated:literal`md-elevated-button`,filled:literal`md-filled-button`,"filled-tonal":literal`md-filled-tonal-button`,outlined:literal`md-outlined-button`,text:literal`md-text-button`},isServer||this.addEventListener("click",this.handleActivationClick)}render(){var t;return"anchor"===this.appearance?html`<a
|
|
2
|
+
target=${ifDefined(this.target)}
|
|
3
|
+
href=${ifDefined(this.href)}
|
|
4
|
+
>${this.value||nothing}<slot></slot
|
|
5
|
+
></a>`:(t=(null==(t=this.tags)?void 0:t[this.appearance])||this.tags.outlined,html$1`<${t}
|
|
6
|
+
?disabled=${this.disabled}
|
|
7
|
+
target=${ifDefined(this.target)}
|
|
8
|
+
href=${ifDefined(this.href)}
|
|
9
|
+
?trailing-icon=${this.trailingIcon}
|
|
10
|
+
?has-icon=${this.hasIcon}
|
|
11
|
+
value="${this.value}"
|
|
12
|
+
type=${this.type}
|
|
13
|
+
class="md-button"
|
|
14
|
+
>
|
|
15
|
+
<div class="slot-wrap">
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</div>
|
|
18
|
+
${this.hasIcon?html`<slot slot="icon" name="icon"></slot>`:nothing}
|
|
19
|
+
</${t}>`)}}_a=internals,requestUpdateOnAriaChange(IxButton),setupFormSubmitter(IxButton),IxButton.formAssociated=!0,IxButton.shadowRootOptions={mode:"open",delegatesFocus:!0},__decorate([property()],IxButton.prototype,"value",void 0),__decorate([property()],IxButton.prototype,"type",void 0),__decorate([property({type:Boolean,reflect:!0})],IxButton.prototype,"disabled",void 0),__decorate([property()],IxButton.prototype,"href",void 0),__decorate([property()],IxButton.prototype,"target",void 0),__decorate([property({type:Boolean,attribute:"trailing-icon"})],IxButton.prototype,"trailingIcon",void 0),__decorate([property({type:Boolean,attribute:"has-icon"})],IxButton.prototype,"hasIcon",void 0),__decorate([property()],IxButton.prototype,"appearance",void 0);class IxButtonStyled extends IxButton{}IxButtonStyled.styles=css`.md-button{display:flex}.slot-wrap{font-weight:700;text-transform:uppercase;position:relative;letter-spacing:1.25px}`,window.customElements.define("ix-button",IxButtonStyled);export{IxButtonStyled};
|
package/package.json
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
"description": "Webcomponent ix-button following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "3.2.
|
|
6
|
+
"version": "3.2.31",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/index.js",
|
|
12
12
|
"./ix-button.js": "./dist/ix-button.js",
|
|
13
|
+
"./ix-button.min.js": "./dist/ix-button.min.js",
|
|
13
14
|
"./IxButton": "./dist/react/IxButton.js"
|
|
14
15
|
},
|
|
15
16
|
"publishConfig": {
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"scripts": {
|
|
19
20
|
"analyze": "cem analyze --litelement",
|
|
20
21
|
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
21
|
-
"build": "tsc && npm run analyze -- --exclude dist",
|
|
22
|
+
"build": "tsc && npm run analyze -- --exclude dist && rollup -c",
|
|
22
23
|
"prepublish": "tsc && npm run analyze -- --exclude dist",
|
|
23
24
|
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
24
25
|
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
@@ -46,6 +47,9 @@
|
|
|
46
47
|
"husky": "^4.3.8",
|
|
47
48
|
"lint-staged": "^10.5.4",
|
|
48
49
|
"prettier": "^2.4.1",
|
|
50
|
+
"rollup-plugin-minify-html-literals": "^1.2.6",
|
|
51
|
+
"rollup-plugin-summary": "^2.0.0",
|
|
52
|
+
"rollup-plugin-uglify": "^6.0.4",
|
|
49
53
|
"tslib": "^2.3.1",
|
|
50
54
|
"typescript": "^5.1.6"
|
|
51
55
|
},
|
|
@@ -102,5 +106,5 @@
|
|
|
102
106
|
"README.md",
|
|
103
107
|
"LICENSE"
|
|
104
108
|
],
|
|
105
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "c7668fda980293ca038c0dd061ebe350fa88ee60"
|
|
106
110
|
}
|