зеркало из https://github.com/microsoft/fast.git
Remove eslint config package (#6970)
# Pull Request ## 📖 Description Removal of the `@microsoft/eslint-config-fast-dna` package as we reserve the right to change eslint configurations and will not be maintaining a package outside this repository. As such, the configuration options have been moved to the root `.eslintrc`. ### 🎫 Issues Resolves #6948 ## 👩💻 Reviewer Notes The logic has not changed here, we are only moving this package configuration options internal, and I have added "prettier" as an extension as all current packages re-extend it anyway. ## ✅ Checklist ### General <!--- Review the list and put an x in the boxes that apply. --> - [x] I have included a change request file using `$ yarn change` - [ ] I have added tests for my changes. - [x] I have tested my changes. - [ ] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](/docs/community/code-of-conduct/#our-standards) for this project.
This commit is contained in:
Родитель
4a282aee05
Коммит
00bccd7812
84
.eslintrc.js
84
.eslintrc.js
|
@ -1,3 +1,85 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: ["@microsoft/eslint-config-fast-dna", "prettier"],
|
root: true,
|
||||||
|
parser: "@typescript-eslint/parser",
|
||||||
|
plugins: ["@typescript-eslint", "import"],
|
||||||
|
extends: [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-extra-boolean-cast": "off",
|
||||||
|
"no-empty-function": "off",
|
||||||
|
"@typescript-eslint/no-empty-function": [
|
||||||
|
"error",
|
||||||
|
{ allow: ["asyncMethods", "methods"] },
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-use-before-define": "off",
|
||||||
|
"@typescript-eslint/typedef": "off",
|
||||||
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
|
"max-len": ["error", 140],
|
||||||
|
"import/order": "error",
|
||||||
|
"sort-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
ignoreCase: true,
|
||||||
|
ignoreDeclarationSort: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"comma-dangle": "off",
|
||||||
|
"@typescript-eslint/no-empty-interface": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
allowSingleExtends: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"@typescript-eslint/camelcase": "off",
|
||||||
|
"@typescript-eslint/naming-convention": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
selector: "default",
|
||||||
|
format: ["UPPER_CASE", "camelCase", "PascalCase"],
|
||||||
|
leadingUnderscore: "allow",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "property",
|
||||||
|
format: null, // disable for property names because of our foo__expanded convention for JSS
|
||||||
|
// TODO: I think we can come up with a regex that ignores variables with __ in them
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "variable",
|
||||||
|
format: null, // disable for variable names because of our foo__expanded convention for JSS
|
||||||
|
// TODO: I think we can come up with a regex that ignores variables with __ in them
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "interface",
|
||||||
|
format: ["PascalCase"],
|
||||||
|
custom: {
|
||||||
|
regex: "^I[A-Z]",
|
||||||
|
match: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-inferrable-types": "off",
|
||||||
|
"no-prototype-builtins": "off",
|
||||||
|
"no-fallthrough": "off",
|
||||||
|
"no-unexpected-multiline": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": ["warn", { args: "none" }],
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ["**/*.js"],
|
||||||
|
extends: ["eslint:recommended"],
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
"shared-node-browser": true,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,12 +28,7 @@ build/ @janechu @nicholasrice @chrisdholt @awentzel
|
||||||
|
|
||||||
# Package specific owners
|
# Package specific owners
|
||||||
|
|
||||||
# Tooling
|
|
||||||
/packages/tooling/fast-figma-plugin-msft/ @nicholasrice @bheston @janechu
|
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
/packages/utilities/fast-animation/ @nicholasrice @chrisdholt
|
|
||||||
/packages/utilities/fast-eslint-rules/ @nicholasrice @janechu @chrisdholt
|
|
||||||
/packages/utilities/fast-web-utilities/ @janechu @chrisdholt @nicholasrice
|
/packages/utilities/fast-web-utilities/ @janechu @chrisdholt @nicholasrice
|
||||||
|
|
||||||
# Web components
|
# Web components
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Remove eslint config package",
|
||||||
|
"packageName": "@microsoft/fast-element",
|
||||||
|
"email": "7559015+janechu@users.noreply.github.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Remove eslint config package",
|
||||||
|
"packageName": "@microsoft/fast-foundation",
|
||||||
|
"email": "7559015+janechu@users.noreply.github.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Remove eslint config package",
|
||||||
|
"packageName": "@microsoft/fast-router",
|
||||||
|
"email": "7559015+janechu@users.noreply.github.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Remove eslint config package",
|
||||||
|
"packageName": "@microsoft/fast-ssr",
|
||||||
|
"email": "7559015+janechu@users.noreply.github.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Remove eslint config package",
|
||||||
|
"packageName": "@microsoft/fast-web-utilities",
|
||||||
|
"email": "7559015+janechu@users.noreply.github.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
}
|
|
@ -104,11 +104,15 @@
|
||||||
"@types/jest": "^25.2.1",
|
"@types/jest": "^25.2.1",
|
||||||
"@types/lodash-es": "^4.17.4",
|
"@types/lodash-es": "^4.17.4",
|
||||||
"@types/node": "^15.0.1",
|
"@types/node": "^15.0.1",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
||||||
|
"@typescript-eslint/parser": "^5.0.0",
|
||||||
"beachball": "^2.31.2",
|
"beachball": "^2.31.2",
|
||||||
"chalk": "^2.4.2",
|
"chalk": "^2.4.2",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"docusaurus-init": "^1.11.0",
|
"docusaurus-init": "^1.11.0",
|
||||||
"dotenv": "^6.0.0",
|
"dotenv": "^6.0.0",
|
||||||
|
"eslint": "^8.0.0",
|
||||||
|
"eslint-plugin-import": "^2.25.0",
|
||||||
"glob": "^7.1.2",
|
"glob": "^7.1.2",
|
||||||
"husky": "^4.2.5",
|
"husky": "^4.2.5",
|
||||||
"jest-mock": "29.5.0",
|
"jest-mock": "29.5.0",
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
parser: "@typescript-eslint/parser",
|
|
||||||
plugins: ["@typescript-eslint", "import"],
|
|
||||||
extends: [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"no-extra-boolean-cast": "off",
|
|
||||||
"no-empty-function": "off",
|
|
||||||
"@typescript-eslint/no-empty-function": [
|
|
||||||
"error",
|
|
||||||
{ allow: ["asyncMethods", "methods"] },
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-use-before-define": "off",
|
|
||||||
"@typescript-eslint/typedef": "off",
|
|
||||||
"@typescript-eslint/explicit-function-return-type": "off",
|
|
||||||
"max-len": ["error", 140],
|
|
||||||
"import/order": "error",
|
|
||||||
"sort-imports": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
ignoreCase: true,
|
|
||||||
ignoreDeclarationSort: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"comma-dangle": "off",
|
|
||||||
"@typescript-eslint/no-empty-interface": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
allowSingleExtends: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/camelcase": "off",
|
|
||||||
"@typescript-eslint/naming-convention": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
selector: "default",
|
|
||||||
format: ["UPPER_CASE", "camelCase", "PascalCase"],
|
|
||||||
leadingUnderscore: "allow",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "property",
|
|
||||||
format: null, // disable for property names because of our foo__expanded convention for JSS
|
|
||||||
// TODO: I think we can come up with a regex that ignores variables with __ in them
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "variable",
|
|
||||||
format: null, // disable for variable names because of our foo__expanded convention for JSS
|
|
||||||
// TODO: I think we can come up with a regex that ignores variables with __ in them
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "interface",
|
|
||||||
format: ["PascalCase"],
|
|
||||||
custom: {
|
|
||||||
regex: "^I[A-Z]",
|
|
||||||
match: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-inferrable-types": "off",
|
|
||||||
"no-prototype-builtins": "off",
|
|
||||||
"no-fallthrough": "off",
|
|
||||||
"no-unexpected-multiline": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": ["warn", { args: "none" }],
|
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ["**/*.js"],
|
|
||||||
extends: ["eslint:recommended"],
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
"shared-node-browser": true,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -1 +0,0 @@
|
||||||
package-lock=false
|
|
|
@ -1,56 +0,0 @@
|
||||||
{
|
|
||||||
"name": "@microsoft/eslint-config-fast-dna",
|
|
||||||
"entries": [
|
|
||||||
{
|
|
||||||
"date": "Wed, 01 Jun 2022 17:53:14 GMT",
|
|
||||||
"tag": "@microsoft/eslint-config-fast-dna_v2.1.0",
|
|
||||||
"version": "2.1.0",
|
|
||||||
"comments": {
|
|
||||||
"none": [
|
|
||||||
{
|
|
||||||
"comment": "chore: update package.json metadata",
|
|
||||||
"author": "roeisenb@microsoft.com",
|
|
||||||
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
||||||
"package": "@microsoft/eslint-config-fast-dna"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"comment": "update api extractor and typescript to use the latest versions",
|
|
||||||
"author": "chhol@microsoft.com",
|
|
||||||
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
||||||
"package": "@microsoft/eslint-config-fast-dna"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"date": "Wed, 27 Apr 2022 07:21:09 GMT",
|
|
||||||
"tag": "@microsoft/eslint-config-fast-dna_v2.1.0",
|
|
||||||
"version": "2.1.0",
|
|
||||||
"comments": {
|
|
||||||
"minor": [
|
|
||||||
{
|
|
||||||
"comment": "update to typescript 4.6.2 and update ARIAMixin typings",
|
|
||||||
"author": "chhol@microsoft.com",
|
|
||||||
"commit": "35bdab45550b5d8b8762041110eccb06de78add5",
|
|
||||||
"package": "@microsoft/eslint-config-fast-dna"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"date": "Sun, 31 Oct 2021 07:17:45 GMT",
|
|
||||||
"tag": "@microsoft/eslint-config-fast-dna_v2.0.0",
|
|
||||||
"version": "2.0.0",
|
|
||||||
"comments": {
|
|
||||||
"major": [
|
|
||||||
{
|
|
||||||
"comment": "update eslint-config-rules to leverage latest versions of eslint and remove react",
|
|
||||||
"author": "chhol@microsoft.com",
|
|
||||||
"commit": "a150068ee196e73fe7a4f7b538a38752e0e506ba",
|
|
||||||
"package": "@microsoft/eslint-config-fast-dna"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
# Change Log - @microsoft/eslint-config-fast-dna
|
|
||||||
|
|
||||||
This log was last generated on Wed, 27 Apr 2022 07:21:09 GMT and should not be manually modified.
|
|
||||||
|
|
||||||
<!-- Start content -->
|
|
||||||
|
|
||||||
## 2.1.0
|
|
||||||
|
|
||||||
Wed, 27 Apr 2022 07:21:09 GMT
|
|
||||||
|
|
||||||
### Minor changes
|
|
||||||
|
|
||||||
- update to typescript 4.6.2 and update ARIAMixin typings (chhol@microsoft.com)
|
|
||||||
|
|
||||||
## 2.0.0
|
|
||||||
|
|
||||||
Sun, 31 Oct 2021 07:17:45 GMT
|
|
||||||
|
|
||||||
### Major changes
|
|
||||||
|
|
||||||
- update eslint-config-rules to leverage latest versions of eslint and remove react (chhol@microsoft.com)
|
|
||||||
|
|
||||||
## [1.1.4](https://github.com/microsoft/fast/compare/@microsoft/eslint-config-fast-dna@1.1.3...@microsoft/eslint-config-fast-dna@1.1.4) (2020-06-26)
|
|
||||||
|
|
||||||
**Note:** Version bump only for package @microsoft/eslint-config-fast-dna
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [1.1.2](https://github.com/microsoft/fast/compare/@microsoft/eslint-config-fast@1.1.1...@microsoft/eslint-config-fast@1.1.2) (2020-05-18)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* update eslint config to not warn on function args [#3116](https://github.com/microsoft/fast/issues/3116) ([1df06c9](https://github.com/microsoft/fast/commit/1df06c96da7518ba75de6d5635859345468bd42a))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [1.1.1](https://github.com/microsoft/fast/compare/@microsoft/eslint-config-fast@1.1.0...@microsoft/eslint-config-fast@1.1.1) (2020-04-22)
|
|
||||||
|
|
||||||
**Note:** Version bump only for package @microsoft/eslint-config-fast
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 1.1.0 (2020-04-10)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* add fast-eslint-rules to replace fast-tslint-rules package ([#2793](https://github.com/microsoft/fast/issues/2793)) ([2891e7b](https://github.com/microsoft/fast/commit/2891e7bc9af41b7ba55eb410dee019c6d1adca3b))
|
|
|
@ -1,24 +0,0 @@
|
||||||
# `@microsoft/fast-eslint-rules`
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
Install the package:
|
|
||||||
```
|
|
||||||
npm install @microsoft/eslint-config-fast-dna
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configure your eslint config
|
|
||||||
|
|
||||||
Add `fast-eslint-rules` as an extension in your eslint config
|
|
||||||
```js
|
|
||||||
{
|
|
||||||
"extends": [
|
|
||||||
"@microsoft/eslint-config-fast-dna",
|
|
||||||
// Other rule sets (if any)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Please see [configuring eslint](https://eslint.org/docs/user-guide/configuring) for more details.
|
|
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
"name": "@microsoft/eslint-config-fast-dna",
|
|
||||||
"description": "eslint rules for FAST projects",
|
|
||||||
"sideEffects": false,
|
|
||||||
"version": "2.1.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Microsoft",
|
|
||||||
"url": "https://discord.gg/FcSNfg4"
|
|
||||||
},
|
|
||||||
"homepage": "https://www.fast.design/",
|
|
||||||
"keywords": [
|
|
||||||
"eslint",
|
|
||||||
"typescript"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/microsoft/fast.git",
|
|
||||||
"directory": "packages/utilities/fast-eslint-rules"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/microsoft/fast/issues"
|
|
||||||
},
|
|
||||||
"main": ".eslintrc.js",
|
|
||||||
"beachball": {
|
|
||||||
"disallowedChangeTypes": []
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
||||||
"@typescript-eslint/parser": "^5.0.0",
|
|
||||||
"eslint": "^8.0.0",
|
|
||||||
"eslint-plugin-import": "^2.25.0",
|
|
||||||
"typescript": "~3.9.0 || ~4.3.5 || ^4.7.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"extends": ["@microsoft/eslint-config-fast-dna", "prettier"],
|
"extends": ["../../../.eslintrc.js"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"import/extensions": [
|
"import/extensions": [
|
||||||
"error",
|
"error",
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
"@types/chai": "^4.2.11",
|
"@types/chai": "^4.2.11",
|
||||||
"@types/karma": "^6.3.3",
|
"@types/karma": "^6.3.3",
|
||||||
"@types/mocha": "^7.0.2",
|
"@types/mocha": "^7.0.2",
|
||||||
"@microsoft/eslint-config-fast-dna": "^2.1.0",
|
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"chai-spies": "^1.0.0",
|
"chai-spies": "^1.0.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
* Returns the index of the last element in the array where predicate is true, and -1 otherwise.
|
* Returns the index of the last element in the array where predicate is true, and -1 otherwise.
|
||||||
*
|
*
|
||||||
* @param array - the array to test
|
* @param array - the array to test
|
||||||
* @param predicate - find calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
* @param predicate - find calls predicate once for each element of the array, in descending order,
|
||||||
|
* until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index.
|
||||||
|
* Otherwise, findIndex returns -1.
|
||||||
*/
|
*/
|
||||||
export function findLastIndex<T>(
|
export function findLastIndex<T>(
|
||||||
array: Array<T>,
|
array: Array<T>,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"extends": ["@microsoft/eslint-config-fast-dna", "prettier"],
|
"extends": ["../../../.eslintrc.js"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"max-classes-per-file": "off",
|
"max-classes-per-file": "off",
|
||||||
"no-case-declarations": "off",
|
"no-case-declarations": "off",
|
||||||
|
|
|
@ -91,7 +91,8 @@ export const booleanConverter: ValueConverter = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link ValueConverter} that converts to and from `boolean` values. `null`, `undefined`, `""`, and `void` values are converted to `null`.
|
* A {@link ValueConverter} that converts to and from `boolean` values. `null`, `undefined`, `""`,
|
||||||
|
* and `void` values are converted to `null`.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export const nullableBooleanConverter: ValueConverter = {
|
export const nullableBooleanConverter: ValueConverter = {
|
||||||
|
|
|
@ -54,7 +54,8 @@ const contextEventType = "context-request";
|
||||||
let requestStrategy: FASTContextRequestStrategy;
|
let requestStrategy: FASTContextRequestStrategy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables using the {@link https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md | W3C Community Context protocol.}
|
* Enables using:
|
||||||
|
* {@link https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md | W3C Community Context protocol.}
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export const Context = Object.freeze({
|
export const Context = Object.freeze({
|
||||||
|
|
|
@ -41,6 +41,7 @@ const debugMessages = {
|
||||||
[1504 /* cannotAutoregisterDependency */]: "Unable to autoregister dependency.",
|
[1504 /* cannotAutoregisterDependency */]: "Unable to autoregister dependency.",
|
||||||
[1505 /* cannotResolveKey */]: "Unable to resolve dependency injection key '${key}'.",
|
[1505 /* cannotResolveKey */]: "Unable to resolve dependency injection key '${key}'.",
|
||||||
[1506 /* cannotConstructNativeFunction */]:
|
[1506 /* cannotConstructNativeFunction */]:
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",
|
"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",
|
||||||
[1507 /* cannotJITRegisterNonConstructor */]:
|
[1507 /* cannotJITRegisterNonConstructor */]:
|
||||||
"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",
|
"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",
|
||||||
|
|
|
@ -718,7 +718,8 @@ export const DI = Object.freeze({
|
||||||
* @returns An array of dependency keys.
|
* @returns An array of dependency keys.
|
||||||
*/
|
*/
|
||||||
getDependencies(Type: Constructable | Injectable): Key[] {
|
getDependencies(Type: Constructable | Injectable): Key[] {
|
||||||
// Note: Every detail of this getDependencies method is pretty deliberate at the moment, and probably not yet 100% tested from every possible angle,
|
// Note: Every detail of this getDependencies method is pretty deliberate at the moment,
|
||||||
|
// and probably not yet 100% tested from every possible angle,
|
||||||
// so be careful with making changes here as it can have a huge impact on complex end user apps.
|
// so be careful with making changes here as it can have a huge impact on complex end user apps.
|
||||||
// Preferably, only make changes to the dependency resolution process via a RFC.
|
// Preferably, only make changes to the dependency resolution process via a RFC.
|
||||||
|
|
||||||
|
@ -2156,7 +2157,8 @@ const isNativeFunction = (function () {
|
||||||
i <= 100 &&
|
i <= 100 &&
|
||||||
// This whole heuristic *could* be tricked by a comment. Do we need to care about that?
|
// This whole heuristic *could* be tricked by a comment. Do we need to care about that?
|
||||||
sourceText.charCodeAt(i - 1) === 0x7d && // }
|
sourceText.charCodeAt(i - 1) === 0x7d && // }
|
||||||
// TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption.
|
// TODO: the spec is a little vague about the precise constraints,
|
||||||
|
// so we do need to test this across various browsers to make sure just one whitespace is a safe assumption.
|
||||||
sourceText.charCodeAt(i - 2) <= 0x20 && // whitespace
|
sourceText.charCodeAt(i - 2) <= 0x20 && // whitespace
|
||||||
sourceText.charCodeAt(i - 3) === 0x5d && // ]
|
sourceText.charCodeAt(i - 3) === 0x5d && // ]
|
||||||
sourceText.charCodeAt(i - 4) === 0x65 && // e
|
sourceText.charCodeAt(i - 4) === 0x65 && // e
|
||||||
|
|
|
@ -81,7 +81,7 @@ export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
||||||
|
|
||||||
// Much thanks to LitHTML for working this out!
|
// Much thanks to LitHTML for working this out!
|
||||||
const lastAttributeNameRegex =
|
const lastAttributeNameRegex =
|
||||||
/* eslint-disable-next-line no-control-regex */
|
/* eslint-disable-next-line no-control-regex, max-len */
|
||||||
/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
|
/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,8 +2,7 @@ const path = require("path");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: [
|
extends: [
|
||||||
"@microsoft/eslint-config-fast-dna",
|
"../../../.eslintrc.js",
|
||||||
"prettier",
|
|
||||||
"plugin:storybook/recommended",
|
"plugin:storybook/recommended",
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
|
|
@ -203,6 +203,7 @@ test.describe("Accordion", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should remove an expanded items' expandbutton aria-disabled attribute when expand mode changes from single to multi", async () => {
|
test("should remove an expanded items' expandbutton aria-disabled attribute when expand mode changes from single to multi", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -19,7 +19,8 @@ import { AccordionExpandMode } from "./accordion.options.js";
|
||||||
* @public
|
* @public
|
||||||
*
|
*
|
||||||
* @remarks
|
* @remarks
|
||||||
* Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(FASTAccordionItem:class)}.
|
* Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate}
|
||||||
|
* and {@link @microsoft/fast-foundation#(FASTAccordionItem:class)}.
|
||||||
*/
|
*/
|
||||||
export class FASTAccordion extends FASTElement {
|
export class FASTAccordion extends FASTElement {
|
||||||
/**
|
/**
|
||||||
|
@ -242,7 +243,8 @@ export class FASTAccordion extends FASTElement {
|
||||||
};
|
};
|
||||||
|
|
||||||
private handleItemFocus = (event: FocusEvent): void => {
|
private handleItemFocus = (event: FocusEvent): void => {
|
||||||
// update the active item index if the focus moves to an accordion item via a different method other than the up and down arrow key actions
|
// update the active item index if the focus moves to an accordion item
|
||||||
|
// via a different method other than the up and down arrow key actions
|
||||||
// only do so if the focus is actually on the accordion item and not on any of its children
|
// only do so if the focus is actually on the accordion item and not on any of its children
|
||||||
if (event.target === event.currentTarget) {
|
if (event.target === event.currentTarget) {
|
||||||
const focusedItem = event.target as HTMLElement;
|
const focusedItem = event.target as HTMLElement;
|
||||||
|
|
|
@ -24,7 +24,8 @@ export type AnchorOptions = StartEndOptions<FASTAnchor>;
|
||||||
*/
|
*/
|
||||||
export class FASTAnchor extends FASTElement {
|
export class FASTAnchor extends FASTElement {
|
||||||
/**
|
/**
|
||||||
* Prompts the user to save the linked URL. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
|
* Prompts the user to save the linked URL.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: download
|
* HTML Attribute: download
|
||||||
|
@ -33,7 +34,8 @@ export class FASTAnchor extends FASTElement {
|
||||||
public download: string;
|
public download: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The URL the hyperlink references. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
|
* The URL the hyperlink references.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: href
|
* HTML Attribute: href
|
||||||
|
@ -42,7 +44,8 @@ export class FASTAnchor extends FASTElement {
|
||||||
public href: string;
|
public href: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hints at the language of the referenced resource. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
|
* Hints at the language of the referenced resource.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: hreflang
|
* HTML Attribute: hreflang
|
||||||
|
|
|
@ -78,6 +78,7 @@ test.describe("Breadcrumb", () => {
|
||||||
).toHaveAttribute("aria-current", "page");
|
).toHaveAttribute("aria-current", "page");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should remove `aria-current` from any prior breadcrumb item children with child anchors when a new node is appended", async () => {
|
test("should remove `aria-current` from any prior breadcrumb item children with child anchors when a new node is appended", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -482,6 +482,7 @@ test.describe("Calendar", () => {
|
||||||
).toBe("1942 शक");
|
).toBe("1942 शक");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test('should set the formatted `year` property to "2564" when the `year` attribute is "2021" for the Buddhist calendar', async () => {
|
test('should set the formatted `year` property to "2564" when the `year` attribute is "2021" for the Buddhist calendar', async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -389,6 +389,7 @@ test.describe("Checkbox", () => {
|
||||||
await expect(element).toHaveJSProperty("checked", true);
|
await expect(element).toHaveJSProperty("checked", true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where checked attribute modifications change the checked property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where checked attribute modifications change the checked property prior to user or programmatic interaction", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -344,6 +344,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
|
|
||||||
expect(node.getTokenValue(token)).toEqual(12);
|
expect(node.getTokenValue(token)).toEqual(12);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should resolve a static value from an ancestor node assigned a static value when the descendent node does not have the token assigned a value", () => {
|
test("should resolve a static value from an ancestor node assigned a static value when the descendent node does not have the token assigned a value", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const ancestor = createNode();
|
const ancestor = createNode();
|
||||||
|
@ -354,6 +355,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
|
|
||||||
expect(descendent.getTokenValue(token)).toEqual(12);
|
expect(descendent.getTokenValue(token)).toEqual(12);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should resolve a static value from an ancestor node assigned a derived value when the descendent node does not have the token assigned a value", () => {
|
test("should resolve a static value from an ancestor node assigned a derived value when the descendent node does not have the token assigned a value", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const ancestor = createNode();
|
const ancestor = createNode();
|
||||||
|
@ -589,6 +591,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
);
|
);
|
||||||
expect(() => node.getTokenValue(token)).toThrow();
|
expect(() => node.getTokenValue(token)).toThrow();
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the node that has a token assigned a derived value and a dependency of the derived value changes for the node", () => {
|
test("the token with the node that has a token assigned a derived value and a dependency of the derived value changes for the node", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -618,6 +621,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
);
|
);
|
||||||
expect(node.getTokenValue(token)).toEqual(14);
|
expect(node.getTokenValue(token)).toEqual(14);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a token assigned a static value that is a dependency of a value assigned for an ancestor", () => {
|
test("the token with the descendent node that has a token assigned a static value that is a dependency of a value assigned for an ancestor", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -651,6 +655,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(12);
|
expect(parent.getTokenValue(token)).toEqual(12);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(14);
|
expect(descendent.getTokenValue(token)).toEqual(14);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a token assigned a derived value that is a dependency of a value assigned for an ancestor", () => {
|
test("the token with the descendent node that has a token assigned a derived value that is a dependency of a value assigned for an ancestor", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -684,6 +689,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(12);
|
expect(parent.getTokenValue(token)).toEqual(12);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(14);
|
expect(descendent.getTokenValue(token)).toEqual(14);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a token reassigned a static value that is a dependency of a value assigned for an ancestor", () => {
|
test("the token with the descendent node that has a token reassigned a static value that is a dependency of a value assigned for an ancestor", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -718,6 +724,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(12);
|
expect(parent.getTokenValue(token)).toEqual(12);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(16);
|
expect(descendent.getTokenValue(token)).toEqual(16);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a token reassigned a derived value that is a dependency of a value assigned for an ancestor", () => {
|
test("the token with the descendent node that has a token reassigned a derived value that is a dependency of a value assigned for an ancestor", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -752,6 +759,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(12);
|
expect(parent.getTokenValue(token)).toEqual(12);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(16);
|
expect(descendent.getTokenValue(token)).toEqual(16);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with a descendent node when a ancestor and descendent both have a dependency assigned and the ancestor is reassigned a token to a derived value that resolves the dependency and results in a value change", () => {
|
test("the token with a descendent node when a ancestor and descendent both have a dependency assigned and the ancestor is reassigned a token to a derived value that resolves the dependency and results in a value change", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -795,6 +803,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(10);
|
expect(parent.getTokenValue(token)).toEqual(10);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(14);
|
expect(descendent.getTokenValue(token)).toEqual(14);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a token assigned a static value deleted that is a dependency of a value assigned for an ancestor", () => {
|
test("the token with the descendent node that has a token assigned a static value deleted that is a dependency of a value assigned for an ancestor", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -827,6 +836,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(12);
|
expect(parent.getTokenValue(token)).toEqual(12);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(12);
|
expect(descendent.getTokenValue(token)).toEqual(12);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a token assigned a derived value deleted that is a dependency of a value assigned for an ancestor", () => {
|
test("the token with the descendent node that has a token assigned a derived value deleted that is a dependency of a value assigned for an ancestor", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -859,6 +869,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(parent.getTokenValue(token)).toEqual(12);
|
expect(parent.getTokenValue(token)).toEqual(12);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(12);
|
expect(descendent.getTokenValue(token)).toEqual(12);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should the token for ancestor, parent, and descendent nodes when parent and descendent are assigned a value that depends on the token and the ancestor's value is changed", () => {
|
test("should the token for ancestor, parent, and descendent nodes when parent and descendent are assigned a value that depends on the token and the ancestor's value is changed", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const ancestor = createNode();
|
const ancestor = createNode();
|
||||||
|
@ -914,6 +925,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
/**
|
/**
|
||||||
* Appending nodes
|
* Appending nodes
|
||||||
*/
|
*/
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a dependency assigned when the node is appended to an ancestor with a derived value assigned that depends on the dependency", () => {
|
test("the token with the descendent node that has a dependency assigned when the node is appended to an ancestor with a derived value assigned that depends on the dependency", () => {
|
||||||
const ancestor = createNode();
|
const ancestor = createNode();
|
||||||
const parent = createNode(ancestor);
|
const parent = createNode(ancestor);
|
||||||
|
@ -947,6 +959,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
/**
|
/**
|
||||||
* Removing nodes
|
* Removing nodes
|
||||||
*/
|
*/
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a dependency assigned when the node is appended to an ancestor with a derived value assigned that depends on the dependency and is then removed", () => {
|
test("the token with the descendent node that has a dependency assigned when the node is appended to an ancestor with a derived value assigned that depends on the dependency and is then removed", () => {
|
||||||
const ancestor = createNode();
|
const ancestor = createNode();
|
||||||
const parent = createNode(ancestor);
|
const parent = createNode(ancestor);
|
||||||
|
@ -980,6 +993,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
/**
|
/**
|
||||||
* Moving node
|
* Moving node
|
||||||
*/
|
*/
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the descendent node that has a dependency assigned when the node is re-parented to an ancestor with a different derived value assigned that depends on the dependency", () => {
|
test("the token with the descendent node that has a dependency assigned when the node is re-parented to an ancestor with a different derived value assigned that depends on the dependency", () => {
|
||||||
const ancestorA = createNode();
|
const ancestorA = createNode();
|
||||||
const ancestorB = createNode();
|
const ancestorB = createNode();
|
||||||
|
@ -1013,6 +1027,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
);
|
);
|
||||||
expect(descendent.getTokenValue(token)).toEqual(21);
|
expect(descendent.getTokenValue(token)).toEqual(21);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should support reparenting a node with a derived token assigned to a tree where the immediate parent doesn't not have the dependency assigned", () => {
|
test("should support reparenting a node with a derived token assigned to a tree where the immediate parent doesn't not have the dependency assigned", () => {
|
||||||
const ancestor = new DesignTokenNode();
|
const ancestor = new DesignTokenNode();
|
||||||
const parent = new DesignTokenNode();
|
const parent = new DesignTokenNode();
|
||||||
|
@ -1062,6 +1077,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token with the ancestor and descendent node when the ancestor is assigned a derived value using an observable and a token, where both nodes contain a value set for the dependency", () => {
|
test("the token with the ancestor and descendent node when the ancestor is assigned a derived value using an observable and a token, where both nodes contain a value set for the dependency", () => {
|
||||||
const ancestor = createNode();
|
const ancestor = createNode();
|
||||||
const parent = createNode(ancestor);
|
const parent = createNode(ancestor);
|
||||||
|
@ -1121,6 +1137,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
|
|
||||||
expect(handleChange).not.toHaveBeenCalled();
|
expect(handleChange).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token when the derived value assigned to a node results in the same value as the previously assigned static value", () => {
|
test("the token when the derived value assigned to a node results in the same value as the previously assigned static value", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const node = new DesignTokenNode();
|
const node = new DesignTokenNode();
|
||||||
|
@ -1132,6 +1149,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
|
|
||||||
expect(handleChange).not.toHaveBeenCalled();
|
expect(handleChange).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token when the derived value assigned to a node results in the same value as the previously assigned derived value", () => {
|
test("the token when the derived value assigned to a node results in the same value as the previously assigned derived value", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const node = new DesignTokenNode();
|
const node = new DesignTokenNode();
|
||||||
|
@ -1152,7 +1170,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(a).not.toEqual(b);
|
expect(a).not.toEqual(b);
|
||||||
expect(handleChange).not.toHaveBeenCalled();
|
expect(handleChange).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("the token when a dependency of a derived token value is set for a descendent but there is an intermediary value set that is a static value", () => {
|
test("the token when a dependency of a derived token value is set for a descendent but there is an intermediary value set that is a static value", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
@ -1170,6 +1188,7 @@ test.describe("DesignTokenNode", () => {
|
||||||
expect(handleChange).not.toHaveBeenCalled();
|
expect(handleChange).not.toHaveBeenCalled();
|
||||||
expect(child.getTokenValue(token)).toEqual(25);
|
expect(child.getTokenValue(token)).toEqual(25);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test.skip("the token when a dependency of a derived token value is set for a descendent but there is an intermediary value set that is a derived value that does not depend on the dependent token", () => {
|
test.skip("the token when a dependency of a derived token value is set for a descendent but there is an intermediary value set that is a derived value that does not depend on the dependent token", () => {
|
||||||
const token = new DesignToken<number>();
|
const token = new DesignToken<number>();
|
||||||
const dependency = new DesignToken<number>();
|
const dependency = new DesignToken<number>();
|
||||||
|
|
|
@ -66,6 +66,7 @@ class DerivedValueEvaluator<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
"DesignTokenNode has encountered a circular token reference. Avoid this by setting the token value for an ancestor node."
|
"DesignTokenNode has encountered a circular token reference. Avoid this by setting the token value for an ancestor node."
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -498,6 +498,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toBe("12");
|
).toBe("12");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set a CSS custom property equal to the resolved value of a derived token value with a dependent token", async () => {
|
test("should set a CSS custom property equal to the resolved value of a derived token value with a dependent token", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -516,7 +517,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toBe("12");
|
).toBe("12");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should update a CSS custom property to the resolved value of a derived token value with a dependent token when the dependent token changes", async () => {
|
test("should update a CSS custom property to the resolved value of a derived token value with a dependent token when the dependent token changes", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -547,7 +548,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toEqual(["12", "14"]);
|
).toEqual(["12", "14"]);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set a CSS custom property equal to the resolved value for an element of a derived token value with a dependent token", async () => {
|
test("should set a CSS custom property equal to the resolved value for an element of a derived token value with a dependent token", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -577,7 +578,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toEqual(["12", "14"]);
|
).toEqual(["12", "14"]);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set a CSS custom property equal to the resolved value for an element in a shadow DOM of a derived token value with a dependent token", async () => {
|
test("should set a CSS custom property equal to the resolved value for an element in a shadow DOM of a derived token value with a dependent token", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -609,7 +610,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toEqual(["12", "14"]);
|
).toEqual(["12", "14"]);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set a CSS custom property equal to the resolved value for both elements for which a dependent token is set when setting a derived token value", async () => {
|
test("should set a CSS custom property equal to the resolved value for both elements for which a dependent token is set when setting a derived token value", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -831,6 +832,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toEqual(["12", "14"]);
|
).toEqual(["12", "14"]);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should update the emitted CSS custom property of a token assigned a derived value when the token dependency changes", async () => {
|
test("should update the emitted CSS custom property of a token assigned a derived value when the token dependency changes", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -885,6 +887,7 @@ test.describe("A DesignToken", () => {
|
||||||
).toEqual([12, 24]);
|
).toEqual([12, 24]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should update the CSS custom property of a derived token with a dependency that is a derived token that depends on a third token", async () => {
|
test("should update the CSS custom property of a derived token with a dependency that is a derived token that depends on a third token", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -1343,6 +1346,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toBe(1);
|
).toBe(1);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should notify a subscriber when a static-value dependency of subscribed token changes for a parent of the subscription target", async () => {
|
test("should notify a subscriber when a static-value dependency of subscribed token changes for a parent of the subscription target", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -1372,6 +1376,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toEqual([1, 14]);
|
).toEqual([1, 14]);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should notify a subscriber when a derived-value dependency of subscribed token changes for a parent of the subscription target", async () => {
|
test("should notify a subscriber when a derived-value dependency of subscribed token changes for a parent of the subscription target", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
@ -1400,6 +1405,7 @@ test.describe("A DesignToken", () => {
|
||||||
})
|
})
|
||||||
).toEqual([1, 14]);
|
).toEqual([1, 14]);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should notify a subscriber when a dependency of subscribed token changes for a parent of the subscription target", async () => {
|
test("should notify a subscriber when a dependency of subscribed token changes for a parent of the subscription target", async () => {
|
||||||
expect(
|
expect(
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { DividerOrientation, DividerRole } from "./divider.options.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Divider Custom HTML Element.
|
* A Divider Custom HTML Element.
|
||||||
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
|
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator }
|
||||||
|
* or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,7 +21,8 @@ export type FlipperOptions = {
|
||||||
* @slot previous - The previous flipper content
|
* @slot previous - The previous flipper content
|
||||||
* @csspart next - Wraps the next flipper content
|
* @csspart next - Wraps the next flipper content
|
||||||
* @csspart previous - Wraps the previous flipper content
|
* @csspart previous - Wraps the previous flipper content
|
||||||
* @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard and the flipper is exposed to assistive technologies.
|
* @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard
|
||||||
|
* and the flipper is exposed to assistive technologies.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +37,8 @@ export class FASTFlipper extends FASTElement {
|
||||||
public disabled: boolean;
|
public disabled: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates the flipper should be hidden from assistive technology. Because flippers are often supplementary navigation, they are often hidden from assistive technology.
|
* Indicates the flipper should be hidden from assistive technology.
|
||||||
|
* Because flippers are often supplementary navigation, they are often hidden from assistive technology.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @defaultValue - true
|
* @defaultValue - true
|
||||||
|
|
|
@ -411,7 +411,7 @@ test.describe("FormAssociated", () => {
|
||||||
|
|
||||||
await expect(element).toHaveAttribute("value", "attr-value");
|
await expect(element).toHaveAttribute("value", "attr-value");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where modifcations to the `value` attribute update the `value` property prior to user or programmatic interaction", async ({
|
test("should put the control into a clean state, where modifcations to the `value` attribute update the `value` property prior to user or programmatic interaction", async ({
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
|
@ -54,7 +54,8 @@ interface ElementInternals {
|
||||||
*/
|
*/
|
||||||
readonly willValidate: boolean;
|
readonly willValidate: boolean;
|
||||||
/**
|
/**
|
||||||
* Returns true if internals target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case.
|
* Returns true if internals target element has no validity problems; false otherwise.
|
||||||
|
* Fires an invalid event at the element in the latter case.
|
||||||
*/
|
*/
|
||||||
checkValidity(): boolean;
|
checkValidity(): boolean;
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +66,8 @@ interface ElementInternals {
|
||||||
/**
|
/**
|
||||||
* Sets both the state and submission value of internals target element to value.
|
* Sets both the state and submission value of internals target element to value.
|
||||||
*
|
*
|
||||||
* While "null" isn't enumerated as a argument type (here)[https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface],
|
* While "null" isn't enumerated as
|
||||||
|
* a argument type (here)[https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface],
|
||||||
* In practice it appears to remove the value from the form data on submission. Adding it as a valid type here
|
* In practice it appears to remove the value from the form data on submission. Adding it as a valid type here
|
||||||
* becuase that capability is required for checkbox and radio types
|
* becuase that capability is required for checkbox and radio types
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -100,6 +100,7 @@ test.describe("HorizontalScroll", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test('should set the "disabled" class on the previous flipper when the scroll position is at the beginning of the content', async () => {
|
test('should set the "disabled" class on the previous flipper when the scroll position is at the beginning of the content', async () => {
|
||||||
await expect(scrollPrevious).toHaveClass(/disabled/);
|
await expect(scrollPrevious).toHaveClass(/disabled/);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,9 @@ export type MenuItemOptions = StartEndOptions<FASTMenuItem> & {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Switch Custom HTML Element.
|
* A Switch Custom HTML Element.
|
||||||
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
|
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem },
|
||||||
|
* {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox},
|
||||||
|
* or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
|
||||||
*
|
*
|
||||||
* @slot checked-indicator - The checked indicator
|
* @slot checked-indicator - The checked indicator
|
||||||
* @slot radio-indicator - The radio indicator
|
* @slot radio-indicator - The radio indicator
|
||||||
|
@ -45,7 +47,8 @@ export type MenuItemOptions = StartEndOptions<FASTMenuItem> & {
|
||||||
* @csspart expand-collapse - The expand/collapse element
|
* @csspart expand-collapse - The expand/collapse element
|
||||||
* @csspart submenu-region - The container for the submenu, used for positioning
|
* @csspart submenu-region - The container for the submenu, used for positioning
|
||||||
* @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
|
* @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
|
||||||
* @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
|
* @fires change - Fires a custom 'change' event when a non-submenu item with
|
||||||
|
* a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -487,6 +487,7 @@ test.describe("NumberField", () => {
|
||||||
await expect(control).toHaveValue("10");
|
await expect(control).toHaveValue("10");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set the `value` to match `max` after stepping down when `value` is undefined and `min` and `max` are less than zero", async () => {
|
test("should set the `value` to match `max` after stepping down when `value` is undefined and `min` and `max` are less than zero", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
@ -502,7 +503,7 @@ test.describe("NumberField", () => {
|
||||||
|
|
||||||
await expect(control).toHaveValue("-5");
|
await expect(control).toHaveValue("-5");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set the `value` to match `max` after stepping up when `value` is undefined and `min` and `max` are less than zero", async () => {
|
test("should set the `value` to match `max` after stepping up when `value` is undefined and `min` and `max` are less than zero", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
@ -677,7 +678,7 @@ test.describe("NumberField", () => {
|
||||||
|
|
||||||
await expect(element).toHaveJSProperty("value", "10");
|
await expect(element).toHaveJSProperty("value", "10");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where `value` attribute modifications change the `value` property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where `value` attribute modifications change the `value` property prior to user or programmatic interaction", async () => {
|
||||||
const form = page.locator("form");
|
const form = page.locator("form");
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,8 @@ export type NumberFieldOptions = StartEndOptions<FASTNumberField> & {
|
||||||
*/
|
*/
|
||||||
export class FASTNumberField extends FormAssociatedNumberField {
|
export class FASTNumberField extends FormAssociatedNumberField {
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: readonly
|
* HTML Attribute: readonly
|
||||||
|
@ -52,7 +53,9 @@ export class FASTNumberField extends FormAssociatedNumberField {
|
||||||
public readOnly: boolean;
|
public readOnly: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that this element should get focus after the page finishes loading. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute} for more information.
|
* Indicates that this element should get focus after the page finishes loading.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute}
|
||||||
|
* for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: autofocus
|
* HTML Attribute: autofocus
|
||||||
|
@ -80,7 +83,8 @@ export class FASTNumberField extends FormAssociatedNumberField {
|
||||||
public placeholder: string;
|
public placeholder: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist} to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist}
|
||||||
|
* to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: list
|
* HTML Attribute: list
|
||||||
|
|
|
@ -25,7 +25,8 @@ import { RadioGroupOrientation } from "./radio-group.options.js";
|
||||||
*/
|
*/
|
||||||
export class FASTRadioGroup extends FASTElement {
|
export class FASTRadioGroup extends FASTElement {
|
||||||
/**
|
/**
|
||||||
* When true, the child radios will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the child radios will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: readonly
|
* HTML Attribute: readonly
|
||||||
|
|
|
@ -278,7 +278,7 @@ test.describe("Radio", () => {
|
||||||
|
|
||||||
await expect(element).toBeChecked();
|
await expect(element).toBeChecked();
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where `checked` attribute modifications modify the `checked` property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where `checked` attribute modifications modify the `checked` property prior to user or programmatic interaction", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -35,7 +35,8 @@ export type RadioOptions = {
|
||||||
*/
|
*/
|
||||||
export class FASTRadio extends FormAssociatedRadio implements RadioControl {
|
export class FASTRadio extends FormAssociatedRadio implements RadioControl {
|
||||||
/**
|
/**
|
||||||
* The name of the radio. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname | name attribute} for more info.
|
* The name of the radio.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname | name attribute} for more info.
|
||||||
*/
|
*/
|
||||||
@observable
|
@observable
|
||||||
public name: string;
|
public name: string;
|
||||||
|
|
|
@ -293,7 +293,7 @@ test.describe("Search", () => {
|
||||||
|
|
||||||
await expect(element).toHaveJSProperty("value", "test value");
|
await expect(element).toHaveJSProperty("value", "test value");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where `value` attribute modifications change the `value` property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where `value` attribute modifications change the `value` property prior to user or programmatic interaction", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -36,7 +36,8 @@ export type SearchOptions = StartEndOptions<FASTSearch> & {
|
||||||
*/
|
*/
|
||||||
export class FASTSearch extends FormAssociatedSearch {
|
export class FASTSearch extends FormAssociatedSearch {
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: readonly
|
* HTML Attribute: readonly
|
||||||
|
@ -51,7 +52,9 @@ export class FASTSearch extends FormAssociatedSearch {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that this element should get focus after the page finishes loading. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute} for more information.
|
* Indicates that this element should get focus after the page finishes loading.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute}
|
||||||
|
* for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: autofocus
|
* HTML Attribute: autofocus
|
||||||
|
@ -81,7 +84,8 @@ export class FASTSearch extends FormAssociatedSearch {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist} to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist}
|
||||||
|
* to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: list
|
* HTML Attribute: list
|
||||||
|
|
|
@ -554,7 +554,7 @@ test.describe("Slider", () => {
|
||||||
|
|
||||||
await expect(element).toHaveJSProperty("value", "7");
|
await expect(element).toHaveJSProperty("value", "7");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where the value attribute changes the value property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where the value attribute changes the value property prior to user or programmatic interaction", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -35,7 +35,8 @@ import { SliderMode } from "./slider.options.js";
|
||||||
*/
|
*/
|
||||||
export class FASTSlider extends FormAssociatedSlider implements SliderConfiguration {
|
export class FASTSlider extends FormAssociatedSlider implements SliderConfiguration {
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
|
|
|
@ -385,7 +385,7 @@ test.describe("Switch", () => {
|
||||||
|
|
||||||
await expect(element).toHaveJSProperty("checked", true);
|
await expect(element).toHaveJSProperty("checked", true);
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where `checked` attribute modifications update the `checked` property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where `checked` attribute modifications update the `checked` property prior to user or programmatic interaction", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -26,7 +26,8 @@ export type SwitchOptions = {
|
||||||
*/
|
*/
|
||||||
export class FASTSwitch extends FormAssociatedSwitch {
|
export class FASTSwitch extends FormAssociatedSwitch {
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: readonly
|
* HTML Attribute: readonly
|
||||||
|
|
|
@ -20,7 +20,8 @@ export type TabOptions = StartEndOptions<FASTTab>;
|
||||||
*/
|
*/
|
||||||
export class FASTTab extends FASTElement {
|
export class FASTTab extends FASTElement {
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled | disabled HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled | disabled HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: disabled
|
* HTML Attribute: disabled
|
||||||
|
|
|
@ -106,7 +106,7 @@ test.describe("Tabs", () => {
|
||||||
await expect(tabPanel).toHaveCount(1);
|
await expect(tabPanel).toHaveCount(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set `aria-labelledby` on the tab panel and `aria-controls` on the tab which corresponds to the matching ID when IDs are NOT provided", async () => {
|
test("should set `aria-labelledby` on the tab panel and `aria-controls` on the tab which corresponds to the matching ID when IDs are NOT provided", async () => {
|
||||||
await root.evaluate(
|
await root.evaluate(
|
||||||
(node, { template }) => {
|
(node, { template }) => {
|
||||||
|
@ -137,7 +137,7 @@ test.describe("Tabs", () => {
|
||||||
await expect(tab).toHaveAttribute("aria-controls", panelId);
|
await expect(tab).toHaveAttribute("aria-controls", panelId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set `aria-labelledby` on the tab panel and `aria-controls` on the tab which corresponds to the matching ID when IDs are NOT provided and additional tabs and panels are added", async () => {
|
test("should set `aria-labelledby` on the tab panel and `aria-controls` on the tab which corresponds to the matching ID when IDs are NOT provided and additional tabs and panels are added", async () => {
|
||||||
await root.evaluate(
|
await root.evaluate(
|
||||||
(node, { template }) => {
|
(node, { template }) => {
|
||||||
|
@ -259,6 +259,7 @@ test.describe("Tabs", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe("active tabpanel", () => {
|
test.describe("active tabpanel", () => {
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should set an `aria-labelledby` attribute on the tabpanel with a value of the tab id when `activeid` is provided", async () => {
|
test("should set an `aria-labelledby` attribute on the tabpanel with a value of the tab id when `activeid` is provided", async () => {
|
||||||
await root.evaluate(
|
await root.evaluate(
|
||||||
(node, { template }) => {
|
(node, { template }) => {
|
||||||
|
|
|
@ -226,7 +226,7 @@ test.describe("TextArea", () => {
|
||||||
|
|
||||||
await expect(element).toHaveJSProperty("value", "foo");
|
await expect(element).toHaveJSProperty("value", "foo");
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should put the control into a clean state, where `value` attribute modifications change the `value` property prior to user or programmatic interaction", async () => {
|
test("should put the control into a clean state, where `value` attribute modifications change the `value` property prior to user or programmatic interaction", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `
|
node.innerHTML = /* html */ `
|
||||||
|
|
|
@ -30,7 +30,8 @@ export type TextAreaOptions = StartEndOptions;
|
||||||
*/
|
*/
|
||||||
export class FASTTextArea extends FormAssociatedTextArea {
|
export class FASTTextArea extends FormAssociatedTextArea {
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: readonly
|
* HTML Attribute: readonly
|
||||||
|
@ -73,14 +74,16 @@ export class FASTTextArea extends FormAssociatedTextArea {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id | id} of the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form | form} the element is associated to
|
* The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id | id}
|
||||||
|
* of the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form | form} the element is associated to
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
@attr({ attribute: "form" })
|
@attr({ attribute: "form" })
|
||||||
public formId: string;
|
public formId: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist} to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist}
|
||||||
|
* to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: list
|
* HTML Attribute: list
|
||||||
|
|
|
@ -34,7 +34,8 @@ export type TextFieldOptions = StartEndOptions<FASTTextField>;
|
||||||
*/
|
*/
|
||||||
export class FASTTextField extends FormAssociatedTextField {
|
export class FASTTextField extends FormAssociatedTextField {
|
||||||
/**
|
/**
|
||||||
* When true, the input will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
* When true, the input will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: readonly
|
* HTML Attribute: readonly
|
||||||
|
@ -49,7 +50,9 @@ export class FASTTextField extends FormAssociatedTextField {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that this element should get focus after the page finishes loading. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute} for more information.
|
* Indicates that this element should get focus after the page finishes loading.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus | autofocus HTML attribute}
|
||||||
|
* for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: autofocus
|
* HTML Attribute: autofocus
|
||||||
|
@ -94,7 +97,8 @@ export class FASTTextField extends FormAssociatedTextField {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist} to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
* Allows associating a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist | datalist}
|
||||||
|
* to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: list
|
* HTML Attribute: list
|
||||||
|
|
|
@ -194,7 +194,7 @@ test.describe.skip("Toolbar", () => {
|
||||||
|
|
||||||
await expect(endSlotButton).toBeFocused();
|
await expect(endSlotButton).toBeFocused();
|
||||||
});
|
});
|
||||||
|
/* eslint-disable-next-line max-len */
|
||||||
test("should move focus to next element when keyboard incrementer is pressed and start slot content is added after connect", async () => {
|
test("should move focus to next element when keyboard incrementer is pressed and start slot content is added after connect", async () => {
|
||||||
await root.evaluate(node => {
|
await root.evaluate(node => {
|
||||||
node.innerHTML = /* html */ `<fast-toolbar></fast-toolbar>`;
|
node.innerHTML = /* html */ `<fast-toolbar></fast-toolbar>`;
|
||||||
|
|
|
@ -70,7 +70,8 @@ export class FASTTreeItem extends FASTElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled | disabled HTML attribute} for more information.
|
* When true, the control will be immutable by user interaction.
|
||||||
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled | disabled HTML attribute} for more information.
|
||||||
* @public
|
* @public
|
||||||
* @remarks
|
* @remarks
|
||||||
* HTML Attribute: disabled
|
* HTML Attribute: disabled
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"extends": ["@microsoft/eslint-config-fast-dna", "prettier"],
|
"extends": ["../../../.eslintrc.js"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
"@typescript-eslint/ban-types": [
|
"@typescript-eslint/ban-types": [
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: ["@microsoft/eslint-config-fast-dna", "prettier"]
|
extends: ["../../../.eslintrc.js"]
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
"author": "Microsoft",
|
"author": "Microsoft",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@microsoft/eslint-config-fast-dna": "^2.1.0",
|
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@types/node": "^15.0.1",
|
"@types/node": "^15.0.1",
|
||||||
|
|
|
@ -20663,7 +20663,7 @@ typedarray@^0.0.6:
|
||||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||||
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
|
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
|
||||||
|
|
||||||
"typescript@^3 || ^4", typescript@^4.7.0, typescript@^4.7.3, "typescript@~3.9.0 || ~4.3.5 || ^4.7.0":
|
"typescript@^3 || ^4", typescript@^4.7.0, typescript@^4.7.3:
|
||||||
version "4.9.5"
|
version "4.9.5"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||||
|
|
Загрузка…
Ссылка в новой задаче