@digital-realty/ix-time 1.2.4 → 1.3.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.
Files changed (2) hide show
  1. package/dist/ix-time.min.js +59 -1
  2. package/package.json +12 -16
@@ -1 +1,59 @@
1
- import{__decorate}from"tslib";import{css,LitElement,html}from"lit";import{property,query,state}from"lit/decorators.js";import{classMap}from"lit/directives/class-map.js";import"@digital-realty/ix-field/ix-field.js";import{mixinDelegatesAria}from"@material/web/internal/aria/delegate.js";import{mixinElementInternals}from"@material/web/labs/behaviors/element-internals.js";let IxTimeStyles=css`:host{display:block}::part(input-field){background:0 0;padding:0;height:26px}#search-input-vaadin-time-picker-3{padding:0!important;--_hover-highlight:transparent}vaadin-time-picker::before{display:none}ix-field{display:block}.flex-fill{flex:1;align-items:center}input{border:none;background:0 0;outline:0;min-width:3rem}.time{position:relative}`,ixTimeBaseClass=mixinDelegatesAria(mixinElementInternals(LitElement));class IxTime extends ixTimeBaseClass{constructor(){super(...arguments),this.label="",this.value="",this.min="",this.max="",this.internals=this.attachInternals(),this.disabled=!1,this.internalErrorText="",this.errorText="",this.required=!1,this.hideError=!1,this.onChanged=()=>{},this.focused=!1,this.focusin=()=>{this.focused=!0},this.clear=()=>{this.value=""},this.handleChange=e=>{e=e.target.value;this.value=e,this.validateDate(),this.onChanged(e)},this.validateDate=()=>{this.value&&this.timeInput.validity.valid?this.internalErrorText="":this.timeInput.validity.rangeUnderflow||this.timeInput.validity.rangeOverflow?this.internalErrorText=`The value must be between ${this.min} and ${this.max}.`:this.required&&!this.timeInput.validity.valid&&(this.internalErrorText="Time is not valid.")},this.focusOut=()=>{this.focused=!1}}static get styles(){return[IxTimeStyles]}get error(){return this.internalErrorText||this.errorText||""}get hasError(){return!!this.error}get form(){return this.internals.form}get labels(){return this.internals.labels}get name(){var e;return null!=(e=this.getAttribute("name"))?e:""}set name(e){this.setAttribute("name",e)}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}formResetCallback(){this.reset()}reset(){var e;this.clear(),this.value=null!=(e=this.getAttribute("value"))?e:""}updated(){this.internals.setValidity({badInput:this.hasError},this.error,this.timeInput),this.internals.setFormValue(this.value)}focus(){this.timeInput.focus()}firstUpdated(){this.validateDate()}render(){var e={disabled:this.disabled,error:!this.disabled&&this.hasError};return html`<ix-field class="${classMap(e)}" ?focused="${this.focused}" ?populated="${this.value}" ?disabled="${this.disabled}" ?required="${this.required}" ?error="${this.hasError&&!this.hideError}" error-text="${this.error}" label="${this.label}" @focusin="${this.focusin}" @focusout="${this.focusOut}"><input id="time-input" @change="${this.handleChange}" .value="${this.value}" class="flex-fill" type="time" min="${this.min}" max="${this.max}"></ix-field>`}}IxTime.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0},IxTime.formAssociated=!0,__decorate([property({type:String})],IxTime.prototype,"label",void 0),__decorate([property({type:String})],IxTime.prototype,"value",void 0),__decorate([property({type:String})],IxTime.prototype,"min",void 0),__decorate([property({type:String})],IxTime.prototype,"max",void 0),__decorate([query("#time-input")],IxTime.prototype,"timeInput",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTime.prototype,"disabled",void 0),__decorate([state()],IxTime.prototype,"internalErrorText",void 0),__decorate([property({type:String})],IxTime.prototype,"errorText",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTime.prototype,"required",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTime.prototype,"hideError",void 0),__decorate([property({type:Function})],IxTime.prototype,"onChanged",void 0),__decorate([state()],IxTime.prototype,"focused",void 0),window.customElements.define("ix-time",IxTime);
1
+ import{__decorate as t}from"tslib";import{css as e,LitElement as i,html as r}from"lit";import{property as s,query as a,state as o}from"lit/decorators.js";import{classMap as n}from"lit/directives/class-map.js";import"@digital-realty/ix-field/ix-field.js";import{mixinDelegatesAria as l}from"@material/web/internal/aria/delegate.js";import{mixinElementInternals as d}from"@material/web/labs/behaviors/element-internals.js";const h=e`
2
+ :host {
3
+ display: block;
4
+ }
5
+ ::part(input-field) {
6
+ background: transparent;
7
+ padding: 0;
8
+ height: 26px;
9
+ }
10
+
11
+ #search-input-vaadin-time-picker-3 {
12
+ padding: 0 !important;
13
+ --_hover-highlight: transparent;
14
+ }
15
+
16
+ vaadin-time-picker::before {
17
+ display: none;
18
+ }
19
+
20
+ ix-field {
21
+ display: block;
22
+ }
23
+ .flex-fill {
24
+ flex: 1;
25
+ align-items: center;
26
+ }
27
+ input {
28
+ border: none;
29
+ background: transparent;
30
+ outline: none;
31
+ min-width: 3rem;
32
+ }
33
+ .time {
34
+ position: relative;
35
+ }
36
+ `,p=l(d(i));class u extends p{constructor(){super(...arguments),this.label="",this.value="",this.min="",this.max="",this.internals=this.attachInternals(),this.disabled=!1,this.internalErrorText="",this.errorText="",this.required=!1,this.hideError=!1,this.onChanged=()=>{},this.focused=!1,this.focusin=()=>{this.focused=!0},this.clear=()=>{this.value=""},this.handleChange=t=>{const{value:e}=t.target;this.value=e,this.validateDate(),this.onChanged(e)},this.validateDate=()=>{this.value&&this.timeInput.validity.valid?this.internalErrorText="":this.timeInput.validity.rangeUnderflow||this.timeInput.validity.rangeOverflow?this.internalErrorText=`The value must be between ${this.min} and ${this.max}.`:this.required&&!this.timeInput.validity.valid&&(this.internalErrorText="Time is not valid.")},this.focusOut=()=>{this.focused=!1}}static get styles(){return[h]}get error(){return this.internalErrorText||this.errorText||""}get hasError(){return!!this.error}get form(){return this.internals.form}get labels(){return this.internals.labels}get name(){var t;return null!==(t=this.getAttribute("name"))&&void 0!==t?t:""}set name(t){this.setAttribute("name",t)}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}formResetCallback(){this.reset()}reset(){var t;this.clear(),this.value=null!==(t=this.getAttribute("value"))&&void 0!==t?t:""}updated(){this.internals.setValidity({badInput:this.hasError},this.error,this.timeInput),this.internals.setFormValue(this.value)}focus(){this.timeInput.focus()}firstUpdated(){this.validateDate()}render(){const t={disabled:this.disabled,error:!this.disabled&&this.hasError};return r`
37
+ <ix-field
38
+ class="${n(t)}"
39
+ ?focused=${this.focused}
40
+ ?populated=${this.value}
41
+ ?disabled=${this.disabled}
42
+ ?required=${this.required}
43
+ ?error=${this.hasError&&!this.hideError}
44
+ error-text=${this.error}
45
+ label=${this.label}
46
+ @focusin=${this.focusin}
47
+ @focusout=${this.focusOut}
48
+ >
49
+ <input
50
+ id="time-input"
51
+ @change=${this.handleChange}
52
+ .value=${this.value}
53
+ class="flex-fill"
54
+ type="time"
55
+ min=${this.min}
56
+ max=${this.max}
57
+ />
58
+ </ix-field>
59
+ `}}u.shadowRootOptions={...i.shadowRootOptions,delegatesFocus:!0},u.formAssociated=!0,t([s({type:String})],u.prototype,"label",void 0),t([s({type:String})],u.prototype,"value",void 0),t([s({type:String})],u.prototype,"min",void 0),t([s({type:String})],u.prototype,"max",void 0),t([a("#time-input")],u.prototype,"timeInput",void 0),t([s({type:Boolean,reflect:!0})],u.prototype,"disabled",void 0),t([o()],u.prototype,"internalErrorText",void 0),t([s({type:String})],u.prototype,"errorText",void 0),t([s({type:Boolean,reflect:!0})],u.prototype,"required",void 0),t([s({type:Boolean,reflect:!0})],u.prototype,"hideError",void 0),t([s({type:Function})],u.prototype,"onChanged",void 0),t([o()],u.prototype,"focused",void 0),window.customElements.define("ix-time",u);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-time following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "1.2.4",
6
+ "version": "1.3.1",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -20,14 +20,14 @@
20
20
  "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
21
21
  "build": "tsc && npm run analyze -- --exclude dist && rollup -c",
22
22
  "prepublish": "tsc && npm run analyze -- --exclude dist",
23
- "lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
24
- "format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
23
+ "lint": "eslint --ext .ts,.html . && prettier \"**/*.ts\" --check --ignore-path .gitignore",
24
+ "format": "eslint --ext .ts,.html . --fix && prettier \"**/*.ts\" --write --ignore-path .gitignore",
25
25
  "test": "tsc && wtr --coverage",
26
26
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
27
27
  },
28
28
  "dependencies": {
29
29
  "@adobe/lit-mobx": "^2.2.2",
30
- "@digital-realty/ix-field": "^1.2.4",
30
+ "@digital-realty/ix-field": "^1.3.1",
31
31
  "@material/web": "2.4.0",
32
32
  "@vaadin/time-picker": "^24.6.1",
33
33
  "@web/test-runner-commands": "^0.9.0",
@@ -38,33 +38,29 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@custom-elements-manifest/analyzer": "^0.4.17",
41
- "@open-wc/eslint-config": "^9.2.1",
42
41
  "@open-wc/testing": "^3.1.6",
43
- "@typescript-eslint/eslint-plugin": "^5.48.0",
44
- "@typescript-eslint/parser": "^5.48.0",
42
+ "@rollup/plugin-terser": "^1.0.0",
43
+ "@typescript-eslint/eslint-plugin": "^8.58.2",
44
+ "@typescript-eslint/parser": "^8.58.2",
45
45
  "@web/dev-server": "^0.4.6",
46
46
  "@web/dev-server-import-maps": "^0.2.1",
47
+ "@web/dev-server-rollup": "^0.6.4",
47
48
  "@web/test-runner": "^0.20.2",
48
- "concurrently": "^9.1.0",
49
- "eslint": "^8.31.0",
49
+ "concurrently": "^9.2.1",
50
+ "eslint": "^9.39.4",
50
51
  "eslint-config-prettier": "^8.3.0",
51
52
  "husky": "^4.3.8",
52
53
  "lint-staged": "^10.5.4",
53
54
  "prettier": "^2.4.1",
54
55
  "rollup": "^4.29.1",
55
- "rollup-plugin-minify-html-literals": "^1.2.6",
56
+ "rollup-plugin-replace": "^2.2.0",
56
57
  "rollup-plugin-summary": "^2.0.0",
57
- "rollup-plugin-uglify": "^6.0.4",
58
58
  "tslib": "^2.3.1",
59
59
  "typescript": "^4.5.2"
60
60
  },
61
61
  "customElements": "custom-elements.json",
62
62
  "eslintConfig": {
63
63
  "parser": "@typescript-eslint/parser",
64
- "extends": [
65
- "@open-wc",
66
- "prettier"
67
- ],
68
64
  "plugins": [
69
65
  "@typescript-eslint"
70
66
  ],
@@ -105,5 +101,5 @@
105
101
  "README.md",
106
102
  "LICENSE"
107
103
  ],
108
- "gitHead": "5f957be9ee993f439c24887108d7d1f35c40ab17"
104
+ "gitHead": "da06737d6707fd3d4ef898ba0fa632e7b3ed8019"
109
105
  }