@neovici/cosmoz-input 6.0.0-beta.2 → 6.0.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.
@@ -7,7 +7,7 @@ import { attributes, render } from './render';
7
7
  import { styles } from './styles';
8
8
  import { useAllowedPattern } from './use-allowed-pattern';
9
9
  import { useInput } from './use-input';
10
- import { getPlaceholder } from './util';
10
+ import { defaultMax, getPlaceholder } from './util';
11
11
  const observedAttributes = [
12
12
  'type',
13
13
  'variant',
@@ -51,7 +51,7 @@ export const Input = (host) => {
51
51
  @focus=${onFocus}
52
52
  @blur=${onFocus}
53
53
  min=${ifDefined(min)}
54
- max=${ifDefined(max)}
54
+ max=${ifDefined(defaultMax(type, max))}
55
55
  step=${ifDefined(step)}
56
56
  />
57
57
  `, host);
package/dist/util.d.ts CHANGED
@@ -2,4 +2,5 @@ interface Props {
2
2
  placeholder?: string;
3
3
  }
4
4
  export declare const getPlaceholder: ({ placeholder }: Props) => string;
5
+ export declare const defaultMax: (type: string, max?: string) => string | undefined;
5
6
  export {};
package/dist/util.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export const getPlaceholder = ({ placeholder }) => {
2
2
  return placeholder || ' ';
3
3
  };
4
+ export const defaultMax = (type, max) => max ?? (type === 'date' ? '9999-12-31' : undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-input",
3
- "version": "6.0.0-beta.2",
3
+ "version": "6.0.0-beta.3",
4
4
  "description": "A input web component",
5
5
  "keywords": [
6
6
  "lit-html",
@@ -76,7 +76,7 @@
76
76
  "lit-html": "^2.0.0 || ^3.0.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@commitlint/cli": "^20.0.0",
79
+ "@commitlint/cli": "^21.0.0",
80
80
  "@commitlint/config-conventional": "^20.0.0",
81
81
  "@neovici/cfg": "^2.8.0",
82
82
  "@neovici/testing": "^2.3.0",
@@ -96,7 +96,7 @@
96
96
  "lint-staged": "^16.2.7",
97
97
  "semantic-release": "^25.0.2",
98
98
  "shadow-dom-testing-library": "^1.13.1",
99
- "sinon": "^21.0.0",
99
+ "sinon": "^22.0.0",
100
100
  "storybook": "^10.1.9",
101
101
  "vitest": "^4.0.18",
102
102
  "@types/mocha": "^10.0.3",