fix: update storybook/linting; adjust story labels, eslint ignores
This commit is contained in:
parent
6497db62d3
commit
8d96f84090
160 changed files with 1552 additions and 1244 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -8,8 +8,8 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
## npm
|
## npm
|
||||||
/node_modules/
|
node_modules/
|
||||||
/npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
# we do prefer yarn.lock so we do not want npms version of it
|
# we do prefer yarn.lock so we do not want npms version of it
|
||||||
/package-lock.json
|
/package-lock.json
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
"useBuiltIns": "entry"
|
"useBuiltIns": "entry",
|
||||||
},
|
"corejs": "2",
|
||||||
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import '@storybook/addon-storysource/register';
|
import '@storybook/addon-storysource/register';
|
||||||
import '@storybook/addon-actions/register';
|
import '@storybook/addon-actions/register';
|
||||||
import '@storybook/addon-backgrounds/register';
|
|
||||||
import '@storybook/addon-notes/register';
|
import '@storybook/addon-notes/register';
|
||||||
|
import '@storybook/addon-knobs/register';
|
||||||
import '@storybook/addon-links/register';
|
import '@storybook/addon-links/register';
|
||||||
import '@storybook/addon-viewport/register';
|
import '@storybook/addon-viewport/register';
|
||||||
import '@storybook/addon-options/register';
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import { configure } from '@storybook/polymer';
|
import { configure } from '@storybook/polymer';
|
||||||
import { setOptions } from '@storybook/addon-options';
|
import '@storybook/addon-console';
|
||||||
|
|
||||||
setOptions({
|
|
||||||
hierarchyRootSeparator: /\|/,
|
|
||||||
});
|
|
||||||
|
|
||||||
const req = require.context('../stories', true, /\.stories\.js$/);
|
const req = require.context('../stories', true, /\.stories\.js$/);
|
||||||
function loadStories() {
|
function loadStories() {
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,8 @@
|
||||||
const path = require('path');
|
const defaultConfig = require('@open-wc/demoing-storybook/default-storybook-webpack-config.js');
|
||||||
|
|
||||||
module.exports = (storybookBaseConfig, configType, defaultConfig) => {
|
module.exports = ({ config }) => {
|
||||||
defaultConfig.module.rules.push({
|
return defaultConfig({
|
||||||
test: [/\.stories\.js$/, /index\.js$/],
|
config,
|
||||||
loaders: [require.resolve('@storybook/addon-storysource/loader')],
|
transpilePackages: ['lit-html', 'lit-element', '@open-wc', 'autosize'],
|
||||||
enforce: 'pre',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const transpilePackages = ['lit-html', 'lit-element', '@open-wc', 'autosize'];
|
|
||||||
|
|
||||||
// this is a separate config for only those packages
|
|
||||||
// the main storybook will use the .babelrc which is needed so storybook itself works in IE
|
|
||||||
defaultConfig.module.rules.push({
|
|
||||||
test: new RegExp(`node_modules(\\\/|\\\\)(${transpilePackages.join('|')})(.*)\\.js$`),
|
|
||||||
use: {
|
|
||||||
loader: 'babel-loader',
|
|
||||||
options: {
|
|
||||||
plugins: [
|
|
||||||
'@babel/plugin-syntax-dynamic-import',
|
|
||||||
'@babel/plugin-proposal-object-rest-spread',
|
|
||||||
],
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@babel/preset-env',
|
|
||||||
{
|
|
||||||
useBuiltIns: 'entry',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
babelrc: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
defaultConfig.devServer = {
|
|
||||||
headers: { 'X-UA-Compatible': 'IE=Edge' },
|
|
||||||
};
|
|
||||||
|
|
||||||
return defaultConfig;
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^7.0.0",
|
"@commitlint/cli": "^7.0.0",
|
||||||
"@commitlint/config-conventional": "^7.0.0",
|
"@commitlint/config-conventional": "^7.0.0",
|
||||||
"@open-wc/eslint-config": "^0.4.0",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
|
"@open-wc/eslint-config": "^0.4.5",
|
||||||
"@open-wc/prettier-config": "^0.1.0",
|
"@open-wc/prettier-config": "^0.1.0",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/testing": "^0.11.5",
|
||||||
"@open-wc/testing": "^0.11.1",
|
|
||||||
"@open-wc/testing-karma": "^1.0.0",
|
"@open-wc/testing-karma": "^1.0.0",
|
||||||
"@open-wc/testing-karma-bs": "^1.0.0",
|
"@open-wc/testing-karma-bs": "^1.0.0",
|
||||||
"@webcomponents/webcomponentsjs": "^2.2.5",
|
"@webcomponents/webcomponentsjs": "^2.2.5",
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
"@lion/core": "^0.1.2"
|
"@lion/core": "^0.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1",
|
"@open-wc/testing": "^0.11.1",
|
||||||
"sinon": "^7.2.2"
|
"sinon": "^7.2.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { axios } from '@bundled-es-modules/axios';
|
import { axios } from '@bundled-es-modules/axios';
|
||||||
import { LionSingleton } from '@lion/core';
|
import { LionSingleton } from '@lion/core';
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { axios } from '@bundled-es-modules/axios';
|
import { axios } from '@bundled-es-modules/axios';
|
||||||
|
|
||||||
// FIXME: lang must be dynamic, fallback to html tag lang attribute or use the user-provided one
|
// FIXME: lang must be dynamic, fallback to html tag lang attribute or use the user-provided one
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import { storiesOf, html, action } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import { ajax } from '../src/ajax.js';
|
import { ajax } from '../src/ajax.js';
|
||||||
import { AjaxClass } from '../src/AjaxClass.js';
|
import { AjaxClass } from '../src/AjaxClass.js';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
storiesOf('Ajax system|Ajax', module)
|
||||||
storiesOf('Ajax system|ajax', module)
|
|
||||||
.addParameters({ options: { selectedPanel: 'storybook/actions/actions-panel' } })
|
.addParameters({ options: { selectedPanel: 'storybook/actions/actions-panel' } })
|
||||||
.add(
|
.add(
|
||||||
'Get',
|
'Get',
|
||||||
|
|
@ -14,10 +13,10 @@ storiesOf('Ajax system|ajax', module)
|
||||||
ajax
|
ajax
|
||||||
.get('./dummy-jsons/peter.json')
|
.get('./dummy-jsons/peter.json')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
action('request-response')(response.data);
|
console.log(response.data);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
action('request-error')(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -38,10 +37,10 @@ storiesOf('Ajax system|ajax', module)
|
||||||
myAjax
|
myAjax
|
||||||
.get('./dummy-jsons/peter.json')
|
.get('./dummy-jsons/peter.json')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
action('request-response')(response.data);
|
console.log(response.data);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
action('request-error')(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -58,19 +57,19 @@ storiesOf('Ajax system|ajax', module)
|
||||||
myAjax
|
myAjax
|
||||||
.get('./dummy-jsons/peter.json')
|
.get('./dummy-jsons/peter.json')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
action('Request 1:')(response.data);
|
console.log(response.data);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
action('Request 1: I got cancelled:')(error.message);
|
console.log(error.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
myAjax
|
myAjax
|
||||||
.get('./dummy-jsons/max.json')
|
.get('./dummy-jsons/max.json')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
action('Request 2:')(response.data);
|
console.log(response.data);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
action('Request 2: I got cancelled:')(error.message);
|
console.log(error.message);
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect, aTimeout } from '@open-wc/testing';
|
import { expect, aTimeout } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
"@lion/form": "^0.1.2",
|
"@lion/form": "^0.1.2",
|
||||||
"@lion/icon": "^0.1.2",
|
"@lion/icon": "^0.1.2",
|
||||||
"@lion/input": "^0.1.2",
|
"@lion/input": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1",
|
"@open-wc/testing": "^0.11.1",
|
||||||
"@polymer/iron-test-helpers": "^3.0.1",
|
"@polymer/iron-test-helpers": "^3.0.1",
|
||||||
"sinon": "^7.2.2"
|
"sinon": "^7.2.2"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { css, html, DelegateMixin, SlotMixin } from '@lion/core';
|
import { css, html, DelegateMixin, SlotMixin } from '@lion/core';
|
||||||
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
|
export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
import { storiesOf, html, action } from '@open-wc/storybook';
|
|
||||||
import { bug12 } from '@lion/icon/stories/icons/bugs-collection';
|
import { bug12 } from '@lion/icon/stories/icons/bugs-collection';
|
||||||
import '@lion/icon/lion-icon.js';
|
import '@lion/icon/lion-icon.js';
|
||||||
import '@lion/form/lion-form.js';
|
import '@lion/form/lion-form.js';
|
||||||
|
|
@ -7,7 +6,7 @@ import '@lion/input/lion-input.js';
|
||||||
|
|
||||||
import '../lion-button.js';
|
import '../lion-button.js';
|
||||||
|
|
||||||
storiesOf('Buttons|<lion-button>', module)
|
storiesOf('Buttons|Button', module)
|
||||||
.add(
|
.add(
|
||||||
'Used on its own',
|
'Used on its own',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
@ -39,8 +38,7 @@ storiesOf('Buttons|<lion-button>', module)
|
||||||
<lion-input name="foo" label="Foo" .modelValue=${'bar'}></lion-input>
|
<lion-input name="foo" label="Foo" .modelValue=${'bar'}></lion-input>
|
||||||
<lion-button
|
<lion-button
|
||||||
type="submit"
|
type="submit"
|
||||||
@click=${() =>
|
@click=${() => console.log(document.querySelector('#form').serializeGroup())}
|
||||||
action('serializeGroup')(document.querySelector('#form').serializeGroup())}
|
|
||||||
>Submit</lion-button
|
>Submit</lion-button
|
||||||
>
|
>
|
||||||
</form></lion-form
|
</form></lion-form
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect, fixture, html } from '@open-wc/testing';
|
import { expect, fixture, html } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { pressEnter, pressSpace } from '@polymer/iron-test-helpers/mock-interactions.js';
|
import { pressEnter, pressSpace } from '@polymer/iron-test-helpers/mock-interactions.js';
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"@lion/checkbox": "^0.1.2",
|
"@lion/checkbox": "^0.1.2",
|
||||||
"@lion/form": "^0.1.2",
|
"@lion/form": "^0.1.2",
|
||||||
"@lion/localize": "^0.1.2",
|
"@lion/localize": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1",
|
"@open-wc/testing": "^0.11.1",
|
||||||
"sinon": "^7.2.2"
|
"sinon": "^7.2.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { LionFieldset } from '@lion/fieldset';
|
import { LionFieldset } from '@lion/fieldset';
|
||||||
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
export class LionCheckboxGroup extends LionFieldset {
|
export class LionCheckboxGroup extends LionFieldset {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { storiesOf, html, action } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import '../lion-checkbox-group.js';
|
import '../lion-checkbox-group.js';
|
||||||
import '@lion/checkbox/lion-checkbox.js';
|
import '@lion/checkbox/lion-checkbox.js';
|
||||||
import '@lion/form/lion-form.js';
|
import '@lion/form/lion-form.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-checkbox-group>', module)
|
storiesOf('Forms|Checkbox Group', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
@ -92,7 +92,7 @@ storiesOf('Forms|<lion-checkbox-group>', module)
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
const form = document.querySelector('#form');
|
const form = document.querySelector('#form');
|
||||||
if (form.errorState === false) {
|
if (form.errorState === false) {
|
||||||
action('serializeGroup')(form.serializeGroup());
|
console.log(form.serializeGroup());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return html`
|
return html`
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle, no-unused-expressions */
|
|
||||||
import { expect, html, fixture, triggerFocusFor, nextFrame } from '@open-wc/testing';
|
import { expect, html, fixture, triggerFocusFor, nextFrame } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
"@lion/input": "^0.1.2"
|
"@lion/input": "^0.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lion/input": "^0.1.2",
|
"@lion/input": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
|
/* eslint-disable class-methods-use-this */
|
||||||
|
|
||||||
import { html, css, nothing } from '@lion/core';
|
import { html, css, nothing } from '@lion/core';
|
||||||
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
||||||
import { FormatMixin } from '@lion/field';
|
import { FormatMixin } from '@lion/field';
|
||||||
|
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this */
|
|
||||||
export const ChoiceInputMixin = superclass =>
|
export const ChoiceInputMixin = superclass =>
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
class ChoiceInputMixin extends FormatMixin(ObserverMixin(superclass)) {
|
class ChoiceInputMixin extends FormatMixin(ObserverMixin(superclass)) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
import { html } from '@lion/core';
|
import { html } from '@lion/core';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
"lit-html": "1.0.0"
|
"lit-html": "1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1",
|
"@open-wc/testing": "^0.11.1",
|
||||||
"sinon": "^7.2.2"
|
"sinon": "^7.2.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* # CssClassMixin
|
* # CssClassMixin
|
||||||
* `CssClassMixin` is a base mixin for the use of css in lion-components.
|
* `CssClassMixin` is a base mixin for the use of css in lion-components.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this */
|
/* eslint-disable class-methods-use-this */
|
||||||
|
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this */
|
|
||||||
/* global ShadyCSS */
|
/* global ShadyCSS */
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
import { DomHelpersMixin } from './DomHelpersMixin.js';
|
import { DomHelpersMixin } from './DomHelpersMixin.js';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this */
|
/* eslint-disable class-methods-use-this */
|
||||||
|
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'LionSingleton' provides an instance of the given class via .getInstance(foo, bar) and will
|
* 'LionSingleton' provides an instance of the given class via .getInstance(foo, bar) and will
|
||||||
* return the same instance if already created. It can reset its instance so a new one will be
|
* return the same instance if already created. It can reset its instance so a new one will be
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
|
/* eslint-disable class-methods-use-this */
|
||||||
|
|
||||||
import { dedupeMixin } from './dedupeMixin.js';
|
import { dedupeMixin } from './dedupeMixin.js';
|
||||||
import { DomHelpersMixin } from './DomHelpersMixin.js';
|
import { DomHelpersMixin } from './DomHelpersMixin.js';
|
||||||
|
|
||||||
/* eslint-disable class-methods-use-this, no-underscore-dangle */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* # SlotMixin
|
* # SlotMixin
|
||||||
* `SlotMixin`, when attached to the DOM it creates content for defined slots in the Light DOM.
|
* `SlotMixin`, when attached to the DOM it creates content for defined slots in the Light DOM.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle, no-unused-expressions */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
|
|
||||||
import { LionLitElement } from '../src/LionLitElement.js';
|
import { LionLitElement } from '../src/LionLitElement.js';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions, class-methods-use-this */
|
|
||||||
import { expect, fixture, defineCE, unsafeStatic, html } from '@open-wc/testing';
|
import { expect, fixture, defineCE, unsafeStatic, html } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { LionLitElement } from '../src/LionLitElement.js';
|
import { LionLitElement } from '../src/LionLitElement.js';
|
||||||
|
|
@ -503,6 +501,6 @@ describe('DelegateMixin', () => {
|
||||||
|
|
||||||
// we expect to NOT use an "internal" property
|
// we expect to NOT use an "internal" property
|
||||||
// TODO: double check if we test the right thing here
|
// TODO: double check if we test the right thing here
|
||||||
expect(el.constructor._classProperties.get('size')).to.be.undefined; // eslint-disable-line no-underscore-dangle
|
expect(el.constructor._classProperties.get('size')).to.be.undefined;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable class-methods-use-this, no-underscore-dangle */
|
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||||
import { LionLitElement, html } from '../src/LionLitElement.js';
|
import { LionLitElement, html } from '../src/LionLitElement.js';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions, class-methods-use-this */
|
|
||||||
import { expect, fixture, html, defineCE } from '@open-wc/testing';
|
import { expect, fixture, html, defineCE } from '@open-wc/testing';
|
||||||
import { LionLitElement } from '../src/LionLitElement.js';
|
import { LionLitElement } from '../src/LionLitElement.js';
|
||||||
|
|
||||||
|
|
@ -38,7 +36,6 @@ describe('EventMixin', () => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line class-methods-use-this
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<button id="button1">with click event</button>
|
<button id="button1">with click event</button>
|
||||||
|
|
@ -108,7 +105,7 @@ describe('EventMixin', () => {
|
||||||
expect(element.fired).to.equal(true);
|
expect(element.fired).to.equal(true);
|
||||||
|
|
||||||
// this will clear it's state on window
|
// this will clear it's state on window
|
||||||
delete window.__eventMixinProcessed; // eslint-disable-line no-underscore-dangle
|
delete window.__eventMixinProcessed;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports multiple different events for a single node', async () => {
|
it('supports multiple different events for a single node', async () => {
|
||||||
|
|
@ -142,7 +139,7 @@ describe('EventMixin', () => {
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this.lightDomInput = this.querySelector('input');
|
this.lightDomInput = this.querySelector('input');
|
||||||
this.__registerEvents(); // eslint-disable-line
|
this.__registerEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customElements.define('multi-events', MultiEvents);
|
customElements.define('multi-events', MultiEvents);
|
||||||
|
|
@ -177,7 +174,7 @@ describe('EventMixin', () => {
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this.lightDomButton = this.querySelector('button');
|
this.lightDomButton = this.querySelector('button');
|
||||||
this.__registerEvents(); // eslint-disable-line
|
this.__registerEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customElements.define('multi-functions', MultiFunctions);
|
customElements.define('multi-functions', MultiFunctions);
|
||||||
|
|
@ -194,9 +191,9 @@ describe('EventMixin', () => {
|
||||||
|
|
||||||
it('will not add same event/function multiple times to a node', async () => {
|
it('will not add same event/function multiple times to a node', async () => {
|
||||||
const element = await fixture(`<event-mixin></event-mixin>`);
|
const element = await fixture(`<event-mixin></event-mixin>`);
|
||||||
element.__registerEvents(); // eslint-disable-line
|
element.__registerEvents();
|
||||||
element.__registerEvents(); // eslint-disable-line
|
element.__registerEvents();
|
||||||
expect(element.__eventsCache.length).to.equal(4); // eslint-disable-line
|
expect(element.__eventsCache.length).to.equal(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('will cleanup events', async () => {
|
it('will cleanup events', async () => {
|
||||||
|
|
@ -205,8 +202,8 @@ describe('EventMixin', () => {
|
||||||
// in dev tools you can use getEventListeners but that is not available globally
|
// in dev tools you can use getEventListeners but that is not available globally
|
||||||
// so we are at least testing our implementation
|
// so we are at least testing our implementation
|
||||||
const element = await fixture(`<event-mixin></event-mixin>`);
|
const element = await fixture(`<event-mixin></event-mixin>`);
|
||||||
element.__unregisterEvents(); // eslint-disable-line
|
element.__unregisterEvents();
|
||||||
expect(element.__eventsCache.length).to.equal(0); // eslint-disable-line
|
expect(element.__eventsCache.length).to.equal(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reregisters events if dom node is moved', async () => {
|
it('reregisters events if dom node is moved', async () => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle, no-unused-expressions, class-methods-use-this */
|
|
||||||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||||
|
|
||||||
import { LionLitElement, html, css } from '../src/LionLitElement.js';
|
import { LionLitElement, html, css } from '../src/LionLitElement.js';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
|
|
||||||
import { LionSingleton } from '../src/LionSingleton.js';
|
import { LionSingleton } from '../src/LionSingleton.js';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this, no-unused-expressions */
|
|
||||||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { LionLitElement } from '../src/LionLitElement.js';
|
import { LionLitElement } from '../src/LionLitElement.js';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle, no-unused-expressions */
|
|
||||||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||||
|
|
||||||
import { SlotMixin } from '../src/SlotMixin.js';
|
import { SlotMixin } from '../src/SlotMixin.js';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
|
|
||||||
import { dedupeMixin } from '../src/dedupeMixin.js';
|
import { dedupeMixin } from '../src/dedupeMixin.js';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
|
|
||||||
import { html } from '../src/lit-html.js';
|
import { html } from '../src/lit-html.js';
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lion/localize": "^0.1.2",
|
"@lion/localize": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1",
|
"@open-wc/testing": "^0.11.1",
|
||||||
"sinon": "^7.2.2"
|
"sinon": "^7.2.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { dedupeMixin, nothing } from '@lion/core';
|
import { dedupeMixin, nothing } from '@lion/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { dedupeMixin, DelegateMixin } from '@lion/core';
|
import { dedupeMixin, DelegateMixin } from '@lion/core';
|
||||||
|
|
||||||
export const FocusMixin = dedupeMixin(
|
export const FocusMixin = dedupeMixin(
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { html, css, nothing, dedupeMixin } from '@lion/core';
|
import { html, css, nothing, dedupeMixin } from '@lion/core';
|
||||||
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
||||||
|
|
||||||
|
|
@ -496,7 +495,7 @@ export const FormControlMixin = dedupeMixin(
|
||||||
return (
|
return (
|
||||||
super.showSuccessCondition(newStates, oldStates) &&
|
super.showSuccessCondition(newStates, oldStates) &&
|
||||||
this._interactionStateFeedbackCondition()
|
this._interactionStateFeedbackCondition()
|
||||||
); // eslint-disable-line max-len
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_interactionStateFeedbackCondition() {
|
_interactionStateFeedbackCondition() {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this */
|
/* eslint-disable class-methods-use-this */
|
||||||
|
|
||||||
import { dedupeMixin } from '@lion/core';
|
import { dedupeMixin } from '@lion/core';
|
||||||
import { EventMixin } from '@lion/core/src/EventMixin.js';
|
import { EventMixin } from '@lion/core/src/EventMixin.js';
|
||||||
|
|
@ -54,7 +54,7 @@ export const FormatMixin = dedupeMixin(
|
||||||
* Examples:
|
* Examples:
|
||||||
* - For a date input, this would be the iso format of a date, e.g. '1999-01-20'.
|
* - For a date input, this would be the iso format of a date, e.g. '1999-01-20'.
|
||||||
* - For a number input this would be the String representation of a float ('1234.56' instead
|
* - For a number input this would be the String representation of a float ('1234.56' instead
|
||||||
* of 1234.56) // eslint-disable-line max-len
|
* of 1234.56)
|
||||||
*
|
*
|
||||||
* When no parser is available, the value is usually the same as the formattedValue
|
* When no parser is available, the value is usually the same as the formattedValue
|
||||||
* (being inputElement.value)
|
* (being inputElement.value)
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,6 @@ import { FocusMixin } from './FocusMixin.js';
|
||||||
* field is left non-empty
|
* field is left non-empty
|
||||||
* - on keyup (actually, on the model-value-changed event) -> 'dirty' will be set to true
|
* - on keyup (actually, on the model-value-changed event) -> 'dirty' will be set to true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable class-methods-use-this, no-underscore-dangle */
|
|
||||||
|
|
||||||
export const InteractionStateMixin = dedupeMixin(
|
export const InteractionStateMixin = dedupeMixin(
|
||||||
superclass =>
|
superclass =>
|
||||||
// eslint-disable-next-line no-unused-vars, no-shadow
|
// eslint-disable-next-line no-unused-vars, no-shadow
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@ import { FormControlMixin } from './FormControlMixin.js';
|
||||||
import { InteractionStateMixin } from './InteractionStateMixin.js'; // applies FocusMixin
|
import { InteractionStateMixin } from './InteractionStateMixin.js'; // applies FocusMixin
|
||||||
import { FormatMixin } from './FormatMixin.js';
|
import { FormatMixin } from './FormatMixin.js';
|
||||||
|
|
||||||
/* eslint-disable max-len, no-underscore-dangle, class-methods-use-this, camelcase, no-param-reassign */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LionField: wraps components input, textarea and select and potentially others
|
* LionField: wraps components input, textarea and select and potentially others
|
||||||
* (checkbox group, radio group)
|
* (checkbox group, radio group)
|
||||||
|
|
@ -52,7 +50,7 @@ export class LionField extends FormControlMixin(
|
||||||
'disabled',
|
'disabled',
|
||||||
'selectionStart',
|
'selectionStart',
|
||||||
'selectionEnd',
|
'selectionEnd',
|
||||||
], // eslint-disable-line max-len
|
],
|
||||||
attributes: [...super.delegations.attributes, 'name', 'type', 'disabled'],
|
attributes: [...super.delegations.attributes, 'name', 'type', 'disabled'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -193,6 +191,7 @@ export class LionField extends FormControlMixin(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
__isRequired(modelValue) {
|
__isRequired(modelValue) {
|
||||||
return {
|
return {
|
||||||
required:
|
required:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable class-methods-use-this, no-underscore-dangle, max-len */
|
|
||||||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||||
import { LionField } from '../src/LionField.js';
|
import { LionField } from '../src/LionField.js';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable class-methods-use-this, no-underscore-dangle, no-unused-expressions */
|
|
||||||
import { expect, fixture, html, defineCE, unsafeStatic, nextFrame } from '@open-wc/testing';
|
import { expect, fixture, html, defineCE, unsafeStatic, nextFrame } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { SlotMixin } from '@lion/core';
|
import { SlotMixin } from '@lion/core';
|
||||||
|
|
@ -12,7 +11,6 @@ describe('FormControlMixin', () => {
|
||||||
let tag;
|
let tag;
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
const FormControlMixinClass = class extends FormControlMixin(SlotMixin(LionLitElement)) {
|
const FormControlMixinClass = class extends FormControlMixin(SlotMixin(LionLitElement)) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable class-methods-use-this, no-underscore-dangle */
|
|
||||||
import { expect, fixture, html, aTimeout, defineCE, unsafeStatic } from '@open-wc/testing';
|
import { expect, fixture, html, aTimeout, defineCE, unsafeStatic } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
|
@ -12,7 +10,6 @@ function mimicUserInput(formControl, newViewValue) {
|
||||||
formControl.inputElement.dispatchEvent(new CustomEvent('input', { bubbles: true }));
|
formControl.inputElement.dispatchEvent(new CustomEvent('input', { bubbles: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
describe('FormatMixin', () => {
|
describe('FormatMixin', () => {
|
||||||
let elem;
|
let elem;
|
||||||
let nonFormat;
|
let nonFormat;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/*
|
|
||||||
eslint-disable class-method-use-this, no-underscore-dangle,
|
|
||||||
no-unused-expressions, no-new, no-unused-vars
|
|
||||||
*/
|
|
||||||
import { expect, fixture, unsafeStatic, html, defineCE } from '@open-wc/testing';
|
import { expect, fixture, unsafeStatic, html, defineCE } from '@open-wc/testing';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
||||||
|
|
@ -50,7 +45,6 @@ describe('InteractionStateMixin', async () => {
|
||||||
// See: https://stackblitz.com/edit/lit-element-request-update-bug-g59tjq?file=blurry.js
|
// See: https://stackblitz.com/edit/lit-element-request-update-bug-g59tjq?file=blurry.js
|
||||||
// it.skip
|
// it.skip
|
||||||
it('sets touched to true when field left after focus', async () => {
|
it('sets touched to true when field left after focus', async () => {
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// const formElement = await LionTest.htmlFixture(`<${elem}><input type="text" slot="input"></${elem}>`);
|
// const formElement = await LionTest.htmlFixture(`<${elem}><input type="text" slot="input"></${elem}>`);
|
||||||
// await triggerFocusFor(formElement.inputElement); // focus/blur can't be delegated
|
// await triggerFocusFor(formElement.inputElement); // focus/blur can't be delegated
|
||||||
// await triggerBlurFor(formElement.inputElement);
|
// await triggerBlurFor(formElement.inputElement);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle, no-unused-expressions */
|
|
||||||
import {
|
import {
|
||||||
expect,
|
expect,
|
||||||
fixture,
|
fixture,
|
||||||
|
|
@ -138,7 +136,6 @@ describe('<lion-field>', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('preserves the caret position on value change for native text fields (input|textarea)', async () => {
|
it('preserves the caret position on value change for native text fields (input|textarea)', async () => {
|
||||||
// eslint-disable-line
|
|
||||||
const lionField = await fixture(`<${tagString}>${inputSlotString}</${tagString}>`);
|
const lionField = await fixture(`<${tagString}>${inputSlotString}</${tagString}>`);
|
||||||
await triggerFocusFor(lionField);
|
await triggerFocusFor(lionField);
|
||||||
await lionField.updateComplete;
|
await lionField.updateComplete;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lion/input": "^0.1.2",
|
"@lion/input": "^0.1.2",
|
||||||
"@lion/localize": "^0.1.2",
|
"@lion/localize": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1",
|
"@open-wc/testing": "^0.11.1",
|
||||||
"sinon": "^7.2.2"
|
"sinon": "^7.2.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { SlotMixin, html } from '@lion/core';
|
import { SlotMixin, html } from '@lion/core';
|
||||||
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
||||||
import { CssClassMixin } from '@lion/core/src/CssClassMixin.js';
|
import { CssClassMixin } from '@lion/core/src/CssClassMixin.js';
|
||||||
|
|
@ -20,7 +18,6 @@ const pascalCase = str => str.charAt(0).toUpperCase() + str.slice(1);
|
||||||
export class LionFieldset extends FormControlMixin(
|
export class LionFieldset extends FormControlMixin(
|
||||||
ValidateMixin(EventMixin(CssClassMixin(SlotMixin(ObserverMixin(LionLitElement))))),
|
ValidateMixin(EventMixin(CssClassMixin(SlotMixin(ObserverMixin(LionLitElement))))),
|
||||||
) {
|
) {
|
||||||
// eslint-disable-line no-unused-vars, max-len
|
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
...super.properties,
|
...super.properties,
|
||||||
|
|
@ -344,7 +341,7 @@ export class LionFieldset extends FormControlMixin(
|
||||||
this.constructor._addDescriptionElementIdsToField(
|
this.constructor._addDescriptionElementIdsToField(
|
||||||
child,
|
child,
|
||||||
parent._getAriaDescriptionElements(),
|
parent._getAriaDescriptionElements(),
|
||||||
); // eslint-disable-line max-len
|
);
|
||||||
// Also check if the newly added child needs to refer grandparents
|
// Also check if the newly added child needs to refer grandparents
|
||||||
parent = parent.__parentFormGroup;
|
parent = parent.__parentFormGroup;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { storiesOf, html, action } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import '../lion-fieldset.js';
|
import '../lion-fieldset.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-fieldset>', module)
|
storiesOf('Forms|Fieldset', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
@ -25,7 +25,7 @@ storiesOf('Forms|<lion-fieldset>', module)
|
||||||
<lion-fieldset name="nameGroup" label="Name">
|
<lion-fieldset name="nameGroup" label="Name">
|
||||||
<lion-input name="FirstName" label="First Name" .modelValue=${'Foo'}></lion-input>
|
<lion-input name="FirstName" label="First Name" .modelValue=${'Foo'}></lion-input>
|
||||||
<lion-input name="LastName" label="Last Name" .modelValue=${'Bar'}></lion-input>
|
<lion-input name="LastName" label="Last Name" .modelValue=${'Bar'}></lion-input>
|
||||||
<button @click=${ev => action('modelValue')(ev.target.parentElement.modelValue)}>
|
<button @click=${ev => console.log(ev.target.parentElement.modelValue)}>
|
||||||
Log to Action Logger
|
Log to Action Logger
|
||||||
</button>
|
</button>
|
||||||
</lion-fieldset>
|
</lion-fieldset>
|
||||||
|
|
@ -44,13 +44,12 @@ storiesOf('Forms|<lion-fieldset>', module)
|
||||||
<lion-input name="country" label="Country" .modelValue=${'Netherlands'}></lion-input>
|
<lion-input name="country" label="Country" .modelValue=${'Netherlands'}></lion-input>
|
||||||
</lion-fieldset>
|
</lion-fieldset>
|
||||||
<lion-input name="age" label="Age" .modelValue=${21}></lion-input>
|
<lion-input name="age" label="Age" .modelValue=${21}></lion-input>
|
||||||
<button @click=${ev => action('modelValue')(ev.target.parentElement.modelValue)}>
|
<button @click=${ev => console.log(ev.target.parentElement.modelValue)}>
|
||||||
Log to Action Logger
|
Log to Action Logger
|
||||||
</button>
|
</button>
|
||||||
<br />
|
<br />
|
||||||
<button
|
<button
|
||||||
@click=${ev =>
|
@click=${ev => console.log(ev.target.parentElement.formElements.nameGroup.modelValue)}
|
||||||
action('modelValue')(ev.target.parentElement.formElements.nameGroup.modelValue)}
|
|
||||||
>
|
>
|
||||||
Log nameGroup to Action Logger
|
Log nameGroup to Action Logger
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import {
|
import {
|
||||||
expect,
|
expect,
|
||||||
fixture,
|
fixture,
|
||||||
|
|
@ -73,7 +71,6 @@ describe('<lion-fieldset>', () => {
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* eslint-disable no-console */
|
|
||||||
it('throws if an element without a name tries to register', async () => {
|
it('throws if an element without a name tries to register', async () => {
|
||||||
const orig = console.info;
|
const orig = console.info;
|
||||||
console.info = () => {};
|
console.info = () => {};
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
"@lion/radio": "^0.1.2",
|
"@lion/radio": "^0.1.2",
|
||||||
"@lion/radio-group": "^0.1.2",
|
"@lion/radio-group": "^0.1.2",
|
||||||
"@lion/textarea": "^0.1.2",
|
"@lion/textarea": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import '@lion/form/lion-form.js';
|
import '@lion/form/lion-form.js';
|
||||||
import '@lion/fieldset/lion-fieldset.js';
|
import '@lion/fieldset/lion-fieldset.js';
|
||||||
|
|
@ -14,7 +14,7 @@ import '@lion/input-amount/lion-input-amount.js';
|
||||||
import '@lion/input-date/lion-input-date.js';
|
import '@lion/input-date/lion-input-date.js';
|
||||||
import '@lion/input-email/lion-input-email.js';
|
import '@lion/input-email/lion-input-email.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-form>', module).add('Umbrella form', () => {
|
storiesOf('Forms|Form', module).add('Umbrella form', () => {
|
||||||
return html`
|
return html`
|
||||||
<lion-form
|
<lion-form
|
||||||
><form>
|
><form>
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
"@lion/input-iban": "^0.1.2",
|
"@lion/input-iban": "^0.1.2",
|
||||||
"@lion/textarea": "^0.1.2",
|
"@lion/textarea": "^0.1.2",
|
||||||
"@lion/validate": "^0.1.2",
|
"@lion/validate": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { DelegateMixin } from '@lion/core';
|
import { DelegateMixin } from '@lion/core';
|
||||||
import { LionFieldset } from '@lion/fieldset';
|
import { LionFieldset } from '@lion/fieldset';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { storiesOf, html, action } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import '../lion-form.js';
|
import '../lion-form.js';
|
||||||
import '@lion/fieldset/lion-fieldset.js';
|
import '@lion/fieldset/lion-fieldset.js';
|
||||||
|
|
@ -7,7 +7,7 @@ import '@lion/textarea/lion-textarea.js';
|
||||||
|
|
||||||
import { maxLengthValidator } from '@lion/validate';
|
import { maxLengthValidator } from '@lion/validate';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-form>', module)
|
storiesOf('Forms|Form', module)
|
||||||
.add(
|
.add(
|
||||||
'Basic form result',
|
'Basic form result',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
@ -29,10 +29,7 @@ storiesOf('Forms|<lion-form>', module)
|
||||||
help-text="If none, leave empty"
|
help-text="If none, leave empty"
|
||||||
label="Comments"
|
label="Comments"
|
||||||
></lion-textarea>
|
></lion-textarea>
|
||||||
<button
|
<button @click=${() => console.log(document.querySelector('#form').serializeGroup())}>
|
||||||
@click=${() =>
|
|
||||||
action('serializeGroup')(document.querySelector('#form').serializeGroup())}
|
|
||||||
>
|
|
||||||
Log to Action Logger
|
Log to Action Logger
|
||||||
</button>
|
</button>
|
||||||
</form></lion-form
|
</form></lion-form
|
||||||
|
|
@ -43,7 +40,7 @@ storiesOf('Forms|<lion-form>', module)
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
const form = document.querySelector('#form');
|
const form = document.querySelector('#form');
|
||||||
if (form.errorState === false) {
|
if (form.errorState === false) {
|
||||||
action('serializeGroup')(form.serializeGroup());
|
console.log(form.serializeGroup());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return html`
|
return html`
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { expect, fixture, html } from '@open-wc/testing';
|
import { expect, fixture, html } from '@open-wc/testing';
|
||||||
|
|
||||||
import '@lion/input/lion-input.js';
|
import '@lion/input/lion-input.js';
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
"@lion/core": "^0.1.2"
|
"@lion/core": "^0.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { html, css, render, unsafeHTML, until } from '@lion/core';
|
import { html, css, render, unsafeHTML, until } from '@lion/core';
|
||||||
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
import { LionLitElement } from '@lion/core/src/LionLitElement.js';
|
||||||
|
|
||||||
|
|
@ -73,7 +72,6 @@ export class LionIcon extends LionLitElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line class-methods-use-this
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
import { until } from '@lion/core';
|
import { until } from '@lion/core';
|
||||||
|
|
||||||
import '../lion-icon.js';
|
import '../lion-icon.js';
|
||||||
|
|
@ -20,7 +20,7 @@ import sun from './icons/space/sun.svg.js';
|
||||||
import moonFlag from './icons/space/moon-flag.svg.js';
|
import moonFlag from './icons/space/moon-flag.svg.js';
|
||||||
import night from './icons/space/night.svg.js';
|
import night from './icons/space/night.svg.js';
|
||||||
|
|
||||||
storiesOf('Icon System|<lion-icon>', module)
|
storiesOf('Icon System|Icon', module)
|
||||||
.add(
|
.add(
|
||||||
'default',
|
'default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { expect, fixture, aTimeout, html } from '@open-wc/testing';
|
import { expect, fixture, aTimeout, html } from '@open-wc/testing';
|
||||||
import { until } from '@lion/core';
|
import { until } from '@lion/core';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"@lion/validate": "^0.1.2"
|
"@lion/validate": "^0.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { css } from '@lion/core';
|
import { css } from '@lion/core';
|
||||||
import { LocalizeMixin } from '@lion/localize';
|
import { LocalizeMixin } from '@lion/localize';
|
||||||
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
import { ObserverMixin } from '@lion/core/src/ObserverMixin.js';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import '../lion-input-amount.js';
|
import '../lion-input-amount.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input-amount>', module)
|
storiesOf('Forms|Input Amount', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import { localize } from '@lion/localize';
|
import { localize } from '@lion/localize';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect, fixture, aTimeout } from '@open-wc/testing';
|
import { expect, fixture, aTimeout } from '@open-wc/testing';
|
||||||
import { html } from '@lion/core';
|
import { html } from '@lion/core';
|
||||||
import { localize } from '@lion/localize';
|
import { localize } from '@lion/localize';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import { localize } from '@lion/localize';
|
import { localize } from '@lion/localize';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"@lion/validate": "^0.1.2"
|
"@lion/validate": "^0.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { LocalizeMixin, formatDate, parseDate } from '@lion/localize';
|
import { LocalizeMixin, formatDate, parseDate } from '@lion/localize';
|
||||||
import { FieldCustomMixin } from '@lion/field';
|
import { FieldCustomMixin } from '@lion/field';
|
||||||
import { LionInput } from '@lion/input';
|
import { LionInput } from '@lion/input';
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
import { maxDateValidator, minDateValidator, minMaxDateValidator } from '@lion/validate';
|
import { maxDateValidator, minDateValidator, minMaxDateValidator } from '@lion/validate';
|
||||||
|
|
||||||
import '../lion-input-date.js';
|
import '../lion-input-date.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input-date>', module)
|
storiesOf('Forms|Input Date', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
import { html } from '@lion/core';
|
import { html } from '@lion/core';
|
||||||
import { localizeTearDown } from '@lion/localize/test-helpers.js';
|
import { localizeTearDown } from '@lion/localize/test-helpers.js';
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"@lion/validate": "^0.1.2"
|
"@lion/validate": "^0.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
import { LocalizeMixin } from '@lion/localize';
|
import { LocalizeMixin } from '@lion/localize';
|
||||||
import { FieldCustomMixin } from '@lion/field';
|
import { FieldCustomMixin } from '@lion/field';
|
||||||
import { LionInput } from '@lion/input';
|
import { LionInput } from '@lion/input';
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import { localize } from '@lion/localize';
|
import { localize } from '@lion/localize';
|
||||||
|
|
||||||
import '../lion-input-email.js';
|
import '../lion-input-email.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input-email>', module)
|
storiesOf('Forms|Input Email', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
|
|
||||||
import '../lion-input-email.js';
|
import '../lion-input-email.js';
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lion/validate": "^0.1.2",
|
"@lion/validate": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle, class-methods-use-this */
|
|
||||||
|
|
||||||
import { LocalizeMixin } from '@lion/localize';
|
import { LocalizeMixin } from '@lion/localize';
|
||||||
import { LionInput } from '@lion/input';
|
import { LionInput } from '@lion/input';
|
||||||
import { FieldCustomMixin } from '@lion/field';
|
import { FieldCustomMixin } from '@lion/field';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
import { isValidIBAN } from '@bundled-es-modules/ibantools/ibantools.js';
|
import { isValidIBAN } from '@bundled-es-modules/ibantools/ibantools.js';
|
||||||
|
|
||||||
export const isIBAN = value => isValidIBAN(value);
|
export const isIBAN = value => isValidIBAN(value);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import { isCountryIBANValidator } from '../src/validators.js';
|
import { isCountryIBANValidator } from '../src/validators.js';
|
||||||
import '../lion-input-iban.js';
|
import '../lion-input-iban.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input-iban>', module)
|
storiesOf('Forms|Input IBAN', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
|
|
||||||
import { formatIBAN } from '../src/formatters.js';
|
import { formatIBAN } from '../src/formatters.js';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
import { html } from '@lion/core';
|
import { html } from '@lion/core';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
|
|
||||||
import { parseIBAN } from '../src/parsers.js';
|
import { parseIBAN } from '../src/parsers.js';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
/* eslint-disable no-unused-expressions */
|
|
||||||
import { expect } from '@open-wc/testing';
|
import { expect } from '@open-wc/testing';
|
||||||
import { smokeTestValidator } from '@lion/validate/test/validators.test.js';
|
import { smokeTestValidator } from '@lion/validate/test/validators.test.js';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lion/localize": "^0.1.2",
|
"@lion/localize": "^0.1.2",
|
||||||
"@lion/validate": "^0.1.2",
|
"@lion/validate": "^0.1.2",
|
||||||
"@open-wc/storybook": "^0.1.5",
|
"@open-wc/demoing-storybook": "^0.2.0",
|
||||||
"@open-wc/testing": "^0.11.1"
|
"@open-wc/testing": "^0.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { LionField } from '@lion/field';
|
import { LionField } from '@lion/field';
|
||||||
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LionInput: extension of lion-field with native input element in place and user friendly API
|
* LionInput: extension of lion-field with native input element in place and user friendly API
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
|
|
||||||
import '../lion-input.js';
|
import '../lion-input.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input>', module)
|
storiesOf('Forms|Input', module)
|
||||||
.add(
|
.add(
|
||||||
'Default',
|
'Default',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
|
||||||
import { maxLengthValidator } from '@lion/validate';
|
import { maxLengthValidator } from '@lion/validate';
|
||||||
import { localize, LocalizeMixin } from '@lion/localize';
|
import { localize, LocalizeMixin } from '@lion/localize';
|
||||||
import { LionInput } from '../src/LionInput.js';
|
import { LionInput } from '../src/LionInput.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input> Localize', module).add('localize', () => {
|
storiesOf('Forms|Input Localize', module).add('localize', () => {
|
||||||
class InputValidationExample extends LocalizeMixin(LionInput) {
|
class InputValidationExample extends LocalizeMixin(LionInput) {
|
||||||
static get localizeNamespaces() {
|
static get localizeNamespaces() {
|
||||||
return [
|
return [
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { storiesOf, html } from '@open-wc/storybook';
|
import { storiesOf, html } from '@open-wc/demoing-storybook';
|
||||||
import {
|
import {
|
||||||
equalsLengthValidator,
|
equalsLengthValidator,
|
||||||
minLengthValidator,
|
minLengthValidator,
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
import { LocalizeMixin } from '@lion/localize';
|
import { LocalizeMixin } from '@lion/localize';
|
||||||
import { LionInput } from '../src/LionInput.js';
|
import { LionInput } from '../src/LionInput.js';
|
||||||
|
|
||||||
storiesOf('Forms|<lion-input> String Validation', module)
|
storiesOf('Forms|Input String Validation', module)
|
||||||
.add(
|
.add(
|
||||||
'equalsLength',
|
'equalsLength',
|
||||||
() => html`
|
() => html`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/* eslint-env mocha */
|
|
||||||
import { expect, fixture } from '@open-wc/testing';
|
import { expect, fixture } from '@open-wc/testing';
|
||||||
|
|
||||||
import '../lion-input.js';
|
import '../lion-input.js';
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue