@lion/ui 0.15.4 → 0.15.5
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/collapsible/src/LionCollapsible.js +0 -2
- package/components/collapsible/test/lion-collapsible.test.js +0 -9
- package/components/core/test-helpers/ssr-definitions/ScopedElementsHost.define.js +1 -0
- package/components/drawer/test/lion-drawer.test.js +0 -9
- package/components/form-core/src/choice-group/ChoiceGroupMixin.js +12 -2
- package/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js +48 -4
- package/components/input-tel/translations/es.js +1 -1
- package/components/overlays/test/OverlayController.test.js +3 -2
- package/dist-types/components/collapsible/src/LionCollapsible.d.ts.map +1 -1
- package/dist-types/components/core/test-helpers/ssr-definitions/ScopedElementsHost.define.d.ts +2 -0
- package/dist-types/components/core/test-helpers/ssr-definitions/ScopedElementsHost.define.d.ts.map +1 -0
- package/dist-types/components/form-core/src/choice-group/ChoiceGroupMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.d.ts.map +1 -1
- package/dist-types/components/overlays/test/OverlayController.test.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 +1 -1
- 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/form/use-cases.md +2 -2
- 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-datepicker/overview.md +5 -5
- 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 +2 -2
- package/docs/components/switch/use-cases.md +3 -3
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- 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/TypeScript.md +46 -0
- 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
|
@@ -54,12 +54,10 @@ export class LionCollapsible extends LitElement {
|
|
|
54
54
|
if (this._invokerNode) {
|
|
55
55
|
this._invokerNode.addEventListener('click', this.toggle);
|
|
56
56
|
this._invokerNode.setAttribute('aria-expanded', `${this.opened}`);
|
|
57
|
-
this._invokerNode.setAttribute('id', `collapsible-invoker-${uid}`);
|
|
58
57
|
this._invokerNode.setAttribute('aria-controls', `collapsible-content-${uid}`);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
if (this._contentNode) {
|
|
62
|
-
this._contentNode.setAttribute('aria-labelledby', `collapsible-invoker-${uid}`);
|
|
63
61
|
this._contentNode.setAttribute('id', `collapsible-content-${uid}`);
|
|
64
62
|
}
|
|
65
63
|
|
|
@@ -136,14 +136,5 @@ describe('<lion-collapsible>', () => {
|
|
|
136
136
|
expect(invoker).to.have.attribute('aria-expanded', 'true');
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
|
-
|
|
140
|
-
describe('Contents', () => {
|
|
141
|
-
it('adds aria-labelledby referring to invoker id', async () => {
|
|
142
|
-
const collapsibleElement = await fixture(defaultCollapsible);
|
|
143
|
-
const invoker = collapsibleElement.querySelector('[slot=invoker]');
|
|
144
|
-
const content = collapsibleElement.querySelector('[slot=content]');
|
|
145
|
-
expect(content).to.have.attribute('aria-labelledby', invoker?.id);
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
139
|
});
|
|
149
140
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// ... empty file needed for '@lit-labs/testing/fixtures.js'
|
|
@@ -96,14 +96,5 @@ describe('<lion-drawer>', () => {
|
|
|
96
96
|
expect(invoker).to.have.attribute('aria-expanded', 'true');
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
|
-
|
|
100
|
-
describe('Contents', () => {
|
|
101
|
-
it('adds aria-labelledby referring to invoker id', async () => {
|
|
102
|
-
const drawerElement = await fixture(template);
|
|
103
|
-
const invoker = drawerElement.querySelector('[slot=invoker]');
|
|
104
|
-
const content = drawerElement.querySelector('[slot=content]');
|
|
105
|
-
expect(content).to.have.attribute('aria-labelledby', invoker?.id);
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
99
|
});
|
|
109
100
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
2
|
-
import { FormRegistrarMixin } from '../registration/FormRegistrarMixin.js';
|
|
3
2
|
import { InteractionStateMixin } from '../InteractionStateMixin.js';
|
|
3
|
+
import { FormRegistrarMixin } from '../registration/FormRegistrarMixin.js';
|
|
4
4
|
import { ValidateMixin } from '../validate/ValidateMixin.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -260,7 +260,17 @@ const ChoiceGroupMixinImplementation = superclass =>
|
|
|
260
260
|
) {
|
|
261
261
|
return this[property];
|
|
262
262
|
}
|
|
263
|
-
|
|
263
|
+
|
|
264
|
+
// TODO: consider a shared approach for all value getters
|
|
265
|
+
const filteredFnElements = this.formElements.filter(el => _filterFn(el, property));
|
|
266
|
+
|
|
267
|
+
if (property === '_initialModelValue') {
|
|
268
|
+
return this.multipleChoice
|
|
269
|
+
? filteredFnElements.filter(el => el[property].checked).map(el => el[property].value)
|
|
270
|
+
: filteredFnElements.find(el => el[property].checked)?.value;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return filteredFnElements.map(el => el[property]);
|
|
264
274
|
}
|
|
265
275
|
|
|
266
276
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import '@lion/ui/define/lion-fieldset.js';
|
|
3
1
|
import '@lion/ui/define/lion-checkbox-group.js';
|
|
4
2
|
import '@lion/ui/define/lion-checkbox.js';
|
|
3
|
+
import '@lion/ui/define/lion-fieldset.js';
|
|
5
4
|
import {
|
|
6
|
-
FormGroupMixin,
|
|
7
|
-
Required,
|
|
8
5
|
ChoiceGroupMixin,
|
|
9
6
|
ChoiceInputMixin,
|
|
7
|
+
FormGroupMixin,
|
|
8
|
+
Required,
|
|
10
9
|
} from '@lion/ui/form-core.js';
|
|
11
10
|
import { LionInput } from '@lion/ui/input.js';
|
|
12
11
|
import { expect, fixture, fixtureSync, html, unsafeStatic } from '@open-wc/testing';
|
|
12
|
+
import { LitElement } from 'lit';
|
|
13
13
|
import sinon from 'sinon';
|
|
14
14
|
|
|
15
15
|
class ChoiceInputFoo extends ChoiceInputMixin(LionInput) {}
|
|
@@ -45,6 +45,28 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
45
45
|
|
|
46
46
|
describe(`ChoiceGroupMixin: ${cfg.parentTagString}`, () => {
|
|
47
47
|
if (cfg.choiceType === 'single') {
|
|
48
|
+
it('has a single modelValue representing initial checked values', async () => {
|
|
49
|
+
const el = /** @type {ChoiceInputGroup} */ (
|
|
50
|
+
await fixture(html`
|
|
51
|
+
<${parentTag} name="gender[]">
|
|
52
|
+
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
53
|
+
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
54
|
+
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
55
|
+
</${parentTag}>
|
|
56
|
+
`)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// @ts-ignore protected members allowed in test
|
|
60
|
+
expect(el._initialModelValue).to.eql('female');
|
|
61
|
+
expect(el.modelValue).to.eql('female');
|
|
62
|
+
|
|
63
|
+
el.formElements[0].checked = true;
|
|
64
|
+
|
|
65
|
+
// @ts-ignore protected members allowed in test
|
|
66
|
+
expect(el._initialModelValue).to.eql('female');
|
|
67
|
+
expect(el.modelValue).to.eql('male');
|
|
68
|
+
});
|
|
69
|
+
|
|
48
70
|
it('has a single modelValue representing the currently checked radio value', async () => {
|
|
49
71
|
const el = /** @type {ChoiceInputGroup} */ (
|
|
50
72
|
await fixture(html`
|
|
@@ -585,6 +607,28 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
585
607
|
});
|
|
586
608
|
|
|
587
609
|
describe('multipleChoice', () => {
|
|
610
|
+
it('has multiple _initialModelValue representing initial checked values', async () => {
|
|
611
|
+
const el = /** @type {ChoiceInputGroup} */ (
|
|
612
|
+
await fixture(html`
|
|
613
|
+
<${parentTag} multiple-choice name="animals[]">
|
|
614
|
+
<${childTag} .choiceValue=${'dog'} checked></${childTag}>
|
|
615
|
+
<${childTag} .choiceValue=${'cat'} checked></${childTag}>
|
|
616
|
+
<${childTag} .choiceValue=${'lion'}></${childTag}>
|
|
617
|
+
</${parentTag}>
|
|
618
|
+
`)
|
|
619
|
+
);
|
|
620
|
+
|
|
621
|
+
// @ts-ignore protected members allowed in test
|
|
622
|
+
expect(el._initialModelValue).to.eql(['dog', 'cat']);
|
|
623
|
+
expect(el.modelValue).to.eql(['dog', 'cat']);
|
|
624
|
+
|
|
625
|
+
el.formElements[2].checked = true;
|
|
626
|
+
|
|
627
|
+
// @ts-ignore protected members allowed in test
|
|
628
|
+
expect(el._initialModelValue).to.eql(['dog', 'cat']);
|
|
629
|
+
expect(el.modelValue).to.eql(['dog', 'cat', 'lion']);
|
|
630
|
+
});
|
|
631
|
+
|
|
588
632
|
it('has a single modelValue representing all currently checked values', async () => {
|
|
589
633
|
const el = /** @type {ChoiceInputGroup} */ (
|
|
590
634
|
await fixture(html`
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
fixture,
|
|
12
12
|
expect,
|
|
13
13
|
html,
|
|
14
|
+
waitUntil,
|
|
14
15
|
} from '@open-wc/testing';
|
|
15
16
|
|
|
16
17
|
import { isActiveElement } from '../../core/test-helpers/isActiveElement.js';
|
|
@@ -815,8 +816,8 @@ describe('OverlayController', () => {
|
|
|
815
816
|
// without this line, the test is unstable on FF sometimes
|
|
816
817
|
await aTimeout(100);
|
|
817
818
|
|
|
818
|
-
|
|
819
|
-
|
|
819
|
+
await waitUntil(() => !parentOverlay.isShown);
|
|
820
|
+
await waitUntil(() => childOverlay.isShown);
|
|
820
821
|
|
|
821
822
|
await childOverlay.teardown();
|
|
822
823
|
await parentOverlay.teardown();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LionCollapsible.d.ts","sourceRoot":"","sources":["../../../../components/collapsible/src/LionCollapsible.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH;IACE,+CAYC;IAED;;;;;MAOC;IAED,+CAKC;IAIC,gBAAmB;
|
|
1
|
+
{"version":3,"file":"LionCollapsible.d.ts","sourceRoot":"","sources":["../../../../components/collapsible/src/LionCollapsible.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH;IACE,+CAYC;IAED;;;;;MAOC;IAED,+CAKC;IAIC,gBAAmB;IA4DrB;;;OAGG;IACH,sBAGC;IA3BD;;;OAGG;IACH,oBAIC;IAED;;;OAGG;IACH,oBAIC;IAWD;;;;OAIG;IAEH,+BAJW,MAAM,iBAIY;IAE7B;;;;OAIG;IAEH,+BAJW,MAAM,iBAIY;IAE7B;;OAEG;IACH,sDAIC;IAED;;OAEG;IACH,sDAIC;IAED;;OAEG;IACH,uCAGC;IAED;;;OAGG;IACH,wBAMC;IAED;;;OAGG;IACH,4BAUC;IAED;;;OAGG;IACH,0BAIC;CACF"}
|
package/dist-types/components/core/test-helpers/ssr-definitions/ScopedElementsHost.define.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopedElementsHost.define.d.ts","sourceRoot":"","sources":["../../../../../components/core/test-helpers/ssr-definitions/ScopedElementsHost.define.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceGroupMixin.d.ts","sourceRoot":"","sources":["../../../../../components/form-core/src/choice-group/ChoiceGroupMixin.js"],"names":[],"mappings":"+BAMa,OAAO,mDAAmD,EAAE,gBAAgB;
|
|
1
|
+
{"version":3,"file":"ChoiceGroupMixin.d.ts","sourceRoot":"","sources":["../../../../../components/form-core/src/choice-group/ChoiceGroupMixin.js"],"names":[],"mappings":"+BAMa,OAAO,mDAAmD,EAAE,gBAAgB;AA6ZzF,4HAA4E;8BA5Z/D,OAAO,sCAAsC,EAAE,eAAe;yCAC9D,OAAO,qDAAqD,EAAE,0BAA0B;0BACxF,OAAO,+CAA+C,EAAE,WAAW;8BACnE,OAAO,mDAAmD,EAAE,eAAe;wBAC3E,OAAO,0BAA0B,EAAE,SAAS"}
|
package/dist-types/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceGroupMixin.suite.d.ts","sourceRoot":"","sources":["../../../../../components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js"],"names":[],"mappings":"AA4BA;;GAEG;AACH,2FAFW;IAAE,eAAe,CAAC,EAAC,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,
|
|
1
|
+
{"version":3,"file":"ChoiceGroupMixin.suite.d.ts","sourceRoot":"","sources":["../../../../../components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js"],"names":[],"mappings":"AA4BA;;GAEG;AACH,2FAFW;IAAE,eAAe,CAAC,EAAC,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,QA8vBlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayController.test.d.ts","sourceRoot":"","sources":["../../../../components/overlays/test/OverlayController.test.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverlayController.test.d.ts","sourceRoot":"","sources":["../../../../components/overlays/test/OverlayController.test.js"],"names":[],"mappings":"gCAuBa,OAAO,2BAA2B,EAAE,iBAAiB;4BACrD,OAAO,2BAA2B,EAAE,aAAa"}
|