@lion/ui 0.18.0-menu-system.6 → 0.18.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/collapsible.js +0 -1
- package/components/button/src/LionButton.js +0 -4
- package/components/button/test-suites/LionButton.suite.js +0 -1
- package/components/calendar/src/LionCalendar.js +1 -3
- package/components/combobox/test/lion-combobox.test.js +0 -1
- package/components/form-core/src/form-group/FormGroupMixin.js +0 -7
- package/components/form-core/src/registration/FormRegistrarMixin.js +0 -11
- package/components/form-core/test/FormControlMixin.test.js +0 -1
- package/components/form-core/test/validate/Validator.test.js +0 -2
- package/components/form-core/test-suites/ValidateMixin.suite.js +0 -2
- package/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js +0 -1
- package/components/input-datepicker/src/localizeNamespaceLoader.js +0 -1
- package/components/input-datepicker/test/lion-input-datepicker.test.js +6 -5
- package/components/listbox/test-suites/ListboxMixin.suite.js +1 -7
- package/components/localize/src/date/utils/normalizeIntlDate.js +2 -3
- package/components/localize/test/date/formatDate.test.js +2 -3
- package/components/overlays/src/OverlayController.js +110 -278
- package/components/overlays/src/OverlayMixin.js +11 -58
- package/components/overlays/src/OverlaysManager.js +2 -2
- package/components/overlays/src/configurations/withDropdownConfig.js +2 -22
- package/components/overlays/src/configurations/withPopoverConfig.js +32 -0
- package/components/overlays/src/utils/adopt-styles.js +5 -4
- package/components/overlays/src/utils/get-focusable-elements.js +0 -4
- package/components/overlays/src/utils/is-equal-config.js +6 -10
- package/components/overlays/test/OverlayController.test.js +21 -128
- package/components/overlays/test/utils-tests/is-equal-config.test.js +1 -1
- package/components/overlays/test-suites/OverlayMixin.suite.js +8 -8
- package/components/overlays/types/ArrowMixinTypes.ts +1 -3
- package/components/overlays/types/OverlayConfig.ts +5 -20
- package/components/select-rich/test/lion-select-rich.test.js +0 -3
- package/components/switch/src/LionSwitchButton.js +8 -3
- package/components/switch/test/lion-switch-button.test.js +38 -0
- package/custom-elements.json +17566 -30468
- package/dist-types/components/button/src/LionButton.d.ts +0 -1
- package/dist-types/components/button/src/LionButton.d.ts.map +1 -1
- package/dist-types/components/button/test-suites/LionButton.suite.d.ts.map +1 -1
- package/dist-types/components/calendar/src/LionCalendar.d.ts.map +1 -1
- package/dist-types/components/dialog/src/LionDialog.d.ts +1 -5
- package/dist-types/components/dialog/src/LionDialog.d.ts.map +1 -1
- package/dist-types/components/form-core/src/form-group/FormGroupMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/registration/FormRegistrarMixin.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/input-datepicker/src/localizeNamespaceLoader.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/components/overlays/src/OverlayController.d.ts +12 -24
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/overlays/src/configurations/withDropdownConfig.d.ts +0 -1
- package/dist-types/components/overlays/src/configurations/withDropdownConfig.d.ts.map +1 -1
- package/dist-types/components/overlays/src/configurations/withPopoverConfig.d.ts +6 -0
- package/dist-types/components/overlays/src/configurations/withPopoverConfig.d.ts.map +1 -0
- package/dist-types/components/overlays/src/utils/get-focusable-elements.d.ts.map +1 -1
- package/dist-types/components/overlays/src/utils/is-equal-config.d.ts.map +1 -1
- package/dist-types/components/overlays/types/ArrowMixinTypes.d.ts.map +1 -1
- package/dist-types/components/overlays/types/OverlayConfig.d.ts +2 -12
- package/dist-types/components/overlays/types/OverlayConfig.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +2 -10
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitchButton.d.ts +6 -0
- package/dist-types/components/switch/src/LionSwitchButton.d.ts.map +1 -1
- package/dist-types/exports/overlays.d.ts +1 -3
- package/dist-types/exports/overlays.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/api-table.md +8 -21
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/api-table.md +6 -31
- 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/api-table.md +4 -21
- 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/api-table.md +5 -21
- package/docs/components/select-rich/use-cases.md +2 -2
- package/docs/components/switch/api-table.md +2 -0
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/tooltip/api-table.md +11 -36
- 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/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/api-table.md +34 -36
- 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/how-to/index.md +1 -1
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/exports/collapsible.js +0 -1
- package/exports/overlays.js +1 -6
- package/overlays.js +1 -6
- package/package.json +1 -1
- package/components/collapsible/src/DisclosureMixin.js +0 -313
- package/components/collapsible/test-suites/DisclosureMixin.suite.js +0 -30
- package/components/collapsible/types/DisclosureMixinTypes.ts +0 -48
- package/components/menu/CHANGELOG.md +0 -37
- package/components/menu/README.md +0 -335
- package/components/menu/index.js +0 -2
- package/components/menu/lion-menu-overlay.js +0 -3
- package/components/menu/lion-menu.js +0 -3
- package/components/menu/lion-spinbutton.js +0 -3
- package/components/menu/lion-toolbar.js +0 -3
- package/components/menu/lion-tree.js +0 -3
- package/components/menu/package.json +0 -46
- package/components/menu/requirements.temp.md +0 -12
- package/components/menu/src/InteractiveListMixin.js +0 -841
- package/components/menu/src/LionMenu.js +0 -250
- package/components/menu/src/LionMenuHybrid.js +0 -46
- package/components/menu/src/LionMenuOverlay.js +0 -155
- package/components/menu/src/LionSpinbutton.js +0 -213
- package/components/menu/src/LionToolbar.js +0 -94
- package/components/menu/src/LionTree.js +0 -52
- package/components/menu/src/MoreButtonMenuMixin.js +0 -278
- package/components/menu/src/MultiLevelListMixin.js +0 -274
- package/components/menu/src/utils/isInView.js +0 -26
- package/components/menu/src/utils/listItemInteractions.js +0 -124
- package/components/menu/src/utils/uuid.js +0 -3
- package/components/menu/test/lion-menu.test.js +0 -6
- package/components/menu/test-suites/InteractiveListMixin.suite.js +0 -642
- package/components/menu/test-suites/LionMenuHybrid.suite.js +0 -583
- package/components/menu/types/InteractiveListMixinTypes.d.ts +0 -82
- package/components/navigation-bar/README.md +0 -1
- package/components/navigation-bar/src/LionNavigationBar.js +0 -439
- package/components/navigation-bar/src/types.js +0 -41
- package/components/overlays/NEXT.md +0 -49
- package/dist-types/components/collapsible/src/DisclosureMixin.d.ts +0 -3
- package/dist-types/components/collapsible/src/DisclosureMixin.d.ts.map +0 -1
- package/dist-types/components/collapsible/test-suites/DisclosureMixin.suite.d.ts +0 -2
- package/dist-types/components/collapsible/test-suites/DisclosureMixin.suite.d.ts.map +0 -1
- package/dist-types/components/collapsible/types/DisclosureMixinTypes.d.ts +0 -24
- package/dist-types/components/collapsible/types/DisclosureMixinTypes.d.ts.map +0 -1
- package/dist-types/components/menu/index.d.ts +0 -3
- package/dist-types/components/menu/index.d.ts.map +0 -1
- package/dist-types/components/menu/lion-menu-overlay.d.ts +0 -2
- package/dist-types/components/menu/lion-menu-overlay.d.ts.map +0 -1
- package/dist-types/components/menu/lion-menu.d.ts +0 -2
- package/dist-types/components/menu/lion-menu.d.ts.map +0 -1
- package/dist-types/components/menu/lion-spinbutton.d.ts +0 -2
- package/dist-types/components/menu/lion-spinbutton.d.ts.map +0 -1
- package/dist-types/components/menu/lion-toolbar.d.ts +0 -2
- package/dist-types/components/menu/lion-toolbar.d.ts.map +0 -1
- package/dist-types/components/menu/lion-tree.d.ts +0 -2
- package/dist-types/components/menu/lion-tree.d.ts.map +0 -1
- package/dist-types/components/menu/src/InteractiveListMixin.d.ts +0 -617
- package/dist-types/components/menu/src/InteractiveListMixin.d.ts.map +0 -1
- package/dist-types/components/menu/src/LionMenu.d.ts +0 -565
- package/dist-types/components/menu/src/LionMenu.d.ts.map +0 -1
- package/dist-types/components/menu/src/LionMenuHybrid.d.ts +0 -19
- package/dist-types/components/menu/src/LionMenuHybrid.d.ts.map +0 -1
- package/dist-types/components/menu/src/LionMenuOverlay.d.ts +0 -1013
- package/dist-types/components/menu/src/LionMenuOverlay.d.ts.map +0 -1
- package/dist-types/components/menu/src/LionSpinbutton.d.ts +0 -58
- package/dist-types/components/menu/src/LionSpinbutton.d.ts.map +0 -1
- package/dist-types/components/menu/src/LionToolbar.d.ts +0 -8
- package/dist-types/components/menu/src/LionToolbar.d.ts.map +0 -1
- package/dist-types/components/menu/src/LionTree.d.ts +0 -447
- package/dist-types/components/menu/src/LionTree.d.ts.map +0 -1
- package/dist-types/components/menu/src/MoreButtonMenuMixin.d.ts +0 -39
- package/dist-types/components/menu/src/MoreButtonMenuMixin.d.ts.map +0 -1
- package/dist-types/components/menu/src/MultiLevelListMixin.d.ts +0 -495
- package/dist-types/components/menu/src/MultiLevelListMixin.d.ts.map +0 -1
- package/dist-types/components/menu/src/utils/isInView.d.ts +0 -9
- package/dist-types/components/menu/src/utils/isInView.d.ts.map +0 -1
- package/dist-types/components/menu/src/utils/listItemInteractions.d.ts +0 -48
- package/dist-types/components/menu/src/utils/listItemInteractions.d.ts.map +0 -1
- package/dist-types/components/menu/src/utils/uuid.d.ts +0 -2
- package/dist-types/components/menu/src/utils/uuid.d.ts.map +0 -1
- package/dist-types/components/menu/test/lion-menu.test.d.ts +0 -2
- package/dist-types/components/menu/test/lion-menu.test.d.ts.map +0 -1
- package/dist-types/components/menu/test-suites/InteractiveListMixin.suite.d.ts +0 -14
- package/dist-types/components/menu/test-suites/InteractiveListMixin.suite.d.ts.map +0 -1
- package/dist-types/components/menu/test-suites/LionMenuHybrid.suite.d.ts +0 -5
- package/dist-types/components/menu/test-suites/LionMenuHybrid.suite.d.ts.map +0 -1
- package/dist-types/components/navigation-bar/src/LionNavigationBar.d.ts +0 -238
- package/dist-types/components/navigation-bar/src/LionNavigationBar.d.ts.map +0 -1
- package/dist-types/components/navigation-bar/src/types.d.ts +0 -85
- package/dist-types/components/navigation-bar/src/types.d.ts.map +0 -1
- package/dist-types/exports/define/lion-item.d.ts +0 -2
- package/dist-types/exports/define/lion-item.d.ts.map +0 -1
- package/dist-types/exports/define/lion-menu-overlay.d.ts +0 -2
- package/dist-types/exports/define/lion-menu-overlay.d.ts.map +0 -1
- package/dist-types/exports/define/lion-menu.d.ts +0 -2
- package/dist-types/exports/define/lion-menu.d.ts.map +0 -1
- package/dist-types/exports/define/lion-navigation-bar.d.ts +0 -2
- package/dist-types/exports/define/lion-navigation-bar.d.ts.map +0 -1
- package/dist-types/exports/define/lion-toolbar.d.ts +0 -2
- package/dist-types/exports/define/lion-toolbar.d.ts.map +0 -1
- package/dist-types/exports/define/lion-tree.d.ts +0 -2
- package/dist-types/exports/define/lion-tree.d.ts.map +0 -1
- package/dist-types/exports/menu-test-suites.d.ts +0 -2
- package/dist-types/exports/menu-test-suites.d.ts.map +0 -1
- package/dist-types/exports/menu.d.ts +0 -7
- package/dist-types/exports/menu.d.ts.map +0 -1
- package/dist-types/exports/navigation-bar.d.ts +0 -2
- package/dist-types/exports/navigation-bar.d.ts.map +0 -1
- package/docs/components/menu/api-table.md +0 -455
- package/docs/components/menu/applyMenuDemoStyles.js +0 -173
- package/docs/components/menu/extensions.md +0 -262
- package/docs/components/menu/index.md +0 -13
- package/docs/components/menu/overview.md +0 -422
- package/exports/define/lion-item.js +0 -3
- package/exports/define/lion-menu-overlay.js +0 -3
- package/exports/define/lion-menu.js +0 -3
- package/exports/define/lion-navigation-bar.js +0 -3
- package/exports/define/lion-toolbar.js +0 -3
- package/exports/define/lion-tree.js +0 -3
- package/exports/menu-test-suites.js +0 -2
- package/exports/menu.js +0 -7
- package/exports/navigation-bar.js +0 -1
- package/menu-test-suites.js +0 -2
- package/menu.js +0 -7
- package/navigation-bar.js +0 -1
|
@@ -33,7 +33,10 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
33
33
|
class OverlayMixin extends superclass {
|
|
34
34
|
static get properties() {
|
|
35
35
|
return {
|
|
36
|
-
opened: {
|
|
36
|
+
opened: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
reflect: true,
|
|
39
|
+
},
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
42
|
|
|
@@ -59,17 +62,6 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
59
62
|
this.open = this.open.bind(this);
|
|
60
63
|
/** @type {EventListener} */
|
|
61
64
|
this.close = this.close.bind(this);
|
|
62
|
-
|
|
63
|
-
// // By default, we go for disclosure behavior
|
|
64
|
-
// // TODO: in the future, bring disclosure behavior to a controller (and therefore directive).
|
|
65
|
-
// // Take inspiration from VisibilityToggleCtrl of portal elements
|
|
66
|
-
// /**
|
|
67
|
-
// * Terminology aligned with https://open-ui.org/components/openable.explainer/
|
|
68
|
-
// * @type {'disclosure'|'overlay'}
|
|
69
|
-
// */
|
|
70
|
-
// this.openableMode = 'disclosure';
|
|
71
|
-
|
|
72
|
-
// allow hybrid disclosure/overlay components
|
|
73
65
|
}
|
|
74
66
|
|
|
75
67
|
get config() {
|
|
@@ -78,7 +70,6 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
78
70
|
|
|
79
71
|
/** @param {OverlayConfig} value */
|
|
80
72
|
set config(value) {
|
|
81
|
-
// TODO: built-in in overlayCtrl now... delete here
|
|
82
73
|
const shouldUpdate = !isEqualConfig(this.config, value);
|
|
83
74
|
|
|
84
75
|
if (this._overlayCtrl && shouldUpdate) {
|
|
@@ -170,8 +161,6 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
170
161
|
*/
|
|
171
162
|
// eslint-disable-next-line class-methods-use-this
|
|
172
163
|
_setupOpenCloseListeners() {
|
|
173
|
-
// Keeps the close-overlay event private for the controller.
|
|
174
|
-
// (we already have )
|
|
175
164
|
/**
|
|
176
165
|
* @param {{ stopPropagation: () => void; }} ev
|
|
177
166
|
*/
|
|
@@ -229,11 +218,11 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
229
218
|
// @ts-expect-error
|
|
230
219
|
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
|
|
231
220
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
221
|
+
get _overlayInvokerNode() {
|
|
222
|
+
return /** @type {HTMLElement | undefined} */ (
|
|
223
|
+
Array.from(this.children).find(child => child.slot === 'invoker')
|
|
224
|
+
);
|
|
225
|
+
}
|
|
237
226
|
|
|
238
227
|
/**
|
|
239
228
|
* @overridable
|
|
@@ -267,46 +256,13 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
267
256
|
);
|
|
268
257
|
}
|
|
269
258
|
|
|
270
|
-
/**
|
|
271
|
-
* @param {Element} focusableElOrWrapper
|
|
272
|
-
* @returns {Element|null}
|
|
273
|
-
*/
|
|
274
|
-
static _getFocusableInvokerEl(focusableElOrWrapper) {
|
|
275
|
-
// return focusableElOrWrapper;
|
|
276
|
-
return (
|
|
277
|
-
focusableElOrWrapper &&
|
|
278
|
-
(focusableElOrWrapper.hasAttribute('tabindex') || focusableElOrWrapper.tagName === 'BUTTON'
|
|
279
|
-
? focusableElOrWrapper
|
|
280
|
-
: focusableElOrWrapper.querySelector('[role=button], button'))
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
get _overlayInvokerNode() {
|
|
285
|
-
const ctor = /** @type {typeof OverlayMixin} */ (this.constructor);
|
|
286
|
-
if (!this.__invokerNode) {
|
|
287
|
-
const slottedNode = Array.from(this.children).find(child => child.slot === 'invoker');
|
|
288
|
-
if (slottedNode) {
|
|
289
|
-
this.__invokerNode = ctor._getFocusableInvokerEl(slottedNode);
|
|
290
|
-
} else {
|
|
291
|
-
// Look for preceeding sibling with [data-invoker] attribute, and try to find a focusable element in it (either itself or a child)
|
|
292
|
-
this.__invokerNode =
|
|
293
|
-
this.previousElementSibling?.hasAttribute('data-invoker') &&
|
|
294
|
-
ctor._getFocusableInvokerEl(this.previousElementSibling);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return this.__invokerNode;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
259
|
/** @protected */
|
|
301
260
|
_setupOverlayCtrl() {
|
|
302
261
|
if (this.#hasSetup) return;
|
|
303
|
-
|
|
304
|
-
const invokerNode = this._overlayInvokerNode;
|
|
305
|
-
|
|
306
262
|
const config = {
|
|
307
263
|
contentNode: this._overlayContentNode,
|
|
308
264
|
contentWrapperNode: this._overlayContentWrapperNode,
|
|
309
|
-
invokerNode:
|
|
265
|
+
invokerNode: this._overlayInvokerNode,
|
|
310
266
|
referenceNode: this._overlayReferenceNode,
|
|
311
267
|
backdropNode: this._overlayBackdropNode,
|
|
312
268
|
};
|
|
@@ -326,8 +282,6 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
326
282
|
|
|
327
283
|
/** @protected */
|
|
328
284
|
_teardownOverlayCtrl() {
|
|
329
|
-
// Make sure that dynamic behavior (e.g. responsive) is possible by allowing multiple setups and teardowns of the overlay controller.
|
|
330
|
-
this.#hasSetup = false;
|
|
331
285
|
if (!this._overlayCtrl) return;
|
|
332
286
|
|
|
333
287
|
this._teardownOpenCloseListeners();
|
|
@@ -480,7 +434,6 @@ export const OverlayMixinImplementation = superclass => {
|
|
|
480
434
|
for (const postProcessor of overlayMixinPostProcessors) {
|
|
481
435
|
postProcessor(OverlayMixin);
|
|
482
436
|
}
|
|
483
|
-
|
|
484
|
-
return OverlayMixin;
|
|
437
|
+
return /** @type {* & OverlayMixin} */ (OverlayMixin);
|
|
485
438
|
};
|
|
486
439
|
export const OverlayMixin = dedupeMixin(OverlayMixinImplementation);
|
|
@@ -209,9 +209,9 @@ export class OverlaysManager {
|
|
|
209
209
|
const newMarginBottom = this.__bodySizeVars.marginBottom + scrollbarHeight;
|
|
210
210
|
// @ts-expect-error [external]: CSS not yet typed
|
|
211
211
|
if (window.CSS?.number && document.body.attributeStyleMap?.set) {
|
|
212
|
-
// @ts-ignore
|
|
212
|
+
// @ts-ignore
|
|
213
213
|
document.body.attributeStyleMap.set('margin-right', CSS.px(newMarginRight));
|
|
214
|
-
// @ts-ignore
|
|
214
|
+
// @ts-ignore
|
|
215
215
|
document.body.attributeStyleMap.set('margin-bottom', CSS.px(newMarginBottom));
|
|
216
216
|
} else {
|
|
217
217
|
document.body.style.marginRight = `${newMarginRight}px`;
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {import('../../types/OverlayConfig.js').OverlayConfig} OverlayConfig
|
|
5
|
-
*/
|
|
1
|
+
import { withPopoverConfig } from './withPopoverConfig.js';
|
|
6
2
|
|
|
7
3
|
export const withDropdownConfig = () =>
|
|
8
|
-
|
|
9
|
-
placementMode: 'local',
|
|
10
|
-
inheritsReferenceWidth: 'min',
|
|
11
|
-
hidesOnOutsideClick: true,
|
|
12
|
-
hidesOnEsc: true,
|
|
13
|
-
popperConfig: {
|
|
14
|
-
placement: 'bottom-start',
|
|
15
|
-
modifiers: [
|
|
16
|
-
{
|
|
17
|
-
name: 'offset',
|
|
18
|
-
enabled: false,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
handlesAccessibility: true,
|
|
23
|
-
...withClickInteraction(),
|
|
24
|
-
});
|
|
4
|
+
withPopoverConfig({ horizontalFallback: false, placement: 'bottom-start' });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { withClickInteraction } from './visibility-trigger-partials/withClickInteraction.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../../types/OverlayConfig.js').OverlayConfig} OverlayConfig
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const withPopoverConfig = ({ horizontalFallback = true, placement = 'auto' } = {}) =>
|
|
8
|
+
/** @type {OverlayConfig} */ ({
|
|
9
|
+
placementMode: 'local',
|
|
10
|
+
inheritsReferenceWidth: 'min',
|
|
11
|
+
hidesOnOutsideClick: true,
|
|
12
|
+
hidesOnEsc: true,
|
|
13
|
+
popperConfig: {
|
|
14
|
+
placement,
|
|
15
|
+
modifiers: [
|
|
16
|
+
{
|
|
17
|
+
name: 'offset',
|
|
18
|
+
enabled: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'flip',
|
|
22
|
+
options: {
|
|
23
|
+
fallbackPlacements: horizontalFallback
|
|
24
|
+
? ['bottom', 'top', 'right', 'left']
|
|
25
|
+
: ['bottom', 'top'],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
handlesAccessibility: true,
|
|
31
|
+
...withClickInteraction(),
|
|
32
|
+
});
|
|
@@ -56,8 +56,7 @@ function adoptStyleWhenAdoptedStylesheetsNotSupported(
|
|
|
56
56
|
const styleEl = document.createElement('style');
|
|
57
57
|
// keep notation, so it's not renamed in minification/build
|
|
58
58
|
// eslint-disable-next-line dot-notation
|
|
59
|
-
|
|
60
|
-
const nonce = window.litNonce;
|
|
59
|
+
const nonce = window['litNonce'];
|
|
61
60
|
if (nonce !== undefined) {
|
|
62
61
|
styleEl.setAttribute('nonce', nonce);
|
|
63
62
|
}
|
|
@@ -125,9 +124,11 @@ export function adoptStyle(renderRoot, style, { teardown = false } = {}) {
|
|
|
125
124
|
if (!teardown) {
|
|
126
125
|
// @ts-ignore
|
|
127
126
|
// eslint-disable-next-line no-param-reassign
|
|
128
|
-
renderRoot.adoptedStyleSheets = [...
|
|
127
|
+
renderRoot.adoptedStyleSheets = [...renderRoot.adoptedStyleSheets, sheet];
|
|
129
128
|
} else if (renderRoot.adoptedStyleSheets.includes(sheet)) {
|
|
130
|
-
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
// eslint-disable-next-line no-param-reassign
|
|
131
|
+
renderRoot.adoptedStyleSheets = renderRoot.adoptedStyleSheets.filter(s => s !== sheet);
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
|
|
@@ -8,7 +8,6 @@ import { isVisible } from './is-visible.js';
|
|
|
8
8
|
import { sortByTabIndex } from './sort-by-tabindex.js';
|
|
9
9
|
|
|
10
10
|
// IE11 supports matches as 'msMatchesSelector'
|
|
11
|
-
/** @type {'matches' | 'msMatchesSelector'} */
|
|
12
11
|
const matchesFunc = 'matches' in Element.prototype ? 'matches' : 'msMatchesSelector';
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -17,14 +16,11 @@ const matchesFunc = 'matches' in Element.prototype ? 'matches' : 'msMatchesSelec
|
|
|
17
16
|
*/
|
|
18
17
|
function isFocusable(element) {
|
|
19
18
|
// Elements that cannot be focused if they have [disabled] attribute.
|
|
20
|
-
// @ts-ignore - msMatchesSelector is legacy
|
|
21
19
|
if (element[matchesFunc]('input, select, textarea, button, object')) {
|
|
22
|
-
// @ts-ignore
|
|
23
20
|
return element[matchesFunc](':not([disabled])');
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
// Elements that can be focused even if they have [disabled] attribute.
|
|
27
|
-
// @ts-ignore
|
|
28
24
|
return element[matchesFunc]('a[href], area[href], iframe, [tabindex], [contentEditable]');
|
|
29
25
|
}
|
|
30
26
|
|
|
@@ -12,17 +12,13 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export function isEqualConfig(a, b) {
|
|
14
14
|
if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {
|
|
15
|
-
if (typeof a === 'function' && typeof b === 'function') {
|
|
16
|
-
return /** @type {Function} */ (a).toString() === /** @type {Function} */ (b).toString();
|
|
17
|
-
}
|
|
18
15
|
return a === b;
|
|
19
16
|
}
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const aProps = Object.keys(a);
|
|
18
|
+
const bProps = Object.keys(b);
|
|
19
|
+
if (aProps.length !== bProps.length) {
|
|
20
|
+
return false;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
// @ts-ignore - dynamic property access
|
|
26
|
-
isEqualConfig(a[prop], b[prop], prop),
|
|
27
|
-
);
|
|
22
|
+
const isEqual = /** @param {string} prop */ prop => isEqualConfig(a[prop], b[prop]);
|
|
23
|
+
return aProps.every(isEqual);
|
|
28
24
|
}
|
|
@@ -115,35 +115,26 @@ const withLocalTestConfig = () =>
|
|
|
115
115
|
*/
|
|
116
116
|
async function createNestedEscControllers(parentContent) {
|
|
117
117
|
const childContent = /** @type {HTMLDivElement} */ (parentContent.querySelector('div[id]'));
|
|
118
|
+
// Assert valid fixure
|
|
119
|
+
const isValidFixture =
|
|
120
|
+
(parentContent.id.startsWith('parent-overlay--hidesOnEsc') ||
|
|
121
|
+
parentContent.id.startsWith('parent-overlay--hidesOnOutsideEsc')) &&
|
|
122
|
+
(childContent.id.startsWith('child-overlay--hidesOnEsc') ||
|
|
123
|
+
childContent.id.startsWith('child-overlay--hidesOnOutsideEsc'));
|
|
124
|
+
if (!isValidFixture) {
|
|
125
|
+
throw new Error('Provide a valid fixture');
|
|
126
|
+
}
|
|
118
127
|
|
|
119
128
|
if (parentContent.hasAttribute('data-convert-to-shadow-root')) {
|
|
120
129
|
const shadowRootParent = parentContent.attachShadow({ mode: 'open' });
|
|
121
130
|
shadowRootParent.appendChild(childContent);
|
|
122
131
|
}
|
|
123
132
|
|
|
124
|
-
const parentConfig = {};
|
|
125
|
-
const childConfig = {};
|
|
126
|
-
|
|
127
133
|
const parentHasOutsideOnEsc = parentContent.id.startsWith('parent-overlay--hidesOnOutsideEsc');
|
|
128
134
|
const childHasOutsideOnEsc = childContent.id.startsWith('child-overlay--hidesOnOutsideEsc');
|
|
129
135
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
} else {
|
|
133
|
-
parentConfig.hidesOnEsc = true;
|
|
134
|
-
}
|
|
135
|
-
if (childHasOutsideOnEsc) {
|
|
136
|
-
childConfig.hidesOnOutsideEsc = true;
|
|
137
|
-
} else {
|
|
138
|
-
childConfig.hidesOnEsc = true;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const parentHasSyncChildrenCloseState =
|
|
142
|
-
parentContent.dataset.syncChildrenCloseState !== undefined;
|
|
143
|
-
|
|
144
|
-
if (parentHasSyncChildrenCloseState) {
|
|
145
|
-
parentConfig.syncChildrenCloseState = true;
|
|
146
|
-
}
|
|
136
|
+
const parentConfig = parentHasOutsideOnEsc ? { hidesOnOutsideEsc: true } : { hidesOnEsc: true };
|
|
137
|
+
const childConfig = childHasOutsideOnEsc ? { hidesOnOutsideEsc: true } : { hidesOnEsc: true };
|
|
147
138
|
|
|
148
139
|
const parentOverlay = new OverlayController({
|
|
149
140
|
...withGlobalTestConfig(),
|
|
@@ -292,9 +283,8 @@ describe('OverlayController', () => {
|
|
|
292
283
|
contentNode,
|
|
293
284
|
});
|
|
294
285
|
};
|
|
295
|
-
|
|
296
286
|
expect(createOverlayController).to.throw(
|
|
297
|
-
'[OverlayController] Could not find a render target,
|
|
287
|
+
'[OverlayController] Could not find a render target, since the provided contentNode is not connected to the DOM. Make sure that it is connected, e.g. by doing "document.body.appendChild(contentNode)", before passing it on.',
|
|
298
288
|
);
|
|
299
289
|
});
|
|
300
290
|
|
|
@@ -356,21 +346,6 @@ describe('OverlayController', () => {
|
|
|
356
346
|
await ctrl.hide();
|
|
357
347
|
expect(ctrl.isShown).to.be.false;
|
|
358
348
|
});
|
|
359
|
-
|
|
360
|
-
// it('cleans up the dom structure it created', async () => {
|
|
361
|
-
// const contentNode = /** @type {HTMLElement} */ (fixtureSync(html`<div>my content</div>`));
|
|
362
|
-
// const ctrl = new OverlayController({
|
|
363
|
-
// placementMode: 'global',
|
|
364
|
-
// contentNode,
|
|
365
|
-
// });
|
|
366
|
-
// await ctrl.show();
|
|
367
|
-
// expect(ctrl.contentWrapperNode).to.exist;
|
|
368
|
-
// expect(ctrl.__wrappingDialogNode).to.exist;
|
|
369
|
-
|
|
370
|
-
// await ctrl.teardown();
|
|
371
|
-
// expect(ctrl.contentWrapperNode).to.not.exist;
|
|
372
|
-
// expect(ctrl.__wrappingDialogNode).to.not.exist;
|
|
373
|
-
// });
|
|
374
349
|
});
|
|
375
350
|
|
|
376
351
|
describe('Node Configuration', () => {
|
|
@@ -428,7 +403,7 @@ describe('OverlayController', () => {
|
|
|
428
403
|
{ ignoreAttributes: ['closedby'] },
|
|
429
404
|
);
|
|
430
405
|
|
|
431
|
-
expect(el).lightDom.to.equal(`<div
|
|
406
|
+
expect(el).lightDom.to.equal(`<div slot="content">projected</div>`);
|
|
432
407
|
});
|
|
433
408
|
});
|
|
434
409
|
|
|
@@ -450,7 +425,7 @@ describe('OverlayController', () => {
|
|
|
450
425
|
`
|
|
451
426
|
<dialog data-overlay-outer-wrapper="" open="" role="none" style="${wrappingDialogNodeStyle}">
|
|
452
427
|
<div data-id="content-wrapper">
|
|
453
|
-
<div
|
|
428
|
+
<div id="content">non projected</div>
|
|
454
429
|
</div>
|
|
455
430
|
</dialog>
|
|
456
431
|
`,
|
|
@@ -645,7 +620,6 @@ describe('OverlayController', () => {
|
|
|
645
620
|
});
|
|
646
621
|
});
|
|
647
622
|
|
|
648
|
-
// TODO: make features modular (so they can be treeshaken) and test their lifecycle within this desrcibe
|
|
649
623
|
describe('Feature Configuration', () => {
|
|
650
624
|
describe('trapsKeyboardFocus', () => {
|
|
651
625
|
it('focuses the overlay on show', async () => {
|
|
@@ -889,7 +863,10 @@ describe('OverlayController', () => {
|
|
|
889
863
|
|
|
890
864
|
describe('Nested hidesOnEsc / hidesOnOutsideEsc', () => {
|
|
891
865
|
describe('Parent has hidesOnEsc and child has hidesOnOutsideEsc', () => {
|
|
892
|
-
|
|
866
|
+
// TODO: This test is flaky. We need to investigate why the child overlay
|
|
867
|
+
// is not staying shown after the parent overlay is hidden. The failing line
|
|
868
|
+
// is highlighted below.
|
|
869
|
+
it.skip('on [Escape] press in child overlay: parent hides, child stays shown', async () => {
|
|
893
870
|
const parentContent = /** @type {HTMLDivElement} */ (
|
|
894
871
|
await fixture(
|
|
895
872
|
html` <!-- -->
|
|
@@ -901,6 +878,9 @@ describe('OverlayController', () => {
|
|
|
901
878
|
const { parentOverlay, childOverlay } = await createNestedEscControllers(parentContent);
|
|
902
879
|
await mimicEscapePress(childOverlay.contentNode);
|
|
903
880
|
await waitUntil(() => !parentOverlay.isShown);
|
|
881
|
+
|
|
882
|
+
// TODO: This is the failing line ("sometimes").
|
|
883
|
+
// The child overlay is not staying shown after the parent overlay is hidden.
|
|
904
884
|
await waitUntil(() => childOverlay.isShown);
|
|
905
885
|
|
|
906
886
|
await childOverlay.teardown();
|
|
@@ -1008,7 +988,6 @@ describe('OverlayController', () => {
|
|
|
1008
988
|
});
|
|
1009
989
|
});
|
|
1010
990
|
});
|
|
1011
|
-
|
|
1012
991
|
describe('hidesOnOutsideClick', () => {
|
|
1013
992
|
it('hides on outside click', async () => {
|
|
1014
993
|
const contentNode = /** @type {HTMLElement} */ (await fixture('<div>Content</div>'));
|
|
@@ -1729,91 +1708,6 @@ describe('OverlayController', () => {
|
|
|
1729
1708
|
expect(ctrl1.hasActiveBackdrop).to.be.true;
|
|
1730
1709
|
});
|
|
1731
1710
|
});
|
|
1732
|
-
|
|
1733
|
-
describe('focusContentOnOpen', () => {
|
|
1734
|
-
it('adds tabindex="-1" to the content node when focusContentOnOpen is true', async () => {
|
|
1735
|
-
const ctrl = new OverlayController({
|
|
1736
|
-
...withGlobalTestConfig(),
|
|
1737
|
-
isBlocking: false,
|
|
1738
|
-
focusContentOnOpen: true,
|
|
1739
|
-
});
|
|
1740
|
-
const contentNode = /** @type {HTMLElement} */ (await fixture('<div>Content</div>'));
|
|
1741
|
-
ctrl.updateConfig({ contentNode });
|
|
1742
|
-
await ctrl.show();
|
|
1743
|
-
expect(contentNode.getAttribute('tabindex')).to.equal('-1');
|
|
1744
|
-
});
|
|
1745
|
-
|
|
1746
|
-
it('makes contentNode the root of "next tab flow"', async () => {
|
|
1747
|
-
const ctrl = new OverlayController({
|
|
1748
|
-
...withGlobalTestConfig(),
|
|
1749
|
-
isBlocking: false,
|
|
1750
|
-
focusContentOnOpen: true,
|
|
1751
|
-
});
|
|
1752
|
-
const contentNode = /** @type {HTMLElement} */ (
|
|
1753
|
-
await fixture('<div><button>Button</button></div>')
|
|
1754
|
-
);
|
|
1755
|
-
ctrl.updateConfig({ contentNode });
|
|
1756
|
-
await ctrl.show();
|
|
1757
|
-
const button = /** @type {HTMLButtonElement} */ (contentNode.querySelector('button'));
|
|
1758
|
-
button.focus();
|
|
1759
|
-
expect(isActiveElement(button)).to.be.true;
|
|
1760
|
-
});
|
|
1761
|
-
});
|
|
1762
|
-
|
|
1763
|
-
describe('syncChildrenCloseState', () => {
|
|
1764
|
-
it('does not close all children of nested controllers when syncChildrenCloseState is false', async () => {
|
|
1765
|
-
const parentContent = /** @type {HTMLDivElement} */ (
|
|
1766
|
-
await fixture(
|
|
1767
|
-
html` <!-- -->
|
|
1768
|
-
<div data-sync-children-close-state id="parent-overlay">
|
|
1769
|
-
<div id="child-overlay">we open our child and it will close when parent does</div>
|
|
1770
|
-
</div>`,
|
|
1771
|
-
)
|
|
1772
|
-
);
|
|
1773
|
-
const { parentOverlay, childOverlay } = await createNestedEscControllers(parentContent);
|
|
1774
|
-
expect(parentOverlay.isShown).to.be.true;
|
|
1775
|
-
expect(childOverlay.isShown).to.be.true;
|
|
1776
|
-
|
|
1777
|
-
await parentOverlay.hide();
|
|
1778
|
-
await childOverlay._hideComplete;
|
|
1779
|
-
expect(parentOverlay.isShown).to.be.false;
|
|
1780
|
-
expect(childOverlay.isShown).to.be.false;
|
|
1781
|
-
});
|
|
1782
|
-
|
|
1783
|
-
it('does not close all children of nested controllers when syncChildrenCloseState is false', async () => {
|
|
1784
|
-
const parentContent = /** @type {HTMLDivElement} */ (
|
|
1785
|
-
await fixture(
|
|
1786
|
-
html` <!-- -->
|
|
1787
|
-
<div id="parent-overlay">
|
|
1788
|
-
<div id="child-overlay">
|
|
1789
|
-
we open our child and it will not close when parent does
|
|
1790
|
-
</div>
|
|
1791
|
-
</div>`,
|
|
1792
|
-
)
|
|
1793
|
-
);
|
|
1794
|
-
const { parentOverlay, childOverlay } = await createNestedEscControllers(parentContent);
|
|
1795
|
-
expect(parentOverlay.isShown).to.be.true;
|
|
1796
|
-
expect(childOverlay.isShown).to.be.true;
|
|
1797
|
-
|
|
1798
|
-
await parentOverlay.hide();
|
|
1799
|
-
expect(parentOverlay.isShown).to.be.false;
|
|
1800
|
-
expect(childOverlay.isShown).to.be.true;
|
|
1801
|
-
});
|
|
1802
|
-
});
|
|
1803
|
-
|
|
1804
|
-
describe('isActivated', () => {
|
|
1805
|
-
it('allows to conditionally disable overlay/openable functionality (for responsive context like nav menus, accordions/collapsibles vs plain headings/content etc.)', async () => {
|
|
1806
|
-
const ctrl = new OverlayController({
|
|
1807
|
-
...withGlobalTestConfig(),
|
|
1808
|
-
isActivated: false,
|
|
1809
|
-
});
|
|
1810
|
-
expect(ctrl.__hasSetup).to.be.false;
|
|
1811
|
-
ctrl.updateConfig({
|
|
1812
|
-
isActivated: true,
|
|
1813
|
-
});
|
|
1814
|
-
expect(ctrl.__hasSetup).to.be.true;
|
|
1815
|
-
});
|
|
1816
|
-
});
|
|
1817
1711
|
});
|
|
1818
1712
|
|
|
1819
1713
|
describe('Show / Hide / Toggle', () => {
|
|
@@ -2404,7 +2298,6 @@ describe('OverlayController', () => {
|
|
|
2404
2298
|
});
|
|
2405
2299
|
|
|
2406
2300
|
it('should run with scroll prevention', async () => {
|
|
2407
|
-
await overlayControllerPreventsScroll.hide();
|
|
2408
2301
|
await overlayControllerPreventsScroll.show();
|
|
2409
2302
|
|
|
2410
2303
|
expect(
|
|
@@ -48,7 +48,7 @@ describe('isEqualConfig()', () => {
|
|
|
48
48
|
expect(isEqualConfig({ ...config, isBlocking: true }, config)).eql(false);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
it
|
|
51
|
+
it('regards missing props different from ones with undefined value', () => {
|
|
52
52
|
const config = TestConfig();
|
|
53
53
|
expect(isEqualConfig(config, { ...config, referenceNode: undefined })).eql(false);
|
|
54
54
|
});
|
|
@@ -537,13 +537,13 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|
|
537
537
|
it('works with cache directive when reconnected', async () => {
|
|
538
538
|
class CachingContext extends LitElement {
|
|
539
539
|
static properties = {
|
|
540
|
-
|
|
540
|
+
switched: { type: Boolean },
|
|
541
541
|
};
|
|
542
542
|
|
|
543
543
|
constructor() {
|
|
544
544
|
super();
|
|
545
545
|
|
|
546
|
-
this.
|
|
546
|
+
this.switched = false;
|
|
547
547
|
}
|
|
548
548
|
|
|
549
549
|
get overlayEl() {
|
|
@@ -552,12 +552,12 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|
|
552
552
|
|
|
553
553
|
render() {
|
|
554
554
|
return html`${cache(
|
|
555
|
-
this.
|
|
556
|
-
? html
|
|
555
|
+
this.switched
|
|
556
|
+
? html`something else`
|
|
557
|
+
: html`<${tag} id="myOverlay">
|
|
557
558
|
<div slot="content">content b</div>
|
|
558
559
|
<button slot="invoker">invoker button b</button>
|
|
559
|
-
</${tag}
|
|
560
|
-
: html`something else`,
|
|
560
|
+
</${tag}>`,
|
|
561
561
|
)}`;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
@@ -578,7 +578,7 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|
|
578
578
|
// @ts-expect-error [allow-protected] in tests
|
|
579
579
|
const setupSpy = sinon.spy(el.overlayEl, '_setupOverlayCtrl');
|
|
580
580
|
|
|
581
|
-
el.
|
|
581
|
+
el.switched = true;
|
|
582
582
|
// render the new content
|
|
583
583
|
await el.updateComplete;
|
|
584
584
|
// wait for the teardown to complete
|
|
@@ -588,7 +588,7 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|
|
588
588
|
expect(teardownSpy.callCount).to.equal(1);
|
|
589
589
|
expect(setupSpy.callCount).to.equal(0);
|
|
590
590
|
|
|
591
|
-
el.
|
|
591
|
+
el.switched = false;
|
|
592
592
|
await el.updateComplete;
|
|
593
593
|
expect(setupSpy.callCount).to.equal(1);
|
|
594
594
|
|
|
@@ -26,9 +26,7 @@ export declare class ArrowHost {
|
|
|
26
26
|
|
|
27
27
|
protected _defineOverlayConfig(): OverlayConfig;
|
|
28
28
|
|
|
29
|
-
protected _getPopperArrowConfig(
|
|
30
|
-
popperConfigToExtendFrom: Partial<PopperOptions>,
|
|
31
|
-
): Partial<PopperOptions>;
|
|
29
|
+
protected _getPopperArrowConfig(popperConfigToExtendFrom: Partial<PopperOptions>): Partial<PopperOptions>;
|
|
32
30
|
|
|
33
31
|
private __setupRepositionCompletePromise(): void;
|
|
34
32
|
|
|
@@ -21,6 +21,7 @@ export type OverlayPhase =
|
|
|
21
21
|
| 'add'
|
|
22
22
|
| 'remove';
|
|
23
23
|
|
|
24
|
+
|
|
24
25
|
export interface ViewportConfig {
|
|
25
26
|
placement: ViewportPlacement;
|
|
26
27
|
}
|
|
@@ -96,30 +97,14 @@ export interface OverlayConfig {
|
|
|
96
97
|
/** By default, the tooltip content is a 'description' for the invoker (uses aria-describedby) Setting this property to 'label' makes the content function as a label (via aria-labelledby) */
|
|
97
98
|
invokerRelation?: 'label' | 'description';
|
|
98
99
|
|
|
100
|
+
/** render a div instead of dialog */
|
|
101
|
+
_noDialogEl?: Boolean;
|
|
102
|
+
|
|
99
103
|
/**
|
|
100
104
|
* Determines the conditions hiding/showing should be based on. It gets the OverlayController as input and returns an object with
|
|
101
105
|
* functions with Overlay phases as keys
|
|
102
106
|
*/
|
|
103
107
|
visibilityTriggerFunction?: Function;
|
|
108
|
+
}
|
|
104
109
|
|
|
105
|
-
/**
|
|
106
|
-
* Whether the overlay content should receive focus when shown.
|
|
107
|
-
*/
|
|
108
|
-
focusContentOnOpen?: boolean;
|
|
109
|
-
|
|
110
|
-
/*
|
|
111
|
-
* By default, we function either as overlay or disclosure. In some cases, this should be dynamically set (think of responsive changes).
|
|
112
|
-
* or it depends on the context (a top level menu is not openable (unless it's a context menu), its children menus are).
|
|
113
|
-
*/
|
|
114
|
-
isActivated?: boolean;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* By default, an error is thrown when contentNode is not connected to the DOM.
|
|
118
|
-
* This allows to prepare nodes and later connect them to dom.
|
|
119
|
-
*/
|
|
120
|
-
requireConnectedNodes?: boolean;
|
|
121
|
-
|
|
122
|
-
syncChildrenCloseState?: boolean;
|
|
123
110
|
|
|
124
|
-
_shouldTeardownDomStructure?: boolean;
|
|
125
|
-
}
|
|
@@ -832,7 +832,6 @@ describe('lion-select-rich', () => {
|
|
|
832
832
|
await waitUntil(isSelectRichRendered);
|
|
833
833
|
getInvoker()?.click();
|
|
834
834
|
await waitUntil(isDialogVisible);
|
|
835
|
-
// @ts-ignore - NodeList array access
|
|
836
835
|
const optionBlue = /** @type { HTMLElement | undefined } */ (
|
|
837
836
|
wrapperElementShadowRoot?.querySelectorAll('lion-option')
|
|
838
837
|
)?.[1];
|
|
@@ -956,7 +955,6 @@ describe('lion-select-rich', () => {
|
|
|
956
955
|
await waitUntil(isSelectRichRendered);
|
|
957
956
|
getInvoker()?.click();
|
|
958
957
|
await waitUntil(isDialogVisible);
|
|
959
|
-
// @ts-ignore - NodeList array access
|
|
960
958
|
const optionBlue = /** @type { HTMLElement | undefined } */ (
|
|
961
959
|
wrapperElementShadowRoot?.querySelectorAll('lion-option')
|
|
962
960
|
)?.[1];
|
|
@@ -1084,7 +1082,6 @@ describe('lion-select-rich', () => {
|
|
|
1084
1082
|
await waitUntil(isSelectRichRendered);
|
|
1085
1083
|
getInvoker()?.click();
|
|
1086
1084
|
await waitUntil(isDialogVisible);
|
|
1087
|
-
// @ts-ignore - NodeList array access
|
|
1088
1085
|
const optionBlue = /** @type { HTMLElement | undefined } */ (
|
|
1089
1086
|
wrapperElementShadowRoot?.querySelectorAll('lion-option')
|
|
1090
1087
|
)?.[1];
|