feat: introduce wireit and ts use node16 resolution

This commit is contained in:
Thomas Allmer 2022-11-04 14:30:06 +01:00 committed by Thomas Allmer
parent d938e464b4
commit c1982965c3
254 changed files with 979 additions and 876 deletions

4
.gitignore vendored
View file

@ -17,6 +17,10 @@ yarn-error.log
/build/
/bundlesize/dist/
**/custom-elements.json
dist
dist-types
*.tsbuildinfo
.wireit
## types
*.d.ts

311
package-lock.json generated
View file

@ -29,6 +29,7 @@
"@types/fs-extra": "^9.0.7",
"@types/glob": "^7.1.3",
"@types/istanbul-reports": "^3.0.0",
"@types/mocha": "^10.0.0",
"@types/prettier": "^2.2.1",
"@web/dev-server": "^0.1.8",
"@web/dev-server-legacy": "^0.1.7",
@ -72,8 +73,9 @@
"semver": "^7.3.5",
"sinon": "^7.2.2",
"ssl-root-cas": "^1.3.1",
"typescript": "4.5.5",
"whatwg-fetch": "^3.0.0"
"typescript": "~4.8.4",
"whatwg-fetch": "^3.0.0",
"wireit": "^0.7.2"
}
},
"node_modules/@11ty/dependency-tree": {
@ -4567,9 +4569,9 @@
"dev": true
},
"node_modules/@types/mocha": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz",
"integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.0.tgz",
"integrity": "sha512-rADY+HtTOA52l9VZWtgQfn4p+UDVM2eDVkMZT1I6syp0YKxW2F9v+0pbRZLsvskhQv/vMb6ZfCay81GHbz5SHg==",
"dev": true
},
"node_modules/@types/node": {
@ -4894,21 +4896,6 @@
"node": ">=10"
}
},
"node_modules/@wdio/config/node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/@wdio/logger": {
"version": "7.19.0",
"resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-7.19.0.tgz",
@ -5007,21 +4994,6 @@
}
}
},
"node_modules/@wdio/utils/node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/@web/browser-logs": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/@web/browser-logs/-/browser-logs-0.2.5.tgz",
@ -5631,6 +5603,12 @@
"node": ">=12.0.0"
}
},
"node_modules/@web/test-runner-mocha/node_modules/@types/mocha": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz",
"integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==",
"dev": true
},
"node_modules/@web/test-runner-playwright": {
"version": "0.8.10",
"resolved": "https://registry.npmjs.org/@web/test-runner-playwright/-/test-runner-playwright-0.8.10.tgz",
@ -6580,19 +6558,6 @@
"node": ">=8.0.0"
}
},
"node_modules/browser-sync-client/node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/browser-sync-ui": {
"version": "2.27.10",
"resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.10.tgz",
@ -9427,21 +9392,6 @@
}
}
},
"node_modules/devtools/node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/devtools/node_modules/uuid": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
@ -13416,6 +13366,12 @@
"node": ">=6"
}
},
"node_modules/jsonc-parser": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
"dev": true
},
"node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
@ -17918,6 +17874,17 @@
"asap": "~2.0.3"
}
},
"node_modules/proper-lockfile": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
"integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.4",
"retry": "^0.12.0",
"signal-exit": "^3.0.2"
}
},
"node_modules/property-information": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
@ -19243,6 +19210,15 @@
"node": ">=8"
}
},
"node_modules/retry": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
"integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
"dev": true,
"engines": {
"node": ">= 4"
}
},
"node_modules/reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@ -21419,9 +21395,9 @@
}
},
"node_modules/typescript": {
"version": "4.5.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
"integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==",
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@ -22012,21 +21988,6 @@
}
}
},
"node_modules/webdriver/node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/webdriverio": {
"version": "7.25.2",
"resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-7.25.2.tgz",
@ -22154,21 +22115,6 @@
"node": ">=10"
}
},
"node_modules/webdriverio/node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/webdriverio/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
@ -22308,6 +22254,52 @@
"node": ">= 0.8.0"
}
},
"node_modules/wireit": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/wireit/-/wireit-0.7.2.tgz",
"integrity": "sha512-Zjq50QH5hguk64hXfJmJJpLGgi8TUy7780w0u2VXK325qWxJtw1fP6HhOYcdjTWeoYLWQDDkTytQ119y/UMseg==",
"dev": true,
"dependencies": {
"braces": "^3.0.2",
"chokidar": "^3.5.3",
"fast-glob": "^3.2.11",
"jsonc-parser": "^3.0.0",
"proper-lockfile": "^4.1.2"
},
"bin": {
"wireit": "bin/wireit.js"
},
"engines": {
"node": ">=14.14.0"
}
},
"node_modules/wireit/node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
],
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/with": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz",
@ -23236,7 +23228,7 @@
"parse5": "^5.1.1",
"read-package-tree": "5.3.1",
"semver": "^7.1.3",
"typescript": "4.5.5"
"typescript": "~4.8.4"
},
"bin": {
"providence": "src/cli/index.mjs"
@ -23800,6 +23792,7 @@
}
},
"packages/ui": {
"name": "@lion/ui",
"version": "0.0.1",
"license": "MIT",
"dependencies": {
@ -27470,9 +27463,9 @@
"dev": true
},
"@types/mocha": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz",
"integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.0.tgz",
"integrity": "sha512-rADY+HtTOA52l9VZWtgQfn4p+UDVM2eDVkMZT1I6syp0YKxW2F9v+0pbRZLsvskhQv/vMb6ZfCay81GHbz5SHg==",
"dev": true
},
"@types/node": {
@ -27746,14 +27739,6 @@
"requires": {
"brace-expansion": "^2.0.1"
}
},
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true
}
}
},
@ -27827,14 +27812,6 @@
"@types/node": "^18.0.0",
"got": "^11.8.1"
}
},
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true
}
}
},
@ -28355,6 +28332,14 @@
"requires": {
"@types/mocha": "^8.2.0",
"@web/test-runner-core": "^0.10.20"
},
"dependencies": {
"@types/mocha": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz",
"integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==",
"dev": true
}
}
},
"@web/test-runner-playwright": {
@ -29130,14 +29115,6 @@
"mitt": "^1.1.3",
"rxjs": "^5.5.6",
"typescript": "^4.6.2"
},
"dependencies": {
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true
}
}
},
"browser-sync-ui": {
@ -31339,14 +31316,6 @@
"got": "^11.8.1"
}
},
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true
},
"uuid": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
@ -34341,6 +34310,12 @@
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA=="
},
"jsonc-parser": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
"dev": true
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
@ -37865,6 +37840,17 @@
"asap": "~2.0.3"
}
},
"proper-lockfile": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
"integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.4",
"retry": "^0.12.0",
"signal-exit": "^3.0.2"
}
},
"property-information": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
@ -37909,7 +37895,7 @@
"parse5": "^5.1.1",
"read-package-tree": "5.3.1",
"semver": "^7.1.3",
"typescript": "4.5.5"
"typescript": "~4.8.4"
},
"dependencies": {
"@rollup/plugin-node-resolve": {
@ -39042,6 +39028,12 @@
"signal-exit": "^3.0.2"
}
},
"retry": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
"integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
"dev": true
},
"reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@ -40773,9 +40765,9 @@
}
},
"typescript": {
"version": "4.5.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
"integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA=="
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ=="
},
"typical": {
"version": "4.0.0",
@ -41195,14 +41187,6 @@
"@types/node": "^18.0.0",
"got": "^11.8.1"
}
},
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true
}
}
},
@ -41308,14 +41292,6 @@
"brace-expansion": "^2.0.1"
}
},
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true,
"optional": true,
"peer": true
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
@ -41429,6 +41405,37 @@
"integrity": "sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==",
"dev": true
},
"wireit": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/wireit/-/wireit-0.7.2.tgz",
"integrity": "sha512-Zjq50QH5hguk64hXfJmJJpLGgi8TUy7780w0u2VXK325qWxJtw1fP6HhOYcdjTWeoYLWQDDkTytQ119y/UMseg==",
"dev": true,
"requires": {
"braces": "^3.0.2",
"chokidar": "^3.5.3",
"fast-glob": "^3.2.11",
"jsonc-parser": "^3.0.0",
"proper-lockfile": "^4.1.2"
},
"dependencies": {
"chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"dev": true,
"requires": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"fsevents": "~2.3.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
}
}
}
},
"with": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz",

View file

@ -4,7 +4,6 @@
"license": "MIT",
"scripts": {
"build": "rocket build",
"build:types": "tsc -p tsconfig.build.types.json",
"bundlesize": "rollup -c bundlesize/rollup.config.js && bundlesize",
"custom-elements-manifest": "npm run custom-elements-manifest --workspaces --if-present",
"debug": "web-test-runner --watch --config web-test-runner-chrome.config.mjs",
@ -13,15 +12,15 @@
"format": "npm run format:eslint && npm run format:prettier",
"format:eslint": "eslint --ext .js,.html . --fix",
"format:prettier": "prettier \"**/*.{js,md}\" \"packages/*/package.json\" \"package.json\" --write",
"postinstall": "npm run custom-elements-manifest",
"postinstall": "npx patch-package && npm run custom-elements-manifest",
"lint": "run-p lint:*",
"lint-disabled:types": "tsc",
"lint:types": "npm run types",
"lint:eslint": "eslint --ext .js,.html .",
"lint:markdownlint": "git ls-files '*.md' | xargs markdownlint --ignore '{.github/**/*.md,.changeset/*.md,**/CHANGELOG.md,packages/ui/_legacy-changelogs/*.md}'",
"lint:prettier": "prettier \"**/*.js\" --list-different || (echo '↑↑ these files are not prettier formatted ↑↑' && exit 1)",
"lint:versions": "node ./scripts/lint-versions.js",
"prepare": "husky install",
"release": "npm run build:types && changeset publish",
"release": "changeset publish",
"rocket:build": "rocket build",
"rocket:build:start": "web-dev-server --root-dir _site --open",
"start": "rocket start",
@ -30,7 +29,8 @@
"test:browserstack": "web-test-runner --config ./web-test-runner-browserstack.config.js",
"test:node": "npm run test:node --workspaces --if-present",
"test:screenshots": "rimraf screenshots/.diff/ && rimraf screenshots/.current/ && mocha --require scripts/screenshots/bootstrap.js --exit --timeout 10000 \"packages/**/test/*.screenshots-test.js\"",
"test:screenshots:update": "cross-env UPDATE_SCREENSHOTS=true npm run test:screenshots"
"test:screenshots:update": "cross-env UPDATE_SCREENSHOTS=true npm run test:screenshots",
"types": "npm run types --workspaces --if-present"
},
"workspaces": [
"packages/*",
@ -97,8 +97,10 @@
"semver": "^7.3.5",
"sinon": "^7.2.2",
"ssl-root-cas": "^1.3.1",
"typescript": "4.5.5",
"whatwg-fetch": "^3.0.0"
"typescript": "~4.8.4",
"whatwg-fetch": "^3.0.0",
"@types/mocha": "^10.0.0",
"wireit": "^0.7.2"
},
"bundlesize": [
{

View file

@ -10,6 +10,13 @@
"url": "https://github.com/ing-bank/lion.git",
"directory": "packages-node/providence-analytics"
},
"exports": {
".": "./src/index.js",
"./src/cli": "./src/cli/index.js",
"./utils.js": "./src/program/utils/index.js",
"./analyzers": "./src/program/analyzers/index.js",
"./docs/*": "./docs/*"
},
"main": "./src/program/providence.js",
"bin": {
"providence": "./src/cli/index.mjs"
@ -55,7 +62,7 @@
"parse5": "^5.1.1",
"read-package-tree": "5.3.1",
"semver": "^7.1.3",
"typescript": "4.5.5"
"typescript": "~4.8.4"
},
"keywords": [
"analysis",
@ -70,12 +77,5 @@
],
"publishConfig": {
"access": "public"
},
"exports": {
".": "./src/index.js",
"./src/cli": "./src/cli/index.js",
"./utils.js": "./src/program/utils/index.js",
"./analyzers": "./src/program/analyzers/index.js",
"./docs/*": "./docs/*"
}
}

View file

@ -1,12 +0,0 @@
import { Ajax } from './src/Ajax.js';
export { Ajax } from './src/Ajax.js';
export { AjaxFetchError } from './src/AjaxFetchError.js';
export {
acceptLanguageRequestInterceptor,
createXsrfRequestInterceptor,
createCacheInterceptors,
} from './src/interceptors/index.js';
// globally available instance
export const ajax = new Ajax();

View file

@ -11,39 +11,51 @@
"directory": "packages/ajax"
},
"type": "module",
"main": "index.js",
"module": "index.js",
"main": "src/index.js",
"module": "src/index.js",
"files": [
"*.d.ts",
"*.js",
"custom-elements.json",
"dist-types",
"docs",
"src",
"test",
"test-helpers",
"translations",
"types"
"test"
],
"scripts": {
"debug": "cd ../../ && npm run debug -- --group ajax",
"debug:firefox": "cd ../../ && npm run debug:firefox -- --group ajax",
"debug:webkit": "cd ../../ && npm run debug:webkit -- --group ajax",
"publish-docs": "node ../../packages-node/publish-docs/src/cli.js --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../ --copy-dir docs/fundamentals/tools/ajax/assets",
"prepublishOnly": "npm run publish-docs",
"test": "cd ../../ && npm run test:browser -- --group ajax"
"prepublishOnly": "npm run types && npm run publish-docs",
"test": "cd ../../ && npm run test:browser -- --group ajax",
"types": "wireit"
},
"keywords": [
"ajax",
"fetch",
"http",
"lion",
"web-components"
"lion"
],
"publishConfig": {
"access": "public"
},
"exports": {
".": "./index.js",
".": {
"types": "./dist-types/src/index.d.ts",
"default": "./src/index.js"
},
"./docs/*": "./docs/*"
},
"wireit": {
"types": {
"command": "tsc --build --pretty",
"files": [
"src/**/*.js",
"test/**/*.js",
"types/**",
"tsconfig.json"
],
"output": [
"dist-types/**"
]
}
}
}

View file

@ -5,7 +5,18 @@ import {
createCacheInterceptors,
} from './interceptors/index.js';
import { AjaxFetchError } from './AjaxFetchError.js';
import './typedef.js';
/**
* @typedef {import('../types/types.js').RequestInterceptor} RequestInterceptor
* @typedef {import('../types/types.js').CachedRequestInterceptor} CachedRequestInterceptor
* @typedef {import('../types/types.js').ResponseInterceptor} ResponseInterceptor
* @typedef {import('../types/types.js').CachedResponseInterceptor} CachedResponseInterceptor
* @typedef {import('../types/types.js').AjaxConfig} AjaxConfig
* @typedef {import('../types/types.js').CacheRequest} CacheRequest
* @typedef {import('../types/types.js').CacheResponse} CacheResponse
* @typedef {import('../types/types.js').CacheRequestExtension} CacheRequestExtension
* @typedef {import('../types/types.js').LionRequestInit} LionRequestInit
*/
/**
* @param {Response} response
@ -225,7 +236,7 @@ export class Ajax {
for (const intercept of this._responseInterceptors) {
// In this instance we actually do want to await for each sequence
// eslint-disable-next-line no-await-in-loop
interceptedResponse = await intercept(/** @type CacheResponse */ (interceptedResponse));
interceptedResponse = await intercept(/** @type {CacheResponse} */ (interceptedResponse));
}
return interceptedResponse;
}

View file

@ -1,9 +1,12 @@
import './typedef.js';
/**
* @typedef {import('../types/types.js').CachedRequests} CachedRequests
* @typedef {import('../types/types.js').CacheResponse} CacheResponse
*/
export default class Cache {
constructor() {
/**
* @type CachedRequests
* @type {CachedRequests}
* @private
*/
this._cachedRequests = {};

View file

@ -1,5 +1,3 @@
import './typedef.js';
export default class PendingRequestStore {
constructor() {
/**

View file

@ -1,7 +1,12 @@
import './typedef.js';
import Cache from './Cache.js';
import PendingRequestStore from './PendingRequestStore.js';
/**
* @typedef {import('../types/types.js').CacheRequest} CacheRequest
* @typedef {import('../types/types.js').CacheOptions} CacheOptions
* @typedef {import('../types/types.js').ValidatedCacheOptions} ValidatedCacheOptions
*/
/**
* The id for the cache session
* @type {string | undefined}
@ -46,7 +51,7 @@ export const resetCacheSession = cacheId => {
/**
* Stringify URL search params
* @param {Params} params query string parameters object
* @param {*} params query string parameters object
* @returns {string} of querystring parameters WITHOUT `?` or empty string ''
*/
const stringifySearchParams = (params = {}) =>
@ -152,8 +157,8 @@ export const validateCacheOptions = ({
* so perhaps you do want to invalidate /api/accounts when invalidating /api/users.
* If it's NOT one of the config.methods, invalidate caches
*
* @param requestId { string }
* @param cacheOptions { CacheOptions }
* @param {string} requestId
* @param {CacheOptions} cacheOptions
*/
export const invalidateMatchingCache = (requestId, { invalidateUrls, invalidateUrlsRegex }) => {
// invalidate this request

View file

@ -0,0 +1,12 @@
import { Ajax } from './Ajax.js';
export { Ajax } from './Ajax.js';
export { AjaxFetchError } from './AjaxFetchError.js';
export {
acceptLanguageRequestInterceptor,
createXsrfRequestInterceptor,
createCacheInterceptors,
} from './interceptors/index.js';
// globally available instance
export const ajax = new Ajax();

View file

@ -1,9 +1,7 @@
import '../typedef.js';
/**
* Transforms a request, adding an accept-language header with the current application's locale
* if it has not already been set.
* @type {RequestInterceptor}
* @param {Request} request
*/
export async function acceptLanguageRequestInterceptor(request) {
if (!request.headers.has('accept-language')) {

View file

@ -1,5 +1,4 @@
/* eslint-disable no-param-reassign */
import '../typedef.js';
import {
ajaxCache,
extendCacheOptions,
@ -10,6 +9,14 @@ import {
validateCacheOptions,
} from '../cacheManager.js';
/**
* @typedef {import('../../types/types.js').RequestInterceptor} RequestInterceptor
* @typedef {import('../../types/types.js').ResponseInterceptor} ResponseInterceptor
* @typedef {import('../../types/types.js').CacheOptions} CacheOptions
* @typedef {import('../../types/types.js').CacheRequest} CacheRequest
* @typedef {import('../../types/types.js').CacheResponse} CacheResponse
*/
/**
* Tests whether the request method is supported according to the `cacheOptions`
* @param {string[]} methods

View file

@ -1,4 +1,6 @@
import '../typedef.js';
/**
* @typedef {import('../../types/types.js').RequestInterceptor} RequestInterceptor
*/
/**
* @param {string} name the cookie name
@ -20,7 +22,7 @@ export function getCookie(name, _document = document) {
*/
export function createXsrfRequestInterceptor(cookieName, headerName, _document = document) {
/**
* @type {RequestInterceptor}
* @param {Request} request
*/
async function xsrfRequestInterceptor(request) {
const xsrfToken = getCookie(cookieName, _document);

View file

@ -1,19 +0,0 @@
/**
* @typedef {import('../types/types').LionRequestInit} LionRequestInit
* @typedef {import('../types/types').AjaxConfig} AjaxConfig
* @typedef {import('../types/types').RequestInterceptor} RequestInterceptor
* @typedef {import('../types/types').ResponseInterceptor} ResponseInterceptor
* @typedef {import('../types/types').CacheConfig} CacheConfig
* @typedef {import('../types/types').Params} Params
* @typedef {import('../types/types').RequestIdFunction} RequestIdFunction
* @typedef {import('../types/types').CacheOptions} CacheOptions
* @typedef {import('../types/types').ValidatedCacheOptions} ValidatedCacheOptions
* @typedef {import('../types/types').CacheRequestExtension} CacheRequestExtension
* @typedef {import('../types/types').CacheResponseExtension} CacheResponseExtension
* @typedef {import('../types/types').CacheResponseRequest} CacheResponseRequest
* @typedef {import('../types/types').CacheRequest} CacheRequest
* @typedef {import('../types/types').CacheResponse} CacheResponse
* @typedef {import('../types/types').CachedRequests} CachedRequests
* @typedef {import('../types/types').CachedRequestInterceptor} CachedRequestInterceptor
* @typedef {import('../types/types').CachedResponseInterceptor} CachedResponseInterceptor
*/

View file

@ -69,7 +69,8 @@ describe('Ajax', () => {
},
};
// When
// @ts-expect-error
// TODO: fix AjaxConfig types => e.g. create FullAjaxConfig with everything "mandatory" and then AjaxConfig (= Partial of it) for user
// @ts-ignore
const ajax1 = new Ajax(config);
const defaultCacheIdentifierFunction = ajax1.options?.cacheOptions?.getCacheIdentifier;
// Then
@ -267,7 +268,9 @@ describe('Ajax', () => {
it('returns the original request object', async () => {
ajax.addRequestInterceptor(async () => new Response('my response', { status: 200 }));
const response = /** @type {CacheResponse} */ (await await ajax.fetch('/foo'));
const response = /** @type {import('../types/types.js').CacheResponse} */ (
await await ajax.fetch('/foo')
);
expect(response.request).to.be.an.instanceOf(Request);
});

View file

@ -1,9 +1,9 @@
import { expect } from '@open-wc/testing';
import * as sinon from 'sinon';
import '../../src/typedef.js';
import { Ajax } from '../../index.js';
import { Ajax, createCacheInterceptors } from '@lion/ajax';
// TODO: these are private API? should they be exposed? if not why do we test them?
import { extendCacheOptions, resetCacheSession, ajaxCache } from '../../src/cacheManager.js';
import { createCacheInterceptors } from '../../src/interceptors/cacheInterceptors.js';
const MOCK_RESPONSE = 'mock response';
@ -12,6 +12,11 @@ const getUrl = (/** @type {string} */ url) => new URL(url, window.location.href)
/** @type {Ajax} */
let ajax;
/**
* @typedef {import('../../types/types.js').CacheOptions} CacheOptions
* @typedef {import('../../types/types.js').RequestIdFunction} RequestIdFunction
*/
describe('cache interceptors', () => {
/**
* @param {number | undefined} timeout

View file

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist-types",
"rootDir": ".",
},
"include": ["src", "test", "types"],
"exclude": ["dist-types"]
}

View file

@ -1,5 +0,0 @@
import { SingletonManagerClass } from './src/SingletonManagerClass.js';
export { SingletonManagerClass } from './src/SingletonManagerClass.js';
export const singletonManager = new SingletonManagerClass();

View file

@ -11,30 +11,24 @@
"directory": "packages/singleton-manager"
},
"type": "module",
"main": "index.js",
"module": "index.js",
"files": [
"*.d.ts",
"*.js",
"dist-types",
"docs",
"src",
"test",
"test-helpers",
"translations",
"types"
"test"
],
"scripts": {
"debug": "cd ../../ && npm run debug -- --group singleton-manager",
"debug:firefox": "cd ../../ && npm run debug:firefox -- --group singleton-manager",
"debug:webkit": "cd ../../ && npm run debug:webkit -- --group singleton-manager",
"publish-docs": "node ../../packages-node/publish-docs/src/cli.js --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../",
"prepublishOnly": "npm run publish-docs",
"prepublishOnly": "npm run types && npm run publish-docs",
"start:fail": "es-dev-server -c demo/fail/server.js",
"start:singleton": "es-dev-server -c demo/singleton/server.js",
"start:singleton-complex": "es-dev-server -c demo/singleton-complex/server.js",
"test": "cd ../../ && npm run test:browser -- --group singleton-manager"
"test": "cd ../../ && npm run test:browser -- --group singleton-manager",
"types": "wireit"
},
"sideEffects": false,
"keywords": [
"lion",
"singleton-manager"
@ -43,7 +37,24 @@
"access": "public"
},
"exports": {
".": "./index.js",
".": {
"types": "./dist-types/src/index.d.ts",
"default": "./src/index.js"
},
"./docs/*": "./docs/*"
},
"wireit": {
"types": {
"command": "tsc --build --pretty",
"files": [
"src/**/*.js",
"test/**/*.js",
"types/**",
"tsconfig.json"
],
"output": [
"dist-types/**"
]
}
}
}

View file

@ -2,7 +2,7 @@ const sym = Symbol.for('lion::SingletonManagerClassStorage');
export class SingletonManagerClass {
constructor() {
/** protected */
/** @protected */
this._map = window[sym] ? window[sym] : (window[sym] = new Map());
}

View file

@ -0,0 +1,4 @@
import { SingletonManagerClass } from './SingletonManagerClass.js';
export { SingletonManagerClass };
export const singletonManager = new SingletonManagerClass();

View file

@ -19,7 +19,7 @@ describe('SingletonManagerClass', () => {
expect(mngr.has('overlays/overlays.js::0.14.x')).to.be.false;
});
it('does not override existing keys (e.g. subsequentual calls for the same keys are ignored)', () => {
it('does not override existing keys (e.g. subsequential calls for the same keys are ignored)', () => {
const mngr = new SingletonManagerClass();
mngr.set('overlays/overlays.js::0.14.x', 'is-set');
mngr.set('overlays/overlays.js::0.14.x', 'new-set');

View file

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist-types",
"rootDir": ".",
},
"include": ["src", "test", "types"],
"exclude": ["dist-types"]
}

View file

@ -119,7 +119,7 @@ export class LionAccordion extends LitElement {
this.__expanded = [];
}
/** @param {import('@lion/core').PropertyValues } changedProperties */
/** @param {import('lit').PropertyValues } changedProperties */
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties);
this.__setupSlots();

View file

@ -3,8 +3,9 @@ import { html } from 'lit/static-html.js';
import sinon from 'sinon';
import '@lion/ui/define/lion-accordion.js';
/**
* @typedef {import('../LionAccordion.js').LionAccordion} LionAccordion
* @typedef {import('../src/LionAccordion.js').LionAccordion} LionAccordion
*/
const basicAccordion = html`

View file

@ -5,7 +5,7 @@ const isKeyboardClickEvent = (/** @type {KeyboardEvent} */ e) => e.key === ' ' |
const isSpaceKeyboardClickEvent = (/** @type {KeyboardEvent} */ e) => e.key === ' ';
/**
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('lit').TemplateResult} TemplateResult
*/
/**
@ -143,7 +143,7 @@ export class LionButton extends DisabledWithTabIndexMixin(LitElement) {
}
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -1,7 +1,7 @@
import { LionButton } from './LionButton.js';
/**
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('lit').TemplateResult} TemplateResult
*/
/**

View file

@ -1,7 +1,7 @@
import { LionButtonReset } from './LionButtonReset.js';
/**
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('lit').TemplateResult} TemplateResult
* @typedef {{lionButtons: Set<LionButtonSubmit>, helper:HTMLButtonElement, observer:MutationObserver}} HelperRegistration
*/

View file

@ -18,9 +18,9 @@ import { getLastDayPreviousMonth } from './utils/getLastDayPreviousMonth.js';
import { isSameDate } from './utils/isSameDate.js';
/**
* @typedef {import('../types/day').Day} Day
* @typedef {import('../types/day').Week} Week
* @typedef {import('../types/day').Month} Month
* @typedef {import('../types/day.js').Day} Day
* @typedef {import('../types/day.js').Week} Week
* @typedef {import('../types/day.js').Month} Month
*/
/**
@ -308,7 +308,7 @@ export class LionCalendar extends LocalizeMixin(LitElement) {
}
}
/** @param {import('@lion/core').PropertyValues } changedProperties */
/** @param {import('lit').PropertyValues } changedProperties */
updated(changedProperties) {
super.updated(changedProperties);
if (changedProperties.has('__focusedDate') && this.__focusedDate) {

View file

@ -1,6 +1,6 @@
/**
* @param {Date} date,
* @returns {import('../../types/day').Day} day
* @returns {import('../../types/day.js').Day} day
*/
export function createDay(
date = new Date(),

View file

@ -5,7 +5,7 @@ import { createWeek } from './createWeek.js';
* @param {Date} date
* @param {Object} opts
* @param {number} [opts.firstDayOfWeek]
* @returns {import('../../types/day').Month}
* @returns {import('../../types/day.js').Month}
*/
export function createMonth(date, { firstDayOfWeek = 0 } = {}) {
if (Object.prototype.toString.call(date) !== '[object Date]') {
@ -17,7 +17,7 @@ export function createMonth(date, { firstDayOfWeek = 0 } = {}) {
const weekOptions = { firstDayOfWeek };
const month = {
/** @type {{days: import('../../types/day').Day[]}[]} */
/** @type {{days: import('../../types/day.js').Day[]}[]} */
weeks: [],
};

View file

@ -3,14 +3,14 @@ import { createMonth } from './createMonth.js';
/**
*
* @param {Date} date
* @return {{months: import('../../types/day').Month[]}}
* @return {{months: import('../../types/day.js').Month[]}}
*/
export function createMultipleMonth(
date,
{ firstDayOfWeek = 0, pastMonths = 0, futureMonths = 0 } = {},
) {
const multipleMonths = {
/** @type {{weeks: {days: import('../../types/day').Day[]}[]}[]} */
/** @type {{weeks: {days: import('../../types/day.js').Day[]}[]}[]} */
months: [],
};

View file

@ -4,7 +4,7 @@ import { createDay } from './createDay.js';
* @param {Date} date
* @param {Object} opts
* @param {number} [opts.firstDayOfWeek]
* @returns {import('../../types/day').Week}
* @returns {import('../../types/day.js').Week}
*/
export function createWeek(date, { firstDayOfWeek = 0 } = {}) {
if (Object.prototype.toString.call(date) !== '[object Date]') {
@ -19,7 +19,7 @@ export function createWeek(date, { firstDayOfWeek = 0 } = {}) {
}
const week = {
/** @type {import('../../types/day').Day[]} */
/** @type {import('../../types/day.js').Day[]} */
days: [],
};
for (let i = 0; i < 7; i += 1) {

View file

@ -2,8 +2,8 @@ import { html } from 'lit';
import { dayTemplate as defaultDayTemplate } from './dayTemplate.js';
/**
* @param {{months: {weeks: {days: import('../../types/day').Day[]}[]}[]}} data
* @param {{ weekdaysShort: string[], weekdays: string[], monthsLabels?: string[], dayTemplate?: (day: import('../../types/day').Day, { weekdays, monthsLabels }?: any) => import('@lion/core').TemplateResult }} opts
* @param {{months: {weeks: {days: import('../../types/day.js').Day[]}[]}[]}} data
* @param {{ weekdaysShort: string[], weekdays: string[], monthsLabels?: string[], dayTemplate?: (day: import('../../types/day.js').Day, { weekdays, monthsLabels }?: any) => import('lit').TemplateResult }} opts
*/
export function dataTemplate(
data,

View file

@ -20,7 +20,7 @@ const lastDaysOfYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
/**
*
* @param {import('../../types/day').Day} day
* @param {import('../../types/day.js').Day} day
* @param {{ weekdays: string[], monthsLabels?: string[] }} opts
*/
export function dayTemplate(day, { weekdays, monthsLabels = defaultMonthLabels }) {

View file

@ -6,7 +6,7 @@ import { DayObject } from './DayObject.js';
*/
export class CalendarObject {
/**
* @param {import('../src/LionCalendar').LionCalendar} calendarEl
* @param {import('../src/LionCalendar.js').LionCalendar} calendarEl
*/
constructor(calendarEl) {
this.el = calendarEl;

View file

@ -8,8 +8,8 @@ import { isSameDate } from '@lion/ui/calendar.js';
import { CalendarObject, DayObject } from '@lion/ui/calendar-test-helpers.js';
/**
* @typedef {import('../src/LionCalendar').LionCalendar} LionCalendar
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('../src/LionCalendar.js').LionCalendar} LionCalendar
* @typedef {import('lit').TemplateResult} TemplateResult
*/
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCalendar>} */ (_fixture);

View file

@ -3,7 +3,7 @@ import { createMonth } from '../../src/utils/createMonth.js';
import { createWeek } from '../../src/utils/createWeek.js';
/**
* @param {import('../../types/day').Month} obj
* @param {import('../../types/day.js').Month} obj
*/
function compareMonth(obj) {
obj.weeks.forEach((week, weeki) => {

View file

@ -3,7 +3,7 @@ import { createMultipleMonth } from '../../src/utils/createMultipleMonth.js';
import { createMonth } from '../../src/utils/createMonth.js';
/**
* @param {{ months: import('../../types/day').Month[]}} obj
* @param {{ months: import('../../types/day.js').Month[]}} obj
*/
function compareMultipleMonth(obj) {
obj.months.forEach((month, monthi) => {

View file

@ -3,7 +3,7 @@ import { createWeek } from '../../src/utils/createWeek.js';
import { createDay } from '../../src/utils/createDay.js';
/**
* @param {import('../../types/day').Week} obj
* @param {import('../../types/day.js').Week} obj
*/
function compareWeek(obj) {
for (let i = 0; i < 7; i += 1) {

View file

@ -1,3 +0,0 @@
export { LionCheckboxGroup } from "./src/LionCheckboxGroup.js";
export { LionCheckboxIndeterminate } from "./src/LionCheckboxIndeterminate.js";
export { LionCheckbox } from "./src/LionCheckbox.js";

View file

@ -2,7 +2,7 @@ import { html, css } from 'lit';
import { LionCheckbox } from './LionCheckbox.js';
/**
* @typedef {import('./LionCheckboxGroup').LionCheckboxGroup} LionCheckboxGroup
* @typedef {import('./LionCheckboxGroup.js').LionCheckboxGroup} LionCheckboxGroup
*/
export class LionCheckboxIndeterminate extends LionCheckbox {

View file

@ -5,8 +5,8 @@ import '@lion/ui/define/lion-checkbox.js';
import '@lion/ui/define/lion-checkbox-group.js';
/**
* @typedef {import('../src/LionCheckboxGroup').LionCheckboxGroup} LionCheckboxGroup
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('../src/LionCheckboxGroup.js').LionCheckboxGroup} LionCheckboxGroup
* @typedef {import('lit').TemplateResult} TemplateResult
*/
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCheckboxGroup>} */ (_fixture);

View file

@ -6,9 +6,9 @@ import '@lion/ui/define/lion-checkbox-group.js';
import '@lion/ui/define/lion-checkbox-indeterminate.js';
/**
* @typedef {import('../src/LionCheckbox').LionCheckbox} LionCheckbox
* @typedef {import('../src/LionCheckboxIndeterminate').LionCheckboxIndeterminate} LionCheckboxIndeterminate
* @typedef {import('../src/LionCheckboxGroup').LionCheckboxGroup} LionCheckboxGroup
* @typedef {import('../src/LionCheckbox.js').LionCheckbox} LionCheckbox
* @typedef {import('../src/LionCheckboxIndeterminate.js').LionCheckboxIndeterminate} LionCheckboxIndeterminate
* @typedef {import('../src/LionCheckboxGroup.js').LionCheckboxGroup} LionCheckboxGroup
*/
/**

View file

@ -3,7 +3,7 @@ import { html } from 'lit/static-html.js';
import '@lion/ui/define/lion-checkbox.js';
/**
* @typedef {import('../src/LionCheckbox').LionCheckbox} LionCheckbox
* @typedef {import('../src/LionCheckbox.js').LionCheckbox} LionCheckbox
*/
describe('<lion-checkbox>', () => {

View file

@ -65,7 +65,7 @@ export class LionCollapsible extends LitElement {
/**
* Update aria labels on state change.
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties) {
if (changedProperties.has('opened')) {

View file

@ -5,8 +5,8 @@ import '@lion/ui/define/lion-collapsible.js';
/**
* @typedef {import('../src/LionCollapsible').LionCollapsible} LionCollapsible
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('../src/LionCollapsible.js').LionCollapsible} LionCollapsible
* @typedef {import('lit').TemplateResult} TemplateResult
*/
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCollapsible>} */ (_fixture);

View file

@ -62,13 +62,13 @@ function makeMatchingTextBold(root, matchingString, option) {
// on Listbox or ListNavigationWithActiveDescendantMixin
/**
* @typedef {import('@lion/listbox').LionOption} LionOption
* @typedef {import('@lion/listbox').LionOptions} LionOptions
* @typedef {import('@lion/overlays/types/OverlayConfig').OverlayConfig} OverlayConfig
* @typedef {import('@lion/core/types/SlotMixinTypes').SlotsMap} SlotsMap
* @typedef {import('@lion/form-core/types/choice-group/ChoiceInputMixinTypes').ChoiceInputHost} ChoiceInputHost
* @typedef {import('@lion/form-core/types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../types/SelectionDisplay').SelectionDisplay} SelectionDisplay
* @typedef {import('../../listbox/src/LionOption.js').LionOption} LionOption
* @typedef {import('../../listbox/src/LionOptions.js').LionOptions} LionOptions
* @typedef {import('../../overlays/types/OverlayConfig.js').OverlayConfig} OverlayConfig
* @typedef {import('../../core/types/SlotMixinTypes.js').SlotsMap} SlotsMap
* @typedef {import('../../form-core/types/choice-group/ChoiceInputMixinTypes.js').ChoiceInputHost} ChoiceInputHost
* @typedef {import('../../form-core/types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../types/SelectionDisplay.js').SelectionDisplay} SelectionDisplay
*/
/**
@ -419,7 +419,7 @@ export class LionCombobox extends OverlayMixin(LionListbox) {
}
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -10,9 +10,9 @@ import sinon from 'sinon';
import { LionCombobox } from '@lion/ui/combobox.js';
/**
* @typedef {import('../types/SelectionDisplay').SelectionDisplay} SelectionDisplay
* @typedef {import('@lion/listbox/types/ListboxMixinTypes').ListboxHost} ListboxHost
* @typedef {import('@lion/form-core/types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../types/SelectionDisplay.js').SelectionDisplay} SelectionDisplay
* @typedef {import('../../listbox/types/ListboxMixinTypes.js').ListboxHost} ListboxHost
* @typedef {import('../../form-core/types/FormControlMixinTypes.js').FormControlHost} FormControlHost
*/
/**
@ -136,7 +136,7 @@ function getFilteredOptionValues(el) {
}
/**
* @param {{ autocomplete?:'none'|'list'|'both', matchMode?:'begin'|'all' }} [config]
* @param {{ autocomplete?:'none'|'list'|'both', matchMode?:'begin'|'all' }} config
*/
async function fruitFixture({ autocomplete, matchMode } = {}) {
const el = /** @type {LionCombobox} */ (
@ -954,7 +954,7 @@ describe('lion-combobox', () => {
describe('Selection display', () => {
class MySelectionDisplay extends LitElement {
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
onComboboxElementUpdated(changedProperties) {
if (

View file

@ -1,4 +1,4 @@
import { LionCombobox } from '../src/LionCombobox.js.js';
import { LionCombobox } from '../src/LionCombobox.js';
export interface SelectionDisplay extends HTMLElement {
comboboxElement: LionCombobox;

View file

@ -1,12 +1,12 @@
import { dedupeMixin } from '@open-wc/dedupe-mixin';
/**
* @typedef {import('../types/DisabledMixinTypes').DisabledMixin} DisabledMixin
* @typedef {import('../types/DisabledMixinTypes.js').DisabledMixin} DisabledMixin
*/
/**
* @type {DisabledMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('../index').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const DisabledMixinImplementation = superclass =>
// eslint-disable-next-line no-shadow

View file

@ -2,12 +2,12 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
import { DisabledMixin } from './DisabledMixin.js';
/**
* @typedef {import('../types/DisabledWithTabIndexMixinTypes').DisabledWithTabIndexMixin} DisabledWithTabIndexMixin
* @typedef {import('../types/DisabledWithTabIndexMixinTypes.js').DisabledWithTabIndexMixin} DisabledWithTabIndexMixin
*/
/**
* @type {DisabledWithTabIndexMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('../index').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const DisabledWithTabIndexMixinImplementation = superclass =>
// eslint-disable-next-line no-shadow

View file

@ -4,9 +4,9 @@ import { render } from 'lit';
import { isTemplateResult } from 'lit/directive-helpers.js';
/**
* @typedef {import('../types/SlotMixinTypes').SlotMixin} SlotMixin
* @typedef {import('../types/SlotMixinTypes').SlotsMap} SlotsMap
* @typedef {import('../index').LitElement} LitElement
* @typedef {import('../types/SlotMixinTypes.js').SlotMixin} SlotMixin
* @typedef {import('../types/SlotMixinTypes.js').SlotsMap} SlotsMap
* @typedef {import('lit').LitElement} LitElement
*/
/**
@ -36,7 +36,7 @@ const SlotMixinImplementation = superclass =>
/**
* @private
* @param {import('@lion/core').TemplateResult} template
* @param {import('lit').TemplateResult} template
*/
__renderAsNodes(template) {
// @ts-expect-error wait for browser support

View file

@ -1,6 +1,6 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { DisabledHost } from './DisabledMixinTypes';
import { LitElement } from 'lit';
import { DisabledHost } from './DisabledMixinTypes.js';
export declare class DisabledWithTabIndexHost {
tabIndex: number;
/**
@ -15,7 +15,7 @@ export declare class DisabledWithTabIndexHost {
private __internalSetTabIndex(value: boolean): void;
firstUpdated(changedProperties: import('lit-element').PropertyValues): void;
firstUpdated(changedProperties: import('lit').PropertyValues): void;
}
export declare function DisabledWithTabIndexMixinImplementation<T extends Constructor<LitElement>>(

View file

@ -1,5 +1,5 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { TemplateResult, LitElement } from '../index.js';
import { TemplateResult, LitElement } from 'lit';
declare function slotFunction(): HTMLElement | Node[] | TemplateResult | undefined;

View file

@ -3,9 +3,8 @@ import { runOverlayMixinSuite } from '../../overlays/test-suites/OverlayMixin.su
import '@lion/ui/define/lion-dialog.js';
/**
* @typedef {import('../src/LionDialog').LionDialog} LionDialog
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('../src/LionDialog.js').LionDialog} LionDialog
* @typedef {import('lit').TemplateResult} TemplateResult
*/
const fixture = /** @type {(arg: TemplateResult) => Promise<LionDialog>} */ (_fixture);

View file

@ -15,9 +15,9 @@ function applyFocusVisiblePolyfillWhenNeeded(node) {
}
/**
* @typedef {import('../types/FocusMixinTypes').FocusMixin} FocusMixin
* @typedef {import('../types/FocusMixinTypes.js').FocusMixin} FocusMixin
* @type {FocusMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const FocusMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051

View file

@ -6,16 +6,16 @@ import { Unparseable } from './validate/Unparseable.js';
import { FormRegisteringMixin } from './registration/FormRegisteringMixin.js';
/**
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('@lion/core').CSSResult} CSSResult
* @typedef {import('@lion/core').CSSResultArray} CSSResultArray
* @typedef {import('@lion/core/types/SlotMixinTypes').SlotsMap} SlotsMap
* @typedef {import('./validate/LionValidationFeedback').LionValidationFeedback} LionValidationFeedback
* @typedef {import('../types/choice-group/ChoiceInputMixinTypes').ChoiceInputHost} ChoiceInputHost
* @typedef {import('../types/FormControlMixinTypes.js.js').FormControlHost} FormControlHost
* @typedef {import('../types/FormControlMixinTypes.js.js').HTMLElementWithValue} HTMLElementWithValue
* @typedef {import('../types/FormControlMixinTypes.js.js').FormControlMixin} FormControlMixin
* @typedef {import('../types/FormControlMixinTypes.js.js').ModelValueEventDetails} ModelValueEventDetails
* @typedef {import('lit').TemplateResult} TemplateResult
* @typedef {import('lit').CSSResult} CSSResult
* @typedef {import('lit').CSSResultArray} CSSResultArray
* @typedef {import('../../core/types/SlotMixinTypes.js').SlotsMap} SlotsMap
* @typedef {import('./validate/LionValidationFeedback.js').LionValidationFeedback} LionValidationFeedback
* @typedef {import('../types/choice-group/ChoiceInputMixinTypes.js').ChoiceInputHost} ChoiceInputHost
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../types/FormControlMixinTypes.js').HTMLElementWithValue} HTMLElementWithValue
* @typedef {import('../types/FormControlMixinTypes.js').FormControlMixin} FormControlMixin
* @typedef {import('../types/FormControlMixinTypes.js').ModelValueEventDetails} ModelValueEventDetails
*/
/**
@ -24,7 +24,7 @@ import { FormRegisteringMixin } from './registration/FormRegisteringMixin.js';
* This Mixin is a shared fundament for all form components, it's applied on:
* - LionField (which is extended to LionInput, LionTextarea, LionSelect etc. etc.)
* - LionFieldset (which is extended to LionRadioGroup, LionCheckboxGroup, LionForm)
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
* @type {FormControlMixin}
*/
const FormControlMixinImplementation = superclass =>
@ -272,7 +272,7 @@ const FormControlMixinImplementation = superclass =>
}
}
/** @param {import('@lion/core').PropertyValues } changedProperties */
/** @param {import('lit').PropertyValues } changedProperties */
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -6,9 +6,9 @@ import { Unparseable } from './validate/Unparseable.js';
import { ValidateMixin } from './validate/ValidateMixin.js';
/**
* @typedef {import('../types/FormatMixinTypes').FormatMixin} FormatMixin
* @typedef {import('../types/FormatMixinTypes').FormatOptions} FormatOptions
* @typedef {import('../types/FormControlMixinTypes.js.js').ModelValueEventDetails} ModelValueEventDetails
* @typedef {import('../types/FormatMixinTypes.js').FormatMixin} FormatMixin
* @typedef {import('../types/FormatMixinTypes.js').FormatOptions} FormatOptions
* @typedef {import('../types/FormControlMixinTypes.js').ModelValueEventDetails} ModelValueEventDetails
*/
// For a future breaking release:
@ -55,7 +55,7 @@ import { ValidateMixin } from './validate/ValidateMixin.js';
* Flow: serializedValue (deserializer) -> `.modelValue` (formatter) -> `.formattedValue` -> `._inputNode.value`
*
* @type {FormatMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const FormatMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -310,10 +310,12 @@ const FormatMixinImplementation = superclass =>
/** @privateEvent model-value-changed: FormControl redispatches it as public event */
new CustomEvent('model-value-changed', {
bubbles: true,
detail: /** @type { ModelValueEventDetails } */ ({
formPath: [this],
isTriggeredByUser: Boolean(this._isHandlingUserInput),
}),
detail: /** @type { ModelValueEventDetails } */ (
/** @type {unknown} */ ({
formPath: [this],
isTriggeredByUser: Boolean(this._isHandlingUserInput),
})
),
}),
);
}

View file

@ -2,8 +2,8 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
import { FormControlMixin } from './FormControlMixin.js';
/**
* @typedef {import('../types/InteractionStateMixinTypes').InteractionStateMixin} InteractionStateMixin
* @typedef {import('../types/InteractionStateMixinTypes').InteractionStates} InteractionStates
* @typedef {import('../types/InteractionStateMixinTypes.js').InteractionStateMixin} InteractionStateMixin
* @typedef {import('../types/InteractionStateMixinTypes.js').InteractionStates} InteractionStates
*/
/**
@ -16,7 +16,7 @@ import { FormControlMixin } from './FormControlMixin.js';
* - on keyup (actually, on the model-value-changed event) -> 'dirty' will be set to true
*
* @type {InteractionStateMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const InteractionStateMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051

View file

@ -27,7 +27,7 @@ export class LionField extends FormControlMixin(
InteractionStateMixin(FocusMixin(FormatMixin(ValidateMixin(SlotMixin(LitElement))))),
) {
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues} changedProperties
*/
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties);

View file

@ -4,9 +4,9 @@ import { FocusMixin } from './FocusMixin.js';
import { FormatMixin } from './FormatMixin.js';
/**
* @typedef {import('../types/NativeTextFieldMixinTypes').NativeTextFieldMixin} NativeTextFieldMixin
* @typedef {import('../types/NativeTextFieldMixinTypes.js').NativeTextFieldMixin} NativeTextFieldMixin
* @type {NativeTextFieldMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass} superclass
*/
const NativeTextFieldMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -70,7 +70,8 @@ const NativeTextFieldMixinImplementation = superclass =>
/**
* The view value. Will be delegated to `._inputNode.value`
* @override FormatMixin
*
* Note: Overrides the implementation from FormatMixin
*/
get value() {
return (this._inputNode && this._inputNode.value) || this.__value || '';
@ -78,7 +79,7 @@ const NativeTextFieldMixinImplementation = superclass =>
/**
* @param {string} value
* @override FormatMixin - We don't delegate, because we want to preserve caret position via _setValueAndPreserveCaret
* Note: Overridess the implementation from FormatMixin - We don't delegate, because we want to preserve caret position via _setValueAndPreserveCaret
*/
set value(value) {
// if not yet connected to dom can't change the value
@ -125,7 +126,7 @@ const NativeTextFieldMixinImplementation = superclass =>
}
/**
* @override FormatMixin
* Note: Overrides the implementation from FormatMixin
*/
_reflectBackFormattedValueToUser() {
super._reflectBackFormattedValueToUser();

View file

@ -3,11 +3,11 @@ import { FormRegistrarMixin } from '../registration/FormRegistrarMixin.js';
import { InteractionStateMixin } from '../InteractionStateMixin.js';
/**
* @typedef {import('../../types/choice-group/ChoiceGroupMixinTypes').ChoiceGroupMixin} ChoiceGroupMixin
* @typedef {import('../../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/form-group/FormGroupMixinTypes').FormControl} FormControl
* @typedef {import('../../types/choice-group/ChoiceInputMixinTypes').ChoiceInputHost} ChoiceInputHost
* @typedef {import('../../types/choice-group/ChoiceGroupMixinTypes.js').ChoiceGroupMixin} ChoiceGroupMixin
* @typedef {import('../../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/form-group/FormGroupMixinTypes.js').FormControl} FormControl
* @typedef {import('../../types/choice-group/ChoiceInputMixinTypes.js').ChoiceInputHost} ChoiceInputHost
*/
/**
@ -18,7 +18,7 @@ import { InteractionStateMixin } from '../InteractionStateMixin.js';
* children events, like in FormGroups
*
* @type {ChoiceGroupMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const ChoiceGroupMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -166,7 +166,7 @@ const ChoiceGroupMixinImplementation = superclass =>
Promise.resolve().then(() => super._completeRegistration());
}
/** @param {import('@lion/core').PropertyValues} changedProperties */
/** @param {import('lit').PropertyValues} changedProperties */
updated(changedProperties) {
super.updated(changedProperties);
if (changedProperties.has('name') && this.name !== changedProperties.get('name')) {

View file

@ -5,10 +5,10 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
import { FormatMixin } from '../FormatMixin.js';
/**
* @typedef {import('../../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {FormControlHost & HTMLElement & {_parentFormGroup?:HTMLElement, checked?:boolean}} FormControl
* @typedef {import('../../types/choice-group/ChoiceInputMixinTypes').ChoiceInputMixin} ChoiceInputMixin
* @typedef {import('../../types/choice-group/ChoiceInputMixinTypes').ChoiceInputModelValue} ChoiceInputModelValue
* @typedef {import('../../types/choice-group/ChoiceInputMixinTypes.js').ChoiceInputMixin} ChoiceInputMixin
* @typedef {import('../../types/choice-group/ChoiceInputMixinTypes.js').ChoiceInputModelValue} ChoiceInputModelValue
*/
/**
@ -19,7 +19,7 @@ const hasChanged = (nw, old = {}) => nw.value !== old.value || nw.checked !== ol
/**
* @type {ChoiceInputMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const ChoiceInputMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -70,7 +70,7 @@ const ChoiceInputMixinImplementation = superclass =>
}
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties);
@ -82,7 +82,7 @@ const ChoiceInputMixinImplementation = superclass =>
}
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -1,6 +1,6 @@
import { html } from 'lit';
import { SlotMixin, DisabledMixin } from '@lion/ui/core.js';
import { dedupeMixin } from '@open-wc/dedupe-mixin';
import { SlotMixin, DisabledMixin } from '@lion/ui/core.js';
import { FormControlMixin } from '../FormControlMixin.js';
import { FormControlsCollection } from '../registration/FormControlsCollection.js';
import { FormRegistrarMixin } from '../registration/FormRegistrarMixin.js';
@ -9,12 +9,12 @@ import { getAriaElementsInRightDomOrder } from '../utils/getAriaElementsInRightD
import { FormElementsHaveNoError } from './FormElementsHaveNoError.js';
/**
* @typedef {import('../../types/form-group/FormGroupMixinTypes').FormGroupMixin} FormGroupMixin
* @typedef {import('../../types/form-group/FormGroupMixinTypes').FormGroupHost} FormGroupHost
* @typedef {import('../../types/form-group/FormGroupMixinTypes').FormControl} FormControl
* @typedef {import('../../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegisteringMixinTypes').FormRegisteringHost} FormRegisteringHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/form-group/FormGroupMixinTypes.js').FormGroupMixin} FormGroupMixin
* @typedef {import('../../types/form-group/FormGroupMixinTypes.js').FormGroupHost} FormGroupHost
* @typedef {import('../../types/form-group/FormGroupMixinTypes.js').FormControl} FormControl
* @typedef {import('../../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegisteringMixinTypes.js').FormRegisteringHost} FormRegisteringHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').ElementWithParentFormGroup} ElementWithParentFormGroup
*/
/**
@ -27,7 +27,7 @@ import { FormElementsHaveNoError } from './FormElementsHaveNoError.js';
* children via formElements and the automatic grouping of formElements via '[]').
*
* @type {FormGroupMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const FormGroupMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -199,7 +199,7 @@ const FormGroupMixinImplementation = superclass =>
}
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -1,12 +1,12 @@
import { dedupeMixin } from '@open-wc/dedupe-mixin';
/**
* @typedef {import('@lion/core').LitElement} LitElement
* @typedef {import('../../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegisteringMixinTypes').FormRegisteringMixin} FormRegisteringMixin
* @typedef {import('../../types/registration/FormRegisteringMixinTypes').FormRegisteringHost} FormRegisteringHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').FormRegistrarHost} FormRegistrarHost
* @typedef {import('lit').LitElement} LitElement
* @typedef {import('../../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegisteringMixinTypes.js').FormRegisteringMixin} FormRegisteringMixin
* @typedef {import('../../types/registration/FormRegisteringMixinTypes.js').FormRegisteringHost} FormRegisteringHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').FormRegistrarHost} FormRegistrarHost
*/
/**

View file

@ -4,11 +4,11 @@ import { FormControlsCollection } from './FormControlsCollection.js';
import { FormRegisteringMixin } from './FormRegisteringMixin.js';
/**
* @typedef {import('../../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').FormRegistrarMixin} FormRegistrarMixin
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').FormRegistrarHost} FormRegistrarHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/registration/FormRegisteringMixinTypes').FormRegisteringHost} FormRegisteringHost
* @typedef {import('../../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').FormRegistrarMixin} FormRegistrarMixin
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').FormRegistrarHost} FormRegistrarHost
* @typedef {import('../../types/registration/FormRegistrarMixinTypes.js').ElementWithParentFormGroup} ElementWithParentFormGroup
* @typedef {import('../../types/registration/FormRegisteringMixinTypes.js').FormRegisteringHost} FormRegisteringHost
* @typedef {FormControlHost & HTMLElement & {_parentFormGroup?:HTMLElement, checked?:boolean}} FormControl
*/
@ -21,7 +21,7 @@ import { FormRegisteringMixin } from './FormRegisteringMixin.js';
* For choice groups, the value will only stay an array.
* See FormControlsCollection for more information
* @type {FormRegistrarMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const FormRegistrarMixinImplementation = superclass =>
// eslint-disable-next-line no-shadow, no-unused-vars

View file

@ -1,8 +1,8 @@
import { dedupeMixin } from '@open-wc/dedupe-mixin';
/**
* @typedef {import('../../types/registration/FormRegistrarPortalMixinTypes').FormRegistrarPortalMixin} FormRegistrarPortalMixin
* @typedef {import('../../types/registration/FormRegistrarPortalMixinTypes').FormRegistrarPortalHost} FormRegistrarPortalHost
* @typedef {import('../../types/registration/FormRegistrarPortalMixinTypes.js').FormRegistrarPortalMixin} FormRegistrarPortalMixin
* @typedef {import('../../types/registration/FormRegistrarPortalMixinTypes.js').FormRegistrarPortalHost} FormRegistrarPortalHost
*/
/**

View file

@ -3,8 +3,8 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
// TODO: will be moved to @Lion/core later?
/**
* @typedef {import('../../types/utils/SyncUpdatableMixinTypes').SyncUpdatableMixin} SyncUpdatableMixin
* @typedef {import('../../types/utils/SyncUpdatableMixinTypes').SyncUpdatableNamespace} SyncUpdatableNamespace
* @typedef {import('../../types/utils/SyncUpdatableMixinTypes.js').SyncUpdatableMixin} SyncUpdatableMixin
* @typedef {import('../../types/utils/SyncUpdatableMixinTypes.js').SyncUpdatableNamespace} SyncUpdatableNamespace
*/
/**
@ -21,7 +21,7 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
* Whenever the implementation of `requestUpdate` changes (this happened in the past for
* `requestUpdate`) we only have to change our abstraction instead of all our components
* @type {SyncUpdatableMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
const SyncUpdatableMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -76,7 +76,7 @@ const SyncUpdatableMixinImplementation = superclass =>
__syncUpdatableInitialize() {
const ns = this.__SyncUpdatableNamespace;
const ctor =
/** @type {typeof SyncUpdatableMixin & typeof import('../../types/utils/SyncUpdatableMixinTypes').SyncUpdatableHost} */ (
/** @type {typeof SyncUpdatableMixin & typeof import('../../types/utils/SyncUpdatableMixinTypes.js').SyncUpdatableHost} */ (
this.constructor
);
@ -103,7 +103,7 @@ const SyncUpdatableMixinImplementation = superclass =>
const ns = this.__SyncUpdatableNamespace;
const ctor =
/** @type {typeof SyncUpdatableMixin & typeof import('../../types/utils/SyncUpdatableMixinTypes').SyncUpdatableHost} */ (
/** @type {typeof SyncUpdatableMixin & typeof import('../../types/utils/SyncUpdatableMixinTypes.js').SyncUpdatableHost} */ (
this.constructor
);
// Before connectedCallback: queue

View file

@ -1,8 +1,8 @@
import { html, LitElement } from 'lit';
/**
* @typedef {import('./Validator').Validator} Validator
* @typedef {import('@lion/core').TemplateResult} TemplateResult
* @typedef {import('./Validator.js').Validator} Validator
* @typedef {import('lit').TemplateResult} TemplateResult
* @typedef {Object} messageMap
* @property {string | Node} message
* @property {string} type
@ -34,7 +34,7 @@ export class LionValidationFeedback extends LitElement {
}
/**
* @param {import('@lion/core').PropertyValues } changedProperties
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -17,10 +17,10 @@ import { FormControlMixin } from '../FormControlMixin.js';
// TODO: [v1] make all @readOnly => @readonly and actually make sure those values cannot be set
/**
* @typedef {import('../../types/validate/ValidateMixinTypes').ValidateMixin} ValidateMixin
* @typedef {import('../../types/validate/ValidateMixinTypes').ValidationType} ValidationType
* @typedef {import('../../types/validate/ValidateMixinTypes').ValidateHost} ValidateHost
* @typedef {typeof import('../../types/validate/ValidateMixinTypes').ValidateHost} ValidateHostConstructor
* @typedef {import('../../types/validate/ValidateMixinTypes.js').ValidateMixin} ValidateMixin
* @typedef {import('../../types/validate/ValidateMixinTypes.js').ValidationType} ValidationType
* @typedef {import('../../types/validate/ValidateMixinTypes.js').ValidateHost} ValidateHost
* @typedef {typeof import('../../types/validate/ValidateMixinTypes.js').ValidateHost} ValidateHostConstructor
* @typedef {{validator:Validator; outcome:boolean|string}} ValidationResultEntry
* @typedef {{[type:string]: {[validatorName:string]:boolean|string}}} ValidationStates
*/
@ -38,7 +38,7 @@ function arrayDiff(array1 = [], array2 = []) {
* UI. All error visibility, dom interaction and accessibility are handled in FeedbackMixin.
*
* @type {ValidateMixin}
* @param {import('@open-wc/dedupe-mixin').Constructor<import('@lion/core').LitElement>} superclass
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
*/
export const ValidateMixinImplementation = superclass =>
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
@ -47,7 +47,7 @@ export const ValidateMixinImplementation = superclass =>
) {
static get scopedElements() {
const scopedElementsCtor =
/** @type {typeof import('@open-wc/scoped-elements/src/types').ScopedElementsHost} */ (
/** @type {typeof import('@open-wc/scoped-elements').ScopedElementsHost} */ (
super.constructor
);
return {
@ -271,7 +271,7 @@ export const ValidateMixinImplementation = superclass =>
}
/**
* @param {import('@lion/core').PropertyValues} changedProperties
* @param {import('lit').PropertyValues} changedProperties
*/
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties);
@ -363,7 +363,7 @@ export const ValidateMixinImplementation = superclass =>
* Situations a2 and a3 are not mutually exclusive and can be triggered within one `validate()`
* call. Situation b will occur after every call.
*
* @param {{ clearCurrentResult?: boolean }} [opts]
* @param {{ clearCurrentResult?: boolean }} opts
*/
async validate({ clearCurrentResult } = {}) {
if (this.disabled) {
@ -468,6 +468,8 @@ export const ValidateMixinImplementation = superclass =>
this.__syncValidationResult = syncValidators
.map(v => ({
validator: v,
// TODO: fix this type - ts things this is not a FormControlHost?
// @ts-ignore
outcome: /** @type {boolean|string} */ (v.execute(value, v.param, { node: this })),
}))
.filter(v => Boolean(v.outcome));
@ -612,7 +614,11 @@ export const ValidateMixinImplementation = superclass =>
v.removeEventListener(e, this._onValidatorUpdated);
}
});
v.onFormControlDisconnect(this);
v.onFormControlDisconnect(
/** @type {import('../../types/FormControlMixinTypes.js').FormControlHost} */ (
/** @type {unknown} */ (this)
),
);
});
}
this._allValidators.forEach(v => {
@ -826,7 +832,7 @@ export const ValidateMixinImplementation = superclass =>
}
/**
* @param {import('@lion/core').PropertyValues} changedProperties
* @param {import('lit').PropertyValues} changedProperties
*/
updated(changedProperties) {
super.updated(changedProperties);

View file

@ -1,11 +1,11 @@
/**
* @typedef {import('../../types/validate').FeedbackMessageData} FeedbackMessageData
* @typedef {import('../../types/validate').ValidatorParam} ValidatorParam
* @typedef {import('../../types/validate').ValidatorConfig} ValidatorConfig
* @typedef {import('../../types/validate').ValidatorOutcome} ValidatorOutcome
* @typedef {import('../../types/validate').ValidatorName} ValidatorName
* @typedef {import('../../types/validate').ValidationType} ValidationType
* @typedef {import('../FormControlMixin').FormControlHost} FormControlHost
* @typedef {import('../../types/validate/index.js').FeedbackMessageData} FeedbackMessageData
* @typedef {import('../../types/validate/index.js').ValidatorParam} ValidatorParam
* @typedef {import('../../types/validate/index.js').ValidatorConfig} ValidatorConfig
* @typedef {import('../../types/validate/index.js').ValidatorOutcome} ValidatorOutcome
* @typedef {import('../../types/validate/index.js').ValidatorName} ValidatorName
* @typedef {import('../../types/validate/index.js').ValidationType} ValidationType
* @typedef {import('../FormControlMixin.js').FormControlHost} FormControlHost
*/
// TODO: support attribute validators like <my-el my-validator=${dynamicParam}></my-el> =>

View file

@ -1,7 +1,7 @@
import { ResultValidator } from '../ResultValidator.js';
/**
* @typedef {import('../Validator').Validator} Validator
* @typedef {import('../Validator.js').Validator} Validator
*/
export class DefaultSuccess extends ResultValidator {

View file

@ -1,7 +1,7 @@
import { Validator } from '../Validator.js';
/**
* @typedef {import('../../../types/FormControlMixinTypes.js.js').FormControlHost} FormControlHost
* @typedef {import('../../../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
*/
export class Required extends Validator {

View file

@ -1,6 +1,6 @@
/**
* @typedef {import('../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../types/validate/ValidateMixinTypes').ValidateHost} ValidateHost
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {import('../types/validate/ValidateMixinTypes.js').ValidateHost} ValidateHost
*/
/**

View file

@ -50,6 +50,9 @@ export const runRegistrationSuite = customConfig => {
});
it('works with document.createElement', async () => {
if (parentTagString === undefined || childTagString === undefined) {
throw new Error('You need to define parentTagString & childTagString');
}
const el = /** @type {RegistrarClass} */ (document.createElement(parentTagString));
const childEl = document.createElement(childTagString);
expect(el.formElements.length).to.equal(0);

View file

@ -6,7 +6,7 @@ import { Unparseable, Validator, FormatMixin } from '@lion/ui/form-core.js';
import { getFormControlMembers, mimicUserInput } from '@lion/ui/form-core-test-helpers.js';
/**
* @typedef {import('../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {ArrayConstructor | ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor | DateConstructor | 'iban' | 'email'} modelValueType
*/

View file

@ -11,7 +11,7 @@ const isFirefox = (() => {
})();
/**
* @typedef {import('../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {ArrayConstructor | ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor | DateConstructor | 'iban' | 'email'} modelValueType
*/

View file

@ -22,7 +22,7 @@ import '@lion/ui/define/lion-field.js';
import '@lion/ui/define/lion-validation-feedback.js';
/**
* @typedef {import('..').LionField} LionField
* @typedef {import('@lion/ui/form-core.js').LionField} LionField
*/
/**
@ -1111,15 +1111,17 @@ export function runValidateMixinSuite(customConfig) {
const { _inputNode } = getFormControlMembers(el);
if (_inputNode) {
// @ts-expect-error
// @ts-ignore -- we are testing the protected _inputNode here
const spy = sinon.spy(el._inputNode, 'setCustomValidity');
el.modelValue = '';
expect(spy.callCount).to.equal(1);
// @ts-expect-error needs to be rewritten to new API
// TODO: why are we testing validationMessage here?
// @ts-ignore
expect(el.validationMessage).to.be('foo');
el.modelValue = '123';
expect(spy.callCount).to.equal(2);
// @ts-expect-error needs to be rewritten to new API
// @ts-ignore
expect(el.validationMessage).to.be('');
}
});
@ -1226,7 +1228,7 @@ export function runValidateMixinSuite(customConfig) {
await el.feedbackComplete;
const feedbackNode =
/** @type {import('../src/validate/LionValidationFeedback').LionValidationFeedback} */
/** @type {import('../src/validate/LionValidationFeedback.js').LionValidationFeedback} */
(_feedbackNode);
const resultOrder = feedbackNode.feedbackData?.map(v => v.type);
expect(resultOrder).to.deep.equal(['error', 'x', 'y']);

View file

@ -14,7 +14,7 @@ import {
} from '@lion/ui/form-core.js';
/**
* @typedef {import('../types').FeedbackMessageData} FeedbackMessageData
* @typedef {import('../types/validate/validate.js').FeedbackMessageData} FeedbackMessageData
*/
export function runValidateMixinFeedbackPart() {

View file

@ -27,7 +27,7 @@ class ChoiceInputGroup extends ChoiceGroupMixin(FormGroupMixin(LitElement)) {}
customElements.define('choice-input-group', ChoiceInputGroup);
/**
* @param {{ parentTagString?:string, childTagString?: string, choiceType?: string}} [config]
* @param {{ parentTagString?:string, childTagString?: string, choiceType?: string}} config
*/
export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choiceType } = {}) {
const cfg = {

View file

@ -14,7 +14,7 @@ class ChoiceInput extends ChoiceInputMixin(LionInput) {
customElements.define('choice-group-input', ChoiceInput);
/**
* @param {{ tagString?:string, tagType?: string}} [config]
* @param {{ tagString?:string, tagType?: string}} config
* @deprecated
*/
export function runChoiceInputMixinSuite({ tagString } = {}) {

View file

@ -8,7 +8,7 @@ import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing'
import { FormGroupMixin } from '@lion/ui/form-core.js';
/**
* @typedef {import('@lion/form-core').LionField} LionField
* @typedef {import('@lion/ui/form-core.js').LionField} LionField
*/
/**

View file

@ -144,7 +144,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
// we test the api directly as errors thrown from a web component are in a
// different context and we can not catch them here => register fake elements
el.addFormElement(
/** @type {HTMLElement & import('../../types/FormControlMixinTypes').FormControlHost} */ ({
/** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ ({
name: 'foo',
}),
);
@ -169,12 +169,12 @@ export function runFormGroupMixinSuite(cfg = {}) {
// we test the api directly as errors thrown from a web component are in a
// different context and we can not catch them here => register fake elements
el.addFormElement(
/** @type {HTMLElement & import('../../types/FormControlMixinTypes').FormControlHost} */ ({
/** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ ({
name: 'fooBar',
}),
);
el.addFormElement(
/** @type {HTMLElement & import('../../types/FormControlMixinTypes').FormControlHost} */ ({
/** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ ({
name: 'fooBar',
}),
);
@ -324,7 +324,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
/**
*
* @param {import('../../types/FormControlMixinTypes').FormControlHost & {disabled: boolean}} el
* @param {import('../../types/FormControlMixinTypes.js').FormControlHost & {disabled: boolean}} el
* @param {string} type
*/
_getFromAllFormElementsFilter(el, type) {
@ -383,8 +383,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
}
/**
*
* @param {import('../../types/FormControlMixinTypes').FormControlHost & {disabled: boolean}} el
* @param {import('../../types/FormControlMixinTypes.js').FormControlHost & {disabled: boolean}} el
* @param {string} type
*/
_getFromAllFormElementsFilter(el, type) {
@ -413,7 +412,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
`)
);
// @ts-expect-error access protected method
// @ts-ignore -- we are testing a protected method here
expect(el._getFromAllFormElements('serializedValue')).to.eql({
b: 'x',
newFieldset: {
@ -421,7 +420,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
},
});
// @ts-expect-error access protected method
// @ts-ignore -- we are testing a protected method here
expect(el._getFromAllFormElements('serializedValue', () => true)).to.eql({
a: 'x',
b: 'x',
@ -1236,7 +1235,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
`)
);
const childFieldsetEl = el.querySelector(tagString);
// @ts-expect-error
const resetGroupSpy = sinon.spy(childFieldsetEl, 'resetGroup');
el.resetGroup();
expect(resetGroupSpy.callCount).to.equal(1);
@ -1273,7 +1271,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
`)
);
const childFieldsetEl = el.querySelector(tagString);
// @ts-expect-error
const clearGroupSpy = sinon.spy(childFieldsetEl, 'clearGroup');
el.clearGroup();
expect(clearGroupSpy.callCount).to.equal(1);

View file

@ -10,7 +10,7 @@ import {
} from '@lion/ui/form-core.js';
/**
* @typedef {import('../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
*/
describe('FormControlMixin', () => {
@ -267,7 +267,7 @@ describe('FormControlMixin', () => {
`);
/**
* @typedef {* & import('../types/FormControlMixinTypes').FormControlHost} FormControl
* @typedef {* & import('../types/FormControlMixinTypes.js').FormControlHost} FormControl
*/
const field1El = /** @type {FormControl} */ (formEl.querySelector('[name=field1]'));
const field2El = /** @type {FormControl} */ (formEl.querySelector('[name=field2]'));

View file

@ -15,8 +15,8 @@ import {
import sinon from 'sinon';
/**
* @typedef {import('../src/LionField.js.js').LionField} LionField
* @typedef {import('../types/FormControlMixinTypes').FormControlHost} FormControlHost
* @typedef {import('../src/LionField.js').LionField} LionField
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
* @typedef {FormControlHost & HTMLElement & {_parentFormGroup?:HTMLElement, checked?:boolean}} FormControl
*/
@ -28,7 +28,7 @@ const inputSlotString = '<input slot="input" />';
const inputSlot = unsafeHTML(inputSlotString);
/**
* @param {import("../index.js.js").LionField} formControl
* @param {LionField} formControl
* @param {string} newViewValue
*/
function mimicUserInput(formControl, newViewValue) {
@ -252,7 +252,7 @@ describe('<lion-field>', () => {
);
/**
* @param {import("../index.js.js").LionField} _sceneEl
* @param {LionField} _sceneEl
* @param {{ index?: number; el: any; wantedShowsFeedbackFor: any; }} scenario
*/
const executeScenario = async (_sceneEl, scenario) => {

View file

@ -25,7 +25,7 @@ describe('SyncUpdatableMixin', () => {
this.propB = 'init-b';
}
/** @param {import('@lion/core').PropertyValues } changedProperties */
/** @param {import('lit').PropertyValues } changedProperties */
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties);
hasCalledFirstUpdated = true;

View file

@ -2,7 +2,7 @@ import { expect } from '@open-wc/testing';
import { MinLength, Required, DefaultSuccess, ResultValidator } from '@lion/ui/form-core.js';
/**
* @typedef {import('../../src/validate/Validator').Validator} Validator
* @typedef {import('../../src/validate/Validator.js').Validator} Validator
*/
describe('ResultValidator', () => {

View file

@ -6,7 +6,7 @@ import '@lion/ui/define/lion-validation-feedback.js';
import { AlwaysInvalid, AlwaysValid } from '@lion/ui/form-core-test-helpers.js';
/**
* @typedef {import('../../src/validate/LionValidationFeedback').LionValidationFeedback} LionValidationFeedback
* @typedef {import('../../src/validate/LionValidationFeedback.js').LionValidationFeedback} LionValidationFeedback
*/
describe('lion-validation-feedback', () => {

View file

@ -1,11 +1,11 @@
import { LitElement, nothing, TemplateResult, CSSResultArray } from '@lion/ui/core.js';
import { SlotHost } from '@lion/ui/core/types/SlotMixinTypes.js';
import { Constructor } from '@open-wc/dedupe-mixin';
import { DisabledHost } from '@lion/ui/core/types/DisabledMixinTypes.js';
import { FormRegisteringHost } from './registration/FormRegisteringMixinTypes';
import { LitElement, nothing, TemplateResult, CSSResultArray } from 'lit';
import { DisabledHost } from '../../core/types/DisabledMixinTypes.js';
import { SlotHost } from '../../core/types/SlotMixinTypes.js';
import { FormRegisteringHost } from './registration/FormRegisteringMixinTypes.js';
import { LionValidationFeedback } from '../src/validate/LionValidationFeedback';
import { Unparseable } from '../src/validate/Unparseable.js.js';
import { LionValidationFeedback } from '../src/validate/LionValidationFeedback.js';
import { Unparseable } from '../src/validate/Unparseable.js';
export type ModelValueEventDetails = {
/**
@ -34,7 +34,7 @@ export type ModelValueEventDetails = {
initialize?: boolean;
};
declare interface HTMLElementWithValue extends HTMLElement {
export declare interface HTMLElementWithValue extends HTMLElement {
value: string;
selectionStart?: number;
selectionEnd?: number;
@ -157,7 +157,7 @@ export declare class FormControlHost {
},
): void;
updated(changedProperties: import('@lion/core').PropertyValues): void;
updated(changedProperties: import('lit').PropertyValues): void;
/**
* The interactive (form) element. Can be a native element like input/textarea/select or

View file

@ -1,8 +1,7 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { LitElement } from 'lit';
import { FormatNumberOptions } from '@lion/ui/localize/types/LocalizeMixinTypes.js';
import { ValidateHost } from './validate/ValidateMixinTypes';
import { FormControlHost } from './FormControlMixinTypes';
import { ValidateHost } from './validate/ValidateMixinTypes.js';
import { FormControlHost } from './FormControlMixinTypes.js';
export type FormatOptions = { mode: 'pasted' | 'auto' } & object;
export declare class FormatHost {

View file

@ -1,12 +1,12 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { LitElement } from 'lit';
import { FormControlHost } from './FormControlMixinTypes';
import { FormControlHost } from './FormControlMixinTypes.js';
/**
* A set of meta info about a FormControl that helps in the context of determining validation
* feedback visibility
*/
type InteractionStates = {
export type InteractionStates = {
submitted: boolean;
touched: boolean;
dirty: boolean;

View file

@ -1,8 +1,11 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { LitElement } from 'lit';
import { FocusHost } from '@lion/ui/form-core/types/FocusMixinTypes.js';
import { FormControlHost } from '@lion/ui/form-core/types/FormControlMixinTypes.js';
import { FormatHost } from '@lion/ui/form-core/types/FormatMixinTypes.js';
import { FocusHost } from './FocusMixinTypes.js';
import { FormatHost } from './FormatMixinTypes.js';
import { FormControlHost } from './FormControlMixinTypes.js';
// import { FocusHost } from '@lion/ui/form-core/types/FocusMixinTypes.js';
// import { FormControlHost } from '@lion/ui/form-core/types/FormControlMixinTypes.js';
// import { FormatHost } from '@lion/ui/form-core/types/FormatMixinTypes.js';
export declare class NativeTextFieldHost {
/**

View file

@ -1,9 +1,9 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { LitElement } from 'lit';
import { FormControlHost } from '../FormControlMixinTypes';
import { FormControl } from '../form-group/FormGroupMixinTypes';
import { FormRegistrarHost } from '../registration/FormRegistrarMixinTypes';
import { InteractionStateHost } from '../InteractionStateMixinTypes';
import { FormControlHost } from '../FormControlMixinTypes.js';
import { FormControl } from '../form-group/FormGroupMixinTypes.js';
import { FormRegistrarHost } from '../registration/FormRegistrarMixinTypes.js';
import { InteractionStateHost } from '../InteractionStateMixinTypes.js';
export declare class ChoiceGroupHost {
multipleChoice: boolean;

View file

@ -1,7 +1,6 @@
import { Constructor } from '@open-wc/dedupe-mixin';
import { LitElement, TemplateResult } from '@lion/ui/core.js';
import { CSSResultArray } from '@lion/ui/core.js';
import { FormatHost } from '../FormatMixinTypes';
import { LitElement, TemplateResult, CSSResultArray } from 'lit';
import { FormatHost } from '../FormatMixinTypes.js';
export interface ChoiceInputModelValue {
checked: boolean;

Some files were not shown because too many files have changed in this diff Show more