Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions elements/pfe-accordion/demo/pfe-accordion.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const stories = storiesOf(PfeAccordion.meta.title, module);
import readme from "../README.md";
stories.addParameters({
notes: {
markdown: readme
}
markdown: readme,
},
});

// Define the template to be used
Expand All @@ -23,7 +23,7 @@ const template = (data = {}) => {
stories.addDecorator(storybookBridge.withKnobs);

// Log events
Object.values(PfeAccordion.events).forEach(event => {
Object.values(PfeAccordion.events).forEach((event) => {
stories.addDecorator(withActions(event));
});

Expand All @@ -37,14 +37,14 @@ stories.add(PfeAccordion.tag, () => {

config.prop = tools.autoPropKnobs(PfeAccordion, {
role: {
hidden: true
hidden: true,
},
disclosure: {
hidden: true
hidden: true,
},
history: {
hidden: true
}
hidden: true,
},
});

//-- Add content to light DOM
Expand All @@ -54,7 +54,7 @@ stories.add(PfeAccordion.tag, () => {
// Let the user determine number of accordions
let accordionCount = storybookBridge.number("Count", 5, {
min: 1,
max: 10
max: 10,
});

if (accordionCount === 1) {
Expand All @@ -80,15 +80,15 @@ stories.add(PfeAccordion.tag, () => {
{
content: tools.customTag({
tag: "h2",
content: tools.autoHeading() // customContent ? headings[i] : tools.autoHeading()
})
}
content: tools.autoHeading(), // customContent ? headings[i] : tools.autoHeading()
}),
},
]) +
tools.component("pfe-accordion-panel", {}, [
{
content: tools.autoContent(2, 3) // customContent ? panels[i] : tools.autoContent(5, 3)
}
])
content: tools.autoContent(2, 3), // customContent ? panels[i] : tools.autoContent(5, 3)
},
]),
});
}

Expand Down
6 changes: 3 additions & 3 deletions elements/pfe-accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"preview": "accordion.svg"
},
"version": "1.9.1",
"version": "1.9.2",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -60,10 +60,10 @@
],
"license": "MIT",
"devDependencies": {
"@patternfly/pfe-sass": "^1.9.1"
"@patternfly/pfe-sass": "^1.9.2"
},
"dependencies": {
"@patternfly/pfelement": "^1.9.1"
"@patternfly/pfelement": "^1.9.2"
},
"generator-pfelement-version": "0.5.5",
"bugs": {
Expand Down
28 changes: 14 additions & 14 deletions elements/pfe-accordion/src/pfe-accordion-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ class PfeAccordionHeader extends PFElement {
return {
_id: {
type: String,
default: el => `${el.randomId.replace("pfe", el.tag)}`,
prefix: false
default: (el) => `${el.randomId.replace("pfe", el.tag)}`,
prefix: false,
},
ariaControls: {
type: String,
prefix: false
prefix: false,
},
// @TODO Deprecated pfe-id in 1.0
oldPfeId: {
type: String,
alias: "_id",
attr: "pfe-id"
attr: "pfe-id",
},
expanded: {
title: "Expanded",
type: Boolean,
cascade: "#pfe-accordion-header--button",
observer: "_expandedChanged"
}
observer: "_expandedChanged",
},
};
}

static get events() {
return {
change: `pfe-accordion:change`
change: `pfe-accordion:change`,
};
}

Expand All @@ -64,7 +64,7 @@ class PfeAccordionHeader extends PFElement {

this.addEventListener("click", this._clickHandler);
this._observer.observe(this, {
childList: true
childList: true,
});
}

Expand Down Expand Up @@ -103,7 +103,7 @@ class PfeAccordionHeader extends PFElement {

if (window.ShadyCSS) {
this._observer.observe(this, {
childList: true
childList: true,
});
}
}
Expand All @@ -126,14 +126,14 @@ class PfeAccordionHeader extends PFElement {
}
// If there is more than 1 element in the slot, capture the first h-tag
if (slotted.length > 1) this.warn(`Heading currently only supports 1 tag.`);
const htags = slotted.filter(slot => slot.tagName.match(/^H[1-6]/) || slot.tagName === "P");
const htags = slotted.filter((slot) => slot.tagName.match(/^H[1-6]/) || slot.tagName === "P");
if (htags.length > 0) {
// Return the first htag and attach an observer event to watch for it
slotted.forEach(slot =>
slotted.forEach((slot) =>
this._slotObserver.observe(slot, {
characterData: true,
childList: true,
subtree: true
subtree: true,
})
);
return htags[0];
Expand All @@ -159,8 +159,8 @@ class PfeAccordionHeader extends PFElement {
_clickHandler(event) {
this.emitEvent(PfeAccordionHeader.events.change, {
detail: {
expanded: !this.expanded
}
expanded: !this.expanded,
},
});
}

Expand Down
14 changes: 7 additions & 7 deletions elements/pfe-accordion/src/pfe-accordion-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ class PfeAccordionPanel extends PFElement {
return {
_id: {
type: String,
default: el => `${el.randomId.replace("pfe", el.tag)}`,
prefix: false
default: (el) => `${el.randomId.replace("pfe", el.tag)}`,
prefix: false,
},
role: {
type: String,
default: "region",
prefix: false
prefix: false,
},
// @TODO Deprecated pfe-id in 1.0
oldPfeId: {
type: String,
alias: "_id",
attr: "pfe-id"
attr: "pfe-id",
},
expanded: {
title: "Expanded",
type: Boolean,
default: false
default: false,
},
ariaLabelledby: {
type: String,
prefix: false
}
prefix: false,
},
};
}

Expand Down
Loading