Merge pull request #1083 from ing-bank/fix/validationFeedbackType
Fix/validation feedback type
This commit is contained in:
commit
184af49915
47 changed files with 13539 additions and 46045 deletions
28
.changeset/fair-suns-melt.md
Normal file
28
.changeset/fair-suns-melt.md
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
'@lion/accordion': patch
|
||||||
|
'@lion/calendar': patch
|
||||||
|
'@lion/checkbox-group': patch
|
||||||
|
'@lion/collapsible': patch
|
||||||
|
'@lion/core': patch
|
||||||
|
'@lion/dialog': patch
|
||||||
|
'@lion/form': patch
|
||||||
|
'@lion/form-core': patch
|
||||||
|
'@lion/helpers': patch
|
||||||
|
'@lion/icon': patch
|
||||||
|
'@lion/input-amount': patch
|
||||||
|
'@lion/input-date': patch
|
||||||
|
'@lion/input-datepicker': patch
|
||||||
|
'@lion/input-email': patch
|
||||||
|
'@lion/input-iban': patch
|
||||||
|
'@lion/input-range': patch
|
||||||
|
'@lion/input-stepper': patch
|
||||||
|
'@lion/listbox': patch
|
||||||
|
'@lion/pagination': patch
|
||||||
|
'providence-analytics': patch
|
||||||
|
'@lion/radio-group': patch
|
||||||
|
'@lion/steps': patch
|
||||||
|
'@lion/switch': patch
|
||||||
|
'@lion/textarea': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix type imports to reuse lion where possible, in case Lit updates with new types that may break us.
|
||||||
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
|
|
@ -24,23 +24,20 @@ jobs:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: Install npm 7
|
- name: Get yarn cache directory
|
||||||
run: npm i -g npm@7
|
id: yarn-cache-dir
|
||||||
|
|
||||||
- name: Get npm cache directory
|
|
||||||
id: npm-cache-dir
|
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir.outputs.dir }}
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-npm-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
- name: Create Release Pull Request or Publish to npm
|
- name: Create Release Pull Request or Publish to npm
|
||||||
id: changesets
|
id: changesets
|
||||||
|
|
|
||||||
57
.github/workflows/verify.yml
vendored
57
.github/workflows/verify.yml
vendored
|
|
@ -14,23 +14,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
|
|
||||||
- name: Install npm 7
|
- name: Get yarn cache directory
|
||||||
run: npm i -g npm@7
|
id: yarn-cache-dir
|
||||||
|
|
||||||
- name: Get npm cache directory
|
|
||||||
id: npm-cache-dir
|
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir.outputs.dir }}
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-npm-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
@ -49,23 +46,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
|
|
||||||
- name: Install npm 7
|
- name: Get yarn cache directory
|
||||||
run: npm i -g npm@7
|
id: yarn-cache-dir
|
||||||
|
|
||||||
- name: Get npm cache directory
|
|
||||||
id: npm-cache-dir
|
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir.outputs.dir }}
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-npm-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
- uses: microsoft/playwright-github-action@v1
|
- uses: microsoft/playwright-github-action@v1
|
||||||
|
|
||||||
|
|
@ -86,23 +80,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install npm 7
|
- name: Get yarn cache directory
|
||||||
run: npm i -g npm@7
|
id: yarn-cache-dir
|
||||||
|
|
||||||
- name: Get npm cache directory
|
|
||||||
id: npm-cache-dir
|
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir.outputs.dir }}
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-npm-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm run test:node
|
run: npm run test:node
|
||||||
|
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -12,8 +12,8 @@ node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|
||||||
# we prefer package-lock.json
|
# we use yarn.lock for now until npm 7 is stable
|
||||||
/yarn.lock
|
/package-lock.json
|
||||||
|
|
||||||
## build artifacts
|
## build artifacts
|
||||||
/lib/
|
/lib/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ module.exports = {
|
||||||
"markdownlint --ignore '{.github/**/*.md,.changeset/*.md,**/CHANGELOG.md}'",
|
"markdownlint --ignore '{.github/**/*.md,.changeset/*.md,**/CHANGELOG.md}'",
|
||||||
'git add',
|
'git add',
|
||||||
],
|
],
|
||||||
'package-lock.json': ['node ./scripts/package-lock-scan.js'],
|
'yarn.lock': ['node ./scripts/yarn-lock-scan.js'],
|
||||||
'*package.json': absolutePaths => {
|
'*package.json': absolutePaths => {
|
||||||
const sortPackages = [];
|
const sortPackages = [];
|
||||||
absolutePaths.forEach(p => {
|
absolutePaths.forEach(p => {
|
||||||
|
|
|
||||||
|
|
@ -19,19 +19,13 @@ git clone https://github.com/ing-bank/lion.git
|
||||||
cd lion
|
cd lion
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
npm install
|
yarn
|
||||||
|
|
||||||
# Create a branch for your changes
|
# Create a branch for your changes
|
||||||
git checkout -b fix/buttonSize
|
git checkout -b fix/buttonSize
|
||||||
```
|
```
|
||||||
|
|
||||||
> Requires NPM v7 at least, since we use workspaces.
|
> Requires to use yarn for now, since we use workspaces, and NPM 7 is still too buggy
|
||||||
|
|
||||||
To install NPM 7:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm i -g npm@7
|
|
||||||
```
|
|
||||||
|
|
||||||
Make sure everything works as expected:
|
Make sure everything works as expected:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ For some more details see the [announcement blog post](https://medium.com/ing-bl
|
||||||
|
|
||||||
We do have a [live Storybook](http://lion-web-components.netlify.com) which shows all our components.
|
We do have a [live Storybook](http://lion-web-components.netlify.com) which shows all our components.
|
||||||
|
|
||||||
|
**Please note:** This project uses Yarn [Workspaces](https://classic.yarnpkg.com/en/docs/workspaces). If you want to run all demos locally you need to get [Yarn](https://classic.yarnpkg.com/en/docs/install) and install all dependencies by executing `yarn install`.
|
||||||
|
|
||||||
The code examples make use of [Javascript tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) which are a key component of the [lit-html engine](https://lit-html.polymer-project.org/) used in Lion.
|
The code examples make use of [Javascript tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) which are a key component of the [lit-html engine](https://lit-html.polymer-project.org/) used in Lion.
|
||||||
Additionally imports like `import '@lion/form/lion-form.js'` need to be transformed somehow, for example by [es-dev-server](https://open-wc.org/developing/es-dev-server.html#node-resolve).
|
Additionally imports like `import '@lion/form/lion-form.js'` need to be transformed somehow, for example by [es-dev-server](https://open-wc.org/developing/es-dev-server.html#node-resolve).
|
||||||
|
|
||||||
|
|
@ -142,6 +144,7 @@ Lion Web Components aims to be future proof and use well-supported proven techno
|
||||||
|
|
||||||
- [lit-html](https://lit-html.polymer-project.org) and [lit-element](https://lit-element.polymer-project.org)
|
- [lit-html](https://lit-html.polymer-project.org) and [lit-element](https://lit-element.polymer-project.org)
|
||||||
- [npm](http://npmjs.com)
|
- [npm](http://npmjs.com)
|
||||||
|
- [yarn](https://yarnpkg.com)
|
||||||
- [open-wc](https://open-wc.org)
|
- [open-wc](https://open-wc.org)
|
||||||
- [Karma](https://karma-runner.github.io)
|
- [Karma](https://karma-runner.github.io)
|
||||||
- [Mocha](https://mochajs.org)
|
- [Mocha](https://mochajs.org)
|
||||||
|
|
|
||||||
|
|
@ -94,13 +94,11 @@ Inside ING, our design system also makes use of this providence tool to create t
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"upgrade:lion": "npx update-by-scope @lion && npm run providence:extend",
|
"upgrade:lion": "yarn upgrade --scope @lion --latest --exact && npm run providence:extend",
|
||||||
"providence:extend": "providence extend-docs -r 'node_modules/@lion/*' --prefix-from lion --prefix-to ing"
|
"providence:extend": "providence extend-docs -r 'node_modules/@lion/*' --prefix-from lion --prefix-to ing"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note that if you want to fix your lion versions, you have to do this manually or write your own script for updating by scope. `update-by-scope` does not support passing `--save-exact` flag sadly (or any flag for that matter).
|
|
||||||
|
|
||||||
### Replacing paths & template tagnames
|
### Replacing paths & template tagnames
|
||||||
|
|
||||||
Now that we have a JSON file with all the information we need to know about to replace import paths and tagnames inside templates, we can start transforming the `LionTabs` documentation to `LeaTabs` documentation.
|
Now that we have a JSON file with all the information we need to know about to replace import paths and tagnames inside templates, we can start transforming the `LionTabs` documentation to `LeaTabs` documentation.
|
||||||
|
|
|
||||||
45934
package-lock.json
generated
45934
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -77,7 +77,7 @@
|
||||||
"rimraf": "^2.6.3",
|
"rimraf": "^2.6.3",
|
||||||
"rollup": "^2.0.0",
|
"rollup": "^2.0.0",
|
||||||
"sinon": "^7.2.2",
|
"sinon": "^7.2.2",
|
||||||
"typescript": "^3.8.3",
|
"typescript": "3.9.7",
|
||||||
"web-component-analyzer": "^1.0.3",
|
"web-component-analyzer": "^1.0.3",
|
||||||
"webpack-merge": "^4.1.5",
|
"webpack-merge": "^4.1.5",
|
||||||
"whatwg-fetch": "^3.0.0"
|
"whatwg-fetch": "^3.0.0"
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ export class LionAccordion extends LitElement {
|
||||||
if (!(this.__store && this.__store[this.focusedIndex])) {
|
if (!(this.__store && this.__store[this.focusedIndex])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const previousInvoker = /** @type {HTMLElement | null} */ (Array.from(this.children).find(
|
const previousInvoker = /** @type {HTMLElement | undefined} */ (Array.from(this.children).find(
|
||||||
child => child.slot === 'invoker' && child.firstElementChild?.hasAttribute('focused'),
|
child => child.slot === 'invoker' && child.firstElementChild?.hasAttribute('focused'),
|
||||||
));
|
));
|
||||||
if (previousInvoker) {
|
if (previousInvoker) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { CalendarObject, DayObject } from '../test-helpers.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionCalendar').LionCalendar} LionCalendar
|
* @typedef {import('../src/LionCalendar').LionCalendar} LionCalendar
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCalendar>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCalendar>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import '../lion-checkbox.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionCheckboxGroup').LionCheckboxGroup} LionCheckboxGroup
|
* @typedef {import('../src/LionCheckboxGroup').LionCheckboxGroup} LionCheckboxGroup
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCheckboxGroup>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCheckboxGroup>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import '../lion-collapsible.js';
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* @typedef {import('../src/LionCollapsible').LionCollapsible} LionCollapsible
|
* @typedef {import('../src/LionCollapsible').LionCollapsible} LionCollapsible
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCollapsible>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionCollapsible>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {DelegateMixin}
|
* @type {DelegateMixin}
|
||||||
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit-element').LitElement>} superclass
|
* @param {import('@open-wc/dedupe-mixin').Constructor<import('../index').LitElement>} superclass
|
||||||
*/
|
*/
|
||||||
const DelegateMixinImplementation = superclass =>
|
const DelegateMixinImplementation = superclass =>
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {DisabledMixin}
|
* @type {DisabledMixin}
|
||||||
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit-element').LitElement>} superclass
|
* @param {import('@open-wc/dedupe-mixin').Constructor<import('../index').LitElement>} superclass
|
||||||
*/
|
*/
|
||||||
const DisabledMixinImplementation = superclass =>
|
const DisabledMixinImplementation = superclass =>
|
||||||
// eslint-disable-next-line no-shadow
|
// eslint-disable-next-line no-shadow
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { DisabledMixin } from './DisabledMixin.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {DisabledWithTabIndexMixin}
|
* @type {DisabledWithTabIndexMixin}
|
||||||
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit-element').LitElement>} superclass
|
* @param {import('@open-wc/dedupe-mixin').Constructor<import('../index').LitElement>} superclass
|
||||||
*/
|
*/
|
||||||
const DisabledWithTabIndexMixinImplementation = superclass =>
|
const DisabledWithTabIndexMixinImplementation = superclass =>
|
||||||
// eslint-disable-next-line no-shadow
|
// eslint-disable-next-line no-shadow
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import '../lion-dialog.js';
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* @typedef {import('../src/LionDialog').LionDialog} LionDialog
|
* @typedef {import('../src/LionDialog').LionDialog} LionDialog
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionDialog>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionDialog>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { html, LitElement } from '@lion/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../validate/Validator').Validator} Validator
|
* @typedef {import('../validate/Validator').Validator} Validator
|
||||||
*
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
* @typedef {Object} messageMap
|
* @typedef {Object} messageMap
|
||||||
* @property {string | Node} message
|
* @property {string | Node} message
|
||||||
* @property {string} type
|
* @property {string} type
|
||||||
|
|
@ -23,7 +23,7 @@ export class LionValidationFeedback extends LitElement {
|
||||||
/**
|
/**
|
||||||
* @overridable
|
* @overridable
|
||||||
* @param {Object} opts
|
* @param {Object} opts
|
||||||
* @param {string | Node} opts.message message or feedback node
|
* @param {string | Node | TemplateResult } opts.message message or feedback node or TemplateResult
|
||||||
* @param {string} [opts.type]
|
* @param {string} [opts.type]
|
||||||
* @param {Validator} [opts.validator]
|
* @param {Validator} [opts.validator]
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import '../lion-form.js';
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* @typedef {import('../src/LionForm').LionForm} LionForm
|
* @typedef {import('../src/LionForm').LionForm} LionForm
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionForm>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionForm>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { render } from '@lion/core';
|
||||||
* Helper to render a lit TemplateResult as an offline-created DOM node
|
* Helper to render a lit TemplateResult as an offline-created DOM node
|
||||||
* Make sure that the top-most element in the template has no siblings,
|
* Make sure that the top-most element in the template has no siblings,
|
||||||
* as they won't be taken into account. We only return firstElementChild.
|
* as they won't be taken into account. We only return firstElementChild.
|
||||||
* @param {import('lit-html').TemplateResult} litHtmlTemplate
|
* @param {import('@lion/core').TemplateResult} litHtmlTemplate
|
||||||
*/
|
*/
|
||||||
export const renderLitAsNode = litHtmlTemplate => {
|
export const renderLitAsNode = litHtmlTemplate => {
|
||||||
const offlineRenderContainer = document.createElement('div');
|
const offlineRenderContainer = document.createElement('div');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { css, html, LitElement, render } from '@lion/core';
|
import { css, html, LitElement, render } from '@lion/core';
|
||||||
|
|
||||||
/** @typedef {import('lit-html').TemplateResult} TemplateResult */
|
/** @typedef {import('@lion/core').TemplateResult} TemplateResult */
|
||||||
|
|
||||||
export class SbActionLogger extends LitElement {
|
export class SbActionLogger extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import '../../sb-action-logger.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/SbActionLogger').SbActionLogger} SbActionLogger
|
* @typedef {import('../src/SbActionLogger').SbActionLogger} SbActionLogger
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<SbActionLogger>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<SbActionLogger>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
* @typedef {import('lit-html').nothing} nothing
|
* @typedef {import('@lion/core').nothing} nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export class IconManager {
|
export class IconManager {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import heartSvg from './heart.svg.js';
|
||||||
/**
|
/**
|
||||||
* @typedef {(strings: TemplateStringsArray, ... expr: string[]) => string} TaggedTemplateLiteral
|
* @typedef {(strings: TemplateStringsArray, ... expr: string[]) => string} TaggedTemplateLiteral
|
||||||
* @typedef {import('../src/LionIcon').LionIcon} LionIcon
|
* @typedef {import('../src/LionIcon').LionIcon} LionIcon
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionIcon>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionIcon>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import { parseAmount } from './parsers.js';
|
||||||
* `LionInputAmount` is a class for an amount custom form element (`<lion-input-amount>`).
|
* `LionInputAmount` is a class for an amount custom form element (`<lion-input-amount>`).
|
||||||
*
|
*
|
||||||
* @customElement lion-input-amount
|
* @customElement lion-input-amount
|
||||||
* @extends {LionInput}
|
|
||||||
*/
|
*/
|
||||||
// @ts-expect-error false positive for incompatible static get properties. Lit-element merges super properties already for you.
|
// @ts-expect-error false positive for incompatible static get properties. Lit-element merges super properties already for you.
|
||||||
export class LionInputAmount extends LocalizeMixin(LionInput) {
|
export class LionInputAmount extends LocalizeMixin(LionInput) {
|
||||||
|
|
@ -43,7 +42,7 @@ export class LionInputAmount extends LocalizeMixin(LionInput) {
|
||||||
el.textContent = this.__currencyLabel;
|
el.textContent = this.__currencyLabel;
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
return null;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import '../lion-input-date.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionInputDate').LionInputDate} LionInputDate
|
* @typedef {import('../src/LionInputDate').LionInputDate} LionInputDate
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionInputDate>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionInputDate>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export class LionInputDatepicker extends ScopedElementsMixin(
|
||||||
eventContext: this,
|
eventContext: this,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return renderParent.firstElementChild;
|
return /** @type {HTMLElement} */ (renderParent.firstElementChild);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { LionInputDatepicker } from '../src/LionInputDatepicker.js';
|
||||||
import { DatepickerInputObject } from '../test-helpers.js';
|
import { DatepickerInputObject } from '../test-helpers.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionInputDatepicker>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionInputDatepicker>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import '../lion-input-email.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionInputEmail').LionInputEmail} LionInputEmail
|
* @typedef {import('../src/LionInputEmail').LionInputEmail} LionInputEmail
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputEmail>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputEmail>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import '../lion-input-iban.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionInputIban').LionInputIban} LionInputIban
|
* @typedef {import('../src/LionInputIban').LionInputIban} LionInputIban
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputIban>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputIban>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { LionInput } from '@lion/input';
|
||||||
import { formatNumber, LocalizeMixin } from '@lion/localize';
|
import { formatNumber, LocalizeMixin } from '@lion/localize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('lit-element').CSSResult} CSSResult
|
* @typedef {import('@lion/core').CSSResult} CSSResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -53,6 +53,10 @@ export class LionInputRange extends LocalizeMixin(LionInput) {
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get _inputNode() {
|
||||||
|
return /** @type {HTMLInputElement} */ (super._inputNode);
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.min = Infinity;
|
this.min = Infinity;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import '../lion-input-range.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionInputRange').LionInputRange} LionInputRange
|
* @typedef {import('../src/LionInputRange').LionInputRange} LionInputRange
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputRange>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputRange>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { IsNumber, MinNumber, MaxNumber } from '@lion/form-core';
|
||||||
*
|
*
|
||||||
* @customElement lion-input-stepper
|
* @customElement lion-input-stepper
|
||||||
*/
|
*/
|
||||||
// @ts-expect-error false positive for incompatible static get properties. Lit-element merges super properties already for you.
|
// @ts-expect-error false positive, lit-element already merges properties for you
|
||||||
export class LionInputStepper extends LionInput {
|
export class LionInputStepper extends LionInput {
|
||||||
static get styles() {
|
static get styles() {
|
||||||
return [
|
return [
|
||||||
|
|
@ -44,6 +44,10 @@ export class LionInputStepper extends LionInput {
|
||||||
return parseFloat(this.value) || 0;
|
return parseFloat(this.value) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get _inputNode() {
|
||||||
|
return /** @type {HTMLInputElement} */ (super._inputNode);
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
/** @param {string} modelValue */
|
/** @param {string} modelValue */
|
||||||
|
|
@ -253,7 +257,7 @@ export class LionInputStepper extends LionInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the decrementor button sign template
|
* Get the decrementor button sign template
|
||||||
* @returns {String|import('lit-element').TemplateResult}
|
* @returns {String|import('@lion/core').TemplateResult}
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line class-methods-use-this
|
// eslint-disable-next-line class-methods-use-this
|
||||||
_decrementorSignTemplate() {
|
_decrementorSignTemplate() {
|
||||||
|
|
@ -262,7 +266,7 @@ export class LionInputStepper extends LionInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the incrementor button sign template
|
* Get the incrementor button sign template
|
||||||
* @returns {String|import('lit-element').TemplateResult}
|
* @returns {String|import('@lion/core').TemplateResult}
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line class-methods-use-this
|
// eslint-disable-next-line class-methods-use-this
|
||||||
_incrementorSignTemplate() {
|
_incrementorSignTemplate() {
|
||||||
|
|
@ -271,7 +275,7 @@ export class LionInputStepper extends LionInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the increment button template
|
* Get the increment button template
|
||||||
* @returns {import('lit-element').TemplateResult}
|
* @returns {import('@lion/core').TemplateResult}
|
||||||
*/
|
*/
|
||||||
_decrementorTemplate() {
|
_decrementorTemplate() {
|
||||||
return html`
|
return html`
|
||||||
|
|
@ -289,7 +293,7 @@ export class LionInputStepper extends LionInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the decrement button template
|
* Get the decrement button template
|
||||||
* @returns {import('lit-element').TemplateResult}
|
* @returns {import('@lion/core').TemplateResult}
|
||||||
*/
|
*/
|
||||||
_incrementorTemplate() {
|
_incrementorTemplate() {
|
||||||
return html`
|
return html`
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import '../lion-input-stepper.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionInputStepper').LionInputStepper} LionInputStepper
|
* @typedef {import('../src/LionInputStepper').LionInputStepper} LionInputStepper
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputStepper>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionInputStepper>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import '../lion-listbox.js';
|
||||||
* @typedef {import('../src/LionListbox').LionListbox} LionListbox
|
* @typedef {import('../src/LionListbox').LionListbox} LionListbox
|
||||||
* @typedef {import('../src/LionOption').LionOption} LionOption
|
* @typedef {import('../src/LionOption').LionOption} LionOption
|
||||||
* @typedef {import('@lion/select-rich').LionSelectInvoker} LionSelectInvoker
|
* @typedef {import('@lion/select-rich').LionSelectInvoker} LionSelectInvoker
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionListbox>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionListbox>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { LitElement, html, css } from '@lion/core';
|
||||||
import { LocalizeMixin } from '@lion/localize';
|
import { LocalizeMixin } from '@lion/localize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import '../lion-pagination.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionPagination').LionPagination} LionPagination
|
* @typedef {import('../src/LionPagination').LionPagination} LionPagination
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionPagination>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionPagination>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
"@babel/traverse": "^7.5.5",
|
"@babel/traverse": "^7.5.5",
|
||||||
"@babel/types": "^7.9.0",
|
"@babel/types": "^7.9.0",
|
||||||
"@rollup/plugin-node-resolve": "^7.1.1",
|
"@rollup/plugin-node-resolve": "^7.1.1",
|
||||||
"@typescript-eslint/typescript-estree": "^2.0.0",
|
"@typescript-eslint/typescript-estree": "^3.0.0",
|
||||||
"anymatch": "^3.1.1",
|
"anymatch": "^3.1.1",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
"commander": "^2.20.0",
|
"commander": "^2.20.0",
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
"parse5": "^5.1.1",
|
"parse5": "^5.1.1",
|
||||||
"read-package-tree": "5.3.1",
|
"read-package-tree": "5.3.1",
|
||||||
"semver": "^7.1.3",
|
"semver": "^7.1.3",
|
||||||
"typescript": "^3.8.3"
|
"typescript": "3.9.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mermaid": "^8.2.6",
|
"mermaid": "^8.2.6",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import '../lion-radio.js';
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionRadioGroup').LionRadioGroup} LionRadioGroup
|
* @typedef {import('../src/LionRadioGroup').LionRadioGroup} LionRadioGroup
|
||||||
* @typedef {import('../src/LionRadio').LionRadio} LionRadio
|
* @typedef {import('../src/LionRadio').LionRadio} LionRadio
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionRadioGroup>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionRadioGroup>} */ (_fixture);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import '../lion-steps.js';
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionSteps').LionSteps} LionSteps
|
* @typedef {import('../src/LionSteps').LionSteps} LionSteps
|
||||||
* @typedef {import('../src/LionStep').LionStep} LionStep
|
* @typedef {import('../src/LionStep').LionStep} LionStep
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
* @typedef {{[key: string]: ?}} UnknownData
|
* @typedef {{[key: string]: ?}} UnknownData
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import '../lion-switch-button.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionSwitchButton').LionSwitchButton} LionSwitchButton
|
* @typedef {import('../src/LionSwitchButton').LionSwitchButton} LionSwitchButton
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionSwitchButton>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionSwitchButton>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import '../lion-switch.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionSwitch').LionSwitch} LionSwitch
|
* @typedef {import('../src/LionSwitch').LionSwitch} LionSwitch
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult) => Promise<LionSwitch>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult) => Promise<LionSwitch>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import '../lion-textarea.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../src/LionTextarea').LionTextarea} LionTextarea
|
* @typedef {import('../src/LionTextarea').LionTextarea} LionTextarea
|
||||||
* @typedef {import('lit-html').TemplateResult} TemplateResult
|
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionTextarea>} */ (_fixture);
|
const fixture = /** @type {(arg: TemplateResult|string) => Promise<LionTextarea>} */ (_fixture);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
const packageLockPath = './package-lock.json';
|
|
||||||
const data = fs.readFileSync(path.resolve(packageLockPath), 'utf8');
|
|
||||||
if (data.match(/artifactory/g)) {
|
|
||||||
throw new Error(
|
|
||||||
'Artifactory references in your package-lock.json! Please make sure you are using a public npm registry when downloading your dependencies!',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
10
scripts/yarn-lock-scan.js
Normal file
10
scripts/yarn-lock-scan.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const yarnLockPath = './yarn.lock';
|
||||||
|
const data = fs.readFileSync(path.resolve(yarnLockPath), 'utf8');
|
||||||
|
if (data.match(/artifactory/g)) {
|
||||||
|
throw new Error(
|
||||||
|
'Artifactory references in your yarn.lock! Please make sure you are using a public npm registry when downloading your dependencies!',
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue