@neovici/cosmoz-autocomplete 8.6.0 → 8.7.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.
@@ -1,20 +1,4 @@
1
1
  import { Props } from './use-listbox';
2
2
  export declare const listbox: <I>({ multi, ...thru }: Props<I> & {
3
3
  multi?: boolean | undefined;
4
- }) => import("lit-html/directive.js").DirectiveResult<{
5
- new (_partInfo: import("lit-html/directive.js").PartInfo): {
6
- _op?: import("lit-html").ChildPart | undefined;
7
- _outlet?: HTMLElement | undefined;
8
- _content?: unknown;
9
- render(content: unknown, outlet?: HTMLElement | undefined): import("lit-html").TemplateResult<1>;
10
- update(part: import("lit-html").Part, [content, outlet]: [unknown, (HTMLElement | undefined)?]): import("lit-html").TemplateResult<1>;
11
- updateOutlet(outlet: HTMLElement, content: unknown): void;
12
- clearOutlet(): void;
13
- disconnected(): void;
14
- reconnected(): void;
15
- isConnected: boolean;
16
- _$initialize(part: import("lit-html").Part, parent: import("lit-html").Disconnectable, attributeIndex: number | undefined): void;
17
- setValue(value: unknown): void;
18
- readonly _$isConnected: boolean;
19
- };
20
- }>;
4
+ }) => import("lit-html").TemplateResult<1>;
@@ -1,6 +1,5 @@
1
1
  import { virtualize, virtualizerRef, } from '@lit-labs/virtualizer/virtualize.js';
2
2
  import { sheet } from '@neovici/cosmoz-utils';
3
- import { portal } from '@neovici/cosmoz-utils/directives/portal';
4
3
  import { spreadProps } from '@neovici/cosmoz-utils/directives/spread-props';
5
4
  import { useStyleSheet } from '@neovici/cosmoz-utils/hooks/use-stylesheet';
6
5
  import { props } from '@neovici/cosmoz-utils/object';
@@ -39,24 +38,19 @@ const supportsPopover = () => {
39
38
  };
40
39
  const showPopover = (popover) => {
41
40
  const popoverElement = popover;
42
- requestAnimationFrame(() => {
43
- popoverElement?.showPopover();
44
- });
41
+ if (supportsPopover()) {
42
+ requestAnimationFrame(() => {
43
+ popoverElement?.showPopover();
44
+ });
45
+ }
45
46
  };
46
47
  customElements.define('cosmoz-listbox', component(Listbox, { styleSheets: [sheet(style)] }));
47
48
  export const listbox = ({ multi, ...thru }) => {
48
- if (supportsPopover()) {
49
- return html `<cosmoz-listbox
50
- ${ref(showPopover)}
51
- popover="manual"
52
- part="listbox"
53
- ?multi=${multi}
54
- ...=${spreadProps(props(properties)(thru))}
55
- ></cosmoz-listbox>`;
56
- }
57
- return portal(html `<cosmoz-listbox
58
- part="listbox"
59
- ?multi=${multi}
60
- ...=${spreadProps(props(properties)(thru))}
61
- ></cosmoz-listbox>`);
49
+ return html `<cosmoz-listbox
50
+ ${ref(showPopover)}
51
+ popover="manual"
52
+ part="listbox"
53
+ ?multi=${multi}
54
+ ...=${spreadProps(props(properties)(thru))}
55
+ ></cosmoz-listbox>`;
62
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-autocomplete",
3
- "version": "8.6.0",
3
+ "version": "8.7.0",
4
4
  "description": "A autocomplete input web component",
5
5
  "keywords": [
6
6
  "lit-html",