use global modal for popup messages
All checks were successful
delpoy / build-and-deploy (push) Successful in 51s
All checks were successful
delpoy / build-and-deploy (push) Successful in 51s
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
required = false,
|
||||
disabled = false,
|
||||
readonly = false,
|
||||
checked = false,
|
||||
checked = $bindable(false),
|
||||
size = 'md',
|
||||
pickyWidth = true,
|
||||
containerClass = '',
|
||||
@@ -109,10 +109,15 @@
|
||||
{readonly}
|
||||
bind:this={inputElement}
|
||||
autocomplete="off"
|
||||
onchange={() => {
|
||||
if (type === 'checkbox') {
|
||||
checked = !checked;
|
||||
}
|
||||
}}
|
||||
oninput={(e: Event & { currentTarget: EventTarget & HTMLInputElement }) => {
|
||||
value = e.currentTarget.value;
|
||||
if (pattern && !pattern.test(value)) return;
|
||||
oninput && oninput(e);
|
||||
oninput?.(e);
|
||||
}}
|
||||
onpaste={(e) => {
|
||||
if (pattern && e.clipboardData && !pattern.test(e.clipboardData.getData('text'))) {
|
||||
|
||||
@@ -63,14 +63,14 @@
|
||||
value = searchSuggestion.value;
|
||||
searchSuggestions = [];
|
||||
e.currentTarget.setCustomValidity('');
|
||||
onsubmit && onsubmit(Object.assign(e, { input: inputValue, value: value }));
|
||||
onsubmit?.(Object.assign(e, { input: inputValue, value: value }));
|
||||
} else if (inputValue === '' && emptyAllowed) {
|
||||
onsubmit && onsubmit(Object.assign(e, { input: '', value: '' }));
|
||||
onsubmit?.(Object.assign(e, { input: '', value: '' }));
|
||||
}
|
||||
});
|
||||
}}
|
||||
oninvalid={(e: Event & { currentTarget: EventTarget & HTMLInputElement }) => {
|
||||
invalidMessage && e.currentTarget.setCustomValidity(invalidMessage);
|
||||
if (invalidMessage) e.currentTarget.setCustomValidity(invalidMessage);
|
||||
}}
|
||||
pattern={suggestionRequired
|
||||
? `${value ? inputValue : 'a^' + (emptyAllowed ? '|$^' : '')}`
|
||||
@@ -89,7 +89,7 @@
|
||||
inputValue = searchSuggestion.name;
|
||||
value = searchSuggestion.value;
|
||||
searchSuggestions = [];
|
||||
onsubmit && onsubmit(Object.assign(e, { input: inputValue, value: value }));
|
||||
onsubmit?.(Object.assign(e, { input: inputValue, value: value }));
|
||||
}}>{searchSuggestion.name}</button
|
||||
>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user