@digital-realty/ix-timer 3.4.4 → 3.5.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-timer.min.js +14 -1
  2. package/package.json +10 -17
@@ -1 +1,14 @@
1
- import{LitElement,html,css}from"lit";import{__decorate}from"tslib";import{asyncReplace}from"lit/directives/async-replace.js";import{property,state}from"lit/decorators.js";import"@digital-realty/ix-icon/ix-icon.js";async function*countDownAsync(e,t){let i=e;for(;0<i;)yield--i,await new Promise(e=>setTimeout(e,1e3));null!=t&&t()}class IxTimer extends LitElement{constructor(){super(),this.label="",this.duration=10,this.onFinished=()=>{}}connectedCallback(){super.connectedCallback(),this.timer=countDownAsync(this.duration,this.onFinished)}render(){return html`<div class="timer-container"><ix-icon>timer</ix-icon>${this.label} ${this.timer?asyncReplace(this.timer):""}s</div>`}}__decorate([property({type:String})],IxTimer.prototype,"label",void 0),__decorate([property({type:Number})],IxTimer.prototype,"duration",void 0),__decorate([property({attribute:!1})],IxTimer.prototype,"onFinished",void 0),__decorate([state()],IxTimer.prototype,"timer",void 0);class IxTimerStyled extends IxTimer{}IxTimerStyled.styles=css`.timer-container{display:flex;justify-content:center;align-items:center}ix-icon{font-size:16px;margin-top:4px}`,window.customElements.define("ix-timer",IxTimerStyled);export{IxTimerStyled};
1
+ import{LitElement as i,html as t,css as e}from"lit";import{__decorate as o}from"tslib";import{asyncReplace as r}from"lit/directives/async-replace.js";import{property as n,state as s}from"lit/decorators.js";import"@digital-realty/ix-icon/ix-icon.js";class l extends i{constructor(){super(),this.label="",this.duration=10,this.onFinished=()=>{}}connectedCallback(){super.connectedCallback(),this.timer=async function*(i,t){let e=i;for(;e>0;)yield e-=1,await new Promise(i=>setTimeout(i,1e3));null==t||t()}(this.duration,this.onFinished)}render(){return t` <div class="timer-container">
2
+ <ix-icon>timer</ix-icon>
3
+ ${this.label} ${this.timer?r(this.timer):""}s
4
+ </div>`}}o([n({type:String})],l.prototype,"label",void 0),o([n({type:Number})],l.prototype,"duration",void 0),o([n({attribute:!1})],l.prototype,"onFinished",void 0),o([s()],l.prototype,"timer",void 0);class c extends l{}c.styles=e`
5
+ .timer-container {
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ }
10
+ ix-icon {
11
+ font-size: 16px;
12
+ margin-top: 4px;
13
+ }
14
+ `,window.customElements.define("ix-timer",c);export{c as IxTimerStyled};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-timer following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "3.4.4",
6
+ "version": "3.5.1",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -21,36 +21,34 @@
21
21
  "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
22
22
  "build": "tsc && npm run analyze -- --exclude dist && rollup -c",
23
23
  "prepublish": "tsc && npm run analyze -- --exclude dist",
24
- "lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
25
- "format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
24
+ "lint": "eslint --ext .ts,.html . && prettier \"**/*.ts\" --check --ignore-path .gitignore",
25
+ "format": "eslint --ext .ts,.html . --fix && prettier \"**/*.ts\" --write --ignore-path .gitignore",
26
26
  "test": "tsc && wtr --coverage",
27
27
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
28
28
  },
29
29
  "dependencies": {
30
- "@digital-realty/ix-icon": "^1.2.4",
30
+ "@digital-realty/ix-icon": "^1.3.1",
31
31
  "@lit/react": "^1.0.2",
32
32
  "lit": "^3.2.1",
33
33
  "react": "^18.2.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@custom-elements-manifest/analyzer": "^0.4.17",
37
- "@open-wc/eslint-config": "^9.2.1",
38
37
  "@open-wc/testing": "^3.1.6",
38
+ "@rollup/plugin-terser": "^1.0.0",
39
39
  "@types/react": "^18.2.22",
40
- "@typescript-eslint/eslint-plugin": "^5.48.0",
41
- "@typescript-eslint/parser": "^5.48.0",
40
+ "@typescript-eslint/eslint-plugin": "^8.58.2",
41
+ "@typescript-eslint/parser": "^8.58.2",
42
42
  "@web/dev-server": "^0.4.6",
43
43
  "@web/test-runner": "^0.20.2",
44
- "concurrently": "^9.1.0",
45
- "eslint": "^8.31.0",
44
+ "concurrently": "^9.2.1",
45
+ "eslint": "^9.39.4",
46
46
  "eslint-config-prettier": "^8.3.0",
47
47
  "husky": "^4.3.8",
48
48
  "lint-staged": "^10.5.4",
49
49
  "prettier": "^2.4.1",
50
50
  "rollup": "^4.29.1",
51
- "rollup-plugin-minify-html-literals": "^1.2.6",
52
51
  "rollup-plugin-summary": "^2.0.0",
53
- "rollup-plugin-uglify": "^6.0.4",
54
52
  "tslib": "^2.3.1",
55
53
  "typescript": "^5.1.6"
56
54
  },
@@ -58,11 +56,6 @@
58
56
  "eslintConfig": {
59
57
  "parser": "@typescript-eslint/parser",
60
58
  "root": true,
61
- "extends": [
62
- "@open-wc/eslint-config",
63
- "eslint-config-prettier",
64
- "plugin:json/recommended"
65
- ],
66
59
  "plugins": [
67
60
  "@typescript-eslint"
68
61
  ],
@@ -107,5 +100,5 @@
107
100
  "README.md",
108
101
  "LICENSE"
109
102
  ],
110
- "gitHead": "5f957be9ee993f439c24887108d7d1f35c40ab17"
103
+ "gitHead": "da06737d6707fd3d4ef898ba0fa632e7b3ed8019"
111
104
  }