@neovici/cosmoz-input 1.6.2 → 1.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.
package/cosmoz-input.js CHANGED
@@ -18,7 +18,8 @@ export const Input = host => {
18
18
  disabled,
19
19
  min,
20
20
  max,
21
- step
21
+ step,
22
+ maxlength
22
23
  } = host,
23
24
  { onChange, onFocus, onInput } = useInput(host),
24
25
  onBeforeInput = useAllowedPattern(allowedPattern);
@@ -26,7 +27,7 @@ export const Input = host => {
26
27
  type=${ type } pattern=${ ifDefined(pattern) }
27
28
  autocomplete=${ ifDefined(autocomplete) } placeholder=${ placeholder || ' ' }
28
29
  ?readonly=${ readonly } ?aria-disabled=${ disabled } ?disabled=${ disabled }
29
- .value=${ live(value ?? '') }
30
+ .value=${ live(value ?? '') } maxlength=${ifDefined(maxlength)}
30
31
  @beforeinput=${ onBeforeInput } @input=${ onInput }
31
32
  @change=${ onChange } @focus=${ onFocus } @blur=${ onFocus }
32
33
  min=${ ifDefined(min) } max=${ ifDefined(max) } step=${ifDefined(step)} >`
@@ -14,7 +14,8 @@ export const Textarea = host => {
14
14
  readonly,
15
15
  disabled,
16
16
  rows,
17
- cols
17
+ cols,
18
+ maxlength
18
19
  } = host,
19
20
  { onChange, onFocus, onInput } = useInput(host);
20
21
 
@@ -24,7 +25,7 @@ export const Textarea = host => {
24
25
  <textarea id="input" part="input" style="resize: none"
25
26
  autocomplete=${ ifDefined(autocomplete) } placeholder=${ placeholder || ' ' } rows=${ rows ?? 1 } cols=${ ifDefined(cols) }
26
27
  ?readonly=${ readonly } ?aria-disabled=${ disabled } ?disabled=${ disabled }
27
- .value=${ live(value ?? '') } @input=${ onInput }
28
+ .value=${ live(value ?? '') } maxlength=${ifDefined(maxlength)} @input=${ onInput }
28
29
  @change=${ onChange } @focus=${ onFocus } @blur=${ onFocus }>`
29
30
  , host);
30
31
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-input",
3
- "version": "1.6.2",
3
+ "version": "1.7.0",
4
4
  "description": "A input web component",
5
5
  "keywords": [
6
6
  "lit-html",
package/render.js CHANGED
@@ -25,6 +25,7 @@ export const render = (control, { label, invalid, errorMessage }) => html`
25
25
  'autocomplete',
26
26
  'readonly',
27
27
  'disabled',
28
+ 'maxlength',
28
29
  'invalid',
29
30
  'no-label-float',
30
31
  'always-float-label',