@neovici/cosmoz-autocomplete 13.7.0-beta.2 → 13.7.0-beta.3
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.
|
@@ -13,6 +13,7 @@ export interface Props<I> extends Base<I> {
|
|
|
13
13
|
hint?: string;
|
|
14
14
|
label?: string;
|
|
15
15
|
placeholder?: string;
|
|
16
|
+
required?: boolean;
|
|
16
17
|
showSingle?: boolean;
|
|
17
18
|
itemHeight?: number | 'auto';
|
|
18
19
|
itemLimit?: number;
|
|
@@ -25,5 +26,5 @@ export interface Props<I> extends Base<I> {
|
|
|
25
26
|
type AProps<I> = Omit<Props<I>, keyof RProps<I>> & RProps<I> & {
|
|
26
27
|
onInputRef?: (el?: Element) => void;
|
|
27
28
|
};
|
|
28
|
-
declare const autocomplete: <I>(props: AProps<I>) => import("lit-html").TemplateResult<1>, Autocomplete: <I>(props: Props<I>) => import("lit-html").TemplateResult<1>, observedAttributes: readonly ["variant", "disabled", "invalid", "hint", "text-property", "value-property", "limit", "min", "show-single", "preserve-order", "keep-opened", "keep-query", "default-index", "external-search", "item-height", "item-limit", "wrap", "lazy-open", "mode"];
|
|
29
|
+
declare const autocomplete: <I>(props: AProps<I>) => import("lit-html").TemplateResult<1>, Autocomplete: <I>(props: Props<I>) => import("lit-html").TemplateResult<1>, observedAttributes: readonly ["variant", "disabled", "invalid", "required", "hint", "text-property", "value-property", "limit", "min", "show-single", "preserve-order", "keep-opened", "keep-query", "default-index", "external-search", "item-height", "item-limit", "wrap", "lazy-open", "mode"];
|
|
29
30
|
export { Autocomplete, autocomplete, observedAttributes, style };
|
|
@@ -25,7 +25,7 @@ const shouldShowDropdown = ({ opened, isSingle, showSingle, hasResultsOrQuery, }
|
|
|
25
25
|
return hasResultsOrQuery;
|
|
26
26
|
};
|
|
27
27
|
const autocomplete = (props) => {
|
|
28
|
-
const { variant, opened, invalid, errorMessage, hint, label, placeholder, disabled, textual, text, onText, onToggle, onDeselect, value, limit, min, showSingle, items, source$, loading, chipRenderer, mode, } = props, isOne = limit === 1, isSingle = isOne && value?.[0] != null;
|
|
28
|
+
const { variant, opened, invalid, errorMessage, hint, label, placeholder, required, disabled, textual, text, onText, onToggle, onDeselect, value, limit, min, showSingle, items, source$, loading, chipRenderer, mode, } = props, isOne = limit === 1, isSingle = isOne && value?.[0] != null;
|
|
29
29
|
const hasResultsOrQuery = loading || items.length > 0 || (text != null && text.length > 0);
|
|
30
30
|
return html `<cosmoz-dropdown-next
|
|
31
31
|
open-on-focus
|
|
@@ -44,6 +44,7 @@ const autocomplete = (props) => {
|
|
|
44
44
|
variant=${ifDefined(variant)}
|
|
45
45
|
?readonly=${isSingle}
|
|
46
46
|
?disabled=${disabled}
|
|
47
|
+
?required=${required}
|
|
47
48
|
?invalid=${guard([source$, invalid], () => until(source$.then(() => invalid, () => true), invalid))}
|
|
48
49
|
.errorMessage=${guard([source$, errorMessage], () => until(source$.then(() => errorMessage, (e) => e.message), errorMessage))}
|
|
49
50
|
.value=${live(text)}
|
|
@@ -96,6 +97,7 @@ const autocomplete = (props) => {
|
|
|
96
97
|
'variant',
|
|
97
98
|
'disabled',
|
|
98
99
|
'invalid',
|
|
100
|
+
'required',
|
|
99
101
|
'hint',
|
|
100
102
|
'text-property',
|
|
101
103
|
'value-property',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-autocomplete",
|
|
3
|
-
"version": "13.7.0-beta.
|
|
3
|
+
"version": "13.7.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A autocomplete input web component",
|
|
6
6
|
"keywords": [
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@commitlint/cli": "^20.0.0",
|
|
93
93
|
"@commitlint/config-conventional": "^20.0.0",
|
|
94
94
|
"@neovici/cfg": "^2.8.0",
|
|
95
|
-
"@playwright/test": "^1.
|
|
95
|
+
"@playwright/test": "^1.60.0",
|
|
96
96
|
"@semantic-release/changelog": "^6.0.0",
|
|
97
97
|
"@semantic-release/git": "^10.0.0",
|
|
98
98
|
"@storybook/addon-a11y": "^10.3.4",
|