@lion/ui 0.7.2 → 0.7.3
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/button/test-suites/LionButtonReset.suite.js +7 -9
- package/components/calendar/test/lion-calendar.test.js +26 -30
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +3 -0
- package/components/combobox/test/lion-combobox.test.js +32 -32
- package/components/core/src/SlotMixin.js +7 -1
- package/components/form/test/lion-form.test.js +4 -4
- package/components/form-core/test-suites/ValidateMixin.suite.js +1 -0
- package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +18 -18
- package/components/form-integrations/test/dialog-integrations.test.js +6 -4
- package/components/helpers/src/SbActionLogger.js +11 -2
- package/components/icon/test/lion-icon.test.js +12 -14
- package/components/input-amount/test/lion-input-amount.test.js +10 -14
- package/components/input-datepicker/test/lion-input-datepicker.test.js +4 -4
- package/components/input-file/test/lion-input-file.test.js +3 -3
- package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +23 -23
- package/components/listbox/test-suites/ListboxMixin.suite.js +10 -3
- package/components/localize/src/date/utils/normalizeIntlDate.js +13 -2
- package/components/progress-indicator/test/lion-progress-indicator.test.js +42 -46
- package/components/select-rich/test/lion-select-rich.test.js +6 -8
- package/components/steps/test/lion-step.test.js +5 -7
- package/components/switch/test/lion-switch.test.js +5 -7
- package/custom-elements.json +517 -5134
- package/dist-types/components/button/test-suites/LionButtonReset.suite.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/ValidateMixin.suite.d.ts.map +1 -1
- package/dist-types/components/helpers/src/SbActionLogger.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/test/LionInputTelDropdown.test.d.ts.map +1 -1
- package/dist-types/components/listbox/test-suites/ListboxMixin.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/date/utils/normalizeIntlDate.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/use-cases.md +11 -10
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/assets/applyDemoCollapsibleStyles.js +6 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +4 -3
- package/docs/components/combobox/src/gh-combobox/gh-button.js +3 -1
- package/docs/components/combobox/src/gh-combobox/gh-combobox.js +9 -2
- package/docs/components/combobox/src/google-combobox/google-combobox.js +6 -8
- package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +7 -3
- package/docs/components/combobox/src/md-combobox/style/md-ripple.js +1 -0
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +15 -3
- package/docs/components/combobox/use-cases.md +19 -17
- 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/use-cases.md +3 -2
- 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/input-tel-dropdown/src/intl-input-tel-dropdown.js +15 -5
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/progress-indicator/examples.md +11 -11
- 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/components/tabs/src/lea-tab-panel.js +3 -1
- package/docs/components/tabs/src/lea-tab.js +7 -2
- 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/assets/_mermaid.svg.js +32 -8
- 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 +3 -3
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +0 -9
- package/docs/fundamentals/systems/overlays/_edge-cases.md +74 -80
- 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 +5 -8
- package/docs/fundamentals/tools/helpers/action-logger.md +3 -6
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js +3 -1
- package/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js +3 -1
- package/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js +3 -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 +2 -2
|
@@ -164,15 +164,13 @@ export function LionButtonResetSuite({ klass = LionButtonReset } = {}) {
|
|
|
164
164
|
const formSpyLater = /** @type {EventListener} */ (sinon.spy(e => e.preventDefault()));
|
|
165
165
|
|
|
166
166
|
const form2El = /** @type {HTMLFormElement} */ (
|
|
167
|
-
await fixture(
|
|
168
|
-
|
|
169
|
-
<
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
`,
|
|
175
|
-
)
|
|
167
|
+
await fixture(html`
|
|
168
|
+
<div @click="${outsideSpy}">
|
|
169
|
+
<form @click="${formSpyEarly}">
|
|
170
|
+
<div @click="${insideSpy}">${lionButton}</div>
|
|
171
|
+
</form>
|
|
172
|
+
</div>
|
|
173
|
+
`)
|
|
176
174
|
);
|
|
177
175
|
const form2Node = /** @type {HTMLFormElement} */ (form2El.querySelector('form'));
|
|
178
176
|
|
|
@@ -355,10 +355,12 @@ describe('<lion-calendar>', () => {
|
|
|
355
355
|
it('has a initCentralDate() method for external contexts like datepickers', async () => {
|
|
356
356
|
const initialCentralDate = new Date('2014/07/05');
|
|
357
357
|
const initialSelectedDate = new Date('2014/07/07');
|
|
358
|
-
const el = await fixture(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
const el = await fixture(
|
|
359
|
+
html`<lion-calendar
|
|
360
|
+
.centralDate="${initialCentralDate}"
|
|
361
|
+
.selectedDate="${initialSelectedDate}"
|
|
362
|
+
></lion-calendar>`,
|
|
363
|
+
);
|
|
362
364
|
|
|
363
365
|
expect(el.selectedDate).to.equal(initialSelectedDate);
|
|
364
366
|
expect(el.centralDate).to.equal(initialCentralDate);
|
|
@@ -408,14 +410,12 @@ describe('<lion-calendar>', () => {
|
|
|
408
410
|
it('disables a date with disableDates function', async () => {
|
|
409
411
|
/** @param {Date} d */
|
|
410
412
|
const disable15th = d => d.getDate() === 15;
|
|
411
|
-
const el = await fixture(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
`,
|
|
418
|
-
);
|
|
413
|
+
const el = await fixture(html`
|
|
414
|
+
<lion-calendar
|
|
415
|
+
.selectedDate="${new Date('2000/12/01')}"
|
|
416
|
+
.disableDates=${disable15th}
|
|
417
|
+
></lion-calendar>
|
|
418
|
+
`);
|
|
419
419
|
const elObj = new CalendarObject(el);
|
|
420
420
|
elObj.dayEls.forEach((d, i) => {
|
|
421
421
|
const shouldBeDisabled = i === 15 - 1;
|
|
@@ -490,15 +490,13 @@ describe('<lion-calendar>', () => {
|
|
|
490
490
|
// without normalization, selectedDate < minDate would wrongfully be disabled
|
|
491
491
|
const minDate = new Date('2000-11-02T04:00:00');
|
|
492
492
|
|
|
493
|
-
const el = await fixture(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
`,
|
|
501
|
-
);
|
|
493
|
+
const el = await fixture(html`
|
|
494
|
+
<lion-calendar
|
|
495
|
+
.selectedDate="${selectedDate}"
|
|
496
|
+
.minDate="${minDate}"
|
|
497
|
+
.maxDate="${maxDate}"
|
|
498
|
+
></lion-calendar>
|
|
499
|
+
`);
|
|
502
500
|
const elObj = new CalendarObject(el);
|
|
503
501
|
|
|
504
502
|
expect(elObj.getDayObj(29).isDisabled).to.equal(false);
|
|
@@ -1531,15 +1529,13 @@ describe('<lion-calendar>', () => {
|
|
|
1531
1529
|
});
|
|
1532
1530
|
|
|
1533
1531
|
it('is accessible with disabled dates', async () => {
|
|
1534
|
-
const el = await fixture(
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
.
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
`,
|
|
1542
|
-
);
|
|
1532
|
+
const el = await fixture(html`
|
|
1533
|
+
<lion-calendar
|
|
1534
|
+
.disableDates=${
|
|
1535
|
+
/** @param {Date} date */ date => date.getDay() === 6 || date.getDay() === 0
|
|
1536
|
+
}
|
|
1537
|
+
></lion-calendar>
|
|
1538
|
+
`);
|
|
1543
1539
|
await expect(el).to.be.accessible();
|
|
1544
1540
|
});
|
|
1545
1541
|
|
|
@@ -40,8 +40,11 @@ export function runCheckboxIndeterminateSuite(customConfig) {
|
|
|
40
40
|
let childTag;
|
|
41
41
|
|
|
42
42
|
before(async () => {
|
|
43
|
+
// @ts-expect-error
|
|
43
44
|
tag = unsafeStatic(cfg.tagString);
|
|
45
|
+
// @ts-expect-error
|
|
44
46
|
groupTag = unsafeStatic(cfg.groupTagString);
|
|
47
|
+
// @ts-expect-error
|
|
45
48
|
childTag = unsafeStatic(cfg.childTagString);
|
|
46
49
|
});
|
|
47
50
|
|
|
@@ -2300,17 +2300,17 @@ describe('lion-combobox', () => {
|
|
|
2300
2300
|
await fixture(html`
|
|
2301
2301
|
<${tag} name="foo" autocomplete="both" multiple-choice>
|
|
2302
2302
|
<lion-option .label="${'Artichoke as label'}" .choiceValue="${{
|
|
2303
|
-
|
|
2304
|
-
|
|
2303
|
+
value: 'Artichoke',
|
|
2304
|
+
}}">Artichoke</lion-option>
|
|
2305
2305
|
<lion-option .label="${'Chard as label'}" .choiceValue="${{
|
|
2306
|
-
|
|
2307
|
-
|
|
2306
|
+
value: 'Chard',
|
|
2307
|
+
}}">Chard</lion-option>
|
|
2308
2308
|
<lion-option .label="${'Chicory as label'}" .choiceValue="${{
|
|
2309
|
-
|
|
2310
|
-
|
|
2309
|
+
value: 'Chicory',
|
|
2310
|
+
}}">Chicory</lion-option>
|
|
2311
2311
|
<lion-option .label="${'Victoria Plum as label'}" .choiceValue="${{
|
|
2312
|
-
|
|
2313
|
-
|
|
2312
|
+
value: 'Victoria Plum',
|
|
2313
|
+
}}">Victoria Plum</lion-option>
|
|
2314
2314
|
</${tag}>
|
|
2315
2315
|
`)
|
|
2316
2316
|
);
|
|
@@ -2353,17 +2353,17 @@ describe('lion-combobox', () => {
|
|
|
2353
2353
|
await fixture(html`
|
|
2354
2354
|
<${tag} name="foo">
|
|
2355
2355
|
<lion-option .label="${'Artichoke as label'}" .choiceValue="${{
|
|
2356
|
-
|
|
2357
|
-
|
|
2356
|
+
value: 'Artichoke',
|
|
2357
|
+
}}">Artichoke</lion-option>
|
|
2358
2358
|
<lion-option .label="${'Chard as label'}" .choiceValue="${{
|
|
2359
|
-
|
|
2360
|
-
|
|
2359
|
+
value: 'Chard',
|
|
2360
|
+
}}" checked>Chard</lion-option>
|
|
2361
2361
|
<lion-option .label="${'Chicory as label'}" .choiceValue="${{
|
|
2362
|
-
|
|
2363
|
-
|
|
2362
|
+
value: 'Chicory',
|
|
2363
|
+
}}">Chicory</lion-option>
|
|
2364
2364
|
<lion-option .label="${'Victoria Plum as label'}" .choiceValue="${{
|
|
2365
|
-
|
|
2366
|
-
|
|
2365
|
+
value: 'Victoria Plum',
|
|
2366
|
+
}}">Victoria Plum</lion-option>
|
|
2367
2367
|
</${tag}>
|
|
2368
2368
|
`)
|
|
2369
2369
|
);
|
|
@@ -2403,17 +2403,17 @@ describe('lion-combobox', () => {
|
|
|
2403
2403
|
await fixture(html`
|
|
2404
2404
|
<${tag} name="foo" .modelValue="${{ value: 'Artichoke' }}">
|
|
2405
2405
|
<lion-option .label="${'Artichoke as label'}" .choiceValue="${{
|
|
2406
|
-
|
|
2407
|
-
|
|
2406
|
+
value: 'Artichoke',
|
|
2407
|
+
}}">Artichoke</lion-option>
|
|
2408
2408
|
<lion-option .label="${'Chard as label'}" .choiceValue="${{
|
|
2409
|
-
|
|
2410
|
-
|
|
2409
|
+
value: 'Chard',
|
|
2410
|
+
}}">Chard</lion-option>
|
|
2411
2411
|
<lion-option .label="${'Chicory as label'}" .choiceValue="${{
|
|
2412
|
-
|
|
2413
|
-
|
|
2412
|
+
value: 'Chicory',
|
|
2413
|
+
}}">Chicory</lion-option>
|
|
2414
2414
|
<lion-option .label="${'Victoria Plum as label'}" .choiceValue="${{
|
|
2415
|
-
|
|
2416
|
-
|
|
2415
|
+
value: 'Victoria Plum',
|
|
2416
|
+
}}">Victoria Plum</lion-option>
|
|
2417
2417
|
</${tag}>
|
|
2418
2418
|
`)
|
|
2419
2419
|
);
|
|
@@ -2450,17 +2450,17 @@ describe('lion-combobox', () => {
|
|
|
2450
2450
|
await fixture(html`
|
|
2451
2451
|
<${tag} name="foo">
|
|
2452
2452
|
<lion-option .label="${'Artichoke as label'}" .choiceValue="${{
|
|
2453
|
-
|
|
2454
|
-
|
|
2453
|
+
value: 'Artichoke',
|
|
2454
|
+
}}">Artichoke</lion-option>
|
|
2455
2455
|
<lion-option .label="${'Chard as label'}" .choiceValue="${{
|
|
2456
|
-
|
|
2457
|
-
|
|
2456
|
+
value: 'Chard',
|
|
2457
|
+
}}">Chard</lion-option>
|
|
2458
2458
|
<lion-option .label="${'Chicory as label'}" .choiceValue="${{
|
|
2459
|
-
|
|
2460
|
-
|
|
2459
|
+
value: 'Chicory',
|
|
2460
|
+
}}">Chicory</lion-option>
|
|
2461
2461
|
<lion-option .label="${'Victoria Plum as label'}" .choiceValue="${{
|
|
2462
|
-
|
|
2463
|
-
|
|
2462
|
+
value: 'Victoria Plum',
|
|
2463
|
+
}}">Victoria Plum</lion-option>
|
|
2464
2464
|
</${tag}>
|
|
2465
2465
|
`)
|
|
2466
2466
|
);
|
|
@@ -131,7 +131,13 @@ const SlotMixinImplementation = superclass =>
|
|
|
131
131
|
if (isFirstRender) {
|
|
132
132
|
// @ts-expect-error wait for browser support
|
|
133
133
|
const supportsScopedRegistry = !!ShadowRoot.prototype.createElement;
|
|
134
|
-
const
|
|
134
|
+
const hasShadowRoot = Boolean(this.shadowRoot);
|
|
135
|
+
if (!hasShadowRoot) {
|
|
136
|
+
// TODO: throw an error in a breaking release
|
|
137
|
+
// eslint-disable-next-line no-console
|
|
138
|
+
console.error(`[SlotMixin] No shadowRoot was found`);
|
|
139
|
+
}
|
|
140
|
+
const registryRoot = supportsScopedRegistry ? this.shadowRoot : document;
|
|
135
141
|
|
|
136
142
|
// @ts-expect-error wait for browser support
|
|
137
143
|
const renderTargetThatRespectsShadowRootScoping = registryRoot.createElement('div');
|
|
@@ -208,8 +208,8 @@ describe('<lion-form>', () => {
|
|
|
208
208
|
<lion-form>
|
|
209
209
|
<form>
|
|
210
210
|
<${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
new Required(),
|
|
212
|
+
]}></${childTag}>
|
|
213
213
|
<${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
|
|
214
214
|
<button type="submit">submit</button>
|
|
215
215
|
</form>
|
|
@@ -229,8 +229,8 @@ describe('<lion-form>', () => {
|
|
|
229
229
|
<form>
|
|
230
230
|
<lion-fieldset name="name">
|
|
231
231
|
<${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
new Required(),
|
|
233
|
+
]}></${childTag}>
|
|
234
234
|
<${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
|
|
235
235
|
</lion-fieldset>
|
|
236
236
|
<button type="submit">submit</button>
|
|
@@ -788,6 +788,7 @@ export function runValidateMixinSuite(customConfig) {
|
|
|
788
788
|
await fixture(html`
|
|
789
789
|
<${tag}
|
|
790
790
|
.validators="${[
|
|
791
|
+
// @ts-expect-error
|
|
791
792
|
new EqualsLength(4, { getMessage: () => html`<div id="test123">test</div>` }),
|
|
792
793
|
]}" })]}"
|
|
793
794
|
.modelValue="${'123'}"
|
|
@@ -1485,9 +1485,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
|
|
|
1485
1485
|
const el = /** @type {DynamicCWrapper} */ (
|
|
1486
1486
|
await fixture(html`
|
|
1487
1487
|
<${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1488
|
+
firstName: 'foo',
|
|
1489
|
+
lastName: 'bar',
|
|
1490
|
+
}}">
|
|
1491
1491
|
</${dynamicChildrenTag}>
|
|
1492
1492
|
`)
|
|
1493
1493
|
);
|
|
@@ -1503,9 +1503,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
|
|
|
1503
1503
|
const el2 = /** @type {DynamicCWrapper} */ (
|
|
1504
1504
|
await fixture(html`
|
|
1505
1505
|
<${dynamicChildrenTag} .fields="${['firstName']}" .serializedValue="${{
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1506
|
+
firstName: 'foo',
|
|
1507
|
+
lastName: 'bar',
|
|
1508
|
+
}}">
|
|
1509
1509
|
</${dynamicChildrenTag}>
|
|
1510
1510
|
`)
|
|
1511
1511
|
);
|
|
@@ -1530,9 +1530,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
|
|
|
1530
1530
|
const el = /** @type {DynamicCWrapper} */ (
|
|
1531
1531
|
await fixture(html`
|
|
1532
1532
|
<${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1533
|
+
firstName: 'foo',
|
|
1534
|
+
lastName: 'bar',
|
|
1535
|
+
}}">
|
|
1536
1536
|
</${dynamicChildrenTag}>
|
|
1537
1537
|
`)
|
|
1538
1538
|
);
|
|
@@ -1551,9 +1551,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
|
|
|
1551
1551
|
const el2 = /** @type {DynamicCWrapper} */ (
|
|
1552
1552
|
await fixture(html`
|
|
1553
1553
|
<${dynamicChildrenTag} .fields="${['firstName']}" .serializedValue="${{
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1554
|
+
firstName: 'foo',
|
|
1555
|
+
lastName: 'bar',
|
|
1556
|
+
}}">
|
|
1557
1557
|
</${dynamicChildrenTag}>
|
|
1558
1558
|
`)
|
|
1559
1559
|
);
|
|
@@ -1574,9 +1574,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
|
|
|
1574
1574
|
const el = /** @type {DynamicCWrapper} */ (
|
|
1575
1575
|
await fixture(html`
|
|
1576
1576
|
<${dynamicChildrenTag} .modelValue="${{
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1577
|
+
firstName: 'foo',
|
|
1578
|
+
lastName: 'bar',
|
|
1579
|
+
}}">
|
|
1580
1580
|
</${dynamicChildrenTag}>
|
|
1581
1581
|
`)
|
|
1582
1582
|
);
|
|
@@ -1595,9 +1595,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
|
|
|
1595
1595
|
const el2 = /** @type {DynamicCWrapper} */ (
|
|
1596
1596
|
await fixture(html`
|
|
1597
1597
|
<${dynamicChildrenTag} .serializedValue="${{
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1598
|
+
firstName: 'foo',
|
|
1599
|
+
lastName: 'bar',
|
|
1600
|
+
}}">
|
|
1601
1601
|
</${dynamicChildrenTag}>
|
|
1602
1602
|
`)
|
|
1603
1603
|
);
|
|
@@ -17,10 +17,12 @@ import '@lion/ui/define/lion-radio.js';
|
|
|
17
17
|
// Test umbrella form inside dialog
|
|
18
18
|
describe('Form inside dialog Integrations', () => {
|
|
19
19
|
it('Successfully registers all form components inside a dialog', async () => {
|
|
20
|
-
const el = /** @type {LionDialog} */ await fixture(
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const el = /** @type {LionDialog} */ await fixture(
|
|
21
|
+
html` <lion-dialog>
|
|
22
|
+
<button slot="invoker">Open Dialog</button>
|
|
23
|
+
<umbrella-form slot="content"></umbrella-form>
|
|
24
|
+
</lion-dialog>`,
|
|
25
|
+
);
|
|
24
26
|
|
|
25
27
|
// @ts-ignore
|
|
26
28
|
const formEl = /** @type {LionForm} */ (el._overlayCtrl.contentNode._lionFormNode);
|
|
@@ -25,8 +25,17 @@ export class SbActionLogger extends LitElement {
|
|
|
25
25
|
|
|
26
26
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
27
27
|
display: block;
|
|
28
|
-
font-family:
|
|
29
|
-
|
|
28
|
+
font-family:
|
|
29
|
+
'Nunito Sans',
|
|
30
|
+
-apple-system,
|
|
31
|
+
'.SFNSText-Regular',
|
|
32
|
+
'San Francisco',
|
|
33
|
+
BlinkMacSystemFont,
|
|
34
|
+
'Segoe UI',
|
|
35
|
+
'Helvetica Neue',
|
|
36
|
+
Helvetica,
|
|
37
|
+
Arial,
|
|
38
|
+
sans-serif;
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
.header__info {
|
|
@@ -118,20 +118,18 @@ describe('lion-icon', () => {
|
|
|
118
118
|
window.addEventListener('importDone', resolve);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
const el = await fixture(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.svg
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
`,
|
|
134
|
-
);
|
|
121
|
+
const el = await fixture(html`
|
|
122
|
+
<lion-icon
|
|
123
|
+
.svg=${until(
|
|
124
|
+
import('./heart.svg.js').then(e => {
|
|
125
|
+
dispatchEvent(new CustomEvent('importDone'));
|
|
126
|
+
return e.default;
|
|
127
|
+
}),
|
|
128
|
+
html``,
|
|
129
|
+
)}
|
|
130
|
+
aria-label="Love"
|
|
131
|
+
></lion-icon>
|
|
132
|
+
`);
|
|
135
133
|
|
|
136
134
|
await svgLoading;
|
|
137
135
|
// We need to await the until directive is resolved and rendered to the dom
|
|
@@ -36,24 +36,20 @@ describe('<lion-input-amount>', () => {
|
|
|
36
36
|
|
|
37
37
|
it('formatAmount uses locale provided in formatOptions', async () => {
|
|
38
38
|
let el = /** @type {LionInputAmount} */ (
|
|
39
|
-
await fixture(
|
|
40
|
-
html`
|
|
41
|
-
<lion-input-amount
|
|
42
|
-
.formatOptions="${{ locale: 'en-GB' }}"
|
|
43
|
-
.modelValue="${123}"
|
|
44
|
-
></lion-input-amount>
|
|
45
|
-
`,
|
|
46
|
-
)
|
|
47
|
-
);
|
|
48
|
-
expect(el.formattedValue).to.equal('123.00');
|
|
49
|
-
el = await fixture(
|
|
50
|
-
html`
|
|
39
|
+
await fixture(html`
|
|
51
40
|
<lion-input-amount
|
|
52
|
-
.formatOptions="${{ locale: '
|
|
41
|
+
.formatOptions="${{ locale: 'en-GB' }}"
|
|
53
42
|
.modelValue="${123}"
|
|
54
43
|
></lion-input-amount>
|
|
55
|
-
|
|
44
|
+
`)
|
|
56
45
|
);
|
|
46
|
+
expect(el.formattedValue).to.equal('123.00');
|
|
47
|
+
el = await fixture(html`
|
|
48
|
+
<lion-input-amount
|
|
49
|
+
.formatOptions="${{ locale: 'nl-NL' }}"
|
|
50
|
+
.modelValue="${123}"
|
|
51
|
+
></lion-input-amount>
|
|
52
|
+
`);
|
|
57
53
|
expect(el.formattedValue).to.equal('123,00');
|
|
58
54
|
});
|
|
59
55
|
|
|
@@ -286,10 +286,10 @@ describe('<lion-input-datepicker>', () => {
|
|
|
286
286
|
|
|
287
287
|
it('converts MinDate validator to "minDate" property', async () => {
|
|
288
288
|
const myMinDate = new Date('2019/06/15');
|
|
289
|
-
const el = await fixture(
|
|
290
|
-
.validators="${[new MinDate(myMinDate)]}"
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
const el = await fixture(
|
|
290
|
+
html` <lion-input-datepicker .validators="${[new MinDate(myMinDate)]}">
|
|
291
|
+
</lion-input-datepicker>`,
|
|
292
|
+
);
|
|
293
293
|
const elObj = new DatepickerInputObject(el);
|
|
294
294
|
await elObj.openCalendar();
|
|
295
295
|
|
|
@@ -637,9 +637,9 @@ describe('lion-input-file', () => {
|
|
|
637
637
|
})
|
|
638
638
|
);
|
|
639
639
|
|
|
640
|
-
const el = await fixture(
|
|
641
|
-
|
|
642
|
-
);
|
|
640
|
+
const el = await fixture(html`
|
|
641
|
+
<lion-input-file multiple max-file-size="3" accept=".txt"></lion-input-file>
|
|
642
|
+
`);
|
|
643
643
|
|
|
644
644
|
setTimeout(() => {
|
|
645
645
|
mimicSelectFile(el, [file, fileWrongSize, file2, fileWrongType]);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { runInputTelSuite } from '@lion/ui/input-tel-test-suites.js';
|
|
2
2
|
import { repeat } from 'lit/directives/repeat.js';
|
|
3
3
|
import { ref } from 'lit/directives/ref.js';
|
|
4
|
-
import {
|
|
4
|
+
import { html } from 'lit';
|
|
5
|
+
import { aTimeout, expect, fixture } from '@open-wc/testing';
|
|
5
6
|
import { LionInputTelDropdown } from '@lion/ui/input-tel-dropdown.js';
|
|
6
7
|
import { LionOption } from '@lion/ui/listbox.js';
|
|
7
8
|
import { LionSelectRich } from '@lion/ui/select-rich.js';
|
|
@@ -45,8 +46,9 @@ class WithFormControlInputTelDropdown extends ScopedElementsMixin(LionInputTelDr
|
|
|
45
46
|
${repeat(
|
|
46
47
|
data.regionMetaList,
|
|
47
48
|
regionMeta => regionMeta.regionCode,
|
|
48
|
-
regionMeta =>
|
|
49
|
-
|
|
49
|
+
regionMeta => html`
|
|
50
|
+
<lion-option .choiceValue="${regionMeta.regionCode}"> </lion-option>
|
|
51
|
+
`,
|
|
50
52
|
)}
|
|
51
53
|
</lion-select-rich>
|
|
52
54
|
`;
|
|
@@ -85,8 +87,9 @@ describe('WithFormControlInputTelDropdown', () => {
|
|
|
85
87
|
${repeat(
|
|
86
88
|
data.regionMetaList,
|
|
87
89
|
regionMeta => regionMeta.regionCode,
|
|
88
|
-
regionMeta =>
|
|
89
|
-
|
|
90
|
+
regionMeta => html`
|
|
91
|
+
<lion-option .choiceValue="${regionMeta.regionCode}"> </lion-option>
|
|
92
|
+
`,
|
|
90
93
|
)}
|
|
91
94
|
</lion-select-rich>
|
|
92
95
|
`;
|
|
@@ -95,14 +98,12 @@ describe('WithFormControlInputTelDropdown', () => {
|
|
|
95
98
|
}
|
|
96
99
|
customElements.define('input-tel-dropdown-mac', InputTelDropdownMac);
|
|
97
100
|
const el = /** @type {LionInputTelDropdown} */ (
|
|
98
|
-
await fixture(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
`,
|
|
105
|
-
)
|
|
101
|
+
await fixture(html`
|
|
102
|
+
<input-tel-dropdown-mac
|
|
103
|
+
.allowedRegions="${['NL', 'BE']}"
|
|
104
|
+
.modelValue="${'+31612345678'}"
|
|
105
|
+
></input-tel-dropdown-mac>
|
|
106
|
+
`)
|
|
106
107
|
);
|
|
107
108
|
const dropdownElement = el.refs.dropdown.value;
|
|
108
109
|
// @ts-expect-error [allow-protected-in-tests]
|
|
@@ -139,8 +140,9 @@ describe('WithFormControlInputTelDropdown', () => {
|
|
|
139
140
|
${repeat(
|
|
140
141
|
data.regionMetaList,
|
|
141
142
|
regionMeta => regionMeta.regionCode,
|
|
142
|
-
regionMeta =>
|
|
143
|
-
|
|
143
|
+
regionMeta => html`
|
|
144
|
+
<lion-option .choiceValue="${regionMeta.regionCode}"> </lion-option>
|
|
145
|
+
`,
|
|
144
146
|
)}
|
|
145
147
|
</lion-select-rich>
|
|
146
148
|
`;
|
|
@@ -149,14 +151,12 @@ describe('WithFormControlInputTelDropdown', () => {
|
|
|
149
151
|
}
|
|
150
152
|
customElements.define('input-tel-dropdown-windows', InputTelDropdownWindows);
|
|
151
153
|
const el = /** @type {LionInputTelDropdown} */ (
|
|
152
|
-
await fixture(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
`,
|
|
159
|
-
)
|
|
154
|
+
await fixture(html`
|
|
155
|
+
<input-tel-dropdown-windows
|
|
156
|
+
.allowedRegions="${['NL', 'BE']}"
|
|
157
|
+
.modelValue="${'+31612345678'}"
|
|
158
|
+
></input-tel-dropdown-windows>
|
|
159
|
+
`)
|
|
160
160
|
);
|
|
161
161
|
const dropdownElement = el.refs.dropdown.value;
|
|
162
162
|
// @ts-expect-error [allow-protected-in-tests]
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { sendKeys } from '@web/test-runner-commands';
|
|
17
17
|
import sinon from 'sinon';
|
|
18
18
|
import { getListboxMembers } from '../../../exports/listbox-test-helpers.js';
|
|
19
|
+
import { browserDetection } from '../../core/src/browserDetection.js';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @typedef {import('../src/LionListbox.js').LionListbox} LionListbox
|
|
@@ -380,7 +381,12 @@ export function runListboxMixinSuite(customConfig = {}) {
|
|
|
380
381
|
await aTimeout(1000);
|
|
381
382
|
|
|
382
383
|
// top should be offset 2x40px (sticky header elems) instead of 0px
|
|
383
|
-
|
|
384
|
+
if (browserDetection.isChrome || browserDetection.isChromium) {
|
|
385
|
+
// TODO: find out why this is different in recent Chromium
|
|
386
|
+
expect(el.scrollTop).to.equal(160);
|
|
387
|
+
} else {
|
|
388
|
+
expect(el.scrollTop).to.equal(116);
|
|
389
|
+
}
|
|
384
390
|
});
|
|
385
391
|
});
|
|
386
392
|
|
|
@@ -1633,8 +1639,9 @@ export function runListboxMixinSuite(customConfig = {}) {
|
|
|
1633
1639
|
${repeat(
|
|
1634
1640
|
this.options,
|
|
1635
1641
|
(/** @type {string} */ option) => option,
|
|
1636
|
-
(/** @type {string} */ option) =>
|
|
1637
|
-
|
|
1642
|
+
(/** @type {string} */ option) => html`
|
|
1643
|
+
<lion-option .choiceValue="${option}">${option}</lion-option>
|
|
1644
|
+
`,
|
|
1638
1645
|
)}
|
|
1639
1646
|
</${tag}>
|
|
1640
1647
|
`;
|
|
@@ -21,7 +21,6 @@ export function normalizeIntlDate(str, locale = '', { weekday, year, month, day
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const result = dateString.join('');
|
|
24
|
-
|
|
25
24
|
// Normalize webkit date formatting without year
|
|
26
25
|
if (!year && weekday === 'long' && month === 'long' && day === '2-digit') {
|
|
27
26
|
const CHINESE_LOCALES = [
|
|
@@ -43,7 +42,7 @@ export function normalizeIntlDate(str, locale = '', { weekday, year, month, day
|
|
|
43
42
|
return result.replace(' ', '');
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
if (result.indexOf(',') === -1 && locale === 'en-GB') {
|
|
45
|
+
if ((result.indexOf(',') === -1 && locale === 'en-GB') || locale === 'en-AU') {
|
|
47
46
|
// Saturday 12 October -> Saturday, 12 October
|
|
48
47
|
const match = result.match(/^(\w*) (\d*) (\w*)$/);
|
|
49
48
|
if (match !== null) {
|
|
@@ -63,6 +62,18 @@ export function normalizeIntlDate(str, locale = '', { weekday, year, month, day
|
|
|
63
62
|
return `${match[1]}, ${match[3]} ${match[2]}`;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
65
|
+
|
|
66
|
+
if (locale === 'uk-UA') {
|
|
67
|
+
// суботу => субота
|
|
68
|
+
return result.replace('суботу', 'субота');
|
|
69
|
+
}
|
|
70
|
+
} else if (weekday === 'long' && month === 'long' && day === '2-digit') {
|
|
71
|
+
if (result.indexOf(',') === -1 && locale.startsWith('en-')) {
|
|
72
|
+
// Saturday 12 October 2023 -> Saturday, 12 October 2023
|
|
73
|
+
const [, _weekDayName, _monthDayNumber, _monthName, _year] =
|
|
74
|
+
result.match(/^(\w*) (\d*) (\w*) (\d*)$/) || [];
|
|
75
|
+
return `${_weekDayName}, ${_monthDayNumber} ${_monthName} ${_year}`;
|
|
76
|
+
}
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
return result;
|