@lion/ui 0.5.1 → 0.5.2
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/overlays/src/OverlayController.js +1 -1
- package/components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.js +2 -4
- package/components/tabs/src/LionTabs.js +4 -0
- package/components/tabs/test/lion-tabs.test.js +8 -0
- package/components/tooltip/test/lion-tooltip.test.js +30 -0
- package/custom-elements.json +6 -6
- package/dist-types/components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.d.ts.map +1 -1
- package/dist-types/components/tabs/src/LionTabs.d.ts +1 -0
- package/dist-types/components/tabs/src/LionTabs.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +1 -1
- 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/ajax/overview.md +107 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -933,7 +933,7 @@ export class OverlayController extends EventTarget {
|
|
|
933
933
|
|
|
934
934
|
if (this.elementToFocusAfterHide) {
|
|
935
935
|
this.elementToFocusAfterHide.focus();
|
|
936
|
-
this.elementToFocusAfterHide.scrollIntoView({ block: '
|
|
936
|
+
this.elementToFocusAfterHide.scrollIntoView({ block: 'nearest' });
|
|
937
937
|
} else {
|
|
938
938
|
/** @type {HTMLElement} */ (this.__activeElementRightBeforeHide).blur();
|
|
939
939
|
}
|
package/components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.js
CHANGED
|
@@ -32,15 +32,13 @@ export function withHoverInteraction({ delayIn = 0, delayOut = 300 }) {
|
|
|
32
32
|
*/
|
|
33
33
|
function handleOpenClosed(event) {
|
|
34
34
|
const { type } = event;
|
|
35
|
-
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
35
|
+
|
|
38
36
|
clearTimeout(delayTimeout);
|
|
39
37
|
isFocused = type === 'focusout' ? false : isFocused || type === 'focusin';
|
|
40
38
|
isHovered = type === 'mouseleave' ? false : isHovered || type === 'mouseenter';
|
|
41
39
|
const shouldOpen = isFocused || isHovered;
|
|
42
40
|
|
|
43
|
-
if (shouldOpen) {
|
|
41
|
+
if (shouldOpen && !controller._hasDisabledInvoker()) {
|
|
44
42
|
delayTimeout = setTimeout(() => {
|
|
45
43
|
controller.show();
|
|
46
44
|
}, delayIn);
|
|
@@ -356,7 +356,11 @@ export class LionTabs extends LitElement {
|
|
|
356
356
|
* @param {number} value The new index
|
|
357
357
|
*/
|
|
358
358
|
set selectedIndex(value) {
|
|
359
|
+
if (value === this.__selectedIndex) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
359
362
|
const stale = this.__selectedIndex;
|
|
363
|
+
/** @type {number | undefined} */
|
|
360
364
|
this.__selectedIndex = value;
|
|
361
365
|
this.__updateSelected(false);
|
|
362
366
|
this.dispatchEvent(new Event('selected-changed'));
|
|
@@ -75,6 +75,14 @@ describe('<lion-tabs>', () => {
|
|
|
75
75
|
expect(spy).to.have.been.calledOnce;
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
+
it('does not send event "selected-changed" after selecting currently selected tab', async () => {
|
|
79
|
+
const el = /** @type {LionTabs} */ (await fixture(basicTabs));
|
|
80
|
+
const spy = sinon.spy();
|
|
81
|
+
el.addEventListener('selected-changed', spy);
|
|
82
|
+
el.selectedIndex = 0;
|
|
83
|
+
expect(spy).not.to.have.been.called;
|
|
84
|
+
});
|
|
85
|
+
|
|
78
86
|
it('logs warning if unequal amount of tabs and panels', async () => {
|
|
79
87
|
const stub = sinon.stub(console, 'warn');
|
|
80
88
|
await fixture(html`
|
|
@@ -182,6 +182,36 @@ describe('lion-tooltip', () => {
|
|
|
182
182
|
expect(el._overlayCtrl.isShown).to.equal(false);
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
+
it('gets hidden when invoker gets disabled', async () => {
|
|
186
|
+
const el = /** @type {LionTooltip} */ (
|
|
187
|
+
await fixture(html`
|
|
188
|
+
<lion-tooltip>
|
|
189
|
+
<div slot="content">Hey there</div>
|
|
190
|
+
<button slot="invoker">Tooltip button</button>
|
|
191
|
+
</lion-tooltip>
|
|
192
|
+
`)
|
|
193
|
+
);
|
|
194
|
+
const invoker = /** @type {HTMLButtonElement} */ (
|
|
195
|
+
Array.from(el.children).find(child => child.slot === 'invoker')
|
|
196
|
+
);
|
|
197
|
+
const eventFocusIn = new Event('focusin');
|
|
198
|
+
invoker.dispatchEvent(eventFocusIn);
|
|
199
|
+
clock.tick(300);
|
|
200
|
+
await el.updateComplete;
|
|
201
|
+
// @ts-expect-error [allow-protected-in-tests]
|
|
202
|
+
expect(el._overlayCtrl.isShown).to.equal(true);
|
|
203
|
+
|
|
204
|
+
invoker.setAttribute('disabled', '');
|
|
205
|
+
|
|
206
|
+
const eventFocusOut = new Event('focusout');
|
|
207
|
+
invoker.dispatchEvent(eventFocusOut);
|
|
208
|
+
clock.tick(300);
|
|
209
|
+
await el.updateComplete;
|
|
210
|
+
await el.updateComplete; // webkit needs longer
|
|
211
|
+
// @ts-expect-error [allow-protected-in-tests]
|
|
212
|
+
expect(el._overlayCtrl.isShown).to.equal(false);
|
|
213
|
+
});
|
|
214
|
+
|
|
185
215
|
it('contains html when specified in tooltip content body', async () => {
|
|
186
216
|
const el = /** @type {LionTooltip} */ (
|
|
187
217
|
await fixture(html`
|
package/custom-elements.json
CHANGED
|
@@ -63249,12 +63249,6 @@
|
|
|
63249
63249
|
}
|
|
63250
63250
|
]
|
|
63251
63251
|
},
|
|
63252
|
-
{
|
|
63253
|
-
"kind": "javascript-module",
|
|
63254
|
-
"path": "components/input-file/types/input-file.ts",
|
|
63255
|
-
"declarations": [],
|
|
63256
|
-
"exports": []
|
|
63257
|
-
},
|
|
63258
63252
|
{
|
|
63259
63253
|
"kind": "javascript-module",
|
|
63260
63254
|
"path": "components/input-file/translations/bg-BG.js",
|
|
@@ -63745,6 +63739,12 @@
|
|
|
63745
63739
|
}
|
|
63746
63740
|
]
|
|
63747
63741
|
},
|
|
63742
|
+
{
|
|
63743
|
+
"kind": "javascript-module",
|
|
63744
|
+
"path": "components/input-file/types/input-file.ts",
|
|
63745
|
+
"declarations": [],
|
|
63746
|
+
"exports": []
|
|
63747
|
+
},
|
|
63748
63748
|
{
|
|
63749
63749
|
"kind": "javascript-module",
|
|
63750
63750
|
"path": "components/input-iban/src/LionInputIban.js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withHoverInteraction.d.ts","sourceRoot":"","sources":["../../../../../../components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.js"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;GAMG;AACH,4DAHW;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAG,GACtC,QAAQ,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"withHoverInteraction.d.ts","sourceRoot":"","sources":["../../../../../../components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.js"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;GAMG;AACH,4DAHW;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAG,GACtC,QAAQ,aAAa,CAAC,CA6DlC;4BAxEY,OAAO,4BAA4B,EAAE,aAAa;gCAClD,OAAO,sBAAsB,EAAE,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LionTabs.d.ts","sourceRoot":"","sources":["../../../../components/tabs/src/LionTabs.js"],"names":[],"mappings":"AAqGA;IACE;;;;;;MAQC;IAED,+CA0BC;IAED,+CASC;IA6MD;;OAEG;IACH,+
|
|
1
|
+
{"version":3,"file":"LionTabs.d.ts","sourceRoot":"","sources":["../../../../components/tabs/src/LionTabs.js"],"names":[],"mappings":"AAqGA;IACE;;;;;;MAQC;IAED,+CA0BC;IAED,+CASC;IA6MD;;OAEG;IACH,+BAUC;IApBD;;OAEG;IACH,4BAEC;IAxLD,gCAIC;IAED,4BAIC;IAED,eAAe;IACf,qBAaC;IAED,eAAe;IACf,qBAiCC;IAhCC,2BAA2B;IAC3B,kCAAiB;IAiCnB,eAAe;IACf,qBAQC;IAED;;;;;;OAMG;IACH,gCAUC;IAED;;;;;OAKG;IACH,gCAuBC;IAED;;;;OAIG;IACH,mCAIC;IAED;;;OAGG;IACH,4BAqCC;IAiBC,iCAAiC;IACjC,iBADW,MAAM,GAAG,SAAS,CACD;IAM9B;;;OAGG;IACH,4CAHW,MAAM,QAYhB;IAED,iBAAiB;IACjB,mCAEC;IAED,eAAe;IACf,yBAqBC;CACF;;;;;QAvZa,WAAW;;;;SACX,MAAM;;;;YACN,WAAW;;;;WACX,WAAW;;;;0BACH,KAAK,KAAK,OAAO;;;;4BACjB,KAAK,KAAK,OAAO;;;;0BACjB,KAAK,KAAK,OAAO"}
|