Skip to content

Commit

Permalink
Fix remaining components
Browse files Browse the repository at this point in the history
  • Loading branch information
maxatdetroit committed Apr 25, 2024
1 parent cf1baa1 commit ecec3e2
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/components/atoms/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class Alert extends HTMLElement {
alertContent.id = 'alert-content';
this.alert.appendChild(alertContent);

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
const nodeClasses = node.className.split(' ');
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class Container extends HTMLElement {
this.nav = shadow.querySelector('nav');
this.breadcrumb = shadow.querySelector('ol');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
const nodeClasses = node.className.split(' ');
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/CardBody/CardBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class CardBody extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.cardBody = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.cardBody.append(node);
Expand Down
6 changes: 3 additions & 3 deletions src/components/atoms/CardFooter/CardFooter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styles from '!!raw-loader!./CardFooter.css';
import varStyles from '!!raw-loader!../../../shared/variables.css';
import bootstrapStyles from '!!raw-loader!../../../shared/themed-bootstrap.css';
import varStyles from '!!raw-loader!../../../shared/variables.css';
import styles from '!!raw-loader!./CardFooter.css';

const template = document.createElement('template');

Expand All @@ -17,7 +17,7 @@ export default class CardFooter extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.cardFooter = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.cardFooter.append(node);
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/CardHeader/CardHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class CardHeader extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.cardHeader = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.cardHeader.append(node);
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/CardOverlay/CardOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class CardOverlay extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.cardOverlay = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.cardOverlay.append(node);
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/CarouselCaption/CarouselCaption.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class CarouselCaption extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.carouselCaption = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.carouselCaption.append(node);
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/CarouselItem/CarouselItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class CarouselItem extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.carouselItem = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.carouselItem.append(node);
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Container/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class Container extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.container = document.createElement('div');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.container.append(node);
Expand Down
6 changes: 1 addition & 5 deletions src/components/atoms/DropdownMenu/DropdownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class DropdownMenu extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.dropdownMenu = document.createElement('ul');

this.shadowRoot.addEventListener('slotchange', (ev) => {
this.shadowRoot.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.dropdownMenu.append(node);
Expand All @@ -41,16 +41,12 @@ export default class DropdownMenu extends HTMLElement {
}

attributeChangedCallback(name, oldValue, newValue) {
console.log(newValue);

const tempClasses = this.dropdownMenu.className.split(' ');

const popValue = tempClasses.pop();

popValue != 'show' ? tempClasses.push(popValue) : 0;

console.log(tempClasses);

if (newValue == 'true') {
tempClasses.push('show');
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/FormCheck/FormCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export default class FormCheck extends HTMLElement {
// Always call super first in constructor
super();
// Create a shadow root

const shadow = this.attachShadow({ mode: 'open' });
this.attachShadow({ mode: 'open' });
this.internals = this.attachInternals();
this.container = document.createElement('div');
this.formCheck = document.createElement('input');
Expand Down
4 changes: 1 addition & 3 deletions src/components/atoms/FormControl/FormControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export default class FormControl extends HTMLElement {
// Always call super first in constructor
super();
// Create a shadow root

const shadow = this.attachShadow({ mode: 'open' });
this.attachShadow({ mode: 'open' });
this.internals = this.attachInternals();
this.formControl = null;
this.invalid = false;
Expand All @@ -29,7 +28,6 @@ export default class FormControl extends HTMLElement {

switch (newValue) {
case 'true':
console.log('invalid input');
tempClasses.push('is-invalid');
this.formControl.className = tempClasses.join(' ');
break;
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/FormLabel/FormLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export default class FormLabel extends HTMLElement {
// Always call super first in constructor
super();
// Create a shadow root

const shadow = this.attachShadow({ mode: 'open' });
this.attachShadow({ mode: 'open' });
}

connectedCallback() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/FormSelect/FormSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class FormSelect extends HTMLElement {
// Create select and move options from slot to select
this.select = shadow.querySelector('select');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const node = this.querySelector('option');
node && this.select.append(node);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Image/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Image extends HTMLElement {
// Create select and move options from slot to select
this.picture = shadow.querySelector('picture');

shadow.addEventListener('slotchange', (ev) => {
shadow.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.picture.append(node);
Expand Down
4 changes: 1 addition & 3 deletions src/components/atoms/ListGroupItem/ListGroupItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ export default class ListGroupItem extends HTMLElement {
break;

case 'data-order-index':
console.log(newValue);

if (newValue != null) {
this.listGroupItem.innerHTML = `${newValue}. ${this.listGroupItem.innerHTML}`;

Expand Down Expand Up @@ -111,7 +109,7 @@ export default class ListGroupItem extends HTMLElement {
].join(' ');

if (!this.shadowRoot.querySelector(tag)) {
this.shadowRoot.addEventListener('slotchange', (ev) => {
this.shadowRoot.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.listGroupItem.append(node);
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/Loader/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export default class Loader extends HTMLElement {
// Always call super first in constructor
super();
// Create a shadow root

const shadow = this.attachShadow({ mode: 'open' });
this.attachShadow({ mode: 'open' });
}

connectedCallback() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/ModalBody/ModalBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class ModalBody extends HTMLElement {
shadow.appendChild(template.content.cloneNode(true));
this.body = document.createElement('div');

this.shadowRoot.addEventListener('slotchange', (ev) => {
this.shadowRoot.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.body.append(node);
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/ModalFooter/ModalFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ModalFooter extends HTMLElement {
this.modalFooter = document.createElement('div');
this.closeBtn = document.createElement('cod-button');

this.shadowRoot.addEventListener('slotchange', (ev) => {
this.shadowRoot.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.modalFooter.appendChild(node);
Expand Down Expand Up @@ -69,7 +69,7 @@ export default class ModalFooter extends HTMLElement {
this.removeEventListener('click', this._onClick.bind(this));
}

_onClick(e) {
_onClick() {
this.getRootNode()
.host.getRootNode()
.host.setAttribute('data-show', 'false');
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/ModalHeader/ModalHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class ModalHeader extends HTMLElement {
this.modalTitle = document.createElement('div');
this.closeBtn = document.createElement('cod-button');

this.shadowRoot.addEventListener('slotchange', (ev) => {
this.shadowRoot.addEventListener('slotchange', () => {
const tempElements = Array.from(this.children);
tempElements.forEach((node) => {
this.modalTitle.appendChild(node);
Expand Down Expand Up @@ -75,7 +75,7 @@ export default class ModalHeader extends HTMLElement {
this.removeEventListener('click', this._onClick.bind(this));
}

_onClick(e) {
_onClick() {
this.getRootNode()
.host.getRootNode()
.host.setAttribute('data-show', 'false');
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/Progress/Progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export default class Progress extends HTMLElement {
// Always call super first in constructor
super();
// Create a shadow root

const shadow = this.attachShadow({ mode: 'open' });
this.attachShadow({ mode: 'open' });
}

connectedCallback() {
Expand Down

0 comments on commit ecec3e2

Please sign in to comment.