@microsoft/fast-foundation
Advanced tools
Comparing version 1.12.0 to 1.13.0
# Acknowledgements | ||
* A huge thank-you to [TypeScript](www.typescriptlang.org/) for providing an amazing language, build tools, and at least one [code sample](./src/utilities/apply-mixins.ts) we've shamelessly stolen. | ||
* A huge thank-you to [TypeScript](www.typescriptlang.org/) for providing an amazing language, build tools, and at least one [code sample](./src/utilities/apply-mixins.ts) we've shamelessly stolen. | ||
* Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project for [Dependency Injection](./src/di/di.ts) code and core tests. |
@@ -6,2 +6,19 @@ # Change Log | ||
# [1.13.0](https://github.com/Microsoft/fast/compare/@microsoft/fast-foundation@1.12.0...@microsoft/fast-foundation@1.13.0) (2021-02-08) | ||
### Bug Fixes | ||
* accordion arrow key press moves focus from content to accordion header ([#4331](https://github.com/Microsoft/fast/issues/4331)) ([d959c18](https://github.com/Microsoft/fast/commit/d959c18e5a5cba3b983c2cba096face14bec2bb8)) | ||
* add check for intersection observer support before instanciating ([#4349](https://github.com/Microsoft/fast/issues/4349)) ([d106995](https://github.com/Microsoft/fast/commit/d106995dea3e7384633dbf2653b83aba3c815713)) | ||
### Features | ||
* adds DI system, Configuration, and FoundationElement ([#4166](https://github.com/Microsoft/fast/issues/4166)) ([cfbe786](https://github.com/Microsoft/fast/commit/cfbe786f23623d69f2d658b51fe9211527ef9f0f)) | ||
# [1.12.0](https://github.com/Microsoft/fast/compare/@microsoft/fast-foundation@1.11.1...@microsoft/fast-foundation@1.12.0) (2021-01-30) | ||
@@ -8,0 +25,0 @@ |
@@ -53,4 +53,5 @@ import { FASTElement } from "@microsoft/fast-element"; | ||
private handleItemKeyDown; | ||
private handleItemFocus; | ||
private adjust; | ||
private focusItem; | ||
} |
@@ -0,42 +1,45 @@ | ||
export * from "./accordion-item/index"; | ||
export * from "./accordion/index"; | ||
export * from "./accordion-item/index"; | ||
export * from "./anchor/index"; | ||
export * from "./anchored-region/index"; | ||
export * from "./badge/index"; | ||
export * from "./breadcrumb-item/index"; | ||
export * from "./breadcrumb/index"; | ||
export * from "./breadcrumb-item/index"; | ||
export * from "./button/index"; | ||
export * from "./disclosure/index"; | ||
export * from "./card/index"; | ||
export * from "./checkbox/index"; | ||
export * from "./design-system/index"; | ||
export * from "./custom-properties/index"; | ||
export * from "./data-grid/index"; | ||
export * from "./design-system-provider/index"; | ||
export * from "./di/index"; | ||
export * from "./dialog/index"; | ||
export * from "./disclosure/index"; | ||
export * from "./divider/index"; | ||
export * from "./flipper/index"; | ||
export * from "./form-associated/index"; | ||
export * from "./flipper/index"; | ||
export * from "./foundation-element/index"; | ||
export * from "./listbox-option/index"; | ||
export * from "./listbox/index"; | ||
export * from "./listbox-option/index"; | ||
export * from "./menu-item/index"; | ||
export * from "./menu/index"; | ||
export * from "./menu-item/index"; | ||
export * from "./number-field/index"; | ||
export * from "./patterns/index"; | ||
export * from "./progress-ring/index"; | ||
export * from "./progress/index"; | ||
export * from "./progress-ring/index"; | ||
export * from "./radio-group/index"; | ||
export * from "./radio/index"; | ||
export * from "./radio-group/index"; | ||
export * from "./select/index"; | ||
export * from "./skeleton/index"; | ||
export * from "./slider-label/index"; | ||
export * from "./slider/index"; | ||
export * from "./slider-label/index"; | ||
export * from "./switch/index"; | ||
export * from "./tab-panel/index"; | ||
export * from "./tab/index"; | ||
export * from "./tab-panel/index"; | ||
export * from "./tabs/index"; | ||
export * from "./text-area/index"; | ||
export * from "./text-field/index"; | ||
export * from "./tooltip/index"; | ||
export * from "./tree-item/index"; | ||
export * from "./tree-view/index"; | ||
export * from "./tooltip/index"; | ||
export * from "./utilities/index"; |
@@ -59,2 +59,3 @@ import { __decorate } from "tslib"; | ||
item.addEventListener("keydown", this.handleItemKeyDown); | ||
item.addEventListener("focus", this.handleItemFocus); | ||
}); | ||
@@ -66,2 +67,3 @@ }; | ||
item.removeEventListener("keydown", this.handleItemKeyDown); | ||
item.removeEventListener("focus", this.handleItemFocus); | ||
}); | ||
@@ -80,2 +82,7 @@ }; | ||
this.handleItemKeyDown = (event) => { | ||
// only handle the keydown if the event target is the accordion item | ||
// prevents arrow keys from moving focus to accordion headers when focus is on accordion item panel content | ||
if (event.target !== event.currentTarget) { | ||
return; | ||
} | ||
const keyCode = event.keyCode; | ||
@@ -102,2 +109,14 @@ this.accordionIds = this.getItemIds(); | ||
}; | ||
this.handleItemFocus = (event) => { | ||
// 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 | ||
if (event.target === event.currentTarget) { | ||
const focusedItem = event.target; | ||
const focusedIndex = (this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem)); | ||
if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { | ||
this.activeItemIndex = focusedIndex; | ||
this.activeid = this.accordionIds[this.activeItemIndex]; | ||
} | ||
} | ||
}; | ||
} | ||
@@ -104,0 +123,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import { $global } from "@microsoft/fast-element"; | ||
/** | ||
@@ -8,2 +9,3 @@ * A service to batch intersection event callbacks so multiple elements can share a single observer | ||
constructor() { | ||
this.intersectionDetector = null; | ||
this.observedElements = new Map(); | ||
@@ -17,2 +19,5 @@ /** | ||
var _a; | ||
if (this.intersectionDetector === null) { | ||
return; | ||
} | ||
if (this.observedElements.has(target)) { | ||
@@ -43,2 +48,6 @@ (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback); | ||
this.initializeIntersectionDetector = () => { | ||
if (!$global.IntersectionObserver) { | ||
//intersection observer not supported | ||
return; | ||
} | ||
this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { | ||
@@ -54,2 +63,5 @@ root: null, | ||
this.handleIntersection = (entries) => { | ||
if (this.intersectionDetector === null) { | ||
return; | ||
} | ||
const pendingCallbacks = []; | ||
@@ -59,4 +71,5 @@ const pendingCallbackParams = []; | ||
entries.forEach((entry) => { | ||
var _a; | ||
// stop watching this element until we get new update requests for it | ||
this.intersectionDetector.unobserve(entry.target); | ||
(_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); | ||
const thisElementCallbacks = this.observedElements.get(entry.target); | ||
@@ -63,0 +76,0 @@ if (thisElementCallbacks !== undefined) { |
@@ -29,6 +29,6 @@ import { children, elements, html, slotted } from "@microsoft/fast-element"; | ||
<template | ||
:defaultCellItemTemplate=${createCellItemTemplate(prefix)} | ||
:defaultHeaderCellItemTemplate=${createHeaderCellItemTemplate(prefix)} | ||
role="row" | ||
class="${x => (x.rowType !== "default" ? x.rowType : "")}" | ||
:defaultCellItemTemplate="${createCellItemTemplate(prefix)}" | ||
:defaultHeaderCellItemTemplate="${createHeaderCellItemTemplate(prefix)}" | ||
${children({ | ||
@@ -35,0 +35,0 @@ property: "cellElements", |
@@ -22,3 +22,3 @@ import { children, elements, html } from "@microsoft/fast-element"; | ||
tabindex="0" | ||
:defaultRowItemTemplate=${createRowItemTemplate(prefix)} | ||
:defaultRowItemTemplate="${createRowItemTemplate(prefix)}" | ||
${children({ | ||
@@ -25,0 +25,0 @@ property: "rowElements", |
@@ -0,43 +1,46 @@ | ||
export * from "./accordion-item/index"; | ||
export * from "./accordion/index"; | ||
export * from "./accordion-item/index"; | ||
export * from "./anchor/index"; | ||
export * from "./anchored-region/index"; | ||
export * from "./badge/index"; | ||
export * from "./breadcrumb-item/index"; | ||
export * from "./breadcrumb/index"; | ||
export * from "./breadcrumb-item/index"; | ||
export * from "./button/index"; | ||
export * from "./disclosure/index"; | ||
export * from "./card/index"; | ||
export * from "./checkbox/index"; | ||
export * from "./design-system/index"; | ||
export * from "./custom-properties/index"; | ||
export * from "./data-grid/index"; | ||
export * from "./design-system-provider/index"; | ||
export * from "./di/index"; | ||
export * from "./dialog/index"; | ||
export * from "./disclosure/index"; | ||
export * from "./divider/index"; | ||
export * from "./flipper/index"; | ||
export * from "./form-associated/index"; | ||
export * from "./flipper/index"; | ||
export * from "./foundation-element/index"; | ||
export * from "./listbox-option/index"; | ||
export * from "./listbox/index"; | ||
export * from "./listbox-option/index"; | ||
export * from "./menu-item/index"; | ||
export * from "./menu/index"; | ||
export * from "./menu-item/index"; | ||
export * from "./number-field/index"; | ||
export * from "./patterns/index"; | ||
export * from "./progress-ring/index"; | ||
export * from "./progress/index"; | ||
export * from "./progress-ring/index"; | ||
export * from "./radio-group/index"; | ||
export * from "./radio/index"; | ||
export * from "./radio-group/index"; | ||
export * from "./select/index"; | ||
export * from "./skeleton/index"; | ||
export * from "./slider-label/index"; | ||
export * from "./slider/index"; | ||
export * from "./slider-label/index"; | ||
export * from "./switch/index"; | ||
export * from "./tab-panel/index"; | ||
export * from "./tab/index"; | ||
export * from "./tab-panel/index"; | ||
export * from "./tabs/index"; | ||
export * from "./text-area/index"; | ||
export * from "./text-field/index"; | ||
export * from "./tooltip/index"; | ||
export * from "./tree-item/index"; | ||
export * from "./tree-view/index"; | ||
export * from "./tooltip/index"; | ||
// export our utilities | ||
export * from "./utilities/index"; |
@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.8.0" | ||
"packageVersion": "7.8.1" | ||
} | ||
] | ||
} |
@@ -137,3 +137,3 @@ --- | ||
"build": "webpack --mode=production", | ||
"dev": "webpack-dev-server" | ||
"dev": "webpack serve" | ||
} | ||
@@ -223,2 +223,2 @@ ``` | ||
Congratulations! You're now set up to use FAST, TypeScript, and Webpack. You can import and use more components, build your own components, and when you are ready, build and deploy your website or app to production. | ||
Congratulations! You're now set up to use FAST, TypeScript, and Webpack. You can import and use more components, build your own components, and when you are ready, build and deploy your website or app to production. |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "1.12.0", | ||
"version": "1.13.0", | ||
"author": { | ||
@@ -53,3 +53,3 @@ "name": "Microsoft", | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.7.13", | ||
"@microsoft/api-extractor": "7.8.1", | ||
"@types/chai": "^4.2.11", | ||
@@ -60,2 +60,3 @@ "@types/karma": "^5.0.0", | ||
"chai": "^4.2.0", | ||
"chai-spies": "^1.0.0", | ||
"esm": "^3.2.25", | ||
@@ -77,2 +78,3 @@ "ignore-loader": "^0.1.2", | ||
"karma-webpack": "^4.0.2", | ||
"lodash-es": "4.17.15", | ||
"mocha": "^7.1.2", | ||
@@ -96,4 +98,4 @@ "prettier": "2.0.2", | ||
"dependencies": { | ||
"@microsoft/fast-element": "^0.22.0", | ||
"@microsoft/fast-web-utilities": "^4.7.1", | ||
"@microsoft/fast-element": "^0.22.1", | ||
"@microsoft/fast-web-utilities": "^4.7.2", | ||
"@microsoft/tsdoc-config": "^0.13.4", | ||
@@ -103,3 +105,3 @@ "tabbable": "^4.0.0", | ||
}, | ||
"gitHead": "51b89a2cd29743331d96aaf0268abdb84fe96a79" | ||
"gitHead": "28b24c7d584178b1be974c0c3e866ff311609714" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2664041
364
60082
40