Major Changes
-
c9bd577:
<pf-icon>
: removed thegetIconUrl
static method, and replaced it with the
resolve
static methodThe steps for overriding icon loading behaviour have changed. Before, you had to
return a string from thegetIconUrl
method, 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 thedefaultIconSet
static field. -
c9bd577:
<pf-accordion>
: RemovedBaseAccordion*
classes, as well as staticisPanel
,isHeader
, andisAccordion
methods. Removed the optionalparentAccordion
parameter toPfAccordion#expand(index)
. Renamed accordion event classes by adding thePf
prefix: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/icons
instead -
c9bd577:
<pf-label>
: when clicking close button,close
event 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>
: RemovedBaseClipboardCopy
class.
Reimplement (recommended) or extendPfClipboardCopy
.
RenamesAvatarLoadEvent
toPfAvatarLoadEvent
and 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>
: RemovedBaseIcon
class. Reimplement (recommended) or extendPfIcon
. -
c9bd577:
<pf-label>
: RemovedBaseLabel
class. Reimplement (recommended) or extendPfLabel
. -
c9bd577:
<pf-switch>
: RemovedBaseSwitch
class. Reimplement (recommended) or extendPfSwitch
. -
c9bd577:
<pf-avatar>
: RemovedBaseAvatar
class. Reimplement (recommended) or extendPfAvatar
.
RenamesAvatarLoadEvent
toPfAvatarLoadEvent
and 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>
: RemovedBaseBadge
class. Reimplement (recommended) or extendPfBadge
. -
c9bd577:
<pf-button>
: RemovedBaseButton
class. Reimplement (recommended) or extendPfButton
. -
c9bd577:
<pf-code-block>
: RemovedBaseCodeBlock
class. Reimplement (recommended) or extendPfCodeBlock
. -
c9bd577:
<pf-spinner>
: RemovedBaseSpinner
class. Reimplement (recommended) or extendPfSpinner
. -
c9bd577:
<pf-tabs>
: RemoveBaseTabs
. UseTabsAriaController
, etc. to reimplement
your elements which extend it, or extend fromPfTabs
instead. -
c9bd577:
<pf-tile>
: RemovedBaseTile
class. Reimplement (recommended) or extendPfTile
. -
c9bd577:
<pf-tooltip>
: RemovedBaseTooltip
class. Reimplement (recommended) or extendPfTooltip
. -
c9bd577:
<pf-card>
: RemovesBaseCard
base class. If your project extendsBaseCard
, we recommend extendingLitElement
instead and re-implementing card's properties. Alternately, extend fromPfCard
.
Minor Changes
-
c9bd577:
<pf-card>
: addedtitle
slot, 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>
: Addedhref
attribute 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]