Skip to content

Commit

Permalink
thats why you use build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mirisuzanne committed Aug 27, 2024
1 parent 605e01d commit 1a83dab
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## v0.2.1 - 2024-08-26

- FIX: `switch-control` raw file out-of-date 🙈

## v0.2.0 - 2024-08-26

- BREAKING: Export named classes from `index.js` module
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ Make sure you include the `<script>` in your project
<!-- 3rd party CDN, not recommended for production use -->
<script
type="module"
src="https://www.unpkg.com/@terriblemia/[email protected].0/index.js"
src="https://www.unpkg.com/@terriblemia/[email protected].1/index.js"
></script>
```

```html
<!-- 3rd party CDN, not recommended for production use -->
<script
type="module"
src="https://esm.sh/@terriblemia/[email protected].0"
src="https://esm.sh/@terriblemia/[email protected].1"
></script>
```

Expand Down
1 change: 1 addition & 0 deletions ground-control-raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class GroundControl extends HTMLElement {
template.innerHTML = `<slot></slot>`;
shadowRoot.appendChild(template.content.cloneNode(true));
};

static _adoptShadowStyles = (node) => {
const shadowStyle = new CSSStyleSheet();
shadowStyle.replaceSync(`:host { display: block }`);
Expand Down
1 change: 1 addition & 0 deletions ground-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default class GroundControl extends HTMLElement {
template.innerHTML = `<slot></slot>`;
shadowRoot.appendChild(template.content.cloneNode(true));
};

static _adoptShadowStyles = (node) => {
const shadowStyle = new CSSStyleSheet();
shadowStyle.replaceSync(`:host { display: block }`);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@terriblemia/ground-control",
"version": "0.2.0",
"version": "0.2.1",
"description": "A Web Component for user control of HTML attributes and CSS properties",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions switch-control-raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SwitchControl extends GroundControl {
get pressedValue() {
return this.pressed
? this.dataset.on
: this.dataset.off;
: this.dataset.off || 'false';
};

constructor() {
Expand All @@ -75,7 +75,11 @@ class SwitchControl extends GroundControl {
connectedCallback() {
super.connectedCallback();
this.#findToggle();
this.pressed = this.#isPressedValue(this.storedValue);

if (this.storedValue) {
this.pressed = this.#isPressedValue(this.storedValue);
}

this.doToggleActions();
};

Expand Down

0 comments on commit 1a83dab

Please sign in to comment.