@lion/ui 0.12.0 → 0.13.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/accordion/src/LionAccordion.js +3 -2
- package/components/button/src/LionButton.js +6 -10
- package/components/button/src/LionButtonReset.js +2 -0
- package/components/button/src/LionButtonSubmit.js +2 -0
- package/components/button/test-suites/LionButton.suite.js +0 -14
- package/components/checkbox-group/src/LionCheckbox.js +3 -0
- package/components/checkbox-group/src/LionCheckboxGroup.js +2 -0
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +3 -0
- package/components/collapsible/src/LionCollapsible.js +4 -1
- package/components/combobox/src/LionCombobox.js +31 -8
- package/components/combobox/test/lion-combobox.test.js +206 -57
- package/components/dialog/src/LionDialog.js +3 -0
- package/components/drawer/src/LionDrawer.js +9 -0
- package/components/fieldset/src/LionFieldset.js +1 -1
- package/components/form/src/LionForm.js +0 -1
- package/components/form-core/src/FocusMixin.js +1 -0
- package/components/form-core/src/FormControlMixin.js +33 -18
- package/components/form-core/src/FormatMixin.js +1 -1
- package/components/form-core/src/validate/LionValidationFeedback.js +8 -10
- package/components/form-core/src/validate/ValidateMixin.js +40 -4
- package/components/form-core/test/FormControlMixin.test.js +68 -0
- package/components/form-core/test/validate/lion-validation-feedback.test.js +0 -22
- package/components/form-core/test-suites/ValidateMixin.suite.js +19 -3
- package/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js +119 -0
- package/components/form-core/types/validate/validate.ts +1 -0
- package/components/icon/src/LionIcon.js +2 -0
- package/components/input-file/src/LionInputFile.js +9 -0
- package/components/input-tel/src/LionInputTel.js +3 -0
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +2 -0
- package/components/listbox/src/LionListbox.js +2 -0
- package/components/overlays/src/OverlayController.js +32 -5
- package/components/overlays/src/OverlayMixin.js +5 -0
- package/components/overlays/src/configurations/withDropdownConfig.js +0 -1
- package/components/overlays/src/configurations/withTooltipConfig.js +0 -1
- package/components/overlays/test/OverlayController.test.js +16 -4
- package/components/overlays/test-suites/OverlayMixin.suite.js +71 -0
- package/components/progress-indicator/src/LionProgressIndicator.js +4 -0
- package/components/radio-group/src/LionRadioGroup.js +3 -1
- package/components/select/src/LionSelect.js +4 -0
- package/components/select-rich/src/LionSelectInvoker.js +2 -0
- package/components/select-rich/src/LionSelectRich.js +2 -0
- package/components/steps/src/LionStep.js +0 -1
- package/components/steps/src/LionSteps.js +0 -1
- package/components/switch/src/LionSwitch.js +3 -0
- package/components/switch/src/LionSwitchButton.js +5 -0
- package/components/tabs/src/LionTabs.js +8 -0
- package/custom-elements.json +1271 -406
- package/dist-types/components/accordion/src/LionAccordion.d.ts +3 -2
- package/dist-types/components/accordion/src/LionAccordion.d.ts.map +1 -1
- package/dist-types/components/button/src/LionButton.d.ts +2 -1
- package/dist-types/components/button/src/LionButton.d.ts.map +1 -1
- package/dist-types/components/button/src/LionButtonReset.d.ts +2 -0
- package/dist-types/components/button/src/LionButtonReset.d.ts.map +1 -1
- package/dist-types/components/button/src/LionButtonSubmit.d.ts +2 -0
- package/dist-types/components/button/src/LionButtonSubmit.d.ts.map +1 -1
- package/dist-types/components/button/test-suites/LionButton.suite.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/src/LionCheckbox.d.ts +3 -0
- package/dist-types/components/checkbox-group/src/LionCheckbox.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/src/LionCheckboxGroup.d.ts +2 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxGroup.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts +3 -0
- package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts.map +1 -1
- package/dist-types/components/collapsible/src/LionCollapsible.d.ts +3 -1
- package/dist-types/components/collapsible/src/LionCollapsible.d.ts.map +1 -1
- package/dist-types/components/combobox/src/LionCombobox.d.ts +5 -0
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/core/src/ScopedElementsMixin.d.ts.map +1 -1
- package/dist-types/components/dialog/src/LionDialog.d.ts +3 -0
- package/dist-types/components/dialog/src/LionDialog.d.ts.map +1 -1
- package/dist-types/components/drawer/src/LionDrawer.d.ts +9 -0
- package/dist-types/components/drawer/src/LionDrawer.d.ts.map +1 -1
- package/dist-types/components/fieldset/src/LionFieldset.d.ts +1 -1
- package/dist-types/components/form/src/LionForm.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FocusMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FormControlMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +4 -3
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/ValidateMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/ValidateMixin.suite.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.d.ts.map +1 -1
- package/dist-types/components/form-core/types/validate/validate.d.ts +1 -0
- package/dist-types/components/form-core/types/validate/validate.d.ts.map +1 -1
- package/dist-types/components/icon/src/LionIcon.d.ts +2 -0
- package/dist-types/components/icon/src/LionIcon.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts +9 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/LionInputTel.d.ts +3 -0
- package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +2 -0
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/listbox/src/LionListbox.d.ts +2 -0
- package/dist-types/components/listbox/src/LionListbox.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts +4 -0
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/overlays/src/configurations/withDropdownConfig.d.ts.map +1 -1
- package/dist-types/components/overlays/src/configurations/withTooltipConfig.d.ts.map +1 -1
- package/dist-types/components/overlays/test/OverlayController.test.d.ts.map +1 -1
- package/dist-types/components/overlays/test-suites/OverlayMixin.suite.d.ts.map +1 -1
- package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts +3 -0
- package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts.map +1 -1
- package/dist-types/components/radio-group/src/LionRadioGroup.d.ts +3 -1
- package/dist-types/components/radio-group/src/LionRadioGroup.d.ts.map +1 -1
- package/dist-types/components/select/src/LionSelect.d.ts +3 -0
- package/dist-types/components/select/src/LionSelect.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +2 -0
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +3 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/components/steps/src/LionStep.d.ts +0 -1
- package/dist-types/components/steps/src/LionStep.d.ts.map +1 -1
- package/dist-types/components/steps/src/LionSteps.d.ts +0 -1
- package/dist-types/components/steps/src/LionSteps.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitch.d.ts +3 -0
- package/dist-types/components/switch/src/LionSwitch.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitchButton.d.ts +5 -0
- package/dist-types/components/switch/src/LionSwitchButton.d.ts.map +1 -1
- package/dist-types/components/tabs/src/LionTabs.d.ts +8 -0
- package/dist-types/components/tabs/src/LionTabs.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/api-table.md +8 -0
- package/docs/components/button/api-table.md +0 -3
- package/docs/components/checkbox-group/api-table.md +6 -6
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/api-table.md +7 -0
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/api-table.md +9 -2
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +90 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/drawer/api-table.md +8 -0
- package/docs/components/fieldset/api-table.md +2 -2
- 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/api-table.md +2 -2
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/api-table.md +2 -2
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/api-table.md +2 -2
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/api-table.md +2 -2
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/api-table.md +2 -2
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/api-table.md +9 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/api-table.md +2 -2
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/api-table.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/api-table.md +2 -2
- 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/api-table.md +2 -2
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/api-table.md +2 -2
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/api-table.md +4 -4
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/api-table.md +2 -2
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/api-table.md +2 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/switch/api-table.md +2 -2
- package/docs/components/tabs/api-table.md +7 -0
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/textarea/api-table.md +2 -2
- 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/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/api-table.md +2 -2
- 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/styling.md +3 -20
- package/docs/fundamentals/systems/form/validate.md +19 -3
- 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 +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-new */
|
|
2
2
|
import { OverlayController, overlays } from '@lion/ui/overlays.js';
|
|
3
3
|
import { mimicClick } from '@lion/ui/overlays-test-helpers.js';
|
|
4
|
+
import { sendKeys } from '@web/test-runner-commands';
|
|
4
5
|
import sinon from 'sinon';
|
|
5
6
|
import {
|
|
6
7
|
unsafeStatic,
|
|
@@ -28,12 +29,22 @@ const wrappingDialogNodeStyle = 'display: none; z-index: 9999; padding: 0px;';
|
|
|
28
29
|
/**
|
|
29
30
|
* A small wrapper function that closely mimics an escape press from a user
|
|
30
31
|
* (prevents common mistakes like no bubbling or keydown)
|
|
31
|
-
* @param {
|
|
32
|
+
* @param {HTMLElement|Document} element
|
|
32
33
|
*/
|
|
33
34
|
async function mimicEscapePress(element) {
|
|
34
|
-
element
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
// Make sure that the element inside the dialog is focusable (and cleanup after)
|
|
36
|
+
if (element instanceof HTMLElement) {
|
|
37
|
+
const { tabIndex: tabIndexBefore } = element;
|
|
38
|
+
// eslint-disable-next-line no-param-reassign
|
|
39
|
+
element.tabIndex = -1;
|
|
40
|
+
element.focus();
|
|
41
|
+
// eslint-disable-next-line no-param-reassign
|
|
42
|
+
element.tabIndex = tabIndexBefore; // make sure element is focusable
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Send the event
|
|
46
|
+
await sendKeys({ press: 'Escape' });
|
|
47
|
+
// Wait for at least a microtask, so that possible property effects are performed
|
|
37
48
|
await aTimeout(0);
|
|
38
49
|
}
|
|
39
50
|
|
|
@@ -726,6 +737,7 @@ describe('OverlayController', () => {
|
|
|
726
737
|
)
|
|
727
738
|
);
|
|
728
739
|
const { parentOverlay, childOverlay } = await createNestedEscControllers(parentContent);
|
|
740
|
+
|
|
729
741
|
await mimicEscapePress(childOverlay.contentNode);
|
|
730
742
|
|
|
731
743
|
expect(parentOverlay.isShown).to.be.true;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unsafeStatic,
|
|
3
|
+
fixtureSync,
|
|
3
4
|
nextFrame,
|
|
4
5
|
aTimeout,
|
|
5
6
|
defineCE,
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
html,
|
|
9
10
|
} from '@open-wc/testing';
|
|
10
11
|
import { overlays as overlaysManager, OverlayController } from '@lion/ui/overlays.js';
|
|
12
|
+
import { sendKeys } from '@web/test-runner-commands';
|
|
11
13
|
import { browserDetection } from '@lion/ui/core.js';
|
|
12
14
|
import { cache } from 'lit/directives/cache.js';
|
|
13
15
|
import '@lion/ui/define/lion-dialog.js';
|
|
@@ -30,6 +32,28 @@ function resetOverlaysManager() {
|
|
|
30
32
|
overlaysManager.list.forEach(overlayCtrl => overlaysManager.remove(overlayCtrl));
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
/**
|
|
36
|
+
* A small wrapper function that closely mimics an escape press from a user
|
|
37
|
+
* (prevents common mistakes like no bubbling or keydown)
|
|
38
|
+
* @param {HTMLElement|Document} element
|
|
39
|
+
*/
|
|
40
|
+
async function mimicEscapePress(element) {
|
|
41
|
+
// Make sure that the element inside the dialog is focusable (and cleanup after)
|
|
42
|
+
if (element instanceof HTMLElement) {
|
|
43
|
+
const { tabIndex: tabIndexBefore } = element;
|
|
44
|
+
// eslint-disable-next-line no-param-reassign
|
|
45
|
+
element.tabIndex = -1;
|
|
46
|
+
element.focus();
|
|
47
|
+
// eslint-disable-next-line no-param-reassign
|
|
48
|
+
element.tabIndex = tabIndexBefore; // make sure element is focusable
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Send the event
|
|
52
|
+
await sendKeys({ press: 'Escape' });
|
|
53
|
+
// Wait for at least a microtask, so that possible property effects are performed
|
|
54
|
+
await aTimeout(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
33
57
|
/**
|
|
34
58
|
* @param {{tagString:string, tag: object, suffix?:string}} config
|
|
35
59
|
*/
|
|
@@ -315,6 +339,33 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|
|
315
339
|
expect(getComputedStyle(el._overlayCtrl.contentWrapperNode).display).not.to.equal('none');
|
|
316
340
|
});
|
|
317
341
|
|
|
342
|
+
it('does not run setup when disconnected', async () => {
|
|
343
|
+
const el = /** @type {OverlayEl} */ (
|
|
344
|
+
fixtureSync(html`
|
|
345
|
+
<${tag}>
|
|
346
|
+
<div slot="content">content</div>
|
|
347
|
+
<button slot="invoker">invoker button</button>
|
|
348
|
+
</${tag}>
|
|
349
|
+
`)
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
const parentOfEl = /** @type {HTMLDivElement} */ (el.parentElement);
|
|
353
|
+
|
|
354
|
+
// @ts-expect-error [allow-protected-in-tests]
|
|
355
|
+
const setupSpy = sinon.spy(el, '_setupOverlayCtrl');
|
|
356
|
+
// In some client apps, this sync disconnect happens...
|
|
357
|
+
parentOfEl.removeChild(el);
|
|
358
|
+
await el.updateComplete;
|
|
359
|
+
expect(setupSpy.callCount).to.equal(0);
|
|
360
|
+
|
|
361
|
+
// Now add el again...
|
|
362
|
+
parentOfEl.appendChild(el);
|
|
363
|
+
await el.updateComplete;
|
|
364
|
+
expect(setupSpy.callCount).to.equal(1);
|
|
365
|
+
|
|
366
|
+
setupSpy.restore();
|
|
367
|
+
});
|
|
368
|
+
|
|
318
369
|
/** Prevent unnecessary reset side effects, such as show animation. See: https://github.com/ing-bank/lion/issues/1075 */
|
|
319
370
|
it('does not call updateConfig on equivalent config change', async () => {
|
|
320
371
|
const el = /** @type {OverlayEl} */ (
|
|
@@ -339,6 +390,26 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|
|
339
390
|
stub.restore();
|
|
340
391
|
});
|
|
341
392
|
|
|
393
|
+
it('should not visually hide when hidesOnEsc / hidesOnOutsideEsc is not configured', async () => {
|
|
394
|
+
const el = /** @type {OverlayEl} */ (
|
|
395
|
+
await fixture(html`
|
|
396
|
+
<${tag} .config="${{ hidesOnEsc: false, hidesOnOutsideEsc: false }}" opened>
|
|
397
|
+
<div slot="content">content of the overlay</div>
|
|
398
|
+
<button slot="invoker">invoker button</button>
|
|
399
|
+
</${tag}>
|
|
400
|
+
`)
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
const dialogEl = /** @type {HTMLDialogElement} */ (el._overlayCtrl.__wrappingDialogNode);
|
|
404
|
+
|
|
405
|
+
// @ts-expect-error [allow-protected-in-tests]
|
|
406
|
+
expect(dialogEl.checkVisibility()).to.be.true;
|
|
407
|
+
// @ts-expect-error [allow-protected-in-tests]
|
|
408
|
+
await mimicEscapePress(el._overlayContentNode);
|
|
409
|
+
// @ts-expect-error [allow-protected-in-tests]
|
|
410
|
+
expect(dialogEl.checkVisibility()).to.be.true;
|
|
411
|
+
});
|
|
412
|
+
|
|
342
413
|
describe('Teardown', () => {
|
|
343
414
|
it('does not teardown when moving dom nodes', async () => {
|
|
344
415
|
const el = /** @type {OverlayEl} */ (
|
|
@@ -5,6 +5,10 @@ import { getLocalizeManager, LocalizeMixin } from '@lion/ui/localize-no-side-eff
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {import('lit').TemplateResult} TemplateResult
|
|
7
7
|
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @customElement lion-progress-indicator
|
|
11
|
+
*/
|
|
8
12
|
export class LionProgressIndicator extends LocalizeMixin(LitElement) {
|
|
9
13
|
static get properties() {
|
|
10
14
|
return {
|
|
@@ -2,7 +2,9 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import { ChoiceGroupMixin, FormGroupMixin } from '@lion/ui/form-core.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* A wrapper around multiple radios.
|
|
5
|
+
* LionRadioGroup: A wrapper around multiple radios.
|
|
6
|
+
*
|
|
7
|
+
* @customElement lion-radio-group
|
|
6
8
|
*/
|
|
7
9
|
export class LionRadioGroup extends ChoiceGroupMixin(FormGroupMixin(LitElement)) {
|
|
8
10
|
connectedCallback() {
|
|
@@ -4,6 +4,10 @@ import { LionField } from '@lion/ui/form-core.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {import('../../localize/types/LocalizeMixinTypes.js').FormatNumberOptions} FormatOptions
|
|
6
6
|
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @customElement lion-field-with-select
|
|
10
|
+
*/
|
|
7
11
|
class LionFieldWithSelect extends LionField {
|
|
8
12
|
/** @type {any} */
|
|
9
13
|
static get properties() {
|
|
@@ -11,6 +11,8 @@ import { SlotMixin } from '@lion/ui/core.js';
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* LionSelectInvoker: invoker button consuming a selected element
|
|
14
|
+
*
|
|
15
|
+
* @customElement lion-select-invoker
|
|
14
16
|
*/
|
|
15
17
|
export class LionSelectInvoker extends SlotMixin(LionButton) {
|
|
16
18
|
static get styles() {
|
|
@@ -22,6 +22,8 @@ function detectInteractionMode() {
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* LionSelectRich: wraps the <lion-listbox> element
|
|
25
|
+
*
|
|
26
|
+
* @customElement lion-field-with-select
|
|
25
27
|
*/
|
|
26
28
|
export class LionSelectRich extends SlotMixin(ScopedElementsMixin(OverlayMixin(LionListbox))) {
|
|
27
29
|
static get scopedElements() {
|
|
@@ -3,6 +3,9 @@ import { ChoiceInputMixin, LionField } from '@lion/ui/form-core.js';
|
|
|
3
3
|
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
4
4
|
import { LionSwitchButton } from './LionSwitchButton.js';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @customElement lion-switch
|
|
8
|
+
*/
|
|
6
9
|
export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField)) {
|
|
7
10
|
static get styles() {
|
|
8
11
|
return [
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
2
|
import { DisabledWithTabIndexMixin } from '@lion/ui/core.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* `LionSwitchButton` is a custom switch button component. It's a private component used within LionSwitch
|
|
6
|
+
*
|
|
7
|
+
* @customElement lion-switch-button
|
|
8
|
+
*/
|
|
4
9
|
export class LionSwitchButton extends DisabledWithTabIndexMixin(LitElement) {
|
|
5
10
|
static get properties() {
|
|
6
11
|
return {
|
|
@@ -109,6 +109,14 @@ function handleButtonKeydown(ev) {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* LionTabs: A tabbed interface component
|
|
114
|
+
*
|
|
115
|
+
* @slot tab - The tab elements for the tabs
|
|
116
|
+
* @slot panel - The panel elements for the tabs
|
|
117
|
+
*
|
|
118
|
+
* @customElement lion-tabs
|
|
119
|
+
*/
|
|
112
120
|
export class LionTabs extends LitElement {
|
|
113
121
|
static get properties() {
|
|
114
122
|
return {
|