@dile/ui 3.17.1 → 3.18.1
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/components/steps/index.js +2 -0
- package/components/steps/src/DileStep.js +90 -0
- package/components/steps/src/DileSteps.js +171 -0
- package/components/steps/step.js +5 -0
- package/components/steps/steps.js +5 -0
- package/components/toast/src/DileToast.js +2 -1
- package/components/toast/src/DileToastPersistent.js +1 -1
- package/package.json +4 -4
- package/components/accordion/accordion.spec.js +0 -253
- package/components/app-drawer/app-drawer.spec.js +0 -262
- package/components/avatar/avatar.spec.js +0 -25
- package/components/bottom-nav/__screenshots__/bottom-nav.spec.js/dile-bottom-nav-places-the-sheet-and-the-overlay-above-the-bar-1.png +0 -0
- package/components/bottom-nav/bottom-nav.spec.js +0 -340
- package/components/box-selector/box-selector-item.spec.js +0 -27
- package/components/box-selector/box-selector.spec.js +0 -27
- package/components/breadcrumbs/breadcrumbs-item.spec.js +0 -28
- package/components/breadcrumbs/breadcrumbs.spec.js +0 -33
- package/components/button/button.spec.js +0 -234
- package/components/card/card-slide.spec.js +0 -30
- package/components/card/card.spec.js +0 -26
- package/components/checkbox/checkbox.spec.js +0 -235
- package/components/chip/chip.spec.js +0 -31
- package/components/color-picker/color-picker.spec.js +0 -133
- package/components/confirm/confirm.spec.js +0 -57
- package/components/confirm-text/confirm-text.spec.js +0 -29
- package/components/copy-markdown-url/copy-markdown-url.spec.js +0 -27
- package/components/copy-text/copy-text.spec.js +0 -38
- package/components/data-grid/__screenshots__/data-grid.spec.js/dile-data-grid-dispatches-item-checkbox-changed-and-dile-data-grid-item-selected-when-a-checkbox-is-toggled-1.png +0 -0
- package/components/data-grid/data-grid.spec.js +0 -421
- package/components/drop-file/drop-file.spec.js +0 -214
- package/components/drop-file/file-preview.spec.js +0 -35
- package/components/floating-feedback/floating-feedback.spec.js +0 -30
- package/components/floating-menu/floating-menu-item.spec.js +0 -27
- package/components/floating-menu/floating-menu.spec.js +0 -31
- package/components/form-separator/form-separator.spec.js +0 -28
- package/components/hamburger/hamburger.spec.js +0 -28
- package/components/icon/icon.spec.js +0 -31
- package/components/icon-switch/icon-switch-group.spec.js +0 -46
- package/components/icon-switch/icon-switch.spec.js +0 -35
- package/components/info-box/info-box.spec.js +0 -38
- package/components/inline-feedback/inline-feedback.spec.js +0 -46
- package/components/input/input-contact.spec.js +0 -32
- package/components/input/input-icon.spec.js +0 -166
- package/components/input/input-integer.spec.js +0 -31
- package/components/input/input-mask.spec.js +0 -314
- package/components/input/input-message.spec.js +0 -27
- package/components/input/input-money.spec.js +0 -30
- package/components/input/input-number-mask.spec.js +0 -48
- package/components/input/input-number.spec.js +0 -109
- package/components/input/input-percentage.spec.js +0 -31
- package/components/input/input-search.spec.js +0 -91
- package/components/input/input.spec.js +0 -47
- package/components/light-mode-switch/light-mode-switch.spec.js +0 -34
- package/components/menu-hamburger/menu-hamburger.spec.js +0 -34
- package/components/menu-overlay/menu-overlay.spec.js +0 -44
- package/components/message/message.spec.js +0 -42
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-closes-only-the-topmost-modal-when-Esc-is-pressed-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-dispatches-dile-modal-closed-and-animates-when-the-opened-property-is-set-to-false-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-does-not-close-a-blocking-modal-when-Esc-is-pressed-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-does-not-close-the-modal-below-when-the-topmost-modal-is-blocking-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-ignores-transitionend-events-coming-from-inner-elements-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-keeps-the-focus-on-content-focused-by-the-user-when-opening-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-opens-and-closes-through-the-opened-attribute-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-reflects-the-opened-property-to-the-attribute-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-releases-the-background-layer-after-the-close-animation-even-without-transitionend-1.png +0 -0
- package/components/modal/__screenshots__/modal.spec.js/dile-modal-releases-the-background-layer-immediately-when-the-animation-duration-is-0s-1.png +0 -0
- package/components/modal/modal-help.spec.js +0 -32
- package/components/modal/modal.spec.js +0 -250
- package/components/nav/nav.spec.js +0 -33
- package/components/number-picker/number-picker-element.spec.js +0 -30
- package/components/number-picker/number-picker.spec.js +0 -30
- package/components/order-switch/__screenshots__/order-switch.spec.js/dile-order-switch-clicking-the-label-re-announces-the-current-value-without-toggling-when-not-selected-1.png +0 -0
- package/components/order-switch/__screenshots__/order-switch.spec.js/dile-order-switch-clicking-the-label-toggles-the-order-when-selected-1.png +0 -0
- package/components/order-switch/__screenshots__/order-switch.spec.js/dile-order-switch-defaults-to-ascending-order-1.png +0 -0
- package/components/order-switch/order-switch.spec.js +0 -57
- package/components/otp-input/otp-input.spec.js +0 -41
- package/components/pages/pages.spec.js +0 -44
- package/components/password/password.spec.js +0 -35
- package/components/progress-bar/progress-bar.spec.js +0 -28
- package/components/radio-group/__screenshots__/radio-group-dialog.spec.js/dile-radio-group-dialog-renders-dialog-items-with-labels-and-values-1.png +0 -0
- package/components/radio-group/__screenshots__/radio-group-dialog.spec.js/dile-radio-group-dialog-renders-items-with-optional-description-1.png +0 -0
- package/components/radio-group/__screenshots__/radio-group-dialog.spec.js/dile-radio-group-dialog-updates-value-when-an-option-is-selected-1.png +0 -0
- package/components/radio-group/radio-group-dialog.spec.js +0 -126
- package/components/radio-group/radio-group.spec.js +0 -128
- package/components/radio-group/radio.spec.js +0 -32
- package/components/range/range.spec.js +0 -36
- package/components/rating/rating.spec.js +0 -34
- package/components/rating/star.spec.js +0 -30
- package/components/rating-scale-question/rating-scale-option.spec.js +0 -32
- package/components/rating-scale-question/rating-scale-question.spec.js +0 -35
- package/components/select/__screenshots__/select-search.spec.js/dile-select-search-Value-API-uses-the-label-as-accessible-name-of-the-selected-field-1.png +0 -0
- package/components/select/select-ajax-overlay.spec.js +0 -469
- package/components/select/select-overlay.spec.js +0 -612
- package/components/select/select-search.spec.js +0 -318
- package/components/select/select.spec.js +0 -574
- package/components/selector/selector-item.spec.js +0 -40
- package/components/selector/selector-overlay.spec.js +0 -139
- package/components/selector/selector.spec.js +0 -45
- package/components/slide-menu/slide-menu.spec.js +0 -38
- package/components/slide-show/slide-show.spec.js +0 -34
- package/components/social-icon/social-icon.spec.js +0 -26
- package/components/spinner/spinner-bar.spec.js +0 -26
- package/components/spinner/spinner-block.spec.js +0 -21
- package/components/spinner/spinner-horizontal.spec.js +0 -25
- package/components/spinner/spinner-icon.spec.js +0 -25
- package/components/spinner/spinner-modal.spec.js +0 -26
- package/components/spinner/spinner.spec.js +0 -26
- package/components/switch/switch.spec.js +0 -33
- package/components/tabs/tabs.spec.js +0 -85
- package/components/textarea/textarea.spec.js +0 -39
- package/components/time-picker/time-picker.spec.js +0 -26
- package/components/timer/timer.spec.js +0 -31
- package/components/toast/toast.spec.js +0 -86
- package/components/tooltip/chip-tooltip.spec.js +0 -29
- package/components/tooltip/tooltip.spec.js +0 -32
- package/components/web-visor/web-visor.spec.js +0 -32
- package/mixins/form/src/DileForm.spec.js +0 -29
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
-
import './toast.js';
|
|
3
|
-
|
|
4
|
-
describe('dile-toast', () => {
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
document.body.innerHTML = '';
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
async function renderToast(html) {
|
|
10
|
-
document.body.innerHTML = html;
|
|
11
|
-
const el = document.body.querySelector('dile-toast');
|
|
12
|
-
await el.updateComplete;
|
|
13
|
-
return el;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async function openAndGetItem(el, text, toastType) {
|
|
17
|
-
el.open(text, toastType);
|
|
18
|
-
await el.updateComplete;
|
|
19
|
-
const item = el.shadowRoot.querySelector('dile-toast-item');
|
|
20
|
-
await item.updateComplete;
|
|
21
|
-
return item;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function wait(ms) {
|
|
25
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
it('does not render a close icon by default', async () => {
|
|
29
|
-
const el = await renderToast('<dile-toast duration="10000"></dile-toast>');
|
|
30
|
-
const item = await openAndGetItem(el, 'Hello');
|
|
31
|
-
|
|
32
|
-
expect(item.shadowRoot.querySelector('.closeicon')).toBeNull();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('renders the message text and status class', async () => {
|
|
36
|
-
const el = await renderToast('<dile-toast duration="10000"></dile-toast>');
|
|
37
|
-
const item = await openAndGetItem(el, 'Saved!', 'success');
|
|
38
|
-
|
|
39
|
-
expect(item.shadowRoot.querySelector('.text').textContent.trim()).toBe('Saved!');
|
|
40
|
-
expect(item.shadowRoot.querySelector('div').classList.contains('success')).toBe(true);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('renders a close icon when showCloseIcon is set', async () => {
|
|
44
|
-
const el = await renderToast('<dile-toast duration="10000" showCloseIcon></dile-toast>');
|
|
45
|
-
const item = await openAndGetItem(el, 'Hello');
|
|
46
|
-
|
|
47
|
-
expect(item.shadowRoot.querySelector('dile-icon.closeicon')).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('closing a toast dispatches dile-toast-closed-by-user with the message detail', async () => {
|
|
51
|
-
const el = await renderToast('<dile-toast duration="10000" showCloseIcon></dile-toast>');
|
|
52
|
-
const item = await openAndGetItem(el, 'Dismiss me', 'error');
|
|
53
|
-
|
|
54
|
-
let detail = null;
|
|
55
|
-
el.addEventListener('dile-toast-closed-by-user', (e) => { detail = e.detail; });
|
|
56
|
-
|
|
57
|
-
item.shadowRoot.querySelector('dile-icon.closeicon').click();
|
|
58
|
-
await el.updateComplete;
|
|
59
|
-
|
|
60
|
-
expect(detail).toBeTruthy();
|
|
61
|
-
expect(detail.message.text).toBe('Dismiss me');
|
|
62
|
-
expect(detail.message.toastType).toBe('error');
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('removes the closed toast from the DOM shortly after, without waiting for its duration', async () => {
|
|
66
|
-
const el = await renderToast('<dile-toast duration="10000" showCloseIcon></dile-toast>');
|
|
67
|
-
const item = await openAndGetItem(el, 'Dismiss me');
|
|
68
|
-
|
|
69
|
-
item.shadowRoot.querySelector('dile-icon.closeicon').click();
|
|
70
|
-
await el.updateComplete;
|
|
71
|
-
expect(item.shadowRoot.querySelector('div').classList.contains('hidden')).toBe(true);
|
|
72
|
-
|
|
73
|
-
await wait(600);
|
|
74
|
-
|
|
75
|
-
expect(el.shadowRoot.querySelector('dile-toast-item')).toBeNull();
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('still auto-hides and cleans up a toast on its own after duration elapses', async () => {
|
|
79
|
-
const el = await renderToast('<dile-toast duration="50"></dile-toast>');
|
|
80
|
-
await openAndGetItem(el, 'Auto dismiss');
|
|
81
|
-
|
|
82
|
-
await wait(1200);
|
|
83
|
-
|
|
84
|
-
expect(el.shadowRoot.querySelector('dile-toast-item')).toBeNull();
|
|
85
|
-
});
|
|
86
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
-
import './chip-tooltip.js';
|
|
3
|
-
|
|
4
|
-
describe('dile-chip-tooltip', () => {
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
document.body.innerHTML = '';
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
async function renderChipTooltip(html) {
|
|
10
|
-
document.body.innerHTML = html;
|
|
11
|
-
const el = document.body.querySelector('dile-chip-tooltip');
|
|
12
|
-
await el.updateComplete;
|
|
13
|
-
return el;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
it('renders the label inside a dile-tooltip with the message', async () => {
|
|
17
|
-
const el = await renderChipTooltip('<dile-chip-tooltip label="Info" message="More info here"></dile-chip-tooltip>');
|
|
18
|
-
const tooltip = el.shadowRoot.querySelector('dile-tooltip');
|
|
19
|
-
|
|
20
|
-
expect(tooltip).toBeTruthy();
|
|
21
|
-
expect(tooltip.getAttribute('tooltip')).toBe('More info here');
|
|
22
|
-
expect(el.shadowRoot.querySelector('.label').textContent.trim()).toBe('Info');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('defaults the position to bottom', async () => {
|
|
26
|
-
const el = await renderChipTooltip('<dile-chip-tooltip message="Info"></dile-chip-tooltip>');
|
|
27
|
-
expect(el.position).toBe('bottom');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
-
import './tooltip.js';
|
|
3
|
-
|
|
4
|
-
describe('dile-tooltip', () => {
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
document.body.innerHTML = '';
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
async function renderTooltip(html) {
|
|
10
|
-
document.body.innerHTML = html;
|
|
11
|
-
const el = document.body.querySelector('dile-tooltip');
|
|
12
|
-
await el.updateComplete;
|
|
13
|
-
return el;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
it('renders the tooltip text hidden by default', async () => {
|
|
17
|
-
const el = await renderTooltip('<dile-tooltip tooltip="Hello there">Trigger</dile-tooltip>');
|
|
18
|
-
const tooltipText = el.shadowRoot.querySelector('.tooltiptext');
|
|
19
|
-
|
|
20
|
-
expect(tooltipText).toBeTruthy();
|
|
21
|
-
expect(tooltipText.textContent.trim()).toBe('Hello there');
|
|
22
|
-
expect(tooltipText.classList.contains('show')).toBe(false);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('shows the tooltip on mouseover', async () => {
|
|
26
|
-
const el = await renderTooltip('<dile-tooltip tooltip="Hello there">Trigger</dile-tooltip>');
|
|
27
|
-
el.doMouseover();
|
|
28
|
-
await el.updateComplete;
|
|
29
|
-
|
|
30
|
-
expect(el.shadowRoot.querySelector('.tooltiptext').classList.contains('show')).toBe(true);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
-
import './web-visor.js';
|
|
3
|
-
|
|
4
|
-
describe('dile-web-visor', () => {
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
document.body.innerHTML = '';
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
async function renderWebVisor(html) {
|
|
10
|
-
document.body.innerHTML = html;
|
|
11
|
-
const el = document.body.querySelector('dile-web-visor');
|
|
12
|
-
await el.updateComplete;
|
|
13
|
-
return el;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
it('renders an iframe pointing at the url', async () => {
|
|
17
|
-
const el = await renderWebVisor('<dile-web-visor url="https://example.com" title="Example"></dile-web-visor>');
|
|
18
|
-
const iframe = el.shadowRoot.querySelector('iframe');
|
|
19
|
-
|
|
20
|
-
expect(iframe).toBeTruthy();
|
|
21
|
-
expect(iframe.getAttribute('src')).toBe('https://example.com');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('increases zoom when zoom in is clicked', async () => {
|
|
25
|
-
const el = await renderWebVisor('<dile-web-visor url="https://example.com"></dile-web-visor>');
|
|
26
|
-
const zoomInButton = el.shadowRoot.querySelectorAll('.controls dile-button')[1];
|
|
27
|
-
zoomInButton.click();
|
|
28
|
-
await el.updateComplete;
|
|
29
|
-
|
|
30
|
-
expect(el._zoom).toBeCloseTo(1.1);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
-
import { LitElement, html } from 'lit';
|
|
3
|
-
import { DileForm } from './DileForm.js';
|
|
4
|
-
|
|
5
|
-
class RaceTestForm extends DileForm(LitElement) {
|
|
6
|
-
render() {
|
|
7
|
-
return html`<input name="name" />`;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (!customElements.get('race-test-form')) {
|
|
12
|
-
customElements.define('race-test-form', RaceTestForm);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
describe('DileForm', () => {
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
document.body.innerHTML = '';
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('applies setData after the first render is ready even when called immediately', async () => {
|
|
21
|
-
const form = document.createElement('race-test-form');
|
|
22
|
-
document.body.appendChild(form);
|
|
23
|
-
|
|
24
|
-
form.setData({ name: 'Alice' });
|
|
25
|
-
await form.updateComplete;
|
|
26
|
-
|
|
27
|
-
expect(form.shadowRoot.querySelector('input').value).toBe('Alice');
|
|
28
|
-
});
|
|
29
|
-
});
|