@digital-realty/ix-switch-input 2.2.7 → 2.2.8
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.
|
@@ -13,9 +13,22 @@ export const IxSwitchInputStyles = css `
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.label {
|
|
16
|
-
font-size:
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
font-size: var(
|
|
17
|
+
--ix-switch-label-text-size,
|
|
18
|
+
var(--text-small-size, 0.875rem)
|
|
19
|
+
);
|
|
20
|
+
font-weight: var(
|
|
21
|
+
--ix-switch-label-font-weight,
|
|
22
|
+
var(--text-small-weight, normal)
|
|
23
|
+
);
|
|
24
|
+
line-height: var(
|
|
25
|
+
--ix-switch-label-line-height,
|
|
26
|
+
var(--text-small-line-height, 1.42857143em)
|
|
27
|
+
);
|
|
28
|
+
letter-spacing: var(
|
|
29
|
+
--ix-switch-label-letter-spacing,
|
|
30
|
+
var(--text-small-letter-spacing, 0.0275em)
|
|
31
|
+
);
|
|
19
32
|
margin: 1rem 0 var(--spacing-tiny, 0.25rem);
|
|
20
33
|
display: block;
|
|
21
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ix-switch-input-styles.js","sourceRoot":"","sources":["../src/ix-switch-input-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"ix-switch-input-styles.js","sourceRoot":"","sources":["../src/ix-switch-input-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCrC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxSwitchInputStyles = css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n ix-textbox {\n max-width: var(--po-number-textbox-max-width, 320px);\n }\n\n .label {\n font-size: var(\n --ix-switch-label-text-size,\n var(--text-small-size, 0.875rem)\n );\n font-weight: var(\n --ix-switch-label-font-weight,\n var(--text-small-weight, normal)\n );\n line-height: var(\n --ix-switch-label-line-height,\n var(--text-small-line-height, 1.42857143em)\n );\n letter-spacing: var(\n --ix-switch-label-letter-spacing,\n var(--text-small-letter-spacing, 0.0275em)\n );\n margin: 1rem 0 var(--spacing-tiny, 0.25rem);\n display: block;\n }\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{css,LitElement,html,nothing}from"lit";import{property,query}from"lit/decorators.js";import"@digital-realty/ix-switch-bar";let NotRequired="Not required",IxSwitchInputStyles=css`:host{display:block}:host([hidden]){display:none}ix-textbox{max-width:var(--po-number-textbox-max-width,320px)}.label{font-size
|
|
1
|
+
import{__decorate}from"tslib";import{css,LitElement,html,nothing}from"lit";import{property,query}from"lit/decorators.js";import"@digital-realty/ix-switch-bar";let NotRequired="Not required",IxSwitchInputStyles=css`:host{display:block}:host([hidden]){display:none}ix-textbox{max-width:var(--po-number-textbox-max-width,320px)}.label{font-size:var(--ix-switch-label-text-size,var(--text-small-size,.875rem));font-weight:var(--ix-switch-label-font-weight,var(--text-small-weight,normal));line-height:var(--ix-switch-label-line-height,var(--text-small-line-height,1.42857143em));letter-spacing:var(--ix-switch-label-letter-spacing,var(--text-small-letter-spacing,.0275em));margin:1rem 0 var(--spacing-tiny,.25rem);display:block}`;class IxSwitchInput extends LitElement{constructor(){super(...arguments),this.switchText="",this.switchNote="",this.label="",this.text="",this.defaultInputValue="",this.placeholder="",this.selected=!1,this.disabled=!1,this.required=!1,this.icons=!1,this.showOnlySelectedIcon=!1,this.isHidden=!1,this.isValid=!0}static get styles(){return[IxSwitchInputStyles]}getPlaceholder(){return this.selected?"":this.defaultInputValue||""+NotRequired}getValidityStatus(){var t;return!this.selected||(this.isValid=null!=(t=null==(t=null==(t=this.ixSwitchInputTextbox)?void 0:t.component)?void 0:t.checkValidity())?t:null,this.isValid)}onToggleSwitch(t){this.selected=!this.selected,this.dispatchSwitchEvent(),t.stopPropagation(),this.text="",this.placeholder=this.getPlaceholder()}onUpdateText(t){this.text=t.detail.value,this.getValidityStatus(),this.dispatchTextEvent({value:this.text,isValid:this.isValid}),t.stopPropagation()}dispatchSwitchEvent(){var t=new CustomEvent("toggleSwitch",{detail:{selected:this.selected},composed:!0});this.dispatchEvent(t)}dispatchTextEvent(t){t=new CustomEvent("textChange",{detail:t,composed:!0});this.dispatchEvent(t)}renderSwitch(){return html`<ix-switch-bar .text="${this.switchText}" .note="${this.switchNote}" ?selected="${this.selected}" ?disabled="${this.disabled}" ?required="${this.required}" ?icons="${this.icons}" ?showOnlySelectedIcon="${this.showOnlySelectedIcon}" @toggleSwitch="${t=>this.onToggleSwitch(t)}"></ix-switch-bar>`}renderTextbox(){return this.isHidden?nothing:html`<p class="label">${this.label}</p><ix-textbox id="ix-switch-input-textbox" .text="${this.text}" .placeholder="${this.placeholder}" ?disabled="${!this.selected}" ?required="${this.required&&this.selected}" @textChange="${t=>this.onUpdateText(t)}"></ix-textbox>`}render(){return html`${this.renderSwitch()} ${this.renderTextbox()}`}}__decorate([property({type:String})],IxSwitchInput.prototype,"switchText",void 0),__decorate([property({type:String})],IxSwitchInput.prototype,"switchNote",void 0),__decorate([property({type:String})],IxSwitchInput.prototype,"label",void 0),__decorate([property({type:String})],IxSwitchInput.prototype,"text",void 0),__decorate([property({type:String})],IxSwitchInput.prototype,"defaultInputValue",void 0),__decorate([property({type:String})],IxSwitchInput.prototype,"placeholder",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"selected",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"disabled",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"required",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"icons",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"showOnlySelectedIcon",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"isHidden",void 0),__decorate([property({type:Boolean})],IxSwitchInput.prototype,"isValid",void 0),__decorate([query("#ix-switch-input-textbox")],IxSwitchInput.prototype,"ixSwitchInputTextbox",void 0),window.customElements.define("ix-switch-input",IxSwitchInput);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-switch-input following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "2.2.
|
|
6
|
+
"version": "2.2.8",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@digital-realty/ix-switch-bar": "^2.2.
|
|
31
|
-
"@digital-realty/ix-textbox": "^2.2.
|
|
30
|
+
"@digital-realty/ix-switch-bar": "^2.2.5",
|
|
31
|
+
"@digital-realty/ix-textbox": "^2.2.8",
|
|
32
32
|
"@lit/react": "^1.0.2",
|
|
33
33
|
"lit": "^2.8.0 || ^3.0.0",
|
|
34
34
|
"react": "^18.2.0"
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"husky": "^4.3.8",
|
|
50
50
|
"lint-staged": "^10.5.4",
|
|
51
51
|
"prettier": "^2.4.1",
|
|
52
|
+
"rollup": "^4.29.1",
|
|
52
53
|
"rollup-plugin-minify-html-literals": "^1.2.6",
|
|
53
54
|
"rollup-plugin-summary": "^2.0.0",
|
|
54
55
|
"rollup-plugin-uglify": "^6.0.4",
|
|
@@ -102,5 +103,5 @@
|
|
|
102
103
|
"README.md",
|
|
103
104
|
"LICENSE"
|
|
104
105
|
],
|
|
105
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "3590ef8890b3526a1395c48f0e94c72757c33c35"
|
|
106
107
|
}
|