@digital-realty/ix-textbox 2.0.5 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +68 -68
- package/dist/src/IxTextbox.d.ts +111 -111
- package/dist/src/IxTextbox.js +250 -250
- package/dist/src/IxTextbox.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ix-textbox-styles.d.ts +1 -1
- package/dist/src/ix-textbox-styles.js +58 -58
- package/dist/src/ix-textbox-styles.js.map +1 -1
- package/dist/src/ix-textbox.d.ts +1 -1
- package/dist/src/ix-textbox.js +2 -2
- package/dist/src/ix-textbox.js.map +1 -1
- package/dist/src/react/IxTextbox.d.ts +2 -2
- package/dist/src/react/IxTextbox.js +9 -9
- package/dist/src/react/IxTextbox.js.map +1 -1
- package/dist/src/types/index.d.ts +14 -14
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/test/ix-textbox.test.d.ts +1 -1
- package/dist/test/ix-textbox.test.js +22 -22
- package/dist/test/ix-textbox.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -94
- package/src/IxTextbox.ts +216 -216
- package/src/index.ts +1 -1
- package/src/ix-textbox-styles.ts +59 -59
- package/src/ix-textbox.ts +3 -3
- package/src/react/IxTextbox.ts +11 -11
- package/src/types/index.ts +29 -29
- package/test/ix-textbox.test.ts +32 -32
- package/tsconfig.json +22 -22
- package/web-dev-server.config.mjs +27 -27
- package/web-test-runner.config.mjs +43 -41
package/src/ix-textbox-styles.ts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
|
|
3
|
-
export const IxTextboxStyles = css`
|
|
4
|
-
:host {
|
|
5
|
-
display: block;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
:host([hidden]) {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
input {
|
|
13
|
-
display: block;
|
|
14
|
-
width: 100%;
|
|
15
|
-
padding: 0.5em;
|
|
16
|
-
font-size: 1rem;
|
|
17
|
-
line-height: 1.25rem;
|
|
18
|
-
border: 1px solid lightgrey;
|
|
19
|
-
background-repeat: no-repeat;
|
|
20
|
-
background-position: calc(100% - 0.5em) 50%;
|
|
21
|
-
border-radius: 3px;
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
input:focus {
|
|
26
|
-
outline: none;
|
|
27
|
-
box-shadow: 0 0 2px 1px rgba(0, 153, 204, 0.39),
|
|
28
|
-
0 0 4px 3px rgba(0, 153, 204, 0.18), 0 0 8px 4px rgba(0, 153, 204, 0.1);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
input:required.-is-valid {
|
|
32
|
-
border-color: #99ca3c;
|
|
33
|
-
background-image: url("data:image/svg+xml,%3Csvg width='19px' height='13px' viewBox='0 0 19 13' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cpolygon fill='%2399CA3C' points='6.70967742 13 0 6.29032258 2.09677419 4.19354839 6.70967742 8.80645161 16.3548387 0 18.4516129 2.09677419'%3E%3C/polygon%3E %3C/svg%3E");
|
|
34
|
-
padding-right: 2em;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
input:required.-is-invalid {
|
|
38
|
-
border-color: #e3097c;
|
|
39
|
-
background-image: url("data:image/svg+xml,%3Csvg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cpolygon id='Path' fill='%23E3097C' points='12.759145 0.0312229203 14.8804653 2.15254326 9.57716447 7.45584412 14.8804653 12.759145 12.759145 14.8804653 7.45584412 9.57716447 2.15254326 14.8804653 0.0312229203 12.759145 5.33452378 7.45584412 0.0312229203 2.15254326 2.15254326 0.0312229203 7.45584412 5.33452378'%3E%3C/polygon%3E %3C/svg%3E");
|
|
40
|
-
padding-right: 2em;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
input[type='search'] {
|
|
44
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CclipPath id='clip-path'%3E%3Cpath id='Path_46' data-name='Path 46' d='M17.835-27.347l5.506,5.506a2.249,2.249,0,0,1,0,3.182,2.249,2.249,0,0,1-3.182,0h0l-5.506-5.506a10.6,10.6,0,0,0,3.182-3.182ZM9-42a9,9,0,0,1,9,9,9,9,0,0,1-9,9,9,9,0,0,1-9-9A9,9,0,0,1,9-42Zm0,2.25A6.757,6.757,0,0,0,2.25-33,6.757,6.757,0,0,0,9-26.25,6.757,6.757,0,0,0,15.75-33,6.758,6.758,0,0,0,9-39.75Zm0,1.5v1.5A3.754,3.754,0,0,0,5.25-33H3.75A5.256,5.256,0,0,1,9-38.25Z' transform='translate(0 42)' fill='%23d8d8d8' clip-rule='evenodd'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg id='icon_search' data-name='icon search' clip-path='url(%23clip-path)'%3E%3Cpath id='Path_45' data-name='Path 45' d='M-1-43H24.363v25.363H-1Z' transform='translate(0.429 42.429)' fill='%23d8d8d8'/%3E%3C/g%3E%3C/svg%3E%0A");
|
|
45
|
-
background-position: 0.5em 50%;
|
|
46
|
-
padding-left: 2.25rem;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
input:disabled {
|
|
50
|
-
border-width: 0 0 1px;
|
|
51
|
-
color: #595959;
|
|
52
|
-
border-color: lightgrey;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
input:not([type='search']):disabled {
|
|
56
|
-
background-image: none;
|
|
57
|
-
padding-left: 0;
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export const IxTextboxStyles = css`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host([hidden]) {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
input {
|
|
13
|
+
display: block;
|
|
14
|
+
width: 100%;
|
|
15
|
+
padding: 0.5em;
|
|
16
|
+
font-size: 1rem;
|
|
17
|
+
line-height: 1.25rem;
|
|
18
|
+
border: 1px solid lightgrey;
|
|
19
|
+
background-repeat: no-repeat;
|
|
20
|
+
background-position: calc(100% - 0.5em) 50%;
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input:focus {
|
|
26
|
+
outline: none;
|
|
27
|
+
box-shadow: 0 0 2px 1px rgba(0, 153, 204, 0.39),
|
|
28
|
+
0 0 4px 3px rgba(0, 153, 204, 0.18), 0 0 8px 4px rgba(0, 153, 204, 0.1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
input:required.-is-valid {
|
|
32
|
+
border-color: #99ca3c;
|
|
33
|
+
background-image: url("data:image/svg+xml,%3Csvg width='19px' height='13px' viewBox='0 0 19 13' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cpolygon fill='%2399CA3C' points='6.70967742 13 0 6.29032258 2.09677419 4.19354839 6.70967742 8.80645161 16.3548387 0 18.4516129 2.09677419'%3E%3C/polygon%3E %3C/svg%3E");
|
|
34
|
+
padding-right: 2em;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
input:required.-is-invalid {
|
|
38
|
+
border-color: #e3097c;
|
|
39
|
+
background-image: url("data:image/svg+xml,%3Csvg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cpolygon id='Path' fill='%23E3097C' points='12.759145 0.0312229203 14.8804653 2.15254326 9.57716447 7.45584412 14.8804653 12.759145 12.759145 14.8804653 7.45584412 9.57716447 2.15254326 14.8804653 0.0312229203 12.759145 5.33452378 7.45584412 0.0312229203 2.15254326 2.15254326 0.0312229203 7.45584412 5.33452378'%3E%3C/polygon%3E %3C/svg%3E");
|
|
40
|
+
padding-right: 2em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
input[type='search'] {
|
|
44
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CclipPath id='clip-path'%3E%3Cpath id='Path_46' data-name='Path 46' d='M17.835-27.347l5.506,5.506a2.249,2.249,0,0,1,0,3.182,2.249,2.249,0,0,1-3.182,0h0l-5.506-5.506a10.6,10.6,0,0,0,3.182-3.182ZM9-42a9,9,0,0,1,9,9,9,9,0,0,1-9,9,9,9,0,0,1-9-9A9,9,0,0,1,9-42Zm0,2.25A6.757,6.757,0,0,0,2.25-33,6.757,6.757,0,0,0,9-26.25,6.757,6.757,0,0,0,15.75-33,6.758,6.758,0,0,0,9-39.75Zm0,1.5v1.5A3.754,3.754,0,0,0,5.25-33H3.75A5.256,5.256,0,0,1,9-38.25Z' transform='translate(0 42)' fill='%23d8d8d8' clip-rule='evenodd'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg id='icon_search' data-name='icon search' clip-path='url(%23clip-path)'%3E%3Cpath id='Path_45' data-name='Path 45' d='M-1-43H24.363v25.363H-1Z' transform='translate(0.429 42.429)' fill='%23d8d8d8'/%3E%3C/g%3E%3C/svg%3E%0A");
|
|
45
|
+
background-position: 0.5em 50%;
|
|
46
|
+
padding-left: 2.25rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
input:disabled {
|
|
50
|
+
border-width: 0 0 1px;
|
|
51
|
+
color: #595959;
|
|
52
|
+
border-color: lightgrey;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
input:not([type='search']):disabled {
|
|
56
|
+
background-image: none;
|
|
57
|
+
padding-left: 0;
|
|
58
|
+
}
|
|
59
|
+
`;
|
package/src/ix-textbox.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IxTextbox } from './IxTextbox.js';
|
|
2
|
-
|
|
3
|
-
window.customElements.define('ix-textbox', IxTextbox);
|
|
1
|
+
import { IxTextbox } from './IxTextbox.js';
|
|
2
|
+
|
|
3
|
+
window.customElements.define('ix-textbox', IxTextbox);
|
package/src/react/IxTextbox.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createComponent } from '@lit-labs/react';
|
|
3
|
-
import { IxTextbox as LitComp } from '../IxTextbox.js';
|
|
4
|
-
|
|
5
|
-
window.customElements.define('ix-textbox', LitComp);
|
|
6
|
-
|
|
7
|
-
export const IxTextbox = createComponent({
|
|
8
|
-
tagName: 'ix-textbox',
|
|
9
|
-
elementClass: LitComp,
|
|
10
|
-
react: React,
|
|
11
|
-
});
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit-labs/react';
|
|
3
|
+
import { IxTextbox as LitComp } from '../IxTextbox.js';
|
|
4
|
+
|
|
5
|
+
window.customElements.define('ix-textbox', LitComp);
|
|
6
|
+
|
|
7
|
+
export const IxTextbox = createComponent({
|
|
8
|
+
tagName: 'ix-textbox',
|
|
9
|
+
elementClass: LitComp,
|
|
10
|
+
react: React,
|
|
11
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Input types that are compatible with the text field.
|
|
3
|
-
*/
|
|
4
|
-
export type TextFieldType =
|
|
5
|
-
| 'email'
|
|
6
|
-
| 'number'
|
|
7
|
-
| 'password'
|
|
8
|
-
| 'search'
|
|
9
|
-
| 'tel'
|
|
10
|
-
| 'text'
|
|
11
|
-
| 'url'
|
|
12
|
-
| 'textarea';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Input types that are not fully supported for the text field.
|
|
16
|
-
*/
|
|
17
|
-
export type UnsupportedTextFieldType =
|
|
18
|
-
| 'color'
|
|
19
|
-
| 'date'
|
|
20
|
-
| 'datetime-local'
|
|
21
|
-
| 'file'
|
|
22
|
-
| 'month'
|
|
23
|
-
| 'time'
|
|
24
|
-
| 'week';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The event that is fired when the text field's value changes.
|
|
28
|
-
*/
|
|
29
|
-
export type TextChangeEvent = CustomEvent<{ value: string }>;
|
|
1
|
+
/**
|
|
2
|
+
* Input types that are compatible with the text field.
|
|
3
|
+
*/
|
|
4
|
+
export type TextFieldType =
|
|
5
|
+
| 'email'
|
|
6
|
+
| 'number'
|
|
7
|
+
| 'password'
|
|
8
|
+
| 'search'
|
|
9
|
+
| 'tel'
|
|
10
|
+
| 'text'
|
|
11
|
+
| 'url'
|
|
12
|
+
| 'textarea';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Input types that are not fully supported for the text field.
|
|
16
|
+
*/
|
|
17
|
+
export type UnsupportedTextFieldType =
|
|
18
|
+
| 'color'
|
|
19
|
+
| 'date'
|
|
20
|
+
| 'datetime-local'
|
|
21
|
+
| 'file'
|
|
22
|
+
| 'month'
|
|
23
|
+
| 'time'
|
|
24
|
+
| 'week';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The event that is fired when the text field's value changes.
|
|
28
|
+
*/
|
|
29
|
+
export type TextChangeEvent = CustomEvent<{ value: string }>;
|
package/test/ix-textbox.test.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
-
import { IxTextbox } from '../src/IxTextbox.js';
|
|
4
|
-
import '../src/ix-textbox.js';
|
|
5
|
-
|
|
6
|
-
describe('IxTextbox', () => {
|
|
7
|
-
it('should show the outlined text field by default', async () => {
|
|
8
|
-
const el = await fixture<IxTextbox>(html`<ix-textbox></ix-textbox>`);
|
|
9
|
-
console.log(el.innerHTML);
|
|
10
|
-
const outlinedTextField = el.shadowRoot?.querySelector(
|
|
11
|
-
'md-outlined-text-field'
|
|
12
|
-
);
|
|
13
|
-
const filledTextField = el.shadowRoot?.querySelector(
|
|
14
|
-
'md-filled-text-field'
|
|
15
|
-
);
|
|
16
|
-
expect(outlinedTextField).to.not.be.null;
|
|
17
|
-
expect(filledTextField).to.be.null;
|
|
18
|
-
});
|
|
19
|
-
it('should show the filled text field when outlined is false', async () => {
|
|
20
|
-
const el = await fixture<IxTextbox>(
|
|
21
|
-
html`<ix-textbox .outlined=${false}></ix-textbox>`
|
|
22
|
-
);
|
|
23
|
-
const outlinedTextField = el.shadowRoot?.querySelector(
|
|
24
|
-
'md-outlined-text-field'
|
|
25
|
-
);
|
|
26
|
-
const filledTextField = el.shadowRoot?.querySelector(
|
|
27
|
-
'md-filled-text-field'
|
|
28
|
-
);
|
|
29
|
-
expect(outlinedTextField).to.be.null;
|
|
30
|
-
expect(filledTextField).to.not.be.null;
|
|
31
|
-
});
|
|
32
|
-
});
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
+
import { IxTextbox } from '../src/IxTextbox.js';
|
|
4
|
+
import '../src/ix-textbox.js';
|
|
5
|
+
|
|
6
|
+
describe('IxTextbox', () => {
|
|
7
|
+
it('should show the outlined text field by default', async () => {
|
|
8
|
+
const el = await fixture<IxTextbox>(html`<ix-textbox></ix-textbox>`);
|
|
9
|
+
console.log(el.innerHTML);
|
|
10
|
+
const outlinedTextField = el.shadowRoot?.querySelector(
|
|
11
|
+
'md-outlined-text-field'
|
|
12
|
+
);
|
|
13
|
+
const filledTextField = el.shadowRoot?.querySelector(
|
|
14
|
+
'md-filled-text-field'
|
|
15
|
+
);
|
|
16
|
+
expect(outlinedTextField).to.not.be.null;
|
|
17
|
+
expect(filledTextField).to.be.null;
|
|
18
|
+
});
|
|
19
|
+
it('should show the filled text field when outlined is false', async () => {
|
|
20
|
+
const el = await fixture<IxTextbox>(
|
|
21
|
+
html`<ix-textbox .outlined=${false}></ix-textbox>`
|
|
22
|
+
);
|
|
23
|
+
const outlinedTextField = el.shadowRoot?.querySelector(
|
|
24
|
+
'md-outlined-text-field'
|
|
25
|
+
);
|
|
26
|
+
const filledTextField = el.shadowRoot?.querySelector(
|
|
27
|
+
'md-filled-text-field'
|
|
28
|
+
);
|
|
29
|
+
expect(outlinedTextField).to.be.null;
|
|
30
|
+
expect(filledTextField).to.not.be.null;
|
|
31
|
+
});
|
|
32
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2018",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": ["es2017", "dom"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": false,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"importHelpers": true,
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"inlineSources": true,
|
|
16
|
-
"rootDir": "./",
|
|
17
|
-
"declaration": true,
|
|
18
|
-
"incremental": true,
|
|
19
|
-
"noImplicitAny": false
|
|
20
|
-
},
|
|
21
|
-
"include": ["**/*.ts"]
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2018",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2017", "dom"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"rootDir": "./",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"incremental": true,
|
|
19
|
+
"noImplicitAny": false
|
|
20
|
+
},
|
|
21
|
+
"include": ["**/*.ts"]
|
|
22
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
-
|
|
3
|
-
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
-
const hmr = process.argv.includes('--hmr');
|
|
5
|
-
|
|
6
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
-
open: '/demo/',
|
|
8
|
-
/** Use regular watch mode if HMR is not enabled. */
|
|
9
|
-
watch: !hmr,
|
|
10
|
-
/** Resolve bare module imports */
|
|
11
|
-
nodeResolve: {
|
|
12
|
-
exportConditions: ['browser', 'development'],
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
-
// esbuildTarget: 'auto'
|
|
17
|
-
|
|
18
|
-
/** Set appIndex to enable SPA routing */
|
|
19
|
-
// appIndex: 'demo/index.html',
|
|
20
|
-
|
|
21
|
-
plugins: [
|
|
22
|
-
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
|
-
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
// See documentation for all available options
|
|
27
|
-
});
|
|
1
|
+
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
+
|
|
3
|
+
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
+
const hmr = process.argv.includes('--hmr');
|
|
5
|
+
|
|
6
|
+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
+
open: '/demo/',
|
|
8
|
+
/** Use regular watch mode if HMR is not enabled. */
|
|
9
|
+
watch: !hmr,
|
|
10
|
+
/** Resolve bare module imports */
|
|
11
|
+
nodeResolve: {
|
|
12
|
+
exportConditions: ['browser', 'development'],
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
+
// esbuildTarget: 'auto'
|
|
17
|
+
|
|
18
|
+
/** Set appIndex to enable SPA routing */
|
|
19
|
+
// appIndex: 'demo/index.html',
|
|
20
|
+
|
|
21
|
+
plugins: [
|
|
22
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
// See documentation for all available options
|
|
27
|
+
});
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
-
|
|
3
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
-
|
|
5
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
-
/** Test files to run */
|
|
7
|
-
files: 'dist/test/**/*.test.js',
|
|
8
|
-
|
|
9
|
-
/** Resolve bare module imports */
|
|
10
|
-
nodeResolve: {
|
|
11
|
-
exportConditions: ['browser', 'development'],
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
// playwrightLauncher({ product: '
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
1
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
+
|
|
3
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
+
|
|
5
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
+
/** Test files to run */
|
|
7
|
+
files: 'dist/test/**/*.test.js',
|
|
8
|
+
|
|
9
|
+
/** Resolve bare module imports */
|
|
10
|
+
nodeResolve: {
|
|
11
|
+
exportConditions: ['browser', 'development'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
port: 8019,
|
|
15
|
+
|
|
16
|
+
/** Filter out lit dev mode logs */
|
|
17
|
+
filterBrowserLogs(log) {
|
|
18
|
+
for (const arg of log.args) {
|
|
19
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
27
|
+
// esbuildTarget: 'auto',
|
|
28
|
+
|
|
29
|
+
/** Amount of browsers to run concurrently */
|
|
30
|
+
// concurrentBrowsers: 2,
|
|
31
|
+
|
|
32
|
+
/** Amount of test files per browser to test concurrently */
|
|
33
|
+
// concurrency: 1,
|
|
34
|
+
|
|
35
|
+
/** Browsers to run tests on */
|
|
36
|
+
// browsers: [
|
|
37
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
38
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
39
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
40
|
+
// ],
|
|
41
|
+
|
|
42
|
+
// See documentation for all available options
|
|
43
|
+
});
|