Merge pull request #627 from ing-bank/chore/fix-switch-storybook

chore(switch): fix storybook rendering
This commit is contained in:
gerjanvangeest 2020-03-05 13:16:10 +01:00 committed by GitHub
commit cd4d2fa561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
import { Story, Meta, html } from '@open-wc/demoing-storybook';
import { Validator } from '@lion/validate';
import { LionSwitch } from '../src/LionSwitch';
import { LionSwitch } from '../index.js';
import '../lion-switch.js';
import '@lion/helpers/sb-action-logger.js';
@ -76,13 +76,16 @@ Simple example that illustrates where validation feedback will be displayed.
return "You won't get the latest news!";
}
};
const tagName = 'custom-switch';
if (!customElements.get(tagName)) {
customElements.define(
tagName,
class CustomSwitch extends LionSwitch {
static get validationTypes() {
return [...super.validationTypes, 'info'];
}
}
if (!customElements.get('custom-switch')) {
customElements.define('custom-switch', CustomSwitch);
},
);
}
return html`
<custom-switch
@ -97,7 +100,7 @@ Simple example that illustrates where validation feedback will be displayed.
```js
import { Validator } from '@lion/validate';
import { LionSwitch } from '@lion/switch/src/LionSwitch';
import { LionSwitch } from '@lion/switch';
const IsTrue = class extends Validator {
static get validatorName() {