Releases: patternfly/patternfly-elements
@patternfly/[email protected]
Patch Changes
- 7c855a6:
TabsARIAController: improve SSR compatibility
@patternfly/[email protected]
Patch Changes
- 155911d:
<pf-jump-links>: corrected a layout bug which occurred when thecenteredattribute applied
@patternfly/[email protected]
Patch Changes
- 0ec7338:
OverflowController: prevent browser from locking up in some scenarios
@patternfly/[email protected]
Patch Changes
- 921e5d5: TypeScript CSS Import Transforms: allow importing from bare specifiers
@patternfly/[email protected]
Patch Changes
- 43b97bf:
InternalsController: prevent Safari-detector from breaking SSR
@patternfly/[email protected]
Patch Changes
- bce98d2:
<pf-icon>: fixed lazy icon lazy loading - Updated dependencies [43b97bf]
- @patternfly/[email protected]
@patternfly/[email protected]
Major Changes
-
1ca3515: Custom Elements Manifest: Removed support for non-standard inline
{@default value}JSDoc tags. Use standard syntax insteadBefore:
/** * @cssprop --foo {@default bar} Foo */
After:
/** * @cssprop [--foo=bar] Foo */
-
c9bd577: Custom Elements Manifest: added
custom-elements-manifest.js, which exports the functiongetAllManifestsimport { getAllManifests } from "@patternfly/pfe-tools/custom-elements-manifest/custom-elements-manifest/.js"; for (const manifest of getAllManifests()) { const packageName = manifest.packageJson?.name ?? "package"; console.log( `Available Elements in ${packageName}`, ...manifest.getTagNames() ); }
Minor Changes
-
c9bd577:
a11ySnapshot: Added chai assertions for various accessibility-tree scenariosExamples:
describe("<pf-accordion>", function () { beforeEach(() => fixture(html` <pf-accordion> <pf-accordion-header id="header1">header-1</pf-accordion-header> <pf-accordion-panel>panel-1</pf-accordion-panel> </pf-accordion> `) ); describe("clicking the first heading", function () { beforeEach(clickFirstHeading); it("expands the first panel", async function () { expect(await a11ySnapshot()).to.axContainName("panel-1"); }); it("focuses the first panel", async function () { expect(await a11ySnapshot()).to.have.axTreeFocusOn( document.getElementById("header1") ); }); it("shows the collapse all button", async function () { expect(await a11ySnapshot()).to.axContainRole("button"); }); }); });
-
c9bd577: Added
querySnapshotaccessibility testing helperdescribe("then clicking the toggle", function () { beforeEach(async function () { await clickElementAtCenter(toggle); }); it("expands the disclosure panel", async function () { const snapshot = await a11ySnapshot(); const expanded = querySnapshot(snapshot, { expanded: true }); expect(expanded).to.be.ok; }); });
-
c9bd577: TypeScript: Add static version transformer. This adds a runtime-only
staticversionfield to custom element classes.import "@patternfly/elements/pf-button/pf-button.js"; const PFE_VERSION = await customElements .whenDefined("pf-button") .then((PfButton) => PfButton.version);
Patch Changes
- c9bd577: updated dependencies
- 9d68f3d: Dev Server: load lightdom shim files
- 9d68f3d: Dev Server: reload on typescript file changes
- f3f68c9: Windows compatibility for various tools packages
- c9bd577: Dev Server: use last modified time for the dev server cache
- c9bd577: Test Runner Config: import the production version of Lit for tests, reducing
console chatter during test runs
@patternfly/[email protected]
Major Changes
-
c9bd577:
RovingTabindexController,ListboxController: constructor options were changed.
In particular, theinitItems(items: Item[])andsetActiveItem(item: Item)methods
were removed and replaced with thegetItems: () => Item[]constructor option, and
theatFocusedItemIndexaccessor.Before:
#tabindex = new RovingTabindexController(this); firstUpdated() { this.#tabindex.initItems(this.items); } updated(changed: PropertyValues<this>) { if (changed.has('activeItem')) { this.#tabindex.setActiveItem(this.activeItem); } }
After:
#tabindex = RovingTabindexController.of(this, { getItems: () => this.items, }); updated(changed: PropertyValues<this>) { if (changed.has('activeItem')) { this.#tabindex.atFocusedItemIndex = this.items.indexOf(this.activeItem); } }
For further migration guidance, please see the sources in
@patternfly/pfe-core,
especially:ATFocusController.ts,RovingTabindexController.ts, andListboxController.ts.
-
c9bd577: Removed global
pfeLogfeature -
c9bd577: Removed
window.PfeConfigglobal config object -
c9bd577: Removed global
auto-revealfeature -
c9bd577: Decorators: Added
@observes. Use it to add property change callback by
decorating them with the name of the property to observe@customElement("custom-button") class CustomButton extends LitElement { #internals = this.attachInternals(); @property({ type: Boolean }) disabled = false; @observes("disabled") protected disabledChanged() { this.#internals.ariaDisabled = this.disabled ? "true" : this.ariaDisabled ?? "false"; } }
Breaking change: This commit makes some changes to the internal APIs of the
pre-existing@observedobserver, most notably it changes the constructor
signature of thePropertyObserverControllerand associated functions. Most
users should not have to make any changes, but if you directly import and use
those functions, check the commit log to see how to update your call sites. -
c9bd577: Removed global
trackPerformancefeature
Minor Changes
-
c9bd577: ✨ Added
ActiveDescendantControllerThis controller implements the WAI-ARIA activedescendant pattern
for keyboard and screen-reader accessibility.#activedescendant = ActivedescendantController.of(this, { getItems: () => this.options, getItemsContainer: () => this.#listbox, getOrientation: () => "vertical", getActiveDescendantContainer: () => this.#input, getControlsElements: () => [this.#input, this.#button].filter((x) => !!x), setItemActive: (item, active) => void (item.active = active), });
-
c9bd577: ✨ Added
ComboboxControllerThis controller implements the WAI-ARIA combobox pattern for both
select-only and inline autocomplete comboboxes.#combobox = ComboboxController.of(this, { multi: this.multi, getItems: () => this.options, getFallbackLabel: () => this.accessibleLabel, getListboxElement: () => this._listbox ?? null, getToggleButton: () => this._toggleButton ?? null, getComboboxInput: () => this._toggleInput ?? null, isExpanded: () => this.expanded, requestShowListbox: () => void (this.expanded ||= true), requestHideListbox: () => void (this.expanded &&= false), setItemHidden: (item, hidden) => void (item.hidden = hidden), isItem: (item) => item instanceof PfOption, setItemActive: (item, active) => (item.active = active), setItemSelected: (item, selected) => (item.selected = selected), });
-
6d9045e:
InternalsController: added staticisSafariboolean flag -
c9bd577: Decorators: Added
@listen. Use it to attach element event listeners to
class methods.@customElement("custom-input") class CustomInput extends LitElement { @property({ type: Boolean }) dirty = false; @listen("keyup", { once: true }) protected onKeyup() { this.dirty = true; } }
Patch Changes
@patternfly/[email protected]
@patternfly/[email protected]
Major Changes
-
c9bd577:
<pf-icon>: removed thegetIconUrlstatic method, and replaced it with the
resolvestatic methodThe steps for overriding icon loading behaviour have changed. Before, you had to
return a string from thegetIconUrlmethod, or the second argument to
addIconSet. Now, both of those functions must return a Node, or any lit-html
renderable value, or a Promise thereof.Before:
PfIcon.addIconSet('local', (set, icon) => new URL(`/assets/icons/${set}-${icon}.js`)); // or PfIcon.getIconUrl = (set, icon) => new URL(`/assets/icons/${set}-${icon}.js`))
After:
PfIcon.addIconSet('local', (set, icon) => import(`/assets/icons/${set}-${icon}.js`)) .then(mod => mod.default); // or PfIcon.resolve = (set, icon) => import(`/assets/icons/${set}-${icon}.js`)) .then(mod => mod.default);
-
c9bd577:
<pf-icon>: removed thedefaultIconSetstatic field. -
c9bd577:
<pf-accordion>: RemovedBaseAccordion*classes, as well as staticisPanel,isHeader, andisAccordionmethods. Removed the optionalparentAccordionparameter toPfAccordion#expand(index). Renamed accordion event classes by adding thePfprefix:Before:
import { AccordionHeaderChangeEvent } from "@patternfly/elements/pf-accordion/pf-accordion.js"; addEventListener("change", function (event) { if (event instanceof AccordionHeaderChangeEvent) { // ... } });
After:
import { PfAccordionHeaderChangeEvent } from "@patternfly/elements/pf-accordion/pf-accordion.js"; addEventListener("change", function (event) { if (event instanceof PfAccordionHeaderChangeEvent) { // ... } });
-
c9bd577:
<pf-icon>: removed svg files, use@patternfly/iconsinstead -
c9bd577:
<pf-label>: when clicking close button,closeevent is fired.
Now, if that event is not cancelled, the label will remove itself from the document.To restore previous behaviour:
import { LabelCloseEvent } from "@patternfly/elements/pf-label/pf-label.js"; label.addEventListener("close", function (event) { if (event instanceof LabelCloseEvent) { event.preventDefault(); return false; } });
-
c9bd577:
<pf-clipboard-copy>: RemovedBaseClipboardCopyclass.
Reimplement (recommended) or extendPfClipboardCopy.
RenamesAvatarLoadEventtoPfAvatarLoadEventand moves it topf-avatar.js.Before:
import { ClipboardCopyCopiedEvent } from "@patternfly/elements/pf-clipboard-copy/BaseClipboardCopy.js"; addEventListener("copy", function (event) { if (event instanceof ClipboardCopyCopiedEvent) { // ... } });
After:
import { PfClipboardCopyCopiedEvent } from "@patternfly/elements/pf-clipboard-copy/pf-clipboard-copy.js"; addEventListener("copy", function (event) { if (event instanceof PfClipboardCopyCopiedEvent) { // ... } });
-
c9bd577:
<pf-icon>: RemovedBaseIconclass. Reimplement (recommended) or extendPfIcon. -
c9bd577:
<pf-label>: RemovedBaseLabelclass. Reimplement (recommended) or extendPfLabel. -
c9bd577:
<pf-switch>: RemovedBaseSwitchclass. Reimplement (recommended) or extendPfSwitch. -
c9bd577:
<pf-avatar>: RemovedBaseAvatarclass. Reimplement (recommended) or extendPfAvatar.
RenamesAvatarLoadEventtoPfAvatarLoadEventand moves it topf-avatar.js.Before:
import { AvatarLoadEvent } from "@patternfly/elements/pf-avatar/BaseAvatar.js"; addEventListener("load", function (event) { if (event instanceof AvatarLoadEvent) { // ... } });
After:
import { PfAvatarLoadEvent } from "@patternfly/elements/pf-avatar/pf-avatar.js"; addEventListener("load", function (event) { if (event instanceof PfAvatarLoadEvent) { // ... } });
-
c9bd577:
<pf-badge>: RemovedBaseBadgeclass. Reimplement (recommended) or extendPfBadge. -
c9bd577:
<pf-button>: RemovedBaseButtonclass. Reimplement (recommended) or extendPfButton. -
c9bd577:
<pf-code-block>: RemovedBaseCodeBlockclass. Reimplement (recommended) or extendPfCodeBlock. -
c9bd577:
<pf-spinner>: RemovedBaseSpinnerclass. Reimplement (recommended) or extendPfSpinner. -
c9bd577:
<pf-tabs>: RemoveBaseTabs. UseTabsAriaController, etc. to reimplement
your elements which extend it, or extend fromPfTabsinstead. -
c9bd577:
<pf-tile>: RemovedBaseTileclass. Reimplement (recommended) or extendPfTile. -
c9bd577:
<pf-tooltip>: RemovedBaseTooltipclass. Reimplement (recommended) or extendPfTooltip. -
c9bd577:
<pf-card>: RemovesBaseCardbase class. If your project extendsBaseCard, we recommend extendingLitElementinstead and re-implementing card's properties. Alternately, extend fromPfCard.
Minor Changes
-
c9bd577:
<pf-card>: addedtitleslot, for when the title is not inline with any slotted header actions -
c9bd577: ✨ Added
<pf-select variant="typeahead">A typeahead select is an inline-autocomplete combobox.
<label for="state">State</label> <pf-select id="state" variant="typeahead" placeholder="Select a state"> <pf-option value="Alabama" description="The heart of Dixie"></pf-option> <pf-option value="Florida" description="The sunshine state" disabled ></pf-option> <pf-option value="New Jersey"></pf-option> <pf-option value="New York"></pf-option> <pf-option value="New Mexico"></pf-option> <pf-option value="North Carolina"></pf-option> </pf-select>
-
587d957:
<pf-button>: Addedhrefattribute to<pf-button variant="link">
Patch Changes
- c9bd577: updated dependencies
- 3e9d785:
<pf-select>: prevent bug when select is in a deeply nested in shadow root - 4995067:
<pf-back-to-top>: fix hover color - Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [6d9045e]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- Updated dependencies [c9bd577]
- @patternfly/[email protected]