@neovici/cosmoz-input
Advanced tools
Comparing version 3.8.0 to 3.9.0
@@ -8,2 +8,3 @@ import { html } from 'lit-html'; | ||
import { render, attributes } from './render'; | ||
import { getPlaceholder } from './util'; | ||
const observedAttributes = [ | ||
@@ -20,3 +21,3 @@ 'type', | ||
export const Input = (host) => { | ||
const { type = 'text', pattern, allowedPattern, autocomplete, value, placeholder, readonly, disabled, min, max, step, maxlength, } = host, { onChange, onFocus, onInput } = useInput(host); | ||
const { type = 'text', pattern, allowedPattern, autocomplete, value, readonly, disabled, min, max, step, maxlength, } = host, { onChange, onFocus, onInput } = useInput(host); | ||
const onBeforeInput = useAllowedPattern(allowedPattern); | ||
@@ -31,3 +32,3 @@ return render(html ` | ||
autocomplete=${ifDefined(autocomplete)} | ||
placeholder=${placeholder || ' '} | ||
placeholder=${getPlaceholder(host)} | ||
?readonly=${readonly} | ||
@@ -34,0 +35,0 @@ ?aria-disabled=${disabled} |
@@ -105,4 +105,6 @@ import { tagged as css } from '@neovici/cosmoz-utils'; | ||
} | ||
#input:not(:placeholder-shown):focus + label { | ||
:host(:not(always-float-label):focus-within) #input::placeholder, | ||
:host(:focus-within) label { | ||
color: var(--focused-color); | ||
opacity: 1; | ||
} | ||
@@ -141,3 +143,3 @@ | ||
:host([no-label-float]) .float, | ||
:host([no-label-float]) #input:not(:placeholder-shown) + label { | ||
:host([no-label-float]) label { | ||
display: none; | ||
@@ -195,5 +197,5 @@ } | ||
} | ||
:host([type="color"]) .line { | ||
:host([type='color']) .line { | ||
display: none; | ||
} | ||
`; |
{ | ||
"name": "@neovici/cosmoz-input", | ||
"version": "3.8.0", | ||
"version": "3.9.0", | ||
"description": "A input web component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16382
20
401