diff --git a/.gitignore b/.gitignore index d6974c939..d6a00975d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,10 @@ yarn-error.log /build/ /bundlesize/dist/ **/custom-elements.json +dist +dist-types +*.tsbuildinfo +.wireit ## types *.d.ts diff --git a/package-lock.json b/package-lock.json index a7a7c3f68..34c5b2914 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 769d717ea..097c408fb 100644 --- a/package.json +++ b/package.json @@ -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": [ { diff --git a/packages-node/providence-analytics/package.json b/packages-node/providence-analytics/package.json index c02f5aba2..3dcb18b7a 100644 --- a/packages-node/providence-analytics/package.json +++ b/packages-node/providence-analytics/package.json @@ -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/*" } } diff --git a/packages/ajax/index.js b/packages/ajax/index.js deleted file mode 100644 index 26539bf3f..000000000 --- a/packages/ajax/index.js +++ /dev/null @@ -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(); diff --git a/packages/ajax/package.json b/packages/ajax/package.json index 23dec85d1..1fee682bf 100644 --- a/packages/ajax/package.json +++ b/packages/ajax/package.json @@ -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/**" + ] + } } } diff --git a/packages/ajax/src/Ajax.js b/packages/ajax/src/Ajax.js index f05ae5758..967a82c93 100644 --- a/packages/ajax/src/Ajax.js +++ b/packages/ajax/src/Ajax.js @@ -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; } diff --git a/packages/ajax/src/Cache.js b/packages/ajax/src/Cache.js index 2aa5bea0f..4e541129a 100644 --- a/packages/ajax/src/Cache.js +++ b/packages/ajax/src/Cache.js @@ -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 = {}; diff --git a/packages/ajax/src/PendingRequestStore.js b/packages/ajax/src/PendingRequestStore.js index 413519604..38f3e51ff 100644 --- a/packages/ajax/src/PendingRequestStore.js +++ b/packages/ajax/src/PendingRequestStore.js @@ -1,5 +1,3 @@ -import './typedef.js'; - export default class PendingRequestStore { constructor() { /** diff --git a/packages/ajax/src/cacheManager.js b/packages/ajax/src/cacheManager.js index 557cb5698..e96545a9d 100644 --- a/packages/ajax/src/cacheManager.js +++ b/packages/ajax/src/cacheManager.js @@ -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 diff --git a/packages/ajax/src/index.js b/packages/ajax/src/index.js new file mode 100644 index 000000000..46ff0c763 --- /dev/null +++ b/packages/ajax/src/index.js @@ -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(); diff --git a/packages/ajax/src/interceptors/acceptLanguageHeader.js b/packages/ajax/src/interceptors/acceptLanguageHeader.js index 36f09f96b..94be55e1f 100644 --- a/packages/ajax/src/interceptors/acceptLanguageHeader.js +++ b/packages/ajax/src/interceptors/acceptLanguageHeader.js @@ -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')) { diff --git a/packages/ajax/src/interceptors/cacheInterceptors.js b/packages/ajax/src/interceptors/cacheInterceptors.js index 51430433a..06686dc76 100644 --- a/packages/ajax/src/interceptors/cacheInterceptors.js +++ b/packages/ajax/src/interceptors/cacheInterceptors.js @@ -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 diff --git a/packages/ajax/src/interceptors/xsrfHeader.js b/packages/ajax/src/interceptors/xsrfHeader.js index f1b2ec8c6..19115d567 100644 --- a/packages/ajax/src/interceptors/xsrfHeader.js +++ b/packages/ajax/src/interceptors/xsrfHeader.js @@ -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); diff --git a/packages/ajax/src/typedef.js b/packages/ajax/src/typedef.js deleted file mode 100644 index d1d5721bf..000000000 --- a/packages/ajax/src/typedef.js +++ /dev/null @@ -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 - */ diff --git a/packages/ajax/test/Ajax.test.js b/packages/ajax/test/Ajax.test.js index 3dcd661ef..2ab260383 100644 --- a/packages/ajax/test/Ajax.test.js +++ b/packages/ajax/test/Ajax.test.js @@ -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); }); diff --git a/packages/ajax/test/interceptors/cacheInterceptors.test.js b/packages/ajax/test/interceptors/cacheInterceptors.test.js index 8c14c3cda..6c9e43eb6 100644 --- a/packages/ajax/test/interceptors/cacheInterceptors.test.js +++ b/packages/ajax/test/interceptors/cacheInterceptors.test.js @@ -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 diff --git a/packages/ajax/tsconfig.json b/packages/ajax/tsconfig.json new file mode 100644 index 000000000..e7787a406 --- /dev/null +++ b/packages/ajax/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist-types", + "rootDir": ".", + }, + "include": ["src", "test", "types"], + "exclude": ["dist-types"] +} diff --git a/packages/ajax/types/types.d.ts b/packages/ajax/types/types.ts similarity index 100% rename from packages/ajax/types/types.d.ts rename to packages/ajax/types/types.ts diff --git a/packages/singleton-manager/index.js b/packages/singleton-manager/index.js deleted file mode 100644 index 9dca108e3..000000000 --- a/packages/singleton-manager/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import { SingletonManagerClass } from './src/SingletonManagerClass.js'; - -export { SingletonManagerClass } from './src/SingletonManagerClass.js'; - -export const singletonManager = new SingletonManagerClass(); diff --git a/packages/singleton-manager/package.json b/packages/singleton-manager/package.json index 2447d7820..1397df12e 100644 --- a/packages/singleton-manager/package.json +++ b/packages/singleton-manager/package.json @@ -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/**" + ] + } } } diff --git a/packages/singleton-manager/src/SingletonManagerClass.js b/packages/singleton-manager/src/SingletonManagerClass.js index 1ef744ff3..6a10af55f 100644 --- a/packages/singleton-manager/src/SingletonManagerClass.js +++ b/packages/singleton-manager/src/SingletonManagerClass.js @@ -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()); } diff --git a/packages/singleton-manager/src/index.js b/packages/singleton-manager/src/index.js new file mode 100644 index 000000000..73fb58d52 --- /dev/null +++ b/packages/singleton-manager/src/index.js @@ -0,0 +1,4 @@ +import { SingletonManagerClass } from './SingletonManagerClass.js'; + +export { SingletonManagerClass }; +export const singletonManager = new SingletonManagerClass(); diff --git a/packages/singleton-manager/test/SingletonManagerClass.test.js b/packages/singleton-manager/test/SingletonManagerClass.test.js index 7d5f21faa..c2ca1b4ad 100644 --- a/packages/singleton-manager/test/SingletonManagerClass.test.js +++ b/packages/singleton-manager/test/SingletonManagerClass.test.js @@ -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'); diff --git a/packages/singleton-manager/tsconfig.json b/packages/singleton-manager/tsconfig.json new file mode 100644 index 000000000..e7787a406 --- /dev/null +++ b/packages/singleton-manager/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist-types", + "rootDir": ".", + }, + "include": ["src", "test", "types"], + "exclude": ["dist-types"] +} diff --git a/packages/ui/components/accordion/src/LionAccordion.js b/packages/ui/components/accordion/src/LionAccordion.js index 3ae3291ec..f86713def 100644 --- a/packages/ui/components/accordion/src/LionAccordion.js +++ b/packages/ui/components/accordion/src/LionAccordion.js @@ -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(); diff --git a/packages/ui/components/accordion/test/lion-accordion.test.js b/packages/ui/components/accordion/test/lion-accordion.test.js index 759f24a5c..966f74eee 100644 --- a/packages/ui/components/accordion/test/lion-accordion.test.js +++ b/packages/ui/components/accordion/test/lion-accordion.test.js @@ -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` diff --git a/packages/ui/components/button/src/LionButton.js b/packages/ui/components/button/src/LionButton.js index 77546ab16..14b3d8905 100644 --- a/packages/ui/components/button/src/LionButton.js +++ b/packages/ui/components/button/src/LionButton.js @@ -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); diff --git a/packages/ui/components/button/src/LionButtonReset.js b/packages/ui/components/button/src/LionButtonReset.js index 6b5f1b1ec..cd729fad2 100644 --- a/packages/ui/components/button/src/LionButtonReset.js +++ b/packages/ui/components/button/src/LionButtonReset.js @@ -1,7 +1,7 @@ import { LionButton } from './LionButton.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult */ /** diff --git a/packages/ui/components/button/src/LionButtonSubmit.js b/packages/ui/components/button/src/LionButtonSubmit.js index 5c76ab8a9..9839a21db 100644 --- a/packages/ui/components/button/src/LionButtonSubmit.js +++ b/packages/ui/components/button/src/LionButtonSubmit.js @@ -1,7 +1,7 @@ import { LionButtonReset } from './LionButtonReset.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult * @typedef {{lionButtons: Set, helper:HTMLButtonElement, observer:MutationObserver}} HelperRegistration */ diff --git a/packages/ui/components/calendar/src/LionCalendar.js b/packages/ui/components/calendar/src/LionCalendar.js index 457eb9a2f..44b27cf2d 100644 --- a/packages/ui/components/calendar/src/LionCalendar.js +++ b/packages/ui/components/calendar/src/LionCalendar.js @@ -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) { diff --git a/packages/ui/components/calendar/src/utils/createDay.js b/packages/ui/components/calendar/src/utils/createDay.js index deff912f5..e5498a0f8 100644 --- a/packages/ui/components/calendar/src/utils/createDay.js +++ b/packages/ui/components/calendar/src/utils/createDay.js @@ -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(), diff --git a/packages/ui/components/calendar/src/utils/createMonth.js b/packages/ui/components/calendar/src/utils/createMonth.js index 0d105069b..637b270ba 100644 --- a/packages/ui/components/calendar/src/utils/createMonth.js +++ b/packages/ui/components/calendar/src/utils/createMonth.js @@ -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: [], }; diff --git a/packages/ui/components/calendar/src/utils/createMultipleMonth.js b/packages/ui/components/calendar/src/utils/createMultipleMonth.js index 60055d5ab..80e7debe2 100644 --- a/packages/ui/components/calendar/src/utils/createMultipleMonth.js +++ b/packages/ui/components/calendar/src/utils/createMultipleMonth.js @@ -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: [], }; diff --git a/packages/ui/components/calendar/src/utils/createWeek.js b/packages/ui/components/calendar/src/utils/createWeek.js index d0832f863..a7bd1c71b 100644 --- a/packages/ui/components/calendar/src/utils/createWeek.js +++ b/packages/ui/components/calendar/src/utils/createWeek.js @@ -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) { diff --git a/packages/ui/components/calendar/src/utils/dataTemplate.js b/packages/ui/components/calendar/src/utils/dataTemplate.js index 81a16303e..5f9a91cbb 100644 --- a/packages/ui/components/calendar/src/utils/dataTemplate.js +++ b/packages/ui/components/calendar/src/utils/dataTemplate.js @@ -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, diff --git a/packages/ui/components/calendar/src/utils/dayTemplate.js b/packages/ui/components/calendar/src/utils/dayTemplate.js index fd78fa940..8bc276993 100644 --- a/packages/ui/components/calendar/src/utils/dayTemplate.js +++ b/packages/ui/components/calendar/src/utils/dayTemplate.js @@ -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 }) { diff --git a/packages/ui/components/calendar/test-helpers/CalendarObject.js b/packages/ui/components/calendar/test-helpers/CalendarObject.js index 3d8704b35..c9b052b9f 100644 --- a/packages/ui/components/calendar/test-helpers/CalendarObject.js +++ b/packages/ui/components/calendar/test-helpers/CalendarObject.js @@ -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; diff --git a/packages/ui/components/calendar/test/lion-calendar.test.js b/packages/ui/components/calendar/test/lion-calendar.test.js index 0874a78bb..f300eb9c8 100644 --- a/packages/ui/components/calendar/test/lion-calendar.test.js +++ b/packages/ui/components/calendar/test/lion-calendar.test.js @@ -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} */ (_fixture); diff --git a/packages/ui/components/calendar/test/utils/createMonth.test.js b/packages/ui/components/calendar/test/utils/createMonth.test.js index 64a4daf6f..56cead0ee 100644 --- a/packages/ui/components/calendar/test/utils/createMonth.test.js +++ b/packages/ui/components/calendar/test/utils/createMonth.test.js @@ -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) => { diff --git a/packages/ui/components/calendar/test/utils/createMultipleMonth.test.js b/packages/ui/components/calendar/test/utils/createMultipleMonth.test.js index 00329e6a9..071fe1312 100644 --- a/packages/ui/components/calendar/test/utils/createMultipleMonth.test.js +++ b/packages/ui/components/calendar/test/utils/createMultipleMonth.test.js @@ -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) => { diff --git a/packages/ui/components/calendar/test/utils/createWeek.test.js b/packages/ui/components/calendar/test/utils/createWeek.test.js index 0bf65a465..c14a6bcd3 100644 --- a/packages/ui/components/calendar/test/utils/createWeek.test.js +++ b/packages/ui/components/calendar/test/utils/createWeek.test.js @@ -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) { diff --git a/packages/ui/components/calendar/types/day.d.ts b/packages/ui/components/calendar/types/day.ts similarity index 100% rename from packages/ui/components/calendar/types/day.d.ts rename to packages/ui/components/calendar/types/day.ts diff --git a/packages/ui/components/checkbox-group/index.d.ts b/packages/ui/components/checkbox-group/index.d.ts deleted file mode 100644 index 9d1605842..000000000 --- a/packages/ui/components/checkbox-group/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { LionCheckboxGroup } from "./src/LionCheckboxGroup.js"; -export { LionCheckboxIndeterminate } from "./src/LionCheckboxIndeterminate.js"; -export { LionCheckbox } from "./src/LionCheckbox.js"; diff --git a/packages/ui/components/checkbox-group/src/LionCheckboxIndeterminate.js b/packages/ui/components/checkbox-group/src/LionCheckboxIndeterminate.js index cfe40abc0..2e274935f 100644 --- a/packages/ui/components/checkbox-group/src/LionCheckboxIndeterminate.js +++ b/packages/ui/components/checkbox-group/src/LionCheckboxIndeterminate.js @@ -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 { diff --git a/packages/ui/components/checkbox-group/test/lion-checkbox-group.test.js b/packages/ui/components/checkbox-group/test/lion-checkbox-group.test.js index c092475e8..c59b6852c 100644 --- a/packages/ui/components/checkbox-group/test/lion-checkbox-group.test.js +++ b/packages/ui/components/checkbox-group/test/lion-checkbox-group.test.js @@ -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} */ (_fixture); diff --git a/packages/ui/components/checkbox-group/test/lion-checkbox-indeterminate.test.js b/packages/ui/components/checkbox-group/test/lion-checkbox-indeterminate.test.js index fab501408..7dce4a805 100644 --- a/packages/ui/components/checkbox-group/test/lion-checkbox-indeterminate.test.js +++ b/packages/ui/components/checkbox-group/test/lion-checkbox-indeterminate.test.js @@ -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 */ /** diff --git a/packages/ui/components/checkbox-group/test/lion-checkbox.test.js b/packages/ui/components/checkbox-group/test/lion-checkbox.test.js index ef3709f02..675f296b1 100644 --- a/packages/ui/components/checkbox-group/test/lion-checkbox.test.js +++ b/packages/ui/components/checkbox-group/test/lion-checkbox.test.js @@ -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('', () => { diff --git a/packages/ui/components/collapsible/src/LionCollapsible.js b/packages/ui/components/collapsible/src/LionCollapsible.js index 9593b9be7..7963af2a3 100644 --- a/packages/ui/components/collapsible/src/LionCollapsible.js +++ b/packages/ui/components/collapsible/src/LionCollapsible.js @@ -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')) { diff --git a/packages/ui/components/collapsible/test/lion-collapsible.test.js b/packages/ui/components/collapsible/test/lion-collapsible.test.js index fef835b78..7fb64d8bc 100644 --- a/packages/ui/components/collapsible/test/lion-collapsible.test.js +++ b/packages/ui/components/collapsible/test/lion-collapsible.test.js @@ -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} */ (_fixture); diff --git a/packages/ui/components/combobox/src/LionCombobox.js b/packages/ui/components/combobox/src/LionCombobox.js index c048d3be2..ae7f5264f 100644 --- a/packages/ui/components/combobox/src/LionCombobox.js +++ b/packages/ui/components/combobox/src/LionCombobox.js @@ -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); diff --git a/packages/ui/components/combobox/test/lion-combobox.test.js b/packages/ui/components/combobox/test/lion-combobox.test.js index 3792cc38e..fe3b3dbae 100644 --- a/packages/ui/components/combobox/test/lion-combobox.test.js +++ b/packages/ui/components/combobox/test/lion-combobox.test.js @@ -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 ( diff --git a/packages/ui/components/combobox/types/SelectionDisplay.d.ts b/packages/ui/components/combobox/types/SelectionDisplay.ts similarity index 69% rename from packages/ui/components/combobox/types/SelectionDisplay.d.ts rename to packages/ui/components/combobox/types/SelectionDisplay.ts index a97afca29..be9db4ab6 100644 --- a/packages/ui/components/combobox/types/SelectionDisplay.d.ts +++ b/packages/ui/components/combobox/types/SelectionDisplay.ts @@ -1,4 +1,4 @@ -import { LionCombobox } from '../src/LionCombobox.js.js'; +import { LionCombobox } from '../src/LionCombobox.js'; export interface SelectionDisplay extends HTMLElement { comboboxElement: LionCombobox; diff --git a/packages/ui/components/core/src/DisabledMixin.js b/packages/ui/components/core/src/DisabledMixin.js index f0ad97e46..dc22553d8 100644 --- a/packages/ui/components/core/src/DisabledMixin.js +++ b/packages/ui/components/core/src/DisabledMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const DisabledMixinImplementation = superclass => // eslint-disable-next-line no-shadow diff --git a/packages/ui/components/core/src/DisabledWithTabIndexMixin.js b/packages/ui/components/core/src/DisabledWithTabIndexMixin.js index f6c76ed71..66bbdd884 100644 --- a/packages/ui/components/core/src/DisabledWithTabIndexMixin.js +++ b/packages/ui/components/core/src/DisabledWithTabIndexMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const DisabledWithTabIndexMixinImplementation = superclass => // eslint-disable-next-line no-shadow diff --git a/packages/ui/components/core/src/SlotMixin.js b/packages/ui/components/core/src/SlotMixin.js index 452664885..cdc8c9448 100644 --- a/packages/ui/components/core/src/SlotMixin.js +++ b/packages/ui/components/core/src/SlotMixin.js @@ -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 diff --git a/packages/ui/components/core/types/DisabledMixinTypes.d.ts b/packages/ui/components/core/types/DisabledMixinTypes.ts similarity index 100% rename from packages/ui/components/core/types/DisabledMixinTypes.d.ts rename to packages/ui/components/core/types/DisabledMixinTypes.ts diff --git a/packages/ui/components/core/types/DisabledWithTabIndexMixinTypes.d.ts b/packages/ui/components/core/types/DisabledWithTabIndexMixinTypes.ts similarity index 87% rename from packages/ui/components/core/types/DisabledWithTabIndexMixinTypes.d.ts rename to packages/ui/components/core/types/DisabledWithTabIndexMixinTypes.ts index 4d058889b..172967a12 100644 --- a/packages/ui/components/core/types/DisabledWithTabIndexMixinTypes.d.ts +++ b/packages/ui/components/core/types/DisabledWithTabIndexMixinTypes.ts @@ -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>( diff --git a/packages/ui/components/core/types/SlotMixinTypes.d.ts b/packages/ui/components/core/types/SlotMixinTypes.ts similarity index 96% rename from packages/ui/components/core/types/SlotMixinTypes.d.ts rename to packages/ui/components/core/types/SlotMixinTypes.ts index 221bc7dc2..e61d09f99 100644 --- a/packages/ui/components/core/types/SlotMixinTypes.d.ts +++ b/packages/ui/components/core/types/SlotMixinTypes.ts @@ -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; diff --git a/packages/ui/components/dialog/test/lion-dialog.test.js b/packages/ui/components/dialog/test/lion-dialog.test.js index 18ae1698b..4f434cf69 100644 --- a/packages/ui/components/dialog/test/lion-dialog.test.js +++ b/packages/ui/components/dialog/test/lion-dialog.test.js @@ -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} */ (_fixture); diff --git a/packages/ui/components/form-core/src/FocusMixin.js b/packages/ui/components/form-core/src/FocusMixin.js index 21f7e6b82..7490e54ec 100644 --- a/packages/ui/components/form-core/src/FocusMixin.js +++ b/packages/ui/components/form-core/src/FocusMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const FocusMixinImplementation = superclass => // @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051 diff --git a/packages/ui/components/form-core/src/FormControlMixin.js b/packages/ui/components/form-core/src/FormControlMixin.js index 0bf8a5752..dbe278181 100644 --- a/packages/ui/components/form-core/src/FormControlMixin.js +++ b/packages/ui/components/form-core/src/FormControlMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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); diff --git a/packages/ui/components/form-core/src/FormatMixin.js b/packages/ui/components/form-core/src/FormatMixin.js index 6063e9740..3b21ff976 100644 --- a/packages/ui/components/form-core/src/FormatMixin.js +++ b/packages/ui/components/form-core/src/FormatMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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), + }) + ), }), ); } diff --git a/packages/ui/components/form-core/src/InteractionStateMixin.js b/packages/ui/components/form-core/src/InteractionStateMixin.js index bf8d97529..87e745331 100644 --- a/packages/ui/components/form-core/src/InteractionStateMixin.js +++ b/packages/ui/components/form-core/src/InteractionStateMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const InteractionStateMixinImplementation = superclass => // @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051 diff --git a/packages/ui/components/form-core/src/LionField.js b/packages/ui/components/form-core/src/LionField.js index 30f680a74..f7f2722ae 100644 --- a/packages/ui/components/form-core/src/LionField.js +++ b/packages/ui/components/form-core/src/LionField.js @@ -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); diff --git a/packages/ui/components/form-core/src/NativeTextFieldMixin.js b/packages/ui/components/form-core/src/NativeTextFieldMixin.js index ead9e66ef..7358651dc 100644 --- a/packages/ui/components/form-core/src/NativeTextFieldMixin.js +++ b/packages/ui/components/form-core/src/NativeTextFieldMixin.js @@ -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} superclass} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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(); diff --git a/packages/ui/components/form-core/src/choice-group/ChoiceGroupMixin.js b/packages/ui/components/form-core/src/choice-group/ChoiceGroupMixin.js index 28aecf1f4..23e106024 100644 --- a/packages/ui/components/form-core/src/choice-group/ChoiceGroupMixin.js +++ b/packages/ui/components/form-core/src/choice-group/ChoiceGroupMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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')) { diff --git a/packages/ui/components/form-core/src/choice-group/ChoiceInputMixin.js b/packages/ui/components/form-core/src/choice-group/ChoiceInputMixin.js index bcd9d928b..f48ca8a33 100644 --- a/packages/ui/components/form-core/src/choice-group/ChoiceInputMixin.js +++ b/packages/ui/components/form-core/src/choice-group/ChoiceInputMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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); diff --git a/packages/ui/components/form-core/src/form-group/FormGroupMixin.js b/packages/ui/components/form-core/src/form-group/FormGroupMixin.js index 5d556233d..f37aa195e 100644 --- a/packages/ui/components/form-core/src/form-group/FormGroupMixin.js +++ b/packages/ui/components/form-core/src/form-group/FormGroupMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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); diff --git a/packages/ui/components/form-core/src/registration/FormRegisteringMixin.js b/packages/ui/components/form-core/src/registration/FormRegisteringMixin.js index d48a9f136..15c14a37c 100644 --- a/packages/ui/components/form-core/src/registration/FormRegisteringMixin.js +++ b/packages/ui/components/form-core/src/registration/FormRegisteringMixin.js @@ -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 */ /** diff --git a/packages/ui/components/form-core/src/registration/FormRegistrarMixin.js b/packages/ui/components/form-core/src/registration/FormRegistrarMixin.js index 0bd2fbc7a..a92aacd81 100644 --- a/packages/ui/components/form-core/src/registration/FormRegistrarMixin.js +++ b/packages/ui/components/form-core/src/registration/FormRegistrarMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const FormRegistrarMixinImplementation = superclass => // eslint-disable-next-line no-shadow, no-unused-vars diff --git a/packages/ui/components/form-core/src/registration/FormRegistrarPortalMixin.js b/packages/ui/components/form-core/src/registration/FormRegistrarPortalMixin.js index 102f1b469..8af10b9c1 100644 --- a/packages/ui/components/form-core/src/registration/FormRegistrarPortalMixin.js +++ b/packages/ui/components/form-core/src/registration/FormRegistrarPortalMixin.js @@ -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 */ /** diff --git a/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js b/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js index f01b67bac..6662e3fd5 100644 --- a/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js +++ b/packages/ui/components/form-core/src/utils/SyncUpdatableMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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 diff --git a/packages/ui/components/form-core/src/validate/LionValidationFeedback.js b/packages/ui/components/form-core/src/validate/LionValidationFeedback.js index a5642d4d6..4ff8ca534 100644 --- a/packages/ui/components/form-core/src/validate/LionValidationFeedback.js +++ b/packages/ui/components/form-core/src/validate/LionValidationFeedback.js @@ -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); diff --git a/packages/ui/components/form-core/src/validate/ValidateMixin.js b/packages/ui/components/form-core/src/validate/ValidateMixin.js index d80151ed0..92a952875 100644 --- a/packages/ui/components/form-core/src/validate/ValidateMixin.js +++ b/packages/ui/components/form-core/src/validate/ValidateMixin.js @@ -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} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} 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); diff --git a/packages/ui/components/form-core/src/validate/Validator.js b/packages/ui/components/form-core/src/validate/Validator.js index d0189653e..20058e133 100644 --- a/packages/ui/components/form-core/src/validate/Validator.js +++ b/packages/ui/components/form-core/src/validate/Validator.js @@ -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 => diff --git a/packages/ui/components/form-core/src/validate/resultValidators/DefaultSuccess.js b/packages/ui/components/form-core/src/validate/resultValidators/DefaultSuccess.js index b2b9e35c3..7f0b8bf26 100644 --- a/packages/ui/components/form-core/src/validate/resultValidators/DefaultSuccess.js +++ b/packages/ui/components/form-core/src/validate/resultValidators/DefaultSuccess.js @@ -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 { diff --git a/packages/ui/components/form-core/src/validate/validators/Required.js b/packages/ui/components/form-core/src/validate/validators/Required.js index 33d19fc2b..2bbe142bf 100644 --- a/packages/ui/components/form-core/src/validate/validators/Required.js +++ b/packages/ui/components/form-core/src/validate/validators/Required.js @@ -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 { diff --git a/packages/ui/components/form-core/test-helpers/getFormControlMembers.js b/packages/ui/components/form-core/test-helpers/getFormControlMembers.js index a3cf97e16..d620ba371 100644 --- a/packages/ui/components/form-core/test-helpers/getFormControlMembers.js +++ b/packages/ui/components/form-core/test-helpers/getFormControlMembers.js @@ -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 */ /** diff --git a/packages/ui/components/form-core/test-suites/FormRegistrationMixins.suite.js b/packages/ui/components/form-core/test-suites/FormRegistrationMixins.suite.js index 49b691d27..065dfba5b 100644 --- a/packages/ui/components/form-core/test-suites/FormRegistrationMixins.suite.js +++ b/packages/ui/components/form-core/test-suites/FormRegistrationMixins.suite.js @@ -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); diff --git a/packages/ui/components/form-core/test-suites/FormatMixin.suite.js b/packages/ui/components/form-core/test-suites/FormatMixin.suite.js index 264c7f63c..e0b4dfafc 100644 --- a/packages/ui/components/form-core/test-suites/FormatMixin.suite.js +++ b/packages/ui/components/form-core/test-suites/FormatMixin.suite.js @@ -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 */ diff --git a/packages/ui/components/form-core/test-suites/NativeTextFieldMixin.suite.js b/packages/ui/components/form-core/test-suites/NativeTextFieldMixin.suite.js index 9549d89a8..0a38fcdf2 100644 --- a/packages/ui/components/form-core/test-suites/NativeTextFieldMixin.suite.js +++ b/packages/ui/components/form-core/test-suites/NativeTextFieldMixin.suite.js @@ -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 */ diff --git a/packages/ui/components/form-core/test-suites/ValidateMixin.suite.js b/packages/ui/components/form-core/test-suites/ValidateMixin.suite.js index f05065760..e075ca3a7 100644 --- a/packages/ui/components/form-core/test-suites/ValidateMixin.suite.js +++ b/packages/ui/components/form-core/test-suites/ValidateMixin.suite.js @@ -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']); diff --git a/packages/ui/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js b/packages/ui/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js index 5dc882f0e..7dc8f6567 100644 --- a/packages/ui/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js +++ b/packages/ui/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js @@ -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() { diff --git a/packages/ui/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js b/packages/ui/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js index 1405cc29c..dbf320e24 100644 --- a/packages/ui/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js +++ b/packages/ui/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js @@ -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 = { diff --git a/packages/ui/components/form-core/test-suites/choice-group/ChoiceInputMixin.suite.js b/packages/ui/components/form-core/test-suites/choice-group/ChoiceInputMixin.suite.js index b74614587..021630466 100644 --- a/packages/ui/components/form-core/test-suites/choice-group/ChoiceInputMixin.suite.js +++ b/packages/ui/components/form-core/test-suites/choice-group/ChoiceInputMixin.suite.js @@ -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 } = {}) { diff --git a/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js b/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js index 363d6f804..8b41a90e0 100644 --- a/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js +++ b/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js @@ -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 */ /** diff --git a/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin.suite.js b/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin.suite.js index 4130ac8e8..2d4b4153a 100644 --- a/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +++ b/packages/ui/components/form-core/test-suites/form-group/FormGroupMixin.suite.js @@ -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); diff --git a/packages/ui/components/form-core/test/FormControlMixin.test.js b/packages/ui/components/form-core/test/FormControlMixin.test.js index 74f041868..7e83c1e9b 100644 --- a/packages/ui/components/form-core/test/FormControlMixin.test.js +++ b/packages/ui/components/form-core/test/FormControlMixin.test.js @@ -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]')); diff --git a/packages/ui/components/form-core/test/lion-field.test.js b/packages/ui/components/form-core/test/lion-field.test.js index a191c25ea..b312918f3 100644 --- a/packages/ui/components/form-core/test/lion-field.test.js +++ b/packages/ui/components/form-core/test/lion-field.test.js @@ -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 = ''; 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('', () => { ); /** - * @param {import("../index.js.js").LionField} _sceneEl + * @param {LionField} _sceneEl * @param {{ index?: number; el: any; wantedShowsFeedbackFor: any; }} scenario */ const executeScenario = async (_sceneEl, scenario) => { diff --git a/packages/ui/components/form-core/test/utils/SyncUpdatableMixin.test.js b/packages/ui/components/form-core/test/utils/SyncUpdatableMixin.test.js index 797ee23d9..aa740713a 100644 --- a/packages/ui/components/form-core/test/utils/SyncUpdatableMixin.test.js +++ b/packages/ui/components/form-core/test/utils/SyncUpdatableMixin.test.js @@ -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; diff --git a/packages/ui/components/form-core/test/validate/ResultValidator.test.js b/packages/ui/components/form-core/test/validate/ResultValidator.test.js index fa998ec89..b5705eb3f 100644 --- a/packages/ui/components/form-core/test/validate/ResultValidator.test.js +++ b/packages/ui/components/form-core/test/validate/ResultValidator.test.js @@ -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', () => { diff --git a/packages/ui/components/form-core/test/validate/lion-validation-feedback.test.js b/packages/ui/components/form-core/test/validate/lion-validation-feedback.test.js index 2782881be..5a335db03 100644 --- a/packages/ui/components/form-core/test/validate/lion-validation-feedback.test.js +++ b/packages/ui/components/form-core/test/validate/lion-validation-feedback.test.js @@ -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', () => { diff --git a/packages/ui/components/form-core/types/FocusMixinTypes.d.ts b/packages/ui/components/form-core/types/FocusMixinTypes.ts similarity index 100% rename from packages/ui/components/form-core/types/FocusMixinTypes.d.ts rename to packages/ui/components/form-core/types/FocusMixinTypes.ts diff --git a/packages/ui/components/form-core/types/FormControlMixinTypes.d.ts b/packages/ui/components/form-core/types/FormControlMixinTypes.ts similarity index 95% rename from packages/ui/components/form-core/types/FormControlMixinTypes.d.ts rename to packages/ui/components/form-core/types/FormControlMixinTypes.ts index d09a629b5..545a99717 100644 --- a/packages/ui/components/form-core/types/FormControlMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/FormControlMixinTypes.ts @@ -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 diff --git a/packages/ui/components/form-core/types/FormatMixinTypes.d.ts b/packages/ui/components/form-core/types/FormatMixinTypes.ts similarity index 97% rename from packages/ui/components/form-core/types/FormatMixinTypes.d.ts rename to packages/ui/components/form-core/types/FormatMixinTypes.ts index 9b9dbd98b..2c09f91ce 100644 --- a/packages/ui/components/form-core/types/FormatMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/FormatMixinTypes.ts @@ -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 { diff --git a/packages/ui/components/form-core/types/InteractionStateMixinTypes.d.ts b/packages/ui/components/form-core/types/InteractionStateMixinTypes.ts similarity index 96% rename from packages/ui/components/form-core/types/InteractionStateMixinTypes.d.ts rename to packages/ui/components/form-core/types/InteractionStateMixinTypes.ts index 1fc95e562..5311faea3 100644 --- a/packages/ui/components/form-core/types/InteractionStateMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/InteractionStateMixinTypes.ts @@ -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; diff --git a/packages/ui/components/form-core/types/NativeTextFieldMixinTypes.d.ts b/packages/ui/components/form-core/types/NativeTextFieldMixinTypes.ts similarity index 74% rename from packages/ui/components/form-core/types/NativeTextFieldMixinTypes.d.ts rename to packages/ui/components/form-core/types/NativeTextFieldMixinTypes.ts index 524450d72..bd25f356a 100644 --- a/packages/ui/components/form-core/types/NativeTextFieldMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/NativeTextFieldMixinTypes.ts @@ -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 { /** diff --git a/packages/ui/components/form-core/types/choice-group/ChoiceGroupMixinTypes.d.ts b/packages/ui/components/form-core/types/choice-group/ChoiceGroupMixinTypes.ts similarity index 92% rename from packages/ui/components/form-core/types/choice-group/ChoiceGroupMixinTypes.d.ts rename to packages/ui/components/form-core/types/choice-group/ChoiceGroupMixinTypes.ts index 098624cd8..02289d001 100644 --- a/packages/ui/components/form-core/types/choice-group/ChoiceGroupMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/choice-group/ChoiceGroupMixinTypes.ts @@ -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; diff --git a/packages/ui/components/form-core/types/choice-group/ChoiceInputMixinTypes.d.ts b/packages/ui/components/form-core/types/choice-group/ChoiceInputMixinTypes.ts similarity index 92% rename from packages/ui/components/form-core/types/choice-group/ChoiceInputMixinTypes.d.ts rename to packages/ui/components/form-core/types/choice-group/ChoiceInputMixinTypes.ts index 54975b214..5738c9b8f 100644 --- a/packages/ui/components/form-core/types/choice-group/ChoiceInputMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/choice-group/ChoiceInputMixinTypes.ts @@ -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; diff --git a/packages/ui/components/form-core/types/choice-group/index.d.ts b/packages/ui/components/form-core/types/choice-group/index.d.ts deleted file mode 100644 index a567894cd..000000000 --- a/packages/ui/components/form-core/types/choice-group/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './ChoiceInputMixinTypes'; -export * from './ChoiceGroupMixinTypes'; diff --git a/packages/ui/components/form-core/types/choice-group/index.ts b/packages/ui/components/form-core/types/choice-group/index.ts new file mode 100644 index 000000000..5508ee4a8 --- /dev/null +++ b/packages/ui/components/form-core/types/choice-group/index.ts @@ -0,0 +1,2 @@ +export * from './ChoiceInputMixinTypes.js'; +export * from './ChoiceGroupMixinTypes.js'; diff --git a/packages/ui/components/form-core/types/form-group/FormGroupMixinTypes.d.ts b/packages/ui/components/form-core/types/form-group/FormGroupMixinTypes.ts similarity index 95% rename from packages/ui/components/form-core/types/form-group/FormGroupMixinTypes.d.ts rename to packages/ui/components/form-core/types/form-group/FormGroupMixinTypes.ts index 562474048..7b68c3e6f 100644 --- a/packages/ui/components/form-core/types/form-group/FormGroupMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/form-group/FormGroupMixinTypes.ts @@ -1,10 +1,10 @@ import { Constructor } from '@open-wc/dedupe-mixin'; import { LitElement } from 'lit'; -import { DisabledHost } from '@lion/ui/core/types/DisabledMixinTypes.js'; -import { SlotHost } from '@lion/ui/core/types/SlotMixinTypes.js'; -import { FormControlHost } from '../FormControlMixinTypes'; -import { FormRegistrarHost } from '../registration/FormRegistrarMixinTypes'; -import { ValidateHost } from '../validate/ValidateMixinTypes'; +import { DisabledHost } from '../../../core/types/DisabledMixinTypes.js'; +import { SlotHost } from '../../../core/types/SlotMixinTypes.js'; +import { FormControlHost } from '../FormControlMixinTypes.js'; +import { FormRegistrarHost } from '../registration/FormRegistrarMixinTypes.js'; +import { ValidateHost } from '../validate/ValidateMixinTypes.js'; export declare type FormControl = FormControlHost & HTMLElement & { diff --git a/packages/ui/components/form-core/types/form-group/index.d.ts b/packages/ui/components/form-core/types/form-group/index.d.ts deleted file mode 100644 index aa2781265..000000000 --- a/packages/ui/components/form-core/types/form-group/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './FormGroupMixinTypes'; diff --git a/packages/ui/components/form-core/types/form-group/index.ts b/packages/ui/components/form-core/types/form-group/index.ts new file mode 100644 index 000000000..32c9bda8d --- /dev/null +++ b/packages/ui/components/form-core/types/form-group/index.ts @@ -0,0 +1 @@ +export * from './FormGroupMixinTypes.js'; diff --git a/packages/ui/components/form-core/types/index.d.ts b/packages/ui/components/form-core/types/index.d.ts deleted file mode 100644 index 576fec513..000000000 --- a/packages/ui/components/form-core/types/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './FocusMixinTypes'; -export * from './FormatMixinTypes'; -export * from './FormControlMixinTypes'; -export * from './InteractionStateMixinTypes'; -export * from './NativeTextFieldMixinTypes'; -export * from './validate'; -export * from './utils'; -export * from './registration'; -export * from './form-group'; -export * from './choice-group'; diff --git a/packages/ui/components/form-core/types/index.ts b/packages/ui/components/form-core/types/index.ts new file mode 100644 index 000000000..34d00b7c1 --- /dev/null +++ b/packages/ui/components/form-core/types/index.ts @@ -0,0 +1,10 @@ +export * from './FocusMixinTypes.js'; +export * from './FormatMixinTypes.js'; +export * from './FormControlMixinTypes.js'; +export * from './InteractionStateMixinTypes.js'; +export * from './NativeTextFieldMixinTypes.js'; +// export * from './validate.js'; +// export * from './utils.js'; +// export * from './registration.js'; +// export * from './form-group.js'; +// export * from './choice-group.js'; diff --git a/packages/ui/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts b/packages/ui/components/form-core/types/registration/FormRegisteringMixinTypes.ts similarity index 92% rename from packages/ui/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts rename to packages/ui/components/form-core/types/registration/FormRegisteringMixinTypes.ts index 3ec3bd917..df896ddd5 100644 --- a/packages/ui/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/registration/FormRegisteringMixinTypes.ts @@ -1,7 +1,7 @@ -import { Constructor } from '@open-wc/dedupe-mixin'; -import { FormRegistrarHost } from './FormRegistrarMixinTypes'; - import { LitElement } from 'lit'; +import { Constructor } from '@open-wc/dedupe-mixin'; + +import { FormRegistrarHost } from './FormRegistrarMixinTypes.js'; export declare class FormRegisteringHost { /** diff --git a/packages/ui/components/form-core/types/registration/FormRegistrarMixinTypes.d.ts b/packages/ui/components/form-core/types/registration/FormRegistrarMixinTypes.ts similarity index 96% rename from packages/ui/components/form-core/types/registration/FormRegistrarMixinTypes.d.ts rename to packages/ui/components/form-core/types/registration/FormRegistrarMixinTypes.ts index 4730bae89..8d99a777a 100644 --- a/packages/ui/components/form-core/types/registration/FormRegistrarMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/registration/FormRegistrarMixinTypes.ts @@ -1,8 +1,9 @@ -import { Constructor } from '@open-wc/dedupe-mixin'; -import { FormControlsCollection } from '../../src/registration/FormControlsCollection'; -import { FormRegisteringHost } from './FormRegisteringMixinTypes'; -import { FormControlHost } from '../FormControlMixinTypes'; import { LitElement } from 'lit'; +import { Constructor } from '@open-wc/dedupe-mixin'; + +import { FormControlsCollection } from '../../src/registration/FormControlsCollection.js'; +import { FormRegisteringHost } from './FormRegisteringMixinTypes.js'; +import { FormControlHost } from '../FormControlMixinTypes.js'; export declare class ElementWithParentFormGroup { _parentFormGroup: FormRegistrarHost; diff --git a/packages/ui/components/form-core/types/registration/FormRegistrarPortalMixinTypes.d.ts b/packages/ui/components/form-core/types/registration/FormRegistrarPortalMixinTypes.ts similarity index 100% rename from packages/ui/components/form-core/types/registration/FormRegistrarPortalMixinTypes.d.ts rename to packages/ui/components/form-core/types/registration/FormRegistrarPortalMixinTypes.ts diff --git a/packages/ui/components/form-core/types/registration/index.d.ts b/packages/ui/components/form-core/types/registration/index.d.ts deleted file mode 100644 index d1fbc9b48..000000000 --- a/packages/ui/components/form-core/types/registration/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './FormRegisteringMixinTypes'; -export * from './FormRegistrarMixinTypes'; -export * from './FormRegistrarPortalMixinTypes'; diff --git a/packages/ui/components/form-core/types/registration/index.ts b/packages/ui/components/form-core/types/registration/index.ts new file mode 100644 index 000000000..256b2e9c9 --- /dev/null +++ b/packages/ui/components/form-core/types/registration/index.ts @@ -0,0 +1,3 @@ +export * from './FormRegisteringMixinTypes.js'; +export * from './FormRegistrarMixinTypes.js'; +export * from './FormRegistrarPortalMixinTypes.js'; diff --git a/packages/ui/components/form-core/types/utils/SyncUpdatableMixinTypes.d.ts b/packages/ui/components/form-core/types/utils/SyncUpdatableMixinTypes.ts similarity index 100% rename from packages/ui/components/form-core/types/utils/SyncUpdatableMixinTypes.d.ts rename to packages/ui/components/form-core/types/utils/SyncUpdatableMixinTypes.ts diff --git a/packages/ui/components/form-core/types/utils/index.d.ts b/packages/ui/components/form-core/types/utils/index.d.ts deleted file mode 100644 index 01b93e0f4..000000000 --- a/packages/ui/components/form-core/types/utils/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SyncUpdatableMixinTypes'; diff --git a/packages/ui/components/form-core/types/utils/index.ts b/packages/ui/components/form-core/types/utils/index.ts new file mode 100644 index 000000000..1e760d617 --- /dev/null +++ b/packages/ui/components/form-core/types/utils/index.ts @@ -0,0 +1 @@ +export * from './SyncUpdatableMixinTypes.js'; diff --git a/packages/ui/components/form-core/types/validate/ValidateMixinTypes.d.ts b/packages/ui/components/form-core/types/validate/ValidateMixinTypes.ts similarity index 95% rename from packages/ui/components/form-core/types/validate/ValidateMixinTypes.d.ts rename to packages/ui/components/form-core/types/validate/ValidateMixinTypes.ts index f68e17a2b..203f8b2d1 100644 --- a/packages/ui/components/form-core/types/validate/ValidateMixinTypes.d.ts +++ b/packages/ui/components/form-core/types/validate/ValidateMixinTypes.ts @@ -1,12 +1,13 @@ import { LitElement } from 'lit'; -import { DisabledHost } from '@lion/ui/core/types/DisabledMixinTypes.js'; -import { SlotHost } from '@lion/ui/core/types/SlotMixinTypes.js'; import { Constructor } from '@open-wc/dedupe-mixin'; -import { ScopedElementsHost } from '@open-wc/scoped-elements/src/types'; -import { FormControlHost } from '../FormControlMixinTypes'; -import { LionValidationFeedback } from '../../src/validate/LionValidationFeedback'; -import { SyncUpdatableHost } from '../utils/SyncUpdatableMixinTypes'; -import { Validator } from '../../src/validate/Validator'; +import { ScopedElementsHost } from '@open-wc/scoped-elements'; + +import { DisabledHost } from '../../../core/types/DisabledMixinTypes.js'; +import { SlotHost } from '../../../core/types/SlotMixinTypes.js'; + +import { FormControlHost } from '../FormControlMixinTypes.js'; +import { SyncUpdatableHost } from '../utils/SyncUpdatableMixinTypes.js'; +import { Validator } from '../../src/validate/Validator.js'; type ScopedElementsMap = { [key: string]: typeof HTMLElement; diff --git a/packages/ui/components/form-core/types/validate/index.d.ts b/packages/ui/components/form-core/types/validate/index.d.ts deleted file mode 100644 index e8a6ab654..000000000 --- a/packages/ui/components/form-core/types/validate/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './validate'; -export * from './ValidateMixinTypes'; diff --git a/packages/ui/components/form-core/types/validate/index.ts b/packages/ui/components/form-core/types/validate/index.ts new file mode 100644 index 000000000..d2aa908e1 --- /dev/null +++ b/packages/ui/components/form-core/types/validate/index.ts @@ -0,0 +1,2 @@ +export * from './validate.js'; +export * from './ValidateMixinTypes.js'; diff --git a/packages/ui/components/form-core/types/validate/validate.d.ts b/packages/ui/components/form-core/types/validate/validate.ts similarity index 94% rename from packages/ui/components/form-core/types/validate/validate.d.ts rename to packages/ui/components/form-core/types/validate/validate.ts index d8892bbd4..62241579c 100644 --- a/packages/ui/components/form-core/types/validate/validate.d.ts +++ b/packages/ui/components/form-core/types/validate/validate.ts @@ -1,5 +1,5 @@ -import { FormControlHost } from '../../src/FormControlMixin'; -import { ValidationType } from './ValidateMixinTypes'; +import { FormControlHost } from '../../src/FormControlMixin.js'; +import { ValidationType } from './ValidateMixinTypes.js'; /** * The name under which validation results get registered. For convience and predictability, this diff --git a/packages/ui/components/form-integrations/test/dialog-integrations.test.js b/packages/ui/components/form-integrations/test/dialog-integrations.test.js index 267ee6c00..a2be44e07 100644 --- a/packages/ui/components/form-integrations/test/dialog-integrations.test.js +++ b/packages/ui/components/form-integrations/test/dialog-integrations.test.js @@ -9,8 +9,8 @@ import '@lion/ui/define/lion-radio.js'; /** * @typedef {import('./helpers/umbrella-form.js').UmbrellaForm} UmbrellaForm - * @typedef {import('@lion/dialog').LionDialog} LionDialog - * @typedef {import('@lion/form').LionForm} LionForm + * @typedef {import('../../dialog/src/LionDialog.js').LionDialog} LionDialog + * @typedef {import('../../form/src/LionForm.js').LionForm} LionForm */ // Test umbrella form inside dialog diff --git a/packages/ui/components/form-integrations/test/form-group-methods.test.js b/packages/ui/components/form-integrations/test/form-group-methods.test.js index a81e361af..a1eb233aa 100644 --- a/packages/ui/components/form-integrations/test/form-group-methods.test.js +++ b/packages/ui/components/form-integrations/test/form-group-methods.test.js @@ -39,8 +39,8 @@ import '@lion/ui/define/lion-options.js'; import '@lion/ui/define/lion-validation-feedback.js'; /** - * @typedef {import('@lion/form-core').LionField} LionField - * @typedef {import('@lion/button').LionButton} LionButton + * @typedef {import('../../form-core/src/LionField.js').LionField} LionField + * @typedef {import('../../button/src/LionButton.js').LionButton} LionButton * @typedef {import('./helpers/umbrella-form.js').UmbrellaForm} UmbrellaForm */ diff --git a/packages/ui/components/form-integrations/test/form-integrations.test.js b/packages/ui/components/form-integrations/test/form-integrations.test.js index 7f468fe51..48d711ef2 100644 --- a/packages/ui/components/form-integrations/test/form-integrations.test.js +++ b/packages/ui/components/form-integrations/test/form-integrations.test.js @@ -5,14 +5,14 @@ import { PhoneUtilManager } from '@lion/ui/input-tel.js'; import { getAllTagNames } from './helpers/helpers.js'; import './helpers/umbrella-form.js'; -// import '@lion/ui/define/lion-input-tel-dropdown.js'; +import '@lion/ui/define/lion-input-tel-dropdown.js'; import '@lion/ui/define/lion-option.js'; import '@lion/ui/define/lion-checkbox.js'; import '@lion/ui/define/lion-radio.js'; /** * @typedef {import('./helpers/umbrella-form.js').UmbrellaForm} UmbrellaForm - * @typedef {import('@lion/input-tel-dropdown').LionInputTelDropdown} LionInputTelDropdown + * @typedef {import('../../input-tel-dropdown/src/LionInputTelDropdown.js').LionInputTelDropdown} LionInputTelDropdown */ // Test umbrella form. diff --git a/packages/ui/components/form-integrations/test/helpers/helpers.js b/packages/ui/components/form-integrations/test/helpers/helpers.js index 28999d156..e1e16f8ef 100644 --- a/packages/ui/components/form-integrations/test/helpers/helpers.js +++ b/packages/ui/components/form-integrations/test/helpers/helpers.js @@ -1,6 +1,6 @@ /** - * @typedef {import('@lion/form').LionForm} LionForm - * @typedef {import('@lion/form-core').LionField} LionField + * @typedef {import('../../../form/src/LionForm.js').LionForm} LionForm + * @typedef {import('../../../form-core/src/LionField.js').LionField} LionField */ /** diff --git a/packages/ui/components/form-integrations/test/helpers/umbrella-form.js b/packages/ui/components/form-integrations/test/helpers/umbrella-form.js index 5109125d0..2873c4c33 100644 --- a/packages/ui/components/form-integrations/test/helpers/umbrella-form.js +++ b/packages/ui/components/form-integrations/test/helpers/umbrella-form.js @@ -24,7 +24,7 @@ import '@lion/ui/define/lion-input-stepper.js'; export class UmbrellaForm extends LitElement { get _lionFormNode() { - return /** @type {import('@lion/form').LionForm} */ ( + return /** @type {import('../../../form/src/LionForm.js').LionForm} */ ( this.shadowRoot?.querySelector('lion-form') ); } diff --git a/packages/ui/components/form-integrations/test/model-value-consistency.test.js b/packages/ui/components/form-integrations/test/model-value-consistency.test.js index 55ef21791..dec0398bf 100644 --- a/packages/ui/components/form-integrations/test/model-value-consistency.test.js +++ b/packages/ui/components/form-integrations/test/model-value-consistency.test.js @@ -36,12 +36,12 @@ import '@lion/ui/define/lion-validation-feedback.js'; import { getFormControlMembers } from '@lion/ui/form-core-test-helpers.js'; /** - * @typedef {import('@lion/core').LitElement} LitElement - * @typedef {import('@lion/form-core').LionField} LionField - * @typedef {import('@lion/form-core/types/FormControlMixinTypes').FormControlHost & LitElement & {__parentFormGroup?: HTMLElement, checked?: boolean, disabled: boolean, hasFeedbackFor: string[], makeRequestToBeDisabled: Function }} FormControl - * @typedef {import('@lion/input').LionInput} LionInput - * @typedef {import('@lion/select').LionSelect} LionSelect - * @typedef {import('@lion/listbox').LionOption} LionOption + * @typedef {import('lit').LitElement} LitElement + * @typedef {import('../../form-core/src/LionField.js').LionField} LionField + * @typedef {import('../../form-core/types/FormControlMixinTypes.js').FormControlHost & LitElement & {__parentFormGroup?: HTMLElement, checked?: boolean, disabled: boolean, hasFeedbackFor: string[], makeRequestToBeDisabled: Function }} FormControl + * @typedef {import('../../input/src/LionInput.js').LionInput} LionInput + * @typedef {import('../../select/src/LionSelect.js').LionSelect} LionSelect + * @typedef {import('../../listbox/src/LionOption.js').LionOption} LionOption */ /** diff --git a/packages/ui/components/form-integrations/test/model-value-event.test.js b/packages/ui/components/form-integrations/test/model-value-event.test.js index 619119f2a..801a48d01 100644 --- a/packages/ui/components/form-integrations/test/model-value-event.test.js +++ b/packages/ui/components/form-integrations/test/model-value-event.test.js @@ -6,9 +6,9 @@ import { html } from 'lit/static-html.js'; import sinon from 'sinon'; /** - * @typedef {import('@lion/input').LionInput} LionInput - * @typedef {import('@lion/fieldset').LionFieldset} LionFieldset - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../../input/src/LionInput.js').LionInput} LionInput + * @typedef {import('../../fieldset/src/LionFieldset.js').LionFieldset} LionFieldset + * @typedef {import('lit').TemplateResult} TemplateResult */ const inputFixture = /** @type {(arg: TemplateResult) => Promise} */ (fixture); const fieldsetFixture = /** @type {(arg: TemplateResult) => Promise} */ (fixture); diff --git a/packages/ui/components/form/test/lion-form.test.js b/packages/ui/components/form/test/lion-form.test.js index b40855c13..ba1a2a024 100644 --- a/packages/ui/components/form/test/lion-form.test.js +++ b/packages/ui/components/form/test/lion-form.test.js @@ -17,8 +17,8 @@ import { import { spy } from 'sinon'; /** - * @typedef {import('../src/LionForm').LionForm} LionForm - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionForm.js').LionForm} LionForm + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult) => Promise} */ (_fixture); diff --git a/packages/ui/components/helpers/src/SbActionLogger.js b/packages/ui/components/helpers/src/SbActionLogger.js index 1327dae2a..4cfb4acd4 100644 --- a/packages/ui/components/helpers/src/SbActionLogger.js +++ b/packages/ui/components/helpers/src/SbActionLogger.js @@ -1,6 +1,6 @@ import { css, html, LitElement, render } from 'lit'; -/** @typedef {import('@lion/core').TemplateResult} TemplateResult */ +/** @typedef {import('lit').TemplateResult} TemplateResult */ export class SbActionLogger extends LitElement { static get properties() { diff --git a/packages/ui/components/helpers/src/renderLitAsNode.js b/packages/ui/components/helpers/src/renderLitAsNode.js index 5c846a39e..d472fb928 100644 --- a/packages/ui/components/helpers/src/renderLitAsNode.js +++ b/packages/ui/components/helpers/src/renderLitAsNode.js @@ -4,7 +4,7 @@ import { render } from 'lit'; * Helper to render a lit TemplateResult as an offline-created DOM node * Make sure that the top-most element in the template has no siblings, * as they won't be taken into account. We only return firstElementChild. - * @param {import('@lion/core').TemplateResult} litHtmlTemplate + * @param {import('lit').TemplateResult} litHtmlTemplate */ export const renderLitAsNode = litHtmlTemplate => { const offlineRenderContainer = document.createElement('div'); diff --git a/packages/ui/components/helpers/test/sb-action-logger.test.js b/packages/ui/components/helpers/test/sb-action-logger.test.js index 9a71e2617..f9a137c69 100644 --- a/packages/ui/components/helpers/test/sb-action-logger.test.js +++ b/packages/ui/components/helpers/test/sb-action-logger.test.js @@ -3,8 +3,8 @@ import { html } from 'lit/static-html.js'; import '@lion/ui/define-helpers/sb-action-logger.js'; /** - * @typedef {import('../SbActionLogger').SbActionLogger} SbActionLogger - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/SbActionLogger.js').SbActionLogger} SbActionLogger + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult|string) => Promise} */ (_fixture); diff --git a/packages/ui/components/icon/src/IconManager.js b/packages/ui/components/icon/src/IconManager.js index 0e602d1e1..c2c50b17c 100644 --- a/packages/ui/components/icon/src/IconManager.js +++ b/packages/ui/components/icon/src/IconManager.js @@ -1,6 +1,6 @@ /** * @typedef {import('lit-html').nothing} nothing - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult */ export class IconManager { diff --git a/packages/ui/components/icon/src/LionIcon.js b/packages/ui/components/icon/src/LionIcon.js index 5af9a397d..6adc6b8ac 100644 --- a/packages/ui/components/icon/src/LionIcon.js +++ b/packages/ui/components/icon/src/LionIcon.js @@ -3,7 +3,7 @@ import { isTemplateResult } from 'lit/directive-helpers.js'; import { icons } from './icons.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult * @typedef {(tag: (strings: TemplateStringsArray, ... expr: string[]) => string) => string} TagFunction */ @@ -111,7 +111,7 @@ export class LionIcon extends LitElement { this.__svg = nothing; } - /** @param {import('@lion/core').PropertyValues} changedProperties */ + /** @param {import('lit').PropertyValues} changedProperties */ update(changedProperties) { super.update(changedProperties); if (changedProperties.has('ariaLabel')) { diff --git a/packages/ui/components/icon/test/IconManager.test.js b/packages/ui/components/icon/test/IconManager.test.js index c0471c4df..8e150533e 100644 --- a/packages/ui/components/icon/test/IconManager.test.js +++ b/packages/ui/components/icon/test/IconManager.test.js @@ -4,7 +4,7 @@ import { stub } from 'sinon'; import { IconManager } from '@lion/ui/icon.js'; /** - * @typedef {import("lit-html").TemplateResult} TemplateResult + * @typedef {import("lit").TemplateResult} TemplateResult */ /** diff --git a/packages/ui/components/icon/test/lion-icon.test.js b/packages/ui/components/icon/test/lion-icon.test.js index f19b67ca6..929e3a57e 100644 --- a/packages/ui/components/icon/test/lion-icon.test.js +++ b/packages/ui/components/icon/test/lion-icon.test.js @@ -8,8 +8,8 @@ import heartSvg from './heart.svg.js'; /** * @typedef {(strings: TemplateStringsArray, ... expr: string[]) => string} TaggedTemplateLiteral - * @typedef {import('../src/LionIcon').LionIcon} LionIcon - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionIcon.js').LionIcon} LionIcon + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult|string) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-amount/src/LionInputAmount.js b/packages/ui/components/input-amount/src/LionInputAmount.js index d3e247688..3d4b85406 100644 --- a/packages/ui/components/input-amount/src/LionInputAmount.js +++ b/packages/ui/components/input-amount/src/LionInputAmount.js @@ -6,7 +6,7 @@ import { formatAmount, formatCurrencyLabel } from './formatters.js'; import { parseAmount } from './parsers.js'; /** - * @typedef {import('@lion/form-core/types/FormatMixinTypes').FormatOptions} FormatOptions + * @typedef {import('../../form-core/types/FormatMixinTypes.js').FormatOptions} FormatOptions * @typedef {FormatOptions & {locale?:string;currency:string|undefined}} AmountFormatOptions */ @@ -83,7 +83,7 @@ export class LionInputAmount extends LocalizeMixin(LionInput) { } } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('currency')) { diff --git a/packages/ui/components/input-amount/src/formatters.js b/packages/ui/components/input-amount/src/formatters.js index 785c26a51..8bb08d54a 100644 --- a/packages/ui/components/input-amount/src/formatters.js +++ b/packages/ui/components/input-amount/src/formatters.js @@ -1,7 +1,7 @@ import { formatNumber, getFractionDigits, normalizeCurrencyLabel } from '@lion/ui/localize.js'; /** - * @typedef {import('@lion/localize/types/LocalizeMixinTypes').FormatNumberOptions} FormatOptions + * @typedef {import('../../localize/types/LocalizeMixinTypes.js').FormatNumberOptions} FormatOptions */ /** diff --git a/packages/ui/components/input-amount/src/parsers.js b/packages/ui/components/input-amount/src/parsers.js index a9e4203ae..45c6653f2 100644 --- a/packages/ui/components/input-amount/src/parsers.js +++ b/packages/ui/components/input-amount/src/parsers.js @@ -1,7 +1,7 @@ import { parseNumber, getFractionDigits } from '@lion/ui/localize.js'; /** - * @typedef {import('@lion/localize/types/LocalizeMixinTypes').FormatNumberOptions} FormatOptions + * @typedef {import('../../localize/types/LocalizeMixinTypes.js').FormatNumberOptions} FormatOptions */ /** diff --git a/packages/ui/components/input-amount/test/lion-input-amount.test.js b/packages/ui/components/input-amount/test/lion-input-amount.test.js index dc4c7188c..5929ba4db 100644 --- a/packages/ui/components/input-amount/test/lion-input-amount.test.js +++ b/packages/ui/components/input-amount/test/lion-input-amount.test.js @@ -8,8 +8,8 @@ import { formatAmount, parseAmount } from '@lion/ui/input-amount.js'; import '@lion/ui/define/lion-input-amount.js'; /** - * @typedef {import('@lion/input/src/LionInput').LionInput} LionInput - * @typedef {import('../src/LionInputAmount').LionInputAmount} LionInputAmount + * @typedef {import('../../input/src/LionInput.js').LionInput} LionInput + * @typedef {import('../src/LionInputAmount.js').LionInputAmount} LionInputAmount */ describe('', () => { diff --git a/packages/ui/components/input-date/src/LionInputDate.js b/packages/ui/components/input-date/src/LionInputDate.js index 1a6dad71e..ee1ac6cc5 100644 --- a/packages/ui/components/input-date/src/LionInputDate.js +++ b/packages/ui/components/input-date/src/LionInputDate.js @@ -38,7 +38,7 @@ export class LionInputDate extends LocalizeMixin(LionInput) { this.type = 'text'; } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('locale')) { diff --git a/packages/ui/components/input-date/test/lion-input-date.test.js b/packages/ui/components/input-date/test/lion-input-date.test.js index 2412606b8..1dd10986c 100644 --- a/packages/ui/components/input-date/test/lion-input-date.test.js +++ b/packages/ui/components/input-date/test/lion-input-date.test.js @@ -7,8 +7,8 @@ import { getInputMembers } from '@lion/ui/input-test-helpers.js'; import '@lion/ui/define/lion-input-date.js'; /** - * @typedef {import('../src/LionInputDate').LionInputDate} LionInputDate - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionInputDate.js').LionInputDate} LionInputDate + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-datepicker/src/LionInputDatepicker.js b/packages/ui/components/input-datepicker/src/LionInputDatepicker.js index be07ba498..4bed43349 100644 --- a/packages/ui/components/input-datepicker/src/LionInputDatepicker.js +++ b/packages/ui/components/input-datepicker/src/LionInputDatepicker.js @@ -13,8 +13,8 @@ import { import { LionCalendarOverlayFrame } from './LionCalendarOverlayFrame.js'; /** - * @typedef {import('@lion/form-core').Validator} Validator - * @typedef {import('@lion/core').RenderOptions} RenderOptions + * @typedef {import('../../form-core/src/validate/Validator.js').Validator} Validator + * @typedef {import('lit').RenderOptions} RenderOptions */ /** @@ -230,13 +230,13 @@ export class LionInputDatepicker extends ScopedElementsMixin( } } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ firstUpdated(changedProperties) { super.firstUpdated(changedProperties); this.__toggleInvokerDisabled(); } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('validators')) { @@ -354,7 +354,7 @@ export class LionInputDatepicker extends ScopedElementsMixin( async __openCalendarOverlay() { await this._overlayCtrl.show(); await Promise.all([ - /** @type {import('@lion/core').LitElement} */ (this._overlayCtrl.contentNode).updateComplete, + /** @type {import('lit').LitElement} */ (this._overlayCtrl.contentNode).updateComplete, this._calendarNode.updateComplete, ]); this._onCalendarOverlayOpened(); @@ -408,13 +408,16 @@ export class LionInputDatepicker extends ScopedElementsMixin( /** * Validators contain the information to synchronize the input with * the min, max and enabled dates of the calendar. - * @param {import('@lion/form-core').Validator[]} validators - errorValidators or warningValidators array + * @param {Validator[]} validators - errorValidators or warningValidators array */ __syncDisabledDates(validators) { // On every validator change, synchronize disabled dates: this means // we need to extract minDate, maxDate, minMaxDate and disabledDates validators validators.forEach(v => { - const vctor = /** @type {typeof import('@lion/form-core').Validator} */ (v.constructor); + const vctor = + /** @type {typeof import('../../form-core/src/validate/Validator.js').Validator} */ ( + v.constructor + ); if (vctor.validatorName === 'MinDate') { this.__calendarMinDate = v.param; } else if (vctor.validatorName === 'MaxDate') { diff --git a/packages/ui/components/input-datepicker/test-helpers/DatepickerInputObject.js b/packages/ui/components/input-datepicker/test-helpers/DatepickerInputObject.js index 6f1f96ff1..3e6eb0f7b 100644 --- a/packages/ui/components/input-datepicker/test-helpers/DatepickerInputObject.js +++ b/packages/ui/components/input-datepicker/test-helpers/DatepickerInputObject.js @@ -1,14 +1,14 @@ import { CalendarObject } from '@lion/ui/calendar-test-helpers.js'; export class DatepickerInputObject { - /** @param {import('../src/LionInputDatepicker').LionInputDatepicker} el */ + /** @param {import('../src/LionInputDatepicker.js').LionInputDatepicker} el */ constructor(el) { this.el = el; } /** * Methods mimicing User Interaction - * @param {{click?:boolean}} [options] + * @param {{click?:boolean}} options */ async openCalendar({ click } = {}) { // Make sure the calendar is opened, not closed/toggled; diff --git a/packages/ui/components/input-datepicker/test/lion-input-datepicker.test.js b/packages/ui/components/input-datepicker/test/lion-input-datepicker.test.js index d0815877c..b13f1513a 100644 --- a/packages/ui/components/input-datepicker/test/lion-input-datepicker.test.js +++ b/packages/ui/components/input-datepicker/test/lion-input-datepicker.test.js @@ -11,7 +11,7 @@ import { LionInputDatepicker } from '@lion/ui/input-datepicker.js'; import '@lion/ui/define/lion-input-datepicker.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult */ /** diff --git a/packages/ui/components/input-email/test/lion-input-email.test.js b/packages/ui/components/input-email/test/lion-input-email.test.js index 061cf2b64..e38c12021 100644 --- a/packages/ui/components/input-email/test/lion-input-email.test.js +++ b/packages/ui/components/input-email/test/lion-input-email.test.js @@ -3,8 +3,8 @@ import { getInputMembers } from '@lion/ui/input-test-helpers.js'; import '@lion/ui/define/lion-input-email.js'; /** - * @typedef {import('../src/LionInputEmail').LionInputEmail} LionInputEmail - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionInputEmail.js').LionInputEmail} LionInputEmail + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult|string) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-iban/test/lion-input-iban.test.js b/packages/ui/components/input-iban/test/lion-input-iban.test.js index 68da7755f..120da3622 100644 --- a/packages/ui/components/input-iban/test/lion-input-iban.test.js +++ b/packages/ui/components/input-iban/test/lion-input-iban.test.js @@ -5,8 +5,8 @@ import { IsCountryIBAN, formatIBAN, parseIBAN } from '@lion/ui/input-iban.js'; import '@lion/ui/define/lion-input-iban.js'; /** - * @typedef {import('../src/LionInputIban').LionInputIban} LionInputIban - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionInputIban.js').LionInputIban} LionInputIban + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult|string) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-range/src/LionInputRange.js b/packages/ui/components/input-range/src/LionInputRange.js index 76a6f1a00..195992283 100644 --- a/packages/ui/components/input-range/src/LionInputRange.js +++ b/packages/ui/components/input-range/src/LionInputRange.js @@ -5,7 +5,7 @@ import { LionInput } from '@lion/ui/input.js'; import { formatNumber } from '@lion/ui/localize.js'; /** - * @typedef {import('@lion/core').CSSResult} CSSResult + * @typedef {import('lit').CSSResult} CSSResult */ /** @@ -74,7 +74,7 @@ export class LionInputRange extends LionInput { this.parser = modelValue => parseFloat(modelValue); } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); @@ -91,7 +91,7 @@ export class LionInputRange extends LionInput { } } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ firstUpdated(changedProperties) { super.firstUpdated(changedProperties); if (changedProperties.has('modelValue')) { diff --git a/packages/ui/components/input-range/test/lion-input-range.test.js b/packages/ui/components/input-range/test/lion-input-range.test.js index b4b026cd4..8e55a51f9 100644 --- a/packages/ui/components/input-range/test/lion-input-range.test.js +++ b/packages/ui/components/input-range/test/lion-input-range.test.js @@ -3,8 +3,8 @@ import { expect, fixture as _fixture, nextFrame, html } from '@open-wc/testing'; import '@lion/ui/define/lion-input-range.js'; /** - * @typedef {import('../src/LionInputRange').LionInputRange} LionInputRange - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionInputRange.js').LionInputRange} LionInputRange + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult|string) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-stepper/src/LionInputStepper.js b/packages/ui/components/input-stepper/src/LionInputStepper.js index 3b82dd119..2e43a9408 100644 --- a/packages/ui/components/input-stepper/src/LionInputStepper.js +++ b/packages/ui/components/input-stepper/src/LionInputStepper.js @@ -3,7 +3,7 @@ import { LionInput } from '@lion/ui/input.js'; import { IsNumber, MinNumber, MaxNumber } from '@lion/ui/form-core.js'; /** - * @typedef {import('@lion/core').RenderOptions} RenderOptions + * @typedef {import('lit').RenderOptions} RenderOptions */ /** @@ -93,7 +93,7 @@ export class LionInputStepper extends LionInput { this.removeEventListener('keydown', this.__keyDownHandler); } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); @@ -272,7 +272,7 @@ export class LionInputStepper extends LionInput { /** * Get the decrementor button sign template - * @returns {String|import('@lion/core').TemplateResult} + * @returns {String|import('lit').TemplateResult} * @protected */ // eslint-disable-next-line class-methods-use-this @@ -282,7 +282,7 @@ export class LionInputStepper extends LionInput { /** * Get the incrementor button sign template - * @returns {String|import('@lion/core').TemplateResult} + * @returns {String|import('lit').TemplateResult} * @protected */ // eslint-disable-next-line class-methods-use-this @@ -292,7 +292,7 @@ export class LionInputStepper extends LionInput { /** * Get the increment button template - * @returns {import('@lion/core').TemplateResult} + * @returns {import('lit').TemplateResult} * @protected */ _decrementorTemplate() { @@ -312,7 +312,7 @@ export class LionInputStepper extends LionInput { /** * Get the decrement button template - * @returns {import('@lion/core').TemplateResult} + * @returns {import('lit').TemplateResult} * @protected */ _incrementorTemplate() { diff --git a/packages/ui/components/input-stepper/test/lion-input-stepper.test.js b/packages/ui/components/input-stepper/test/lion-input-stepper.test.js index 1c16665af..ff4827453 100644 --- a/packages/ui/components/input-stepper/test/lion-input-stepper.test.js +++ b/packages/ui/components/input-stepper/test/lion-input-stepper.test.js @@ -4,8 +4,8 @@ import sinon from 'sinon'; import '@lion/ui/define/lion-input-stepper.js'; /** - * @typedef {import('../src/LionInputStepper').LionInputStepper} LionInputStepper - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionInputStepper.js').LionInputStepper} LionInputStepper + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult|string) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-tel-dropdown/src/LionInputTelDropdown.js b/packages/ui/components/input-tel-dropdown/src/LionInputTelDropdown.js index b4ec42801..f18d0317e 100644 --- a/packages/ui/components/input-tel-dropdown/src/LionInputTelDropdown.js +++ b/packages/ui/components/input-tel-dropdown/src/LionInputTelDropdown.js @@ -20,16 +20,16 @@ import { getFlagSymbol } from './getFlagSymbol.js'; /** * @typedef {import('lit/directives/ref.js').Ref} Ref - * @typedef {import('@lion/core').RenderOptions} RenderOptions - * @typedef {import('@lion/form-core/types/FormatMixinTypes').FormatHost} FormatHost - * @typedef {import('@lion/input-tel/types').RegionCode} RegionCode - * @typedef {import('../types').TemplateDataForDropdownInputTel} TemplateDataForDropdownInputTel - * @typedef {import('../types').OnDropdownChangeEvent} OnDropdownChangeEvent - * @typedef {import('../types').DropdownRef} DropdownRef - * @typedef {import('../types').RegionMeta} RegionMeta + * @typedef {import('lit').RenderOptions} RenderOptions + * @typedef {import('../../form-core/types/FormatMixinTypes.js').FormatHost} FormatHost + * @typedef {import('../../input-tel/types/index.js').RegionCode} RegionCode + * @typedef {import('../types/index.js').TemplateDataForDropdownInputTel} TemplateDataForDropdownInputTel + * @typedef {import('../types/index.js').OnDropdownChangeEvent} OnDropdownChangeEvent + * @typedef {import('../types/index.js').DropdownRef} DropdownRef + * @typedef {import('../types/index.js').RegionMeta} RegionMeta * @typedef {* & import('awesome-phonenumber').default} AwesomePhoneNumber - * @typedef {import('@lion/select-rich').LionSelectRich} LionSelectRich - * @typedef {import('@lion/overlays').OverlayController} OverlayController + * @typedef {import('../../select-rich/src/LionSelectRich.js').LionSelectRich} LionSelectRich + * @typedef {import('../../overlays/src/OverlayController.js').OverlayController} OverlayController * @typedef {TemplateDataForDropdownInputTel & {data: {regionMetaList:RegionMeta[]}}} TemplateDataForIntlInputTel */ diff --git a/packages/ui/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js b/packages/ui/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js index 531b93a5b..0c4cee812 100644 --- a/packages/ui/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +++ b/packages/ui/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js @@ -1,6 +1,4 @@ -// @ts-ignore import { PhoneUtilManager } from '@lion/ui/input-tel.js'; -// @ts-ignore import { mockPhoneUtilManager, restorePhoneUtilManager } from '@lion/ui/input-tel-test-helpers.js'; import { aTimeout, @@ -15,9 +13,9 @@ import sinon from 'sinon'; import { LionInputTelDropdown } from '@lion/ui/input-tel-dropdown.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult * @typedef {HTMLSelectElement|HTMLElement & {modelValue:string}} DropdownElement - * @typedef {import('../types').TemplateDataForDropdownInputTel} TemplateDataForDropdownInputTel + * @typedef {import('../types/index.js').TemplateDataForDropdownInputTel} TemplateDataForDropdownInputTel */ const fixture = /** @type {(arg: string | TemplateResult) => Promise} */ ( diff --git a/packages/ui/components/input-tel-dropdown/test/LionInputTelDropdown.test.js b/packages/ui/components/input-tel-dropdown/test/LionInputTelDropdown.test.js index 7aa168f06..8ca519cef 100644 --- a/packages/ui/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +++ b/packages/ui/components/input-tel-dropdown/test/LionInputTelDropdown.test.js @@ -10,10 +10,10 @@ import '@lion/ui/define/lion-option.js'; import '@lion/ui/define/lion-select-rich.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('lit').TemplateResult} TemplateResult * @typedef {HTMLSelectElement|HTMLElement & {modelValue:string}} DropdownElement - * @typedef {import('../types').TemplateDataForDropdownInputTel} TemplateDataForDropdownInputTel - * @typedef {import('../types').RegionMeta} RegionMeta + * @typedef {import('../types/index.js').TemplateDataForDropdownInputTel} TemplateDataForDropdownInputTel + * @typedef {import('../types/index.js').RegionMeta} RegionMeta */ class WithFormControlInputTelDropdown extends LionInputTelDropdown { diff --git a/packages/ui/components/input-tel-dropdown/types/index.d.ts b/packages/ui/components/input-tel-dropdown/types/index.ts similarity index 89% rename from packages/ui/components/input-tel-dropdown/types/index.d.ts rename to packages/ui/components/input-tel-dropdown/types/index.ts index e9596362e..042f54750 100644 --- a/packages/ui/components/input-tel-dropdown/types/index.d.ts +++ b/packages/ui/components/input-tel-dropdown/types/index.ts @@ -1,6 +1,7 @@ -import { RegionCode } from '@lion/ui/input-tel/types.js'; +import { RegionCode } from '../../input-tel/types/index.js'; import { LionSelectRich } from '@lion/ui/select-rich.js'; import { LionCombobox } from '@lion/ui/combobox.js'; +import { OverlayController } from '../../overlays/src/OverlayController.js'; type RefTemplateData = { ref?: { value?: HTMLElement }; diff --git a/packages/ui/components/input-tel/src/LionInputTel.js b/packages/ui/components/input-tel/src/LionInputTel.js index 2ccbf975b..3e2b0a965 100644 --- a/packages/ui/components/input-tel/src/LionInputTel.js +++ b/packages/ui/components/input-tel/src/LionInputTel.js @@ -10,10 +10,10 @@ import { PhoneNumber } from './validators.js'; import { localizeNamespaceLoader } from './localizeNamespaceLoader.js'; /** - * @typedef {import('../types').RegionCode} RegionCode + * @typedef {import('../types/index.js').RegionCode} RegionCode * @typedef {import('awesome-phonenumber').PhoneNumberFormat} PhoneNumberFormat * @typedef {import('awesome-phonenumber').PhoneNumberTypes} PhoneNumberTypes - * @typedef {import('@lion/form-core/types/FormatMixinTypes').FormatOptions} FormatOptions + * @typedef {import('../../form-core/types/FormatMixinTypes.js').FormatOptions} FormatOptions * @typedef {* & import('awesome-phonenumber').default} AwesomePhoneNumber * @typedef {FormatOptions & {regionCode: RegionCode; formatStrategy: PhoneNumberFormat; formatCountryCodeStyle: string;}} FormatOptionsTel */ diff --git a/packages/ui/components/input-tel/src/formatters.js b/packages/ui/components/input-tel/src/formatters.js index 89639fb1a..399e3999b 100644 --- a/packages/ui/components/input-tel/src/formatters.js +++ b/packages/ui/components/input-tel/src/formatters.js @@ -2,7 +2,7 @@ import { PhoneUtilManager } from './PhoneUtilManager.js'; /** * @typedef {import('awesome-phonenumber').PhoneNumberFormat} PhoneNumberFormat - * @typedef {import('../types').RegionCode} RegionCode + * @typedef {import('../types/index.js').RegionCode} RegionCode * @typedef {* & import('awesome-phonenumber').default} AwesomePhoneNumber */ diff --git a/packages/ui/components/input-tel/src/parsers.js b/packages/ui/components/input-tel/src/parsers.js index a08625a34..b70060e8e 100644 --- a/packages/ui/components/input-tel/src/parsers.js +++ b/packages/ui/components/input-tel/src/parsers.js @@ -1,7 +1,7 @@ import { PhoneUtilManager } from './PhoneUtilManager.js'; /** - * @typedef {import('../types').RegionCode} RegionCode + * @typedef {import('../types/index.js').RegionCode} RegionCode * @typedef {* & import('awesome-phonenumber').default} AwesomePhoneNumber */ diff --git a/packages/ui/components/input-tel/src/preprocessors.js b/packages/ui/components/input-tel/src/preprocessors.js index b1832092f..dc1866ad3 100644 --- a/packages/ui/components/input-tel/src/preprocessors.js +++ b/packages/ui/components/input-tel/src/preprocessors.js @@ -2,7 +2,7 @@ import { formatPhoneNumber, getFormatCountryCodeStyle } from './formatters.js'; import { PhoneUtilManager } from './PhoneUtilManager.js'; /** - * @typedef {import('../types').RegionCode} RegionCode + * @typedef {import('../types/index.js').RegionCode} RegionCode * @typedef {import('awesome-phonenumber').PhoneNumberFormat} PhoneNumberFormat * @typedef {* & import('awesome-phonenumber').default} AwesomePhoneNumber */ diff --git a/packages/ui/components/input-tel/src/validators.js b/packages/ui/components/input-tel/src/validators.js index de4ea1acc..d15161369 100644 --- a/packages/ui/components/input-tel/src/validators.js +++ b/packages/ui/components/input-tel/src/validators.js @@ -2,9 +2,9 @@ import { Validator } from '@lion/ui/form-core.js'; import { PhoneUtilManager } from './PhoneUtilManager.js'; /** - * @typedef {import('../types').RegionCode} RegionCode + * @typedef {import('../types/index.js').RegionCode} RegionCode * @typedef {* & import('awesome-phonenumber').default} AwesomePhoneNumber - * @typedef {import('@lion/form-core/types/validate/validate').FeedbackMessageData} FeedbackMessageData + * @typedef {import('../../form-core/types/validate/validate.js').FeedbackMessageData} FeedbackMessageData */ /** diff --git a/packages/ui/components/input-tel/test-suites/LionInputTel.suite.js b/packages/ui/components/input-tel/test-suites/LionInputTel.suite.js index 00cedbdfc..848e6584c 100644 --- a/packages/ui/components/input-tel/test-suites/LionInputTel.suite.js +++ b/packages/ui/components/input-tel/test-suites/LionInputTel.suite.js @@ -15,8 +15,8 @@ import { LionInputTel, PhoneNumber, PhoneUtilManager } from '@lion/ui/input-tel. import { mockPhoneUtilManager, restorePhoneUtilManager } from '@lion/ui/input-tel-test-helpers.js'; /** - * @typedef {import('@lion/core').TemplateResult} TemplateResult - * @typedef {import('../types').RegionCode} RegionCode + * @typedef {import('lit').TemplateResult} TemplateResult + * @typedef {import('../types/index.js').RegionCode} RegionCode */ const fixture = /** @type {(arg: string | TemplateResult) => Promise} */ (_fixture); diff --git a/packages/ui/components/input-tel/types/index.d.ts b/packages/ui/components/input-tel/types/index.ts similarity index 100% rename from packages/ui/components/input-tel/types/index.d.ts rename to packages/ui/components/input-tel/types/index.ts diff --git a/packages/ui/components/input/src/LionInput.js b/packages/ui/components/input/src/LionInput.js index b67284fe6..b2bf8307f 100644 --- a/packages/ui/components/input/src/LionInput.js +++ b/packages/ui/components/input/src/LionInput.js @@ -74,13 +74,13 @@ export class LionInput extends NativeTextFieldMixin(LionField) { } } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ firstUpdated(changedProperties) { super.firstUpdated(changedProperties); this.__delegateReadOnly(); } - /** @param {import('@lion/core').PropertyValues } changedProperties */ + /** @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has('type')) { diff --git a/packages/ui/components/input/test-helpers/getInputMembers.js b/packages/ui/components/input/test-helpers/getInputMembers.js index 4b4de1db1..b1a7e88ed 100644 --- a/packages/ui/components/input/test-helpers/getInputMembers.js +++ b/packages/ui/components/input/test-helpers/getInputMembers.js @@ -1,8 +1,8 @@ import { getFormControlMembers } from '@lion/ui/form-core-test-helpers.js'; /** - * @typedef {import('../src/LionInput').LionInput} LionInput - * @typedef {import('@lion/form-core/types/FormControlMixinTypes').FormControlHost} FormControlHost + * @typedef {import('../src/LionInput.js').LionInput} LionInput + * @typedef {import('../../form-core/types/FormControlMixinTypes.js').FormControlHost} FormControlHost */ /** diff --git a/packages/ui/components/input/test/lion-input.test.js b/packages/ui/components/input/test/lion-input.test.js index c249d05f1..bc2600656 100644 --- a/packages/ui/components/input/test/lion-input.test.js +++ b/packages/ui/components/input/test/lion-input.test.js @@ -4,7 +4,7 @@ import { aTimeout, expect, fixture, html, triggerFocusFor, unsafeStatic } from ' import { getInputMembers } from '@lion/ui/input-test-helpers.js'; /** - * @typedef {import('../src/LionInput').LionInput} LionInput + * @typedef {import('../src/LionInput.js').LionInput} LionInput */ const tagString = 'lion-input'; diff --git a/packages/ui/components/listbox/src/LionOption.js b/packages/ui/components/listbox/src/LionOption.js index 29cbd0188..23474aa16 100644 --- a/packages/ui/components/listbox/src/LionOption.js +++ b/packages/ui/components/listbox/src/LionOption.js @@ -3,9 +3,9 @@ import { ChoiceInputMixin, FormRegisteringMixin } from '@lion/ui/form-core.js'; import { DisabledMixin, SlotMixin } from '@lion/ui/core.js'; /** - * @typedef {import('@lion/core').TemplateResult } TemplateResult - * @typedef {import('@lion/form-core/types/choice-group/ChoiceGroupMixinTypes').ChoiceGroupHost } ChoiceGroupHost - * @typedef {import('../types/LionOption').LionOptionHost } LionOptionHost + * @typedef {import('lit').TemplateResult } TemplateResult + * @typedef {import('../../form-core/types/choice-group/ChoiceGroupMixinTypes.js').ChoiceGroupHost } ChoiceGroupHost + * @typedef {import('../types/LionOption.js').LionOptionHost } LionOptionHost */ /** @@ -90,7 +90,7 @@ export class LionOption extends DisabledMixin( } /** - * @param {import('@lion/core').PropertyValues } changedProperties + * @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); diff --git a/packages/ui/components/listbox/src/ListboxMixin.js b/packages/ui/components/listbox/src/ListboxMixin.js index f7b57645d..084b47ac6 100644 --- a/packages/ui/components/listbox/src/ListboxMixin.js +++ b/packages/ui/components/listbox/src/ListboxMixin.js @@ -10,13 +10,13 @@ import { LionOptions } from './LionOptions.js'; // list items that can be found via MutationObserver or registration (.formElements) /** - * @typedef {import('@lion/form-core/types/FormControlMixinTypes').HTMLElementWithValue} HTMLElementWithValue - * @typedef {import('@lion/form-core/types/FormControlMixinTypes').FormControlHost} FormControlHost - * @typedef {import('./LionOption').LionOption} LionOption - * @typedef {import('../types/ListboxMixinTypes').ListboxMixin} ListboxMixin - * @typedef {import('../types/ListboxMixinTypes').ListboxHost} ListboxHost - * @typedef {import('@lion/form-core/types/registration/FormRegistrarPortalMixinTypes').FormRegistrarPortalHost} FormRegistrarPortalHost - * @typedef {import('@lion/form-core/types/FormControlMixinTypes.js').ModelValueEventDetails} ModelValueEventDetails + * @typedef {import('../../form-core/types/FormControlMixinTypes.js').HTMLElementWithValue} HTMLElementWithValue + * @typedef {import('../../form-core/types/FormControlMixinTypes.js').FormControlHost} FormControlHost + * @typedef {import('./LionOption.js').LionOption} LionOption + * @typedef {import('../types/ListboxMixinTypes.js').ListboxMixin} ListboxMixin + * @typedef {import('../types/ListboxMixinTypes.js').ListboxHost} ListboxHost + * @typedef {import('../../form-core/types/registration/FormRegistrarPortalMixinTypes.js').FormRegistrarPortalHost} FormRegistrarPortalHost + * @typedef {import('../../form-core/types/FormControlMixinTypes.js').ModelValueEventDetails} ModelValueEventDetails */ // TODO: consider adding methods below to @lion/helpers @@ -56,7 +56,7 @@ function moveDefaultSlottablesToTarget(source, target) { /** * @type {ListboxMixin} - * @param {import('@open-wc/dedupe-mixin').Constructor} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const ListboxMixinImplementation = superclass => // @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051 @@ -361,7 +361,7 @@ const ListboxMixinImplementation = superclass => } /** - * @param {import('@lion/core').PropertyValues } changedProperties + * @param {import('lit').PropertyValues } changedProperties */ firstUpdated(changedProperties) { super.firstUpdated(changedProperties); @@ -379,7 +379,7 @@ const ListboxMixinImplementation = superclass => } /** - * @param {import('@lion/core').PropertyValues } changedProperties + * @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); diff --git a/packages/ui/components/listbox/test-helpers/getListboxMembers.js b/packages/ui/components/listbox/test-helpers/getListboxMembers.js index 47c1ae21b..9bd189c29 100644 --- a/packages/ui/components/listbox/test-helpers/getListboxMembers.js +++ b/packages/ui/components/listbox/test-helpers/getListboxMembers.js @@ -1,9 +1,9 @@ import { getFormControlMembers } from '@lion/ui/form-core-test-helpers.js'; /** - * @typedef {import('@lion/listbox/src/LionOptions').LionOptions} LionOptions - * @typedef {import('@lion/listbox/types/ListboxMixinTypes').ListboxHost} ListboxHost - * @typedef {import('@lion/form-core/types/FormControlMixinTypes').FormControlHost} FormControlHost + * @typedef {import('../../listbox/src/LionOptions.js').LionOptions} LionOptions + * @typedef {import('../../listbox/types/ListboxMixinTypes.js').ListboxHost} ListboxHost + * @typedef {import('../../form-core/types/FormControlMixinTypes.js').FormControlHost} FormControlHost */ /** diff --git a/packages/ui/components/listbox/test-suites/ListboxMixin.suite.js b/packages/ui/components/listbox/test-suites/ListboxMixin.suite.js index c1a6e1069..80541b5c1 100644 --- a/packages/ui/components/listbox/test-suites/ListboxMixin.suite.js +++ b/packages/ui/components/listbox/test-suites/ListboxMixin.suite.js @@ -17,10 +17,10 @@ import sinon from 'sinon'; import { getListboxMembers } from '../../../exports/listbox-test-helpers.js'; /** - * @typedef {import('../src/LionListbox').LionListbox} LionListbox - * @typedef {import('../src/LionOption').LionOption} LionOption - * @typedef {import('@lion/select-rich').LionSelectInvoker} LionSelectInvoker - * @typedef {import('@lion/core').TemplateResult} TemplateResult + * @typedef {import('../src/LionListbox.js').LionListbox} LionListbox + * @typedef {import('../src/LionOption.js').LionOption} LionOption + * @typedef {import('../../select-rich/src/LionSelectInvoker.js').LionSelectInvoker} LionSelectInvoker + * @typedef {import('lit').TemplateResult} TemplateResult */ const fixture = /** @type {(arg: TemplateResult) => Promise} */ (_fixture); diff --git a/packages/ui/components/listbox/types/LionOption.d.ts b/packages/ui/components/listbox/types/LionOption.ts similarity index 54% rename from packages/ui/components/listbox/types/LionOption.d.ts rename to packages/ui/components/listbox/types/LionOption.ts index 9dec5308c..5f649e5b4 100644 --- a/packages/ui/components/listbox/types/LionOption.d.ts +++ b/packages/ui/components/listbox/types/LionOption.ts @@ -1,4 +1,4 @@ -import { ChoiceGroupHost } from '@lion/ui/form-core/types/choice-group/ChoiceGroupMixinTypes.js'; +import { ChoiceGroupHost } from '../../form-core/types/choice-group/ChoiceGroupMixinTypes.js'; export declare class LionOptionHost { constructor(...args: any[]); diff --git a/packages/ui/components/listbox/types/ListboxMixinTypes.d.ts b/packages/ui/components/listbox/types/ListboxMixinTypes.ts similarity index 85% rename from packages/ui/components/listbox/types/ListboxMixinTypes.d.ts rename to packages/ui/components/listbox/types/ListboxMixinTypes.ts index 2af4cd88d..7cc3bcb15 100644 --- a/packages/ui/components/listbox/types/ListboxMixinTypes.d.ts +++ b/packages/ui/components/listbox/types/ListboxMixinTypes.ts @@ -1,10 +1,10 @@ import { Constructor } from '@open-wc/dedupe-mixin'; -import { LitElement, CSSResultArray } from '@lion/ui/core.js'; -import { SlotHost } from '@lion/ui/core/types/SlotMixinTypes.js'; +import { LitElement, CSSResultArray } from 'lit'; +import { SlotHost } from '../../core/types/SlotMixinTypes.js'; -import { FormControlHost } from '@lion/ui/form-core/types/FormControlMixinTypes.js'; -import { FormRegistrarHost } from '@lion/ui/form-core/types/registration/FormRegistrarMixinTypes.js'; -import { ChoiceGroupHost } from '@lion/ui/form-core/types/choice-group/ChoiceGroupMixinTypes.js'; +import { FormControlHost } from '../../form-core/types/FormControlMixinTypes.js'; +import { FormRegistrarHost } from '../../form-core/types/registration/FormRegistrarMixinTypes.js'; +import { ChoiceGroupHost } from '../../form-core/types/choice-group/ChoiceGroupMixinTypes.js'; import { LionOptions } from '../src/LionOptions.js'; import { LionOption } from '../src/LionOption.js'; @@ -57,7 +57,7 @@ export declare class ListboxHost { private __setupListboxNode(): void; - protected _handleTypeAhead(ev: KeyboardEvent, { setAsChecked: boolean }): void; + protected _handleTypeAhead(ev: KeyboardEvent, params: { setAsChecked: boolean }): void; protected _getPreviousEnabledOption(currentIndex: number, offset?: number): number; diff --git a/packages/ui/components/localize/src/LocalizeManager.js b/packages/ui/components/localize/src/LocalizeManager.js index 0ac0c8d77..959ffdb43 100644 --- a/packages/ui/components/localize/src/LocalizeManager.js +++ b/packages/ui/components/localize/src/LocalizeManager.js @@ -1,13 +1,13 @@ -// @ts-expect-error [external]: no types for this package +// @ts-ignore import MessageFormat from '@bundled-es-modules/message-format/MessageFormat.js'; import isLocalizeESModule from './isLocalizeESModule.js'; /** - * @typedef {import('../types/LocalizeMixinTypes').NamespaceObject} NamespaceObject + * @typedef {import('../types/LocalizeMixinTypes.js').NamespaceObject} NamespaceObject */ -/** @typedef {import('../types/LocalizeMixinTypes').DatePostProcessor} DatePostProcessor */ -/** @typedef {import('../types/LocalizeMixinTypes').NumberPostProcessor} NumberPostProcessor */ +/** @typedef {import('../types/LocalizeMixinTypes.js').DatePostProcessor} DatePostProcessor */ +/** @typedef {import('../types/LocalizeMixinTypes.js').NumberPostProcessor} NumberPostProcessor */ /** * `LocalizeManager` manages your translations (includes loading) @@ -222,7 +222,7 @@ export class LocalizeManager { /** * @param {NamespaceObject[]} namespaces - * @param {Object} [options] + * @param {Object} options * @param {string} [options.locale] * @returns {Promise.} */ @@ -237,7 +237,7 @@ export class LocalizeManager { /** * @param {NamespaceObject} namespaceObj - * @param {Object} [options] + * @param {Object} options * @param {string} [options.locale] * @returns {Promise.} */ diff --git a/packages/ui/components/localize/src/LocalizeMixin.js b/packages/ui/components/localize/src/LocalizeMixin.js index fd051fda3..1b182b369 100644 --- a/packages/ui/components/localize/src/LocalizeMixin.js +++ b/packages/ui/components/localize/src/LocalizeMixin.js @@ -4,14 +4,14 @@ import { until } from 'lit/directives/until.js'; import { localize } from './singleton.js'; /** - * @typedef {import('@lion/core').DirectiveResult} DirectiveResult - * @typedef {import('../types/LocalizeMixinTypes').LocalizeMixin} LocalizeMixin + * @typedef {import('lit/directive.js').DirectiveResult} DirectiveResult + * @typedef {import('../types/LocalizeMixinTypes.js').LocalizeMixin} LocalizeMixin */ /** * # LocalizeMixin - for self managed templates * @type {LocalizeMixin} - * @param {import('@open-wc/dedupe-mixin').Constructor} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ const LocalizeMixinImplementation = superclass => // @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051 @@ -41,11 +41,9 @@ const LocalizeMixinImplementation = superclass => this.__localizeOnLocaleChanged(event); }; - this.__boundLocalizeOnLocaleChanging = - /** @param {...Object} args */ - () => { - this.__localizeOnLocaleChanging(); - }; + this.__boundLocalizeOnLocaleChanging = () => { + this.__localizeOnLocaleChanging(); + }; // should be loaded in advance /** @private */ diff --git a/packages/ui/components/localize/src/date/formatDate.js b/packages/ui/components/localize/src/date/formatDate.js index ffe1e0da4..c71fed45b 100644 --- a/packages/ui/components/localize/src/date/formatDate.js +++ b/packages/ui/components/localize/src/date/formatDate.js @@ -2,13 +2,13 @@ import { getLocale } from '../utils/getLocale.js'; import { localize } from '../singleton.js'; import { normalizeIntlDate } from './utils/normalizeIntlDate.js'; -/** @typedef {import('../../types/LocalizeMixinTypes').DatePostProcessor} DatePostProcessor */ +/** @typedef {import('../../types/LocalizeMixinTypes.js').DatePostProcessor} DatePostProcessor */ /** * Formats date based on locale and options * * @param {Date} date - * @param {import('@lion/localize/types/LocalizeMixinTypes').FormatDateOptions} [options] Intl options are available + * @param {import('../../types/LocalizeMixinTypes.js').FormatDateOptions} [options] Intl options are available * @returns {string} */ export function formatDate(date, options) { @@ -17,8 +17,7 @@ export function formatDate(date, options) { } const formatOptions = - options || - /** @type {import('@lion/localize/types/LocalizeMixinTypes').FormatDateOptions} */ ({}); + options || /** @type {import('../../types/LocalizeMixinTypes.js').FormatDateOptions} */ ({}); /** * Set smart defaults if: * 1) no options object is passed diff --git a/packages/ui/components/localize/src/date/getMonthNames.js b/packages/ui/components/localize/src/date/getMonthNames.js index 361b1df47..81776cff7 100644 --- a/packages/ui/components/localize/src/date/getMonthNames.js +++ b/packages/ui/components/localize/src/date/getMonthNames.js @@ -6,7 +6,7 @@ const monthsLocaleCache = {}; /** * @desc Returns month names for locale - * @param {Object} [options] + * @param {Object} options * @param {string} [options.locale] locale * @param {"long" | "numeric" | "2-digit" | "short" | "narrow"} [options.style=long] long, short or narrow * @returns {string[]} like: ['January', 'February', ...etc]. diff --git a/packages/ui/components/localize/src/date/getWeekdayNames.js b/packages/ui/components/localize/src/date/getWeekdayNames.js index c01d0392d..ec730de9e 100644 --- a/packages/ui/components/localize/src/date/getWeekdayNames.js +++ b/packages/ui/components/localize/src/date/getWeekdayNames.js @@ -44,7 +44,7 @@ function getCachedWeekdayNames(locale) { /** * @desc Returns weekday names for locale - * @param {Object} [options] + * @param {Object} options * @param {string} [options.locale] locale * @param {string} [options.style=long] long, short or narrow * @param {number} [options.firstDayOfWeek=0] 0 (Sunday), 1 (Monday), etc... diff --git a/packages/ui/components/localize/src/date/utils/normalizeIntlDate.js b/packages/ui/components/localize/src/date/utils/normalizeIntlDate.js index c1ce7355b..752b18f01 100644 --- a/packages/ui/components/localize/src/date/utils/normalizeIntlDate.js +++ b/packages/ui/components/localize/src/date/utils/normalizeIntlDate.js @@ -3,7 +3,7 @@ * * @param {string} str * @param {string} [locale=''] - * @param {import('@lion/localize/types/LocalizeMixinTypes').FormatDateOptions} [options] Intl options are available + * @param {import('../../../types/LocalizeMixinTypes.js').FormatDateOptions} options Intl options are available * @returns {string} */ export function normalizeIntlDate(str, locale = '', { weekday, year, month, day } = {}) { diff --git a/packages/ui/components/localize/src/number/formatNumber.js b/packages/ui/components/localize/src/number/formatNumber.js index 967a4cdb3..46545041d 100644 --- a/packages/ui/components/localize/src/number/formatNumber.js +++ b/packages/ui/components/localize/src/number/formatNumber.js @@ -1,4 +1,4 @@ -/** @typedef {import('../../types/LocalizeMixinTypes').NumberPostProcessor} NumberPostProcessor */ +/** @typedef {import('../../types/LocalizeMixinTypes.js').NumberPostProcessor} NumberPostProcessor */ import { localize } from '../singleton.js'; import { getLocale } from '../utils/getLocale.js'; @@ -7,8 +7,8 @@ import { formatNumberToParts } from './formatNumberToParts.js'; /** * Formats a number based on locale and options. It uses Intl for the formatting. * - * @typedef {import('../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart - * @typedef {import('@lion/localize/types/LocalizeMixinTypes').FormatNumberOptions} FormatOptions + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} FormatOptions * @param {number} number Number to be formatted * @param {FormatOptions} [options] Intl options are available extended by roundMode and returnIfNaN * @returns {string} diff --git a/packages/ui/components/localize/src/number/formatNumberToParts.js b/packages/ui/components/localize/src/number/formatNumberToParts.js index b6dbfce41..01b18c773 100644 --- a/packages/ui/components/localize/src/number/formatNumberToParts.js +++ b/packages/ui/components/localize/src/number/formatNumberToParts.js @@ -30,9 +30,9 @@ export function roundNumber(number, roundMode) { /** * Splits a number up in parts for integer, fraction, group, literal, decimal and currency. * - * @typedef {import('../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {number} number Number to split up - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} [options] Intl options are available extended by roundMode,returnIfNaN + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} [options] Intl options are available extended by roundMode,returnIfNaN * @returns {string | FormatNumberPart[]} Array with parts or (an empty string or returnIfNaN if not a number) */ export function formatNumberToParts(number, options = {}) { diff --git a/packages/ui/components/localize/src/number/getCurrencyName.js b/packages/ui/components/localize/src/number/getCurrencyName.js index 3ac18ffd0..3fa0a7d50 100644 --- a/packages/ui/components/localize/src/number/getCurrencyName.js +++ b/packages/ui/components/localize/src/number/getCurrencyName.js @@ -5,9 +5,9 @@ import { forceCurrencyNameForPHPEnGB } from './utils/normalize-get-currency-name /** * Based on number, returns currency name like 'US dollar' * - * @typedef {import('../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {string} currencyIso iso code like USD - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} [options] Intl options are available extended by roundMode + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} [options] Intl options are available extended by roundMode * @returns {string} currency name like 'US dollar' */ export function getCurrencyName(currencyIso, options) { diff --git a/packages/ui/components/localize/src/number/getDecimalSeparator.js b/packages/ui/components/localize/src/number/getDecimalSeparator.js index bbfac866a..90808306b 100644 --- a/packages/ui/components/localize/src/number/getDecimalSeparator.js +++ b/packages/ui/components/localize/src/number/getDecimalSeparator.js @@ -4,7 +4,7 @@ import { getLocale } from '../utils/getLocale.js'; * To get the decimal separator * * @param {string} [locale] To override the browser locale - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} [options] * @returns {string} The separator */ export function getDecimalSeparator(locale, options) { diff --git a/packages/ui/components/localize/src/number/getFractionDigits.js b/packages/ui/components/localize/src/number/getFractionDigits.js index 86c2ba289..c588f00df 100644 --- a/packages/ui/components/localize/src/number/getFractionDigits.js +++ b/packages/ui/components/localize/src/number/getFractionDigits.js @@ -4,7 +4,7 @@ import { formatNumberToParts } from './formatNumberToParts.js'; * @example * getFractionDigits('JOD'); // return 3 * - * @typedef {import('../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {string} [currency="EUR"] Currency code e.g. EUR * @returns {number} fraction for the given currency */ diff --git a/packages/ui/components/localize/src/number/getGroupSeparator.js b/packages/ui/components/localize/src/number/getGroupSeparator.js index e6e7c8b11..d8d335a8a 100644 --- a/packages/ui/components/localize/src/number/getGroupSeparator.js +++ b/packages/ui/components/localize/src/number/getGroupSeparator.js @@ -5,7 +5,7 @@ import { normalSpaces } from './utils/normalSpaces.js'; * Gets the group separator * * @param {string} [locale] To override the browser locale - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} [options] * @returns {string} */ export function getGroupSeparator(locale, options) { diff --git a/packages/ui/components/localize/src/number/getSeparatorsFromNumber.js b/packages/ui/components/localize/src/number/getSeparatorsFromNumber.js index 318bb5764..80746c32d 100644 --- a/packages/ui/components/localize/src/number/getSeparatorsFromNumber.js +++ b/packages/ui/components/localize/src/number/getSeparatorsFromNumber.js @@ -2,7 +2,7 @@ * * @param {number} parsedNumber * @param {string} formattedNumber - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} [options] * @returns {{groupSeparator: string|null, decimalSeparator: string|null}} */ export function getSeparatorsFromNumber(parsedNumber, formattedNumber, options) { diff --git a/packages/ui/components/localize/src/number/parseNumber.js b/packages/ui/components/localize/src/number/parseNumber.js index 74066a9c6..56b02488e 100644 --- a/packages/ui/components/localize/src/number/parseNumber.js +++ b/packages/ui/components/localize/src/number/parseNumber.js @@ -64,7 +64,7 @@ function getParseMode(value, { mode = 'auto' } = {}) { * parseWithLocale('1,234', { locale: 'en-GB' }) => 1234 * * @param {string} value Number to be parsed - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} options Locale Options + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} options Locale Options */ function parseWithLocale(value, options) { const locale = options && options.locale ? options.locale : undefined; @@ -118,7 +118,7 @@ function parseHeuristic(value) { * parseNumber('1,234.56'); // method: heuristic => 1234.56 * * @param {string} value Number to be parsed - * @param {import('../../types/LocalizeMixinTypes').FormatNumberOptions} [options] Locale Options + * @param {import('../../types/LocalizeMixinTypes.js').FormatNumberOptions} [options] Locale Options */ export function parseNumber(value, options) { const containsNumbers = value.match(/\d/g); diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceAddGroupSeparators.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceAddGroupSeparators.js index fb2c4b791..c3f533e0e 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceAddGroupSeparators.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceAddGroupSeparators.js @@ -1,7 +1,7 @@ /** * Add separators when they are not present * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts * @param {string} groupSeparator * @returns {FormatNumberPart[]} diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceCurrencyToEnd.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceCurrencyToEnd.js index 4199e486a..bdd516ceb 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceCurrencyToEnd.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceCurrencyToEnd.js @@ -1,7 +1,7 @@ /** * For Dutch and Belgian amounts the currency should be at the end of the string * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts * @returns {FormatNumberPart[]} */ diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.js index 4d67caca0..4a75c14ba 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.js @@ -8,9 +8,9 @@ const CURRENCY_CODE_SYMBOL_MAP = { /** * Change the symbols for locale 'en-AU', due to bug in Chrome * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts - * @param {import('../../../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../../../types/LocalizeMixinTypes.js').FormatNumberOptions} options * @returns {FormatNumberPart[]} */ export function forceENAUSymbols(formattedParts, { currency, currencyDisplay } = {}) { diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceNormalSpaces.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceNormalSpaces.js index cdaffa88b..6a965a077 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceNormalSpaces.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceNormalSpaces.js @@ -3,7 +3,7 @@ import { normalSpaces } from '../normalSpaces.js'; /** * Parts with forced "normal" spaces * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts * @returns {FormatNumberPart[]} */ diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceBetweenCurrencyCodeAndNumber.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceBetweenCurrencyCodeAndNumber.js index 883705fcc..e88a79930 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceBetweenCurrencyCodeAndNumber.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceBetweenCurrencyCodeAndNumber.js @@ -1,9 +1,9 @@ /** * When in some locales there is no space between currency and amount it is added * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts - * @param {import('../../../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../../../types/LocalizeMixinTypes.js').FormatNumberOptions} options * @returns {FormatNumberPart[]} */ export function forceSpaceBetweenCurrencyCodeAndNumber( diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceInsteadOfZeroForGroup.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceInsteadOfZeroForGroup.js index 7206ab417..cf6e06a37 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceInsteadOfZeroForGroup.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceInsteadOfZeroForGroup.js @@ -2,7 +2,7 @@ * @desc Intl uses 0 as group separator for bg-BG locale. * This should be a ' ' * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts * @returns {FormatNumberPart[]} corrected formatted parts */ diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceTryCurrencyCode.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceTryCurrencyCode.js index e3c958e7d..81d3aac46 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceTryCurrencyCode.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceTryCurrencyCode.js @@ -1,7 +1,7 @@ /** - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts - * @param {import('../../../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../../../types/LocalizeMixinTypes.js').FormatNumberOptions} options * @returns {FormatNumberPart[]} */ diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.js index 2f39bb5f7..93b972a1c 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.js @@ -1,7 +1,7 @@ /** - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts - * @param {import('../../../../types/LocalizeMixinTypes').FormatNumberOptions} [options] + * @param {import('../../../../types/LocalizeMixinTypes.js').FormatNumberOptions} options * @returns {FormatNumberPart[]} */ export function forceYenSymbol(formattedParts, { currency, currencyDisplay } = {}) { diff --git a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.js b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.js index 23b4f86aa..0857d77ad 100644 --- a/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.js +++ b/packages/ui/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.js @@ -11,9 +11,9 @@ import { forceENAUSymbols } from './forceENAUSymbols.js'; /** * Normalizes function "formatNumberToParts" * - * @typedef {import('../../../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} formattedParts - * @param {import('../../../../types/LocalizeMixinTypes').FormatNumberOptions} options + * @param {import('../../../../types/LocalizeMixinTypes.js').FormatNumberOptions} options * @param {string} _locale * @returns {FormatNumberPart[]} */ diff --git a/packages/ui/components/localize/test/LocalizeManager.test.js b/packages/ui/components/localize/test/LocalizeManager.test.js index 57611565b..4215f85a7 100644 --- a/packages/ui/components/localize/test/LocalizeManager.test.js +++ b/packages/ui/components/localize/test/LocalizeManager.test.js @@ -1,6 +1,6 @@ import { expect, oneEvent, aTimeout } from '@open-wc/testing'; import sinon from 'sinon'; -// @ts-expect-error no types for this package +// @ts-ignore import { fetchMock } from '@bundled-es-modules/fetch-mock'; import { setupFakeImport, resetFakeImport, fakeImport } from '@lion/ui/localize-test-helpers.js'; diff --git a/packages/ui/components/localize/test/LocalizeMixin.test.js b/packages/ui/components/localize/test/LocalizeMixin.test.js index 6caa13c03..f5d014c50 100644 --- a/packages/ui/components/localize/test/LocalizeMixin.test.js +++ b/packages/ui/components/localize/test/LocalizeMixin.test.js @@ -22,7 +22,7 @@ import { } from '@lion/ui/localize-test-helpers.js'; /** - * @typedef {import('../types/LocalizeMixinTypes').LocalizeMixin} LocalizeMixinHost + * @typedef {import('../types/LocalizeMixinTypes.js').LocalizeMixin} LocalizeMixinHost */ describe('LocalizeMixin', () => { diff --git a/packages/ui/components/localize/test/date/formatDate.test.js b/packages/ui/components/localize/test/date/formatDate.test.js index 8d06269ef..0ed55dab5 100644 --- a/packages/ui/components/localize/test/date/formatDate.test.js +++ b/packages/ui/components/localize/test/date/formatDate.test.js @@ -37,7 +37,7 @@ const SUPPORTED_LOCALES = { }; /** - * @typedef {import('../../types/LocalizeMixinTypes').FormatDateOptions} FormatDateOptions + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatDateOptions} FormatDateOptions */ describe('formatDate', () => { diff --git a/packages/ui/components/localize/test/number/formatNumberToParts.test.js b/packages/ui/components/localize/test/number/formatNumberToParts.test.js index cb90f1562..9c7871452 100644 --- a/packages/ui/components/localize/test/number/formatNumberToParts.test.js +++ b/packages/ui/components/localize/test/number/formatNumberToParts.test.js @@ -21,7 +21,7 @@ const m = { type: 'minusSign', value: '−' }; const stringifyParts = /** - * @typedef {import('../../types/LocalizeMixinTypes').FormatNumberPart} FormatNumberPart + * @typedef {import('../../types/LocalizeMixinTypes.js').FormatNumberPart} FormatNumberPart * @param {FormatNumberPart[]} parts * @returns {string} */ diff --git a/packages/ui/components/localize/types/LocalizeMixinTypes.d.ts b/packages/ui/components/localize/types/LocalizeMixinTypes.ts similarity index 96% rename from packages/ui/components/localize/types/LocalizeMixinTypes.d.ts rename to packages/ui/components/localize/types/LocalizeMixinTypes.ts index f74a9f75f..7c39308d4 100644 --- a/packages/ui/components/localize/types/LocalizeMixinTypes.d.ts +++ b/packages/ui/components/localize/types/LocalizeMixinTypes.ts @@ -44,17 +44,17 @@ export declare interface FormatNumberOptions extends Intl.NumberFormatOptions { postProcessors?: Map; } -interface StringToFunctionMap { +export interface StringToFunctionMap { [key: string]: Function; } export type NamespaceObject = StringToFunctionMap | string; -interface msgVariables { +export interface msgVariables { [key: string]: unknown; } -interface msgOptions { +export interface msgOptions { locale?: string; } diff --git a/packages/ui/components/localize/types/index.d.ts b/packages/ui/components/localize/types/index.d.ts deleted file mode 100644 index 6ae7b1561..000000000 --- a/packages/ui/components/localize/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module '@bundled-es-modules/message-format/MessageFormat.js' { - let main: any; - export = main; -} - -declare module '@bundled-es-modules/fetch-mock' { - export const fetchMock: any; -} diff --git a/packages/ui/components/overlays/src/ArrowMixin.js b/packages/ui/components/overlays/src/ArrowMixin.js index 1839156ff..e85729feb 100644 --- a/packages/ui/components/overlays/src/ArrowMixin.js +++ b/packages/ui/components/overlays/src/ArrowMixin.js @@ -3,16 +3,16 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin'; import { OverlayMixin } from './OverlayMixin.js'; /** - * @typedef {import('../types/OverlayConfig').OverlayConfig} OverlayConfig - * @typedef {import('../types/ArrowMixinTypes').ArrowMixin} ArrowMixin - * @typedef {import('@popperjs/core/lib/popper').Options} PopperOptions - * @typedef {import('@popperjs/core/lib/enums').Placement} Placement - * @typedef {import('@lion/core').CSSResultArray} CSSResultArray + * @typedef {import('../types/OverlayConfig.js').OverlayConfig} OverlayConfig + * @typedef {import('../types/ArrowMixinTypes.js').ArrowMixin} ArrowMixin + * @typedef {import('@popperjs/core/lib/popper.js').Options} PopperOptions + * @typedef {import('@popperjs/core/lib/enums.js').Placement} Placement + * @typedef {import('lit').CSSResultArray} CSSResultArray */ /** * @type {ArrowMixin} - * @param {import('@open-wc/dedupe-mixin').Constructor} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ export const ArrowMixinImplementation = superclass => // @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051 @@ -152,7 +152,7 @@ export const ArrowMixinImplementation = superclass => * @protected */ _getPopperArrowConfig(popperConfigToExtendFrom) { - /** @type {Partial & { afterWrite: (arg0: Partial) => void }} */ + /** @type {Partial & { afterWrite: (arg0: Partial) => void }} */ const popperCfg = { ...(popperConfigToExtendFrom || {}), placement: /** @type {Placement} */ ('top'), @@ -171,11 +171,11 @@ export const ArrowMixinImplementation = superclass => }, ...((popperConfigToExtendFrom && popperConfigToExtendFrom.modifiers) || []), ], - /** @param {Partial} data */ + /** @param {Partial} data */ onFirstUpdate: data => { this.__syncFromPopperState(data); }, - /** @param {Partial} data */ + /** @param {Partial} data */ afterWrite: data => { this.__syncFromPopperState(data); }, @@ -196,7 +196,7 @@ export const ArrowMixinImplementation = superclass => } /** - * @param {Partial} data + * @param {Partial} data * @private */ __syncFromPopperState(data) { diff --git a/packages/ui/components/overlays/src/OverlayController.js b/packages/ui/components/overlays/src/OverlayController.js index fbd36ba0e..dc4175899 100644 --- a/packages/ui/components/overlays/src/OverlayController.js +++ b/packages/ui/components/overlays/src/OverlayController.js @@ -3,11 +3,11 @@ import { overlays } from './singleton.js'; import { containFocus } from './utils/contain-focus.js'; /** - * @typedef {import('../types/OverlayConfig').OverlayConfig} OverlayConfig - * @typedef {import('../types/OverlayConfig').ViewportConfig} ViewportConfig - * @typedef {import('@popperjs/core/lib/popper').createPopper} Popper - * @typedef {import('@popperjs/core/lib/popper').Options} PopperOptions - * @typedef {import('@popperjs/core/lib/enums').Placement} Placement + * @typedef {import('../types/OverlayConfig.js').OverlayConfig} OverlayConfig + * @typedef {import('../types/OverlayConfig.js').ViewportConfig} ViewportConfig + * @typedef {import('@popperjs/core/lib/popper.js').createPopper} Popper + * @typedef {import('@popperjs/core/lib/popper.js').Options} PopperOptions + * @typedef {import('@popperjs/core/lib/enums.js').Placement} Placement * @typedef {{ createPopper: Popper }} PopperModule * @typedef {'setup'|'init'|'teardown'|'before-show'|'show'|'hide'|'add'|'remove'} OverlayPhase */ @@ -16,8 +16,10 @@ import { containFocus } from './utils/contain-focus.js'; * @returns {Promise} */ async function preloadPopper() { - // eslint-disable-next-line import/no-extraneous-dependencies -- [external]: import complains about untyped module, but we typecast it ourselves + /* eslint-disable import/no-extraneous-dependencies */ // -- [external]: import complains about untyped module, but we typecast it ourselves + // @ts-ignore return /** @type {* & Promise} */ (import('@popperjs/core/dist/esm/popper.js')); + /* eslint-enable import/no-extraneous-dependencies */ } const GLOBAL_OVERLAYS_CONTAINER_CLASS = 'global-overlays__overlay-container'; diff --git a/packages/ui/components/overlays/src/OverlayMixin.js b/packages/ui/components/overlays/src/OverlayMixin.js index 5718768c0..a371a917b 100644 --- a/packages/ui/components/overlays/src/OverlayMixin.js +++ b/packages/ui/components/overlays/src/OverlayMixin.js @@ -3,14 +3,14 @@ import { OverlayController } from './OverlayController.js'; import { isEqualConfig } from './utils/is-equal-config.js'; /** - * @typedef {import('../types/OverlayConfig').OverlayConfig} OverlayConfig - * @typedef {import('../types/OverlayMixinTypes').DefineOverlayConfig} DefineOverlayConfig - * @typedef {import('../types/OverlayMixinTypes').OverlayMixin} OverlayMixin + * @typedef {import('../types/OverlayConfig.js').OverlayConfig} OverlayConfig + * @typedef {import('../types/OverlayMixinTypes.js').DefineOverlayConfig} DefineOverlayConfig + * @typedef {import('../types/OverlayMixinTypes.js').OverlayMixin} OverlayMixin */ /** * @type {OverlayMixin} - * @param {import('@open-wc/dedupe-mixin').Constructor} superclass + * @param {import('@open-wc/dedupe-mixin').Constructor} superclass */ export const OverlayMixinImplementation = superclass => // @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051 @@ -114,7 +114,7 @@ export const OverlayMixinImplementation = superclass => } /** - * @param {import('@lion/core').PropertyValues } changedProperties + * @param {import('lit').PropertyValues } changedProperties */ updated(changedProperties) { super.updated(changedProperties); diff --git a/packages/ui/components/overlays/src/OverlaysManager.js b/packages/ui/components/overlays/src/OverlaysManager.js index 6e6cba5bb..7d9917c28 100644 --- a/packages/ui/components/overlays/src/OverlaysManager.js +++ b/packages/ui/components/overlays/src/OverlaysManager.js @@ -1,5 +1,5 @@ /** - * @typedef {import('@lion/core').CSSResult} CSSResult + * @typedef {import('lit').CSSResult} CSSResult * @typedef {import('./OverlayController.js').OverlayController} OverlayController */ @@ -177,7 +177,7 @@ export class OverlaysManager { } /** - * @param {{ disabledCtrl?:OverlayController, findNewTrap?:boolean }} [options] + * @param {{ disabledCtrl?:OverlayController, findNewTrap?:boolean }} options */ informTrapsKeyboardFocusGotDisabled({ disabledCtrl, findNewTrap = true } = {}) { const next = this.shownList.find( diff --git a/packages/ui/components/overlays/src/configurations/withBottomSheetConfig.js b/packages/ui/components/overlays/src/configurations/withBottomSheetConfig.js index 27e2973d4..49cf29b3d 100644 --- a/packages/ui/components/overlays/src/configurations/withBottomSheetConfig.js +++ b/packages/ui/components/overlays/src/configurations/withBottomSheetConfig.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../../types/OverlayConfig').OverlayConfig} OverlayConfig + * @typedef {import('../../types/OverlayConfig.js').OverlayConfig} OverlayConfig */ export const withBottomSheetConfig = () => diff --git a/packages/ui/components/overlays/src/configurations/withDropdownConfig.js b/packages/ui/components/overlays/src/configurations/withDropdownConfig.js index 7f6ade081..cb8686169 100644 --- a/packages/ui/components/overlays/src/configurations/withDropdownConfig.js +++ b/packages/ui/components/overlays/src/configurations/withDropdownConfig.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../../types/OverlayConfig').OverlayConfig} OverlayConfig + * @typedef {import('../../types/OverlayConfig.js').OverlayConfig} OverlayConfig */ export const withDropdownConfig = () => diff --git a/packages/ui/components/overlays/src/configurations/withModalDialogConfig.js b/packages/ui/components/overlays/src/configurations/withModalDialogConfig.js index a5865b2fd..79bdda9bd 100644 --- a/packages/ui/components/overlays/src/configurations/withModalDialogConfig.js +++ b/packages/ui/components/overlays/src/configurations/withModalDialogConfig.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../../types/OverlayConfig').OverlayConfig} OverlayConfig + * @typedef {import('../../types/OverlayConfig.js').OverlayConfig} OverlayConfig */ export const withModalDialogConfig = () => diff --git a/packages/ui/components/overlays/src/singleton.js b/packages/ui/components/overlays/src/singleton.js index 1d5d0e5fa..45441b96a 100644 --- a/packages/ui/components/overlays/src/singleton.js +++ b/packages/ui/components/overlays/src/singleton.js @@ -1,5 +1,4 @@ import { singletonManager } from 'singleton-manager'; -// eslint-disable-next-line import/no-cycle import { OverlaysManager } from './OverlaysManager.js'; // eslint-disable-next-line import/no-mutable-exports diff --git a/packages/ui/components/overlays/src/utils/contain-focus.js b/packages/ui/components/overlays/src/utils/contain-focus.js index df28bce5b..3fdf6e0c0 100644 --- a/packages/ui/components/overlays/src/utils/contain-focus.js +++ b/packages/ui/components/overlays/src/utils/contain-focus.js @@ -135,7 +135,7 @@ export function containFocus(rootElement) { } /** - * @param {Object} [opts] + * @param {Object} opts * @param {boolean} [opts.resetToRoot] * @desc When we simulate a modal dialog, we need to restore the focus to the first or last * element of the rootElement diff --git a/packages/ui/components/overlays/src/utils/is-equal-config.js b/packages/ui/components/overlays/src/utils/is-equal-config.js index 779cedf23..86f2ae963 100644 --- a/packages/ui/components/overlays/src/utils/is-equal-config.js +++ b/packages/ui/components/overlays/src/utils/is-equal-config.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../../types/OverlayConfig').OverlayConfig} OverlayConfig + * @typedef {import('../../types/OverlayConfig.js').OverlayConfig} OverlayConfig */ /** diff --git a/packages/ui/components/overlays/test-helpers/mimicClick.js b/packages/ui/components/overlays/test-helpers/mimicClick.js index ed33dc01b..f2a3e6e6f 100644 --- a/packages/ui/components/overlays/test-helpers/mimicClick.js +++ b/packages/ui/components/overlays/test-helpers/mimicClick.js @@ -8,7 +8,7 @@ async function sleep(t = 0) { /** * @param {HTMLElement} el - * @param {{isAsync?:boolean, releaseElement?: HTMLElement}} [config] + * @param {{isAsync?:boolean, releaseElement?: HTMLElement}} config */ export async function mimicClick(el, { isAsync, releaseElement } = { isAsync: false }) { const releaseEl = releaseElement || el; diff --git a/packages/ui/components/overlays/test-suites/OverlayMixin.suite.js b/packages/ui/components/overlays/test-suites/OverlayMixin.suite.js index 320333936..b332817e3 100644 --- a/packages/ui/components/overlays/test-suites/OverlayMixin.suite.js +++ b/packages/ui/components/overlays/test-suites/OverlayMixin.suite.js @@ -6,11 +6,11 @@ import { overlays, OverlayController } from '@lion/ui/overlays.js'; import '@lion/ui/define/lion-dialog.js'; /** - * @typedef {import('../types/OverlayConfig').OverlayConfig} OverlayConfig - * @typedef {import('../types/OverlayMixinTypes').DefineOverlayConfig} DefineOverlayConfig - * @typedef {import('../types/OverlayMixinTypes').OverlayHost} OverlayHost - * @typedef {import('../types/OverlayMixinTypes').OverlayMixin} OverlayMixin - * @typedef {import('@lion/core').LitElement} LitElement + * @typedef {import('../types/OverlayConfig.js').OverlayConfig} OverlayConfig + * @typedef {import('../types/OverlayMixinTypes.js').DefineOverlayConfig} DefineOverlayConfig + * @typedef {import('../types/OverlayMixinTypes.js').OverlayHost} OverlayHost + * @typedef {import('../types/OverlayMixinTypes.js').OverlayMixin} OverlayMixin + * @typedef {import('lit').LitElement} LitElement * @typedef {LitElement & OverlayHost & {_overlayCtrl:OverlayController}} OverlayEl */ diff --git a/packages/ui/components/overlays/test/ArrowMixin.test.js b/packages/ui/components/overlays/test/ArrowMixin.test.js index 889d77670..576dc6e1c 100644 --- a/packages/ui/components/overlays/test/ArrowMixin.test.js +++ b/packages/ui/components/overlays/test/ArrowMixin.test.js @@ -8,7 +8,7 @@ describe('ArrowMixin', () => { * @overridable method `_defineOverlay` * @desc Overrides arrow and keepTogether modifier to be enabled, * and adds onCreate and onUpdate hooks to sync from popper state - * @returns {import('../types/OverlayConfig').OverlayConfig} + * @returns {import('../types/OverlayConfig.js').OverlayConfig} */ _defineOverlayConfig() { return { @@ -84,7 +84,7 @@ describe('ArrowMixin', () => { await fixture(html`