@lion/ui 0.7.9 → 0.8.0
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/accordion/src/LionAccordion.js +1 -1
- package/components/accordion/test/lion-accordion.test.js +9 -4
- package/components/calendar/src/LionCalendar.js +3 -1
- package/components/combobox/test/lion-combobox.test.js +124 -120
- package/components/combobox/test/validators.test.js +2 -2
- package/components/combobox/test-helpers/combobox-helpers.js +8 -9
- package/components/core/src/browserDetection.js +9 -1
- package/components/form-core/test-suites/NativeTextFieldMixin.suite.js +9 -10
- package/custom-elements.json +684 -2497
- package/dist-types/components/accordion/test/lion-accordion.test.d.ts.map +1 -1
- package/dist-types/components/calendar/src/LionCalendar.d.ts +0 -1
- package/dist-types/components/calendar/src/LionCalendar.d.ts.map +1 -1
- package/dist-types/components/combobox/test-helpers/combobox-helpers.d.ts +2 -2
- package/dist-types/components/combobox/test-helpers/combobox-helpers.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/NativeTextFieldMixin.suite.d.ts.map +1 -1
- package/dist-types/components/icon/src/LionIcon.d.ts +2 -2
- package/dist-types/components/icon/src/LionIcon.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +3 -4
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-date/use-cases.md +2 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-datepicker/use-cases.md +2 -3
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +2 -2
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -25,13 +25,13 @@ describe('MatchesOption validation', () => {
|
|
|
25
25
|
config.node = el;
|
|
26
26
|
const validator = new MatchesOption();
|
|
27
27
|
|
|
28
|
-
mimicUserTyping(el, 'Artichoke');
|
|
28
|
+
await mimicUserTyping(el, 'Artichoke');
|
|
29
29
|
await el.updateComplete;
|
|
30
30
|
|
|
31
31
|
isEnabled = validator.execute('Artichoke', undefined, config);
|
|
32
32
|
expect(isEnabled).to.be.false;
|
|
33
33
|
|
|
34
|
-
mimicUserTyping(el, 'Foo');
|
|
34
|
+
await mimicUserTyping(el, 'Foo');
|
|
35
35
|
await el.updateComplete;
|
|
36
36
|
|
|
37
37
|
isEnabled = validator.execute('Foo', undefined, config);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getListboxMembers } from '@lion/ui/listbox-test-helpers.js';
|
|
2
|
+
import { sendKeys } from '@web/test-runner-commands';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @typedef {import('@lion/ui/combobox.js').LionCombobox} LionCombobox
|
|
@@ -34,17 +35,15 @@ export function getComboboxMembers(el) {
|
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* @param {LionCombobox} el
|
|
37
|
-
* @param {string}
|
|
38
|
+
* @param {string} keys
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
|
-
export function mimicUserTyping(el, value) {
|
|
40
|
+
export async function mimicUserTyping(el, keys) {
|
|
41
41
|
const { _inputNode } = getComboboxMembers(el);
|
|
42
|
-
_inputNode.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_inputNode.dispatchEvent(new KeyboardEvent('keydown', { key: value }));
|
|
42
|
+
_inputNode.value = '';
|
|
43
|
+
_inputNode.focus();
|
|
44
|
+
await sendKeys({
|
|
45
|
+
type: keys,
|
|
46
|
+
});
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
/**
|
|
@@ -9,11 +9,19 @@ function checkChrome(flavor = 'google-chrome') {
|
|
|
9
9
|
return flavor === 'google-chrome';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// eslint-disable-next-line prefer-destructuring
|
|
13
|
+
const navigator = /** @type {Navigator & {userAgentData: {brands:{brand:string}[]}}} */ (
|
|
14
|
+
globalThis.navigator
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const isChromium =
|
|
18
|
+
!!navigator.userAgentData &&
|
|
19
|
+
navigator.userAgentData.brands.some(data => data.brand === 'Chromium');
|
|
13
20
|
|
|
14
21
|
if (flavor === 'chromium') {
|
|
15
22
|
return isChromium;
|
|
16
23
|
}
|
|
24
|
+
|
|
17
25
|
const winNav = globalThis.navigator;
|
|
18
26
|
const vendorName = winNav?.vendor;
|
|
19
27
|
const isOpera =
|
|
@@ -4,11 +4,7 @@ import { defineCE, expect, fixture, html, triggerFocusFor, unsafeStatic } from '
|
|
|
4
4
|
import { sendKeys } from '@web/test-runner-commands';
|
|
5
5
|
import { spy } from 'sinon';
|
|
6
6
|
import { NativeTextFieldMixin } from '@lion/ui/form-core.js';
|
|
7
|
-
|
|
8
|
-
const isSafari = (() => {
|
|
9
|
-
const ua = navigator.userAgent.toLowerCase();
|
|
10
|
-
return ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1;
|
|
11
|
-
})();
|
|
7
|
+
import { browserDetection } from '@lion/ui/core.js';
|
|
12
8
|
|
|
13
9
|
/**
|
|
14
10
|
* @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
|
|
@@ -54,10 +50,6 @@ export function runNativeTextFieldMixinSuite(customConfig) {
|
|
|
54
50
|
});
|
|
55
51
|
|
|
56
52
|
it('move focus to a next focusable element after writing some text', async () => {
|
|
57
|
-
if (isSafari) {
|
|
58
|
-
// TODO: This test is broken on Safari, to be fixed later
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
53
|
const el = /** @type {NativeTextFieldClass} */ (await fixture(html`<${tag}></${tag}>`));
|
|
62
54
|
// @ts-ignore [allow-protected] in test
|
|
63
55
|
const setValueAndPreserveCaretSpy = spy(el, '_setValueAndPreserveCaret');
|
|
@@ -71,8 +63,15 @@ export function runNativeTextFieldMixinSuite(customConfig) {
|
|
|
71
63
|
await sendKeys({
|
|
72
64
|
press: 'Tab',
|
|
73
65
|
});
|
|
74
|
-
|
|
66
|
+
|
|
75
67
|
expect(setValueAndPreserveCaretSpy.calledOnce).to.be.false;
|
|
68
|
+
|
|
69
|
+
// TODO: This seems to work in practice, but not in the test. Investigate.
|
|
70
|
+
if (browserDetection.isMacSafari || browserDetection.isFirefox) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
expect(document.activeElement).to.not.equal(_inputNode);
|
|
76
75
|
});
|
|
77
76
|
});
|
|
78
77
|
}
|