thermal icon indicating copy to clipboard operation
thermal copied to clipboard

Custom Toggle switch component

Open mittalyashu opened this issue 4 years ago • 13 comments

Create a custom toggle switch component for Thermal Design System (TDS).


The currently package vue-js-toggle-button is not reactively toggling the switch. For instance:

commitFeature: {
    get: function() {
        return !!+this.settings.commitFeature;
    },
    set: function(value) {
        this.settings.commitFeature = value ? 1 : 0;
    }
}

mittalyashu avatar Oct 06 '19 03:10 mittalyashu

Taking a look at this.

rampreeth avatar Oct 07 '19 08:10 rampreeth

I am facing an issue while trying to set it up locally.

rampreeth avatar Oct 07 '19 09:10 rampreeth

May I know what kind of issue are you facing? @rampreeth

mittalyashu avatar Oct 07 '19 10:10 mittalyashu

yarn
yarn install v1.19.0
warning package.json: License should be a valid SPDX license expression
warning [email protected]: License should be a valid SPDX license expression
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
[-/4] ⠠ waiting...
[2/4] ⠠ fsevents
[3/4] ⠠ electron
error /Users/rampreeth.ethiraj/open-source-repos/src/thermal/node_modules/electron: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Users/rampreeth.ethiraj/open-source-repos/src/thermal/node_modules/electron
Output:
Downloading tmp-7905-0-electron-v5.0.6-darwin-x64.zip
Error: connect ETIMEDOUT 13.234.210.38:443
/Users/rampreeth.ethiraj/open-source-repos/src/thermal/node_modules/electron/install.js:49
  throw err
  ^

Error: connect ETIMEDOUT 13.234.210.38:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1126:14) {
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '13.234.210.38',



warning Error running install script for optional dependency: "/Users/rampreeth.ethiraj/open-source-repos/src/thermal/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install
Arguments:
Directory: /Users/rampreeth.ethiraj/open-source-repos/src/thermal/node_modules/fsevents
Output:

Looks like it is failing when it is trying to install electron.

rampreeth avatar Oct 07 '19 10:10 rampreeth

@rampreeth Seems like the issue is not related to electron instead it's because of the connection timeout.

Error: connect ETIMEDOUT 13.234.210.38:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1126:14) {
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '13.234.210.38',

mittalyashu avatar Oct 08 '19 02:10 mittalyashu

Wanted to check on the progress for the component @rampreeth.

mittalyashu avatar Oct 10 '19 04:10 mittalyashu

Yes so I think the issue is with reactivity in vue. We need to probably use this.$set. I'm yet to try that out.

rampreeth avatar Oct 10 '19 04:10 rampreeth

Are you trying to fix an exiting toggle switch or creating a new one?

mittalyashu avatar Oct 10 '19 04:10 mittalyashu

Existing one itself.

rampreeth avatar Oct 10 '19 04:10 rampreeth

Existing one itself.

No no, seems like you miss-understood the issue title.

You need to create a custom toggle switch component @rampreeth

mittalyashu avatar Oct 10 '19 07:10 mittalyashu

As per the issue , the existing toggle component is not working right. I think that is happening because of vue reactivity.

rampreeth avatar Oct 10 '19 10:10 rampreeth

Yes, I am aware of that problem, that's why I have created this issue to create a new custom toggle switch component.

mittalyashu avatar Oct 11 '19 00:10 mittalyashu

@rampreeth did you make any progress in creating custom toggle switch component?

mittalyashu avatar Oct 15 '19 10:10 mittalyashu