@neovici/cosmoz-autocomplete 8.3.0 → 8.5.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.
@@ -11,9 +11,11 @@ export interface Props<I> extends Base<I> {
11
11
  showSingle?: boolean;
12
12
  itemHeight?: number;
13
13
  itemLimit?: number;
14
+ wrap?: boolean;
15
+ defaultIndex?: number;
14
16
  }
15
17
  type AProps<I> = Omit<Props<I>, keyof RProps<I>> & RProps<I> & {
16
18
  onInputRef?: (el?: Element) => void;
17
19
  };
18
- declare const autocomplete: <I>(props: AProps<I>) => import("lit-html").TemplateResult<1>, Autocomplete: <I>(props: Props<I>) => import("lit-html").TemplateResult<1>, observedAttributes: string[];
20
+ declare const autocomplete: <I>(props: AProps<I>) => import("lit-html").TemplateResult<1>, Autocomplete: <I>(props: Props<I>) => import("lit-html").TemplateResult<1>, observedAttributes: readonly ["disabled", "invalid", "no-label-float", "always-float-label", "text-property", "value-property", "limit", "min", "show-single", "preserve-order", "keep-opened", "keep-query", "hide-empty", "default-index", "item-height", "item-limit", "wrap"];
19
21
  export { autocomplete, Autocomplete, observedAttributes, style };
@@ -28,8 +28,7 @@ const autocomplete = (props) => {
28
28
  useImperativeApi({
29
29
  focus: () => host.shadowRoot?.querySelector('#input')?.focus(),
30
30
  }, []);
31
- return html `
32
- <cosmoz-input
31
+ return html ` <cosmoz-input
33
32
  id="input"
34
33
  part="input"
35
34
  .label=${label}
@@ -13,6 +13,7 @@ export default css `
13
13
  padding: 0 4px 0 8px;
14
14
  gap: 4px;
15
15
  cursor: pointer;
16
+ transform: translateY(var(--cosmoz-autocomplete-chip-translate-y, 0));
16
17
  }
17
18
  .content {
18
19
  color: var(--cosmoz-autocomplete-chip-color, #424242);
@@ -1,5 +1,5 @@
1
1
  import { component, useCallback } from '@pionjs/pion';
2
- import { Autocomplete, observedAttributes as atts, style, } from './autocomplete';
2
+ import { Autocomplete, observedAttributes, style } from './autocomplete';
3
3
  import { sheet } from '@neovici/cosmoz-utils';
4
4
  const Standalone = (host) => {
5
5
  const { onChange, onText, ...props } = host;
@@ -15,6 +15,6 @@ const Standalone = (host) => {
15
15
  }, [onText]),
16
16
  });
17
17
  };
18
- const observedAttributes = atts, styleSheets = [sheet(style)];
18
+ const styleSheets = [sheet(style)];
19
19
  customElements.define('cosmoz-autocomplete-ui', component(Autocomplete, { observedAttributes, styleSheets }));
20
20
  customElements.define('cosmoz-autocomplete', component(Standalone, { observedAttributes, styleSheets }));
@@ -1,5 +1,5 @@
1
1
  export declare const search: <I>(source: I[], query: string, textual: (i: I) => string) => I[];
2
- export declare const normalize: <I>(source: false | I[] | null) => I[];
2
+ export declare const normalize: <I>(source: I[] | false | null) => I[];
3
3
  export declare const notify: <T>(host: EventTarget, name: string, detail: T) => boolean;
4
4
  export declare const useNotify: <V>(host: EventTarget, fn: ((v: V) => void) | undefined, name: string) => (val: V) => void;
5
5
  export declare const EMPTY: never[], EMPTY$: Promise<never[]>;
@@ -1,8 +1,8 @@
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").DirectiveResult<{
5
- new (_partInfo: import("lit-html/directive").PartInfo): {
4
+ }) => import("lit-html/directive.js").DirectiveResult<{
5
+ new (_partInfo: import("lit-html/directive.js").PartInfo): {
6
6
  _op?: import("lit-html").ChildPart | undefined;
7
7
  _outlet?: HTMLElement | undefined;
8
8
  _content?: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-autocomplete",
3
- "version": "8.3.0",
3
+ "version": "8.5.0",
4
4
  "description": "A autocomplete input web component",
5
5
  "keywords": [
6
6
  "lit-html",
@@ -23,12 +23,14 @@
23
23
  "scripts": {
24
24
  "lint": "tsc && eslint --cache .",
25
25
  "build": "tsc -p tsconfig.build.json",
26
- "start": "wds",
26
+ "start": "npm run storybook:start",
27
27
  "test": "wtr --coverage",
28
28
  "test:watch": "wtr --watch",
29
- "prepare": "husky install",
30
- "storybook:build": "build-storybook",
31
- "storybook:deploy": "storybook-to-ghpages"
29
+ "prepare": "husky",
30
+ "storybook:start": "storybook dev -p 8000",
31
+ "storybook:build": "storybook build",
32
+ "storybook:deploy": "storybook-to-ghpages",
33
+ "storybook:preview": "npm run storybook:build && http-server -d ./storybook-static/"
32
34
  },
33
35
  "release": {
34
36
  "plugins": [
@@ -69,25 +71,34 @@
69
71
  "dependencies": {
70
72
  "@lit-labs/virtualizer": "^2.0.0",
71
73
  "@neovici/cosmoz-dropdown": "^4.0.0",
72
- "@neovici/cosmoz-input": "^4.0.0",
74
+ "@neovici/cosmoz-input": "^4.3.1",
73
75
  "@neovici/cosmoz-utils": "^6.0.0",
74
76
  "@pionjs/pion": "^2.0.0",
75
77
  "lit-html": "^2.0.0 || ^3.0.0"
76
78
  },
77
79
  "devDependencies": {
78
- "@commitlint/cli": "^18.0.0",
79
- "@commitlint/config-conventional": "^18.0.0",
80
+ "@commitlint/cli": "^19.0.0",
81
+ "@commitlint/config-conventional": "^19.0.0",
80
82
  "@neovici/cfg": "^1.34.0",
81
83
  "@open-wc/testing": "^4.0.0",
82
84
  "@semantic-release/changelog": "^6.0.0",
83
85
  "@semantic-release/git": "^10.0.0",
86
+ "@storybook/addon-essentials": "^7.0.0",
87
+ "@storybook/addon-links": "^7.0.0",
88
+ "@storybook/builder-vite": "7.6.17",
84
89
  "@storybook/storybook-deployer": "^2.8.5",
85
- "@types/mocha": "^10.0.3",
86
- "@web/dev-server-storybook": "^2.0.0",
87
- "husky": "^8.0.0",
90
+ "@storybook/web-components": "7.6.17",
91
+ "@types/mocha": "^10.0.6",
92
+ "@web/storybook-builder": "^0.1.9",
93
+ "@web/storybook-framework-web-components": "^0.1.1",
94
+ "esbuild": "^0.20.2",
95
+ "http-server": "^14.1.1",
96
+ "husky": "^9.0.0",
97
+ "rollup-plugin-esbuild": "^6.1.1",
88
98
  "rollup-plugin-terser": "^7.0.2",
89
- "semantic-release": "^22.0.0",
99
+ "semantic-release": "^23.0.0",
90
100
  "sinon": "^17.0.0",
101
+ "storybook": "^7.6.17",
91
102
  "typescript": "^5.0.0"
92
103
  }
93
104
  }